Additional cleanups and improvements performed as noticed.
#define f_console_parameters_t_initialize {0, f_string_dynamics_t_initialize, 0 }
- #define macro_f_console_parameters_initialize(parameter, used) { parameter, f_string_dynamics_t_initialize, used }
+ #define macro_f_console_parameters_t_initialize(parameter, used) { parameter, f_string_dynamics_t_initialize, used }
#endif // _di_f_console_parameters_t_
/**
build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf -lf_console
build_libraries-level -lfll_0
build_libraries-monolithic -lfll
-build_sources_program test-console-identify.c test-console-parameter_prioritize_left.c test-console-parameter_prioritize_right.c test-console-parameter_process.c test-console.c
+build_sources_program test-console-identify.c test-console-parameter_prioritize_left.c test-console-parameter_prioritize_right.c test-console-parameter_process.c test-console-parameters_delete.c test-console-parameters_destroy.c test-console.c
build_script no
build_shared yes
build_static no
f_console_parameter_t parameter = f_console_parameter_t_initialize;
f_console_parameter_t parameters_array[1] = { parameter };
- parameters.parameter = parameters_array;
+ parameters.array = parameters_array;
parameters.used = 1;
const f_status_t status = f_console_parameter_prioritize_left(parameters, choices, &decision);
assert_int_equal(F_status_set_fine(status), F_parameter);
}
+
+ f_console_parameters_delete(¶meters);
}
#ifndef _di_level_0_parameter_checking_
void test__f_console_parameter_prioritize_left__parameter_checking(void **state) {
- const f_console_parameters_t parameters = f_console_parameters_t_initialize;
+ f_console_parameters_t parameters = f_console_parameters_t_initialize;
f_console_parameter_ids_t choices = f_console_parameter_ids_t_initialize;
{
assert_int_equal(F_status_set_fine(status), F_parameter);
}
+
+ f_console_parameters_delete(¶meters);
}
#endif // _di_level_0_parameter_checking_
f_console_parameter_t parameter = f_console_parameter_t_initialize;
f_console_parameter_t parameters_array[1] = { parameter };
- parameters.parameter = parameters_array;
+ parameters.array = parameters_array;
parameters.used = 1;
const f_status_t status = f_console_parameter_prioritize_left(parameters, choices, &decision);
parameter_2.location_sub = 4;
f_console_parameter_t parameters_array[2] = { parameter_1, parameter_2 };
- parameters.parameter = parameters_array;
+ parameters.array = parameters_array;
parameters.used = 2;
const f_status_t status = f_console_parameter_prioritize_left(parameters, choices, &decision);
assert_int_equal(status, F_none);
assert_int_equal(decision, 1);
}
+
+ f_console_parameters_delete(¶meters);
}
#ifdef __cplusplus
f_console_parameter_t parameter = f_console_parameter_t_initialize;
f_console_parameter_t parameters_array[1] = { parameter };
- parameters.parameter = parameters_array;
+ parameters.array = parameters_array;
parameters.used = 1;
const f_status_t status = f_console_parameter_prioritize_right(parameters, choices, &decision);
assert_int_equal(F_status_set_fine(status), F_parameter);
}
+
+ f_console_parameters_delete(¶meters);
}
#ifndef _di_level_0_parameter_checking_
void test__f_console_parameter_prioritize_right__parameter_checking(void **state) {
- const f_console_parameters_t parameters = f_console_parameters_t_initialize;
+ f_console_parameters_t parameters = f_console_parameters_t_initialize;
f_console_parameter_ids_t choices = f_console_parameter_ids_t_initialize;
{
assert_int_equal(F_status_set_fine(status), F_parameter);
}
+
+ f_console_parameters_delete(¶meters);
}
#endif // _di_level_0_parameter_checking_
f_console_parameter_t parameter = f_console_parameter_t_initialize;
f_console_parameter_t parameters_array[1] = { parameter };
- parameters.parameter = parameters_array;
+ parameters.array = parameters_array;
parameters.used = 1;
const f_status_t status = f_console_parameter_prioritize_right(parameters, choices, &decision);
parameter_2.location_sub = 4;
f_console_parameter_t parameters_array[2] = { parameter_1, parameter_2 };
- parameters.parameter = parameters_array;
+ parameters.array = parameters_array;
parameters.used = 2;
const f_status_t status = f_console_parameter_prioritize_right(parameters, choices, &decision);
assert_int_equal(status, F_none);
assert_int_equal(decision, 0);
}
+
+ f_console_parameters_delete(¶meters);
}
#ifdef __cplusplus
f_array_lengths_t remaining = f_array_lengths_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, parameters, &remaining);
+ const f_status_t status = f_console_parameter_process(arguments, ¶meters, &remaining);
assert_int_equal(status, F_none);
f_array_lengths_t remaining = f_array_lengths_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, parameters, &remaining);
+ const f_status_t status = f_console_parameter_process(arguments, ¶meters, &remaining);
assert_int_equal(status, F_none);
void test__f_console_parameter_process__parameter_checking(void **state) {
const f_console_arguments_t arguments = f_console_arguments_t_initialize;
- const f_console_parameters_t parameters = f_console_parameters_t_initialize;
+ f_console_parameters_t parameters = f_console_parameters_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, parameters, 0);
+ const f_status_t status = f_console_parameter_process(arguments, ¶meters, 0);
assert_int_equal(F_status_set_fine(status), F_parameter);
}
f_array_lengths_t remaining = f_array_lengths_t_initialize;
{
- const f_status_t status = f_console_parameter_process(arguments, parameters, &remaining);
+ const f_status_t status = f_console_parameter_process(arguments, ¶meters, &remaining);
assert_int_equal(status, F_none);
--- /dev/null
+#include "test-console.h"
+#include "test-console-parameters_delete.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_console_parameters_delete__frees_memory(void **state) {
+
+ const f_array_length_t size = 3;
+
+ f_console_parameters_t parameters = f_console_parameters_t_initialize;
+ f_console_parameter_t parameter = f_console_parameter_t_initialize;
+ f_console_parameter_t parameters_array[1] = { parameter };
+
+ parameters.array = parameters_array;
+ parameters.used = 1;
+
+ {
+ const f_status_t status = f_string_dynamics_resize(size, ¶meters.arguments);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(parameters.arguments.size, 0);
+ assert_non_null(parameters.arguments.array);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(3, ¶meters.array[0].locations);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(parameters.array[0].locations.size, 0);
+ assert_non_null(parameters.array[0].locations.array);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(size, ¶meters.array[0].locations_sub);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(parameters.array[0].locations_sub.size, 0);
+ assert_non_null(parameters.array[0].locations_sub.array);
+ }
+
+ {
+ const f_status_t status = f_console_parameters_delete(¶meters);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(parameters.arguments.size, 0);
+ assert_int_equal(parameters.array[0].locations.size, 0);
+ assert_int_equal(parameters.array[0].locations_sub.size, 0);
+ }
+}
+
+#ifndef _di_level_0_parameter_checking_
+ void test__f_console_parameters_delete__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_console_parameters_delete(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Console
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the console project.
+ */
+#ifndef _TEST__F_console__delete
+#define _TEST__F_console__delete
+
+/**
+ * Test that deallocation works.
+ *
+ * @see f_console_parameters_delete()
+ */
+extern void test__f_console_parameters_delete__frees_memory(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_console_parameters_delete()
+ */
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_console_parameters_delete__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+#endif // _TEST__F_console__delete
--- /dev/null
+#include "test-console.h"
+#include "test-console-parameters_destroy.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void test__f_console_parameters_destroy__frees_memory(void **state) {
+
+ const f_array_length_t size = 3;
+
+ f_console_parameters_t parameters = f_console_parameters_t_initialize;
+ f_console_parameter_t parameter = f_console_parameter_t_initialize;
+ f_console_parameter_t parameters_array[1] = { parameter };
+
+ parameters.array = parameters_array;
+ parameters.used = 1;
+
+ {
+ const f_status_t status = f_string_dynamics_resize(size, ¶meters.arguments);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(parameters.arguments.size, 0);
+ assert_non_null(parameters.arguments.array);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(size, ¶meters.array[0].locations);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(parameters.array[0].locations.size, 0);
+ assert_non_null(parameters.array[0].locations.array);
+ }
+
+ {
+ const f_status_t status = f_type_array_lengths_resize(size, ¶meters.array[0].locations_sub);
+
+ assert_int_equal(status, F_none);
+ assert_int_not_equal(parameters.array[0].locations_sub.size, 0);
+ assert_non_null(parameters.array[0].locations_sub.array);
+ }
+
+ {
+ const f_status_t status = f_console_parameters_destroy(¶meters);
+
+ assert_int_equal(status, F_none);
+ assert_int_equal(parameters.arguments.size, 0);
+ assert_int_equal(parameters.array[0].locations.size, 0);
+ assert_int_equal(parameters.array[0].locations_sub.size, 0);
+ }
+}
+
+#ifndef _di_level_0_parameter_checking_
+ void test__f_console_parameters_destroy__parameter_checking(void **state) {
+
+ {
+ const f_status_t status = f_console_parameters_destroy(0);
+
+ assert_int_equal(F_status_set_fine(status), F_parameter);
+ }
+ }
+#endif // _di_level_0_parameter_checking_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 0
+ *
+ * Project: Console
+ * API Version: 0.5
+ * Licenses: lgpl-2.1-or-later
+ *
+ * Test the console project.
+ */
+#ifndef _TEST__F_console__destroy
+#define _TEST__F_console__destroy
+
+/**
+ * Test that deallocation works.
+ *
+ * @see f_console_parameters_destroy()
+ */
+extern void test__f_console_parameters_destroy__frees_memory(void **state);
+
+/**
+ * Test that parameter checking works as expected.
+ *
+ * @see f_console_parameters_destroy()
+ */
+#ifndef _di_level_0_parameter_checking_
+ extern void test__f_console_parameters_destroy__parameter_checking(void **state);
+#endif // _di_level_0_parameter_checking_
+
+#endif // _TEST__F_console__destroy
cmocka_unit_test(test__f_console_parameter_process__only_remaining),
cmocka_unit_test(test__f_console_parameter_process__works),
+ cmocka_unit_test(test__f_console_parameters_delete__frees_memory),
+
+ cmocka_unit_test(test__f_console_parameters_destroy__frees_memory),
+
#ifndef _di_level_0_parameter_checking_
cmocka_unit_test(test__f_console_identify__parameter_checking),
cmocka_unit_test(test__f_console_parameter_prioritize_left__parameter_checking),
cmocka_unit_test(test__f_console_parameter_prioritize_right__parameter_checking),
cmocka_unit_test(test__f_console_parameter_process__parameter_checking),
+ cmocka_unit_test(test__f_console_parameters_delete__parameter_checking),
+ cmocka_unit_test(test__f_console_parameters_destroy__parameter_checking),
#endif // _di_level_0_parameter_checking_
};
#include "test-console-parameter_prioritize_left.h"
#include "test-console-parameter_prioritize_right.h"
#include "test-console-parameter_process.h"
+#include "test-console-parameters_delete.h"
+#include "test-console-parameters_destroy.h"
#ifdef __cplusplus
extern "C" {
#include <fll/level_0/memory.h>
#include <fll/level_0/string.h>
-// fll-1 control includes
+// FLL-1 control includes.
#include <fll/level_0/control_group-common.h>
#ifdef __cplusplus
#endif
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_mash_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_triples_append_)
- f_status_t private_f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t private_f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
if (destination->used + length > destination->size) {
const f_status_t status = private_f_string_dynamic_increase_by(length, destination);
#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_mash_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_triples_append_)
#if !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
- f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
if (destination->used + length > F_string_t_size_d) {
return F_status_set_error(F_string_too_large);
#endif // !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t *dynamic) {
+ f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) {
f_status_t status = f_memory_adjust(dynamic->size, length, sizeof(f_string_t), (void **) & dynamic->string);
#endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t *dynamic) {
+ f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t * const dynamic) {
if (dynamic->used + amount > dynamic->size) {
if (dynamic->used + amount > F_string_t_size_d) {
#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t *dynamic) {
+ f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t * const dynamic) {
const f_status_t status = f_memory_resize(dynamic->size, length, sizeof(f_string_t), (void **) & dynamic->string);
#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
- f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+ f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
if (dynamics->used + length > F_array_length_t_size_d) {
return F_status_set_error(F_array_too_large);
#endif // !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_)
#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
- f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+ f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
if (dynamics->used + length > F_array_length_t_size_d) {
return F_status_set_error(F_array_too_large);
#endif // !defined(_di_f_string_maps_decrease_by_) || !defined(_di_f_string_maps_increase_) || !defined(_di_f_string_maps_increase_by_) || !defined(_di_f_string_maps_terminate_) || !defined(_di_f_string_maps_terminate_after_)
#if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
- f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
if (destination->used + length > F_string_t_size_d) {
return F_status_set_error(F_string_too_large);
#endif // !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
#if !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
- f_status_t private_f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t private_f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
if (destination->used + length > F_string_t_size_d) {
return F_status_set_error(F_string_too_large);
* @see f_string_mash_nulless()
*/
#if !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
- extern f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_append_assure_nulless_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_assure_nulless_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_assure_nulless_) || !defined(_di_f_string_dynamic_partial_append_nulless_) || !defined(_di_f_string_dynamic_partial_mash_nulless_) || !defined(_di_f_string_mash_nulless_)
/**
*
* @param length
* The new size to use.
- * @param string
+ * @param dynamic
* The string to adjust.
*
* @return
* @see f_string_triples_decimate_by()
*/
#if !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
- extern f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t *string) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_dynamic_adjust(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_dynamic_adjust_) || !defined(_di_f_string_dynamic_decimate_by_) || !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_triples_adjust_) || !defined(_di_f_string_triples_decimate_by_)
/**
*
* @param amount
* A positive number representing how much to increase the size by.
- * @param string
+ * @param dynamic
* The string to resize.
*
* @return
* @see f_string_triples_append()
*/
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- extern f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t *string) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_dynamic_increase_by(const f_array_length_t amount, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(_di_f_string_dynamic_partial_append_) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
/**
*
* @param length
* The new size to use.
- * @param string
+ * @param dynamic
* The string to resize.
*
* @return
* @see f_string_triples_append()
*/
#if !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
- extern f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t *string) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_dynamic_resize(const f_array_length_t length, f_string_dynamic_t * const dynamic) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_append_) || !defined(_di_f_string_append_assure_) || !defined(_di_f_string_append_mash_) || !defined(_di_f_string_append_nulless_) || !defined(_di_f_string_dynamic_append_) || !defined(_di_f_string_dynamic_append_assure_) || !defined(_di_f_string_dynamic_append_nulless_) || !defined(_di_f_string_dynamic_decrease_by_) || !defined(_di_f_string_dynamic_increase_) || !defined(_di_f_string_dynamic_increase_by_) || !defined(_di_f_string_dynamic_mash_) || !defined(_di_f_string_dynamic_mash_nulless_) || !defined(f_string_dynamic_partial_append) || !defined(_di_f_string_dynamic_partial_append_assure_) || !defined(_di_f_string_dynamic_partial_mash_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_dynamic_terminate_) || !defined(_di_f_string_dynamic_terminate_after_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_map_multis_append_) || !defined(_di_f_string_mash_nulless_) || !defined(_di_f_string_mash_) || !defined(_di_f_string_maps_append_) || !defined(_di_f_string_prepend_) || !defined(_di_f_string_prepend_nulless_) || !defined(_di_f_string_triples_append_)
/**
*
* @param length
* The new size to use.
- * @param strings
+ * @param dynamics
* The strings to adjust.
*
* @return
* @see f_string_map_multis_append()
*/
#if !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
- extern f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *strings) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_dynamics_adjust_) || !defined(_di_f_string_dynamics_append_) || !defined(_di_f_string_dynamics_decimate_by_) || !defined(_di_f_string_map_multis_adjust_) || !defined(_di_f_string_map_multis_append_)
/**
*
* @param length
* The new size to use.
- * @param strings
+ * @param dynamics
* The strings to resize.
*
* @return
* @see f_string_dynamics_increase_by()
*/
#if !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
- extern f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *strings) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_dynamics_decrease_by_) || !defined(_di_f_string_dynamics_increase_) || !defined(_di_f_string_dynamics_increase_by_)
/**
* @see f_string_prepend()
*/
#if !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
- extern f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_dynamic_mish_) || !defined(_di_f_string_dynamic_partial_mish_) || !defined(_di_f_string_dynamic_partial_prepend_assure_) || !defined(_di_f_string_dynamic_partial_prepend_) || !defined(_di_f_string_dynamic_prepend_assure_) || !defined(_di_f_string_dynamic_prepend_) || !defined(_di_f_string_mish_) || !defined(_di_f_string_prepend_assure_) || !defined(_di_f_string_prepend_)
/**
* @see f_string_prepend_nulless()
*/
#if !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
- extern f_status_t private_f_string_prepend_nulless(const f_string_t source, f_array_length_t length, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
+ extern f_status_t private_f_string_prepend_nulless(const f_string_t source, f_array_length_t length, f_string_dynamic_t * const destination) F_attribute_visibility_internal_d;
#endif // !defined(_di_f_string_dynamic_mish_nulless_) || !defined(_di_f_string_dynamic_partial_mish_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_partial_prepend_nulless_) || !defined(_di_f_string_dynamic_prepend_assure_nulless_) || !defined(_di_f_string_dynamic_prepend_nulless_) || !defined(_di_f_string_mish_nulless_) || !defined(_di_f_string_prepend_assure_nulless_) || !defined(_di_f_string_prepend_nulless_)
/**
#endif
#ifndef _di_f_string_append_
- f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
return private_f_string_append(source, length, destination);
#endif // _di_f_string_append_
#ifndef _di_f_string_append_assure_
- f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < length) {
#endif // _di_f_string_append_assure_
#ifndef _di_f_string_append_assure_nulless_
- f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < length) {
#endif // _di_f_string_append_assure_nulless_
#ifndef _di_f_string_append_nulless_
- f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
return private_f_string_append_nulless(source, length, destination);
#endif // _di_f_string_append_nulless_
#ifndef _di_f_string_mash_
- f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue_length && destination->used) {
#endif // _di_f_string_mash_
#ifndef _di_f_string_mash_nulless_
- f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue_length && destination->used) {
#endif // _di_f_string_mash_nulless_
#ifndef _di_f_string_mish_
- f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue_length && destination->used) {
#endif // _di_f_string_mish_
#ifndef _di_f_string_mish_nulless_
- f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue_length && destination->used) {
#endif // _di_f_string_mish_nulless_
#ifndef _di_f_string_prepend_
- f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
return private_f_string_prepend(source, length, destination);
#endif // _di_f_string_prepend_
#ifndef _di_f_string_prepend_assure_
- f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < length) {
#endif // _di_f_string_prepend_assure_
#ifndef _di_f_string_prepend_assure_nulless_
- f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < length) {
#endif // _di_f_string_prepend_assure_nulless_
#ifndef _di_f_string_prepend_nulless_
- f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+ f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!length) {
- return F_data_not_eos;
+ return F_data_not;
}
return private_f_string_prepend_nulless(source, length, destination);
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_append_
- extern f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_append(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_append_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_append_assure_
- extern f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_append_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_append_assure_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_append_assure_nulless_
- extern f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_append_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_append_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_append_nulless_
- extern f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_append_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_append_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_mash_
- extern f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_mash(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_mash_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_mash_nulless_
- extern f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_mash_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_mash_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_mish_
- extern f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_mish(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_mish_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_mish_nulless_
- extern f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_mish_nulless(const f_string_t glue, const f_array_length_t glue_length, const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_mish_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_prepend_
- extern f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_prepend(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_prepend_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_prepend_assure_
- extern f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_prepend_assure(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_prepend_assure_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_prepend_assure_nulless_
- extern f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_prepend_assure_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_prepend_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_prepend_nulless_
- extern f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination);
+ extern f_status_t f_string_prepend_nulless(const f_string_t source, const f_array_length_t length, f_string_dynamic_t * const destination);
#endif // _di_f_string_prepend_nulless_
/**
#endif // _di_f_string_dynamic_adjust_
#ifndef _di_f_string_dynamic_append_
- f_status_t f_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_append(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
return private_f_string_append(source.string, source.used, destination);
#endif // _di_f_string_dynamic_append_
#ifndef _di_f_string_dynamic_append_assure_
- f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < source.used) {
#endif // _di_f_string_dynamic_append_assure_
#ifndef _di_f_string_dynamic_append_assure_nulless_
- f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < source.used) {
#endif // _di_f_string_dynamic_append_assure_nulless_
#ifndef _di_f_string_dynamic_append_nulless_
- f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
return private_f_string_append_nulless(source.string, source.used, destination);
#endif // _di_f_string_dynamic_increase_by_
#ifndef _di_f_string_dynamic_mash_
- f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue.used && destination->used) {
#endif // _di_f_string_dynamic_mash_
#ifndef _di_f_string_dynamic_mash_nulless_
- f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue.used && destination->used) {
#endif // _di_f_string_dynamic_mash_nulless_
#ifndef _di_f_string_dynamic_mish_
- f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue.used && destination->used) {
#endif // _di_f_string_dynamic_mish_
#ifndef _di_f_string_dynamic_mish_nulless_
- f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (glue.used && destination->used) {
#endif // _di_f_string_dynamic_mish_nulless_
#ifndef _di_f_string_dynamic_partial_append_
- f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_append_
#ifndef _di_f_string_dynamic_partial_append_assure_
- f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_append_assure_
#ifndef _di_f_string_dynamic_partial_append_assure_nulless_
- f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_append_assure_nulless_
#ifndef _di_f_string_dynamic_partial_append_nulless_
- f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_append_nulless_
#ifndef _di_f_string_dynamic_partial_mash_
- f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_mash_
#ifndef _di_f_string_dynamic_partial_mash_nulless_
- f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_mash_nulless_
#ifndef _di_f_string_dynamic_partial_mish_
- f_status_t f_string_partial_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_partial_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_mish_
#ifndef _di_f_string_dynamic_partial_mish_nulless_
- f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_mish_nulless_
#ifndef _di_f_string_dynamic_partial_prepend_
- f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_prepend_
#ifndef _di_f_string_dynamic_partial_prepend_assure_
- f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_prepend_assure_
#ifndef _di_f_string_dynamic_partial_prepend_assure_nulless_
- f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_prepend_assure_nulless
#ifndef _di_f_string_dynamic_partial_prepend_nulless_
- f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (source.used <= range.stop) return F_status_set_error(F_parameter);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (range.start > range.stop) {
#endif // _di_f_string_dynamic_partial_prepend_nulless
#ifndef _di_f_string_dynamic_prepend_
- f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
return private_f_string_prepend(source.string, source.used, destination);
#endif // _di_f_string_dynamic_prepend_
#ifndef _di_f_string_dynamic_prepend_assure_
- f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < source.used) {
#endif // _di_f_string_dynamic_prepend_assure_
#ifndef _di_f_string_dynamic_prepend_assure_nulless_
- f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!source.used) {
- return F_data_not_eos;
+ return F_data_not;
}
if (destination->used < source.used) {
#endif // _di_f_string_dynamic_prepend_assure_nulless_
#ifndef _di_f_string_dynamic_prepend_nulless_
- f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) return F_data_not;
return private_f_string_prepend_nulless(source.string, source.used, destination);
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
+ if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != f_string_eol_s.string[0]) {
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
+ if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != seek_to_this) {
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
+ if (!buffer.used) return F_data_not;
if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != seek_to_this) {
#endif // _di_f_string_dynamic_seek_to_
#ifndef _di_f_string_dynamic_terminate_
- f_status_t f_string_dynamic_terminate(f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_terminate(f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
- if (destination->used > destination->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!destination->used && destination->size && !destination->string[destination->used - 1]) {
+ if (destination->used && !destination->string[destination->used - 1]) {
return F_none;
}
#endif // _di_f_string_dynamic_terminate_
#ifndef _di_f_string_dynamic_terminate_after_
- f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t *destination) {
+ f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
- if (destination->used > destination->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (destination->used) {
#endif // _di_f_string_dynamic_terminate_after_
#ifndef _di_f_string_dynamics_adjust_
- f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+ f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_dynamics_append_
#ifndef _di_f_string_dynamics_decimate_by_
- f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) {
+ f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_f_string_dynamics_decimate_by_
#ifndef _di_f_string_dynamics_decrease_by_
- f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) {
+ f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_f_string_dynamics_decrease_by_
#ifndef _di_f_string_dynamics_increase_
- f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t *dynamics) {
+ f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_f_string_dynamics_increase_
#ifndef _di_f_string_dynamics_increase_by_
- f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *dynamics) {
+ f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_dynamics_increase_by_
#ifndef _di_f_string_dynamics_resize_
- f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *dynamics) {
+ f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics) {
#ifndef _di_level_0_parameter_checking_
if (!dynamics) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_append_
- extern f_status_t f_string_dynamic_append(const f_string_dynamic_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_append(const f_string_dynamic_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_append_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_append_assure_
- extern f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_append_assure(const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_append_assure_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_append_assure_nulless_
- extern f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_append_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_append_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_append_nulless_
- extern f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_append_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_append_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_mash_
- extern f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_mash(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_mash_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_mash_nulless_
- extern f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_mash_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_mash_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_mish_
- extern f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_mish(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_mish_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_mish_nulless_
- extern f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_mish_nulless(const f_string_static_t glue, const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_mish_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_append_
- extern f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_append(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_append_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_append_assure_
- extern f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_append_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_append_assure_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_append_assure_nulless_
- extern f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_append_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_append_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_append_nulless_
- extern f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_append_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_append_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_mash_
- extern f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_mash(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_mash_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_mash_nulless_
- extern f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_mash_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_mash_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_mish_
- extern f_status_t f_string_dynamic_partial_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_mish(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_mish_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_mish_nulless_
- extern f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_mish_nulless(const f_string_static_t glue, const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_mish_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_prepend_
- extern f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_prepend(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_prepend_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_prepend_assure_
- extern f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_prepend_assure(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_prepend_assure_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_prepend_assure_nulless_
- extern f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_prepend_assure_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_prepend_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_partial_prepend_nulless_
- extern f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_partial_prepend_nulless(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_partial_prepend_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_prepend_
- extern f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_prepend(const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_prepend_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_prepend_assure_
- extern f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_prepend_assure(const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_prepend_assure_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_prepend_assure_nulless_
- extern f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_prepend_assure_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_prepend_assure_nulless_
/**
*
* @return
* F_none on success.
- * F_data_not_eos if source length is 0.
+ * F_data_not if source length is 0.
* F_data_not_stop if range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_prepend_nulless_
- extern f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_prepend_nulless(const f_string_static_t source, f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_prepend_nulless_
/**
* F_none on success.
* F_none_eos on success, but stopped at end of string.
* F_none_stop on success, but stopped at end of range.
- * F_data_not_eos on success, but there was no string data to seek.
+ * F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_none on success.
* F_none_eos on success, but stopped at end of string.
* F_none_stop on success, but stopped at end of range.
- * F_data_not_eos on success, but there was no string data to seek.
+ * F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* F_none on success.
* F_none_eos on success, but stopped at end of string.
* F_none_stop on success, but stopped at end of range.
- * F_data_not_eos on success, but there was no string data to seek.
+ * F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
*
* F_parameter (with error bit) if a parameter is invalid.
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_terminate_
- extern f_status_t f_string_dynamic_terminate(f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_terminate(f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_terminate_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamic_terminate_after_
- extern f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t *destination);
+ extern f_status_t f_string_dynamic_terminate_after(f_string_dynamic_t * const destination);
#endif // _di_f_string_dynamic_terminate_after_
/**
* Errors (with error bit) from: f_memory_adjust().
*/
#ifndef _di_f_string_dynamics_adjust_
- extern f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t *dynamics);
+ extern f_status_t f_string_dynamics_adjust(const f_array_length_t length, f_string_dynamics_t * const dynamics);
#endif // _di_f_string_dynamics_adjust_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamics_decimate_by_
- extern f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t *dynamics);
+ extern f_status_t f_string_dynamics_decimate_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics);
#endif // _di_f_string_dynamics_decimate_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamics_decrease_by_
- extern f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t *dynamics);
+ extern f_status_t f_string_dynamics_decrease_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics);
#endif // _di_f_string_dynamics_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamics_increase_
- extern f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t *dynamics);
+ extern f_status_t f_string_dynamics_increase(const uint16_t step, f_string_dynamics_t * const dynamics);
#endif // _di_f_string_dynamics_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamics_increase_by_
- extern f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t *dynamics);
+ extern f_status_t f_string_dynamics_increase_by(const f_array_length_t amount, f_string_dynamics_t * const dynamics);
#endif // _di_f_string_dynamics_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_dynamics_resize_
- extern f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t *dynamics);
+ extern f_status_t f_string_dynamics_resize(const f_array_length_t length, f_string_dynamics_t * const dynamics);
#endif // _di_f_string_dynamics_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_string_map_multis_adjust_
- f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t *map_multis) {
+ f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis) {
#ifndef _di_level_0_parameter_checking_
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_map_multis_adjust_
#ifndef _di_f_string_map_multis_append_
- f_status_t f_string_map_multis_append(const f_string_map_multis_t source, f_string_map_multis_t *destination) {
+ f_status_t f_string_map_multis_append(const f_string_map_multis_t source, f_string_map_multis_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_map_multis_append_
#ifndef _di_f_string_map_multis_decimate_by_
- f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) {
+ f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_f_string_map_multis_decimate_by_
#ifndef _di_f_string_map_multis_decrease_by_
- f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) {
+ f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_f_string_map_multis_decrease_by_
#ifndef _di_f_string_map_multis_increase_
- f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t *map_multis) {
+ f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t * const map_multis) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_f_string_map_multis_increase_
#ifndef _di_f_string_map_multis_increase_by_
- f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t *map_multis) {
+ f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_f_string_map_multis_increase_by_
#ifndef _di_f_string_map_multis_resize_
- f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t *map_multis) {
+ f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis) {
#ifndef _di_level_0_parameter_checking_
if (!map_multis) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_map_multis_resize_
#ifndef _di_f_string_maps_adjust_
- f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t *maps) {
+ f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_maps_adjust_
#ifndef _di_f_string_maps_append_
- f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t *destination) {
+ f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_maps_append_
#ifndef _di_f_string_maps_decimate_by_
- f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t *maps) {
+ f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_f_string_maps_decimate_by_
#ifndef _di_f_string_maps_decrease_by_
- f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps) {
+ f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_f_string_maps_decrease_by_
#ifndef _di_f_string_maps_increase_
- f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t *maps) {
+ f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_f_string_maps_increase_
#ifndef _di_f_string_maps_increase_by_
- f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps) {
+ f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_f_string_maps_increase_by_
#ifndef _di_f_string_maps_resize_
- f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t *maps) {
+ f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t * const maps) {
#ifndef _di_level_0_parameter_checking_
if (!maps) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_map_multis_adjust_
- extern f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t *map_multis);
+ extern f_status_t f_string_map_multis_adjust(const f_array_length_t length, f_string_map_multis_t * const map_multis);
#endif // _di_f_string_map_multis_adjust_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_map_multis_decimate_by_
- extern f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t *map_multis);
+ extern f_status_t f_string_map_multis_decimate_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
#endif // _di_f_string_map_multis_decimate_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_map_multis_decrease_by_
- extern f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t *map_multis);
+ extern f_status_t f_string_map_multis_decrease_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
#endif // _di_f_string_map_multis_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_map_multis_increase_
- extern f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t *map_multis);
+ extern f_status_t f_string_map_multis_increase(const uint16_t step, f_string_map_multis_t * const map_multis);
#endif // _di_f_string_map_multis_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_map_multis_increase_by_
- extern f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t *map_multis);
+ extern f_status_t f_string_map_multis_increase_by(const f_array_length_t amount, f_string_map_multis_t * const map_multis);
#endif // _di_f_string_map_multis_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_map_multis_resize_
- extern f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t *map_multis);
+ extern f_status_t f_string_map_multis_resize(const f_array_length_t length, f_string_map_multis_t * const map_multis);
#endif // _di_f_string_map_multis_resize_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_maps_adjust_
- extern f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t *maps);
+ extern f_status_t f_string_maps_adjust(const f_array_length_t length, f_string_maps_t * const maps);
#endif // _di_f_string_maps_adjust_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_maps_append_
- extern f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t *destination);
+ extern f_status_t f_string_maps_append(const f_string_maps_t source, f_string_maps_t * const destination);
#endif // _di_f_string_maps_append_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_maps_decimate_by_
- extern f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t *maps);
+ extern f_status_t f_string_maps_decimate_by(const f_array_length_t amount, f_string_maps_t * const maps);
#endif // _di_f_string_maps_decimate_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_maps_decrease_by_
- extern f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t *maps);
+ extern f_status_t f_string_maps_decrease_by(const f_array_length_t amount, f_string_maps_t * const maps);
#endif // _di_f_string_maps_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_maps_increase_
- extern f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t *maps);
+ extern f_status_t f_string_maps_increase(const uint16_t step, f_string_maps_t * const maps);
#endif // _di_f_string_maps_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_maps_increase_by_
- extern f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t *maps);
+ extern f_status_t f_string_maps_increase_by(const f_array_length_t amount, f_string_maps_t * const maps);
#endif // _di_f_string_maps_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_maps_resize_
- extern f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t *maps);
+ extern f_status_t f_string_maps_resize(const f_array_length_t length, f_string_maps_t * const maps);
#endif // _di_f_string_maps_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_string_quantitys_adjust_
- f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t *quantitys) {
+ f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
#ifndef _di_level_0_parameter_checking_
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_quantitys_append_
#ifndef _di_f_string_quantitys_decimate_by_
- f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) {
+ f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantitys_decimate_by_
#ifndef _di_f_string_quantitys_decrease_by_
- f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) {
+ f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantitys_decrease_by_
#ifndef _di_f_string_quantitys_increase_
- f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t *quantitys) {
+ f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t * const quantitys) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantitys_increase_
#ifndef _di_f_string_quantitys_increase_by_
- f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t *quantitys) {
+ f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantitys_increase_by_
#ifndef _di_f_string_quantitys_resize_
- f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t *quantitys) {
+ f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys) {
#ifndef _di_level_0_parameter_checking_
if (!quantitys) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_quantityss_adjust_
#ifndef _di_f_string_quantityss_decimate_by_
- f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) {
+ f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!quantityss) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantityss_decimate_by_
#ifndef _di_f_string_quantityss_decrease_by_
- f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) {
+ f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!quantityss) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantityss_decrease_by_
#ifndef _di_f_string_quantityss_increase_
- f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t *quantityss) {
+ f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t * const quantityss) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!quantityss) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantityss_increase_
#ifndef _di_f_string_quantityss_increase_by_
- f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t *quantityss) {
+ f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!quantityss) return F_status_set_error(F_parameter);
#endif // _di_f_string_quantityss_increase_by_
#ifndef _di_f_string_quantityss_resize_
- f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t *quantityss) {
+ f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss) {
#ifndef _di_level_0_parameter_checking_
if (!quantityss) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_adjust_
- extern f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t *quantitys);
+ extern f_status_t f_string_quantitys_adjust(const f_array_length_t length, f_string_quantitys_t * const quantitys);
#endif // _di_f_string_quantitys_adjust_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_append_
- extern f_status_t f_string_quantitys_append(const f_string_quantitys_t source, f_string_quantitys_t *destination);
+ extern f_status_t f_string_quantitys_append(const f_string_quantitys_t source, f_string_quantitys_t * const destination);
#endif // _di_f_string_quantitys_append_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_decimate_by_
- extern f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t *quantitys);
+ extern f_status_t f_string_quantitys_decimate_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys);
#endif // _di_f_string_quantitys_decimate_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_decrease_by_
- extern f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t *quantitys);
+ extern f_status_t f_string_quantitys_decrease_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys);
#endif // _di_f_string_quantitys_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_increase_
- extern f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t *quantitys);
+ extern f_status_t f_string_quantitys_increase(const uint16_t step, f_string_quantitys_t * const quantitys);
#endif // _di_f_string_quantitys_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_increase_by_
- extern f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t *quantitys);
+ extern f_status_t f_string_quantitys_increase_by(const f_array_length_t amount, f_string_quantitys_t * const quantitys);
#endif // _di_f_string_quantitys_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantitys_resize_
- extern f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t *quantitys);
+ extern f_status_t f_string_quantitys_resize(const f_array_length_t length, f_string_quantitys_t * const quantitys);
#endif // _di_f_string_quantitys_resize_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantityss_adjust_
- extern f_status_t f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t *quantityss);
+ extern f_status_t f_string_quantityss_adjust(const f_array_length_t length, f_string_quantityss_t * const quantityss);
#endif // _di_f_string_quantityss_adjust_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantityss_decimate_by_
- extern f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t *quantityss);
+ extern f_status_t f_string_quantityss_decimate_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss);
#endif // _di_f_string_quantityss_decimate_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantityss_decrease_by_
- extern f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t *quantityss);
+ extern f_status_t f_string_quantityss_decrease_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss);
#endif // _di_f_string_quantityss_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantityss_increase_
- extern f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t *quantityss);
+ extern f_status_t f_string_quantityss_increase(const uint16_t step, f_string_quantityss_t * const quantityss);
#endif // _di_f_string_quantityss_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantityss_increase_by_
- extern f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t *quantityss);
+ extern f_status_t f_string_quantityss_increase_by(const f_array_length_t amount, f_string_quantityss_t * const quantityss);
#endif // _di_f_string_quantityss_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_quantityss_resize_
- extern f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t *quantityss);
+ extern f_status_t f_string_quantityss_resize(const f_array_length_t length, f_string_quantityss_t * const quantityss);
#endif // _di_f_string_quantityss_resize_
#ifdef __cplusplus
#endif
#ifndef _di_f_string_ranges_adjust_
- f_status_t f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t *ranges) {
+ f_status_t f_string_ranges_adjust(const f_array_length_t length, f_string_ranges_t * const ranges) {
#ifndef _di_level_0_parameter_checking_
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_ranges_adjust_
#ifndef _di_f_string_ranges_append_
- f_status_t f_string_ranges_append(const f_string_ranges_t source, f_string_ranges_t *destination) {
+ f_status_t f_string_ranges_append(const f_string_ranges_t source, f_string_ranges_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_ranges_append_
#ifndef _di_f_string_ranges_decimate_by_
- f_status_t f_string_ranges_decimate_by(const f_array_length_t amount, f_string_ranges_t *ranges) {
+ f_status_t f_string_ranges_decimate_by(const f_array_length_t amount, f_string_ranges_t * const ranges) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_f_string_ranges_decimate_by_
#ifndef _di_f_string_ranges_decrease_by_
- f_status_t f_string_ranges_decrease_by(const f_array_length_t amount, f_string_ranges_t *ranges) {
+ f_status_t f_string_ranges_decrease_by(const f_array_length_t amount, f_string_ranges_t * const ranges) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_f_string_ranges_decrease_by_
#ifndef _di_f_string_ranges_increase_
- f_status_t f_string_ranges_increase(const uint16_t step, f_string_ranges_t *ranges) {
+ f_status_t f_string_ranges_increase(const uint16_t step, f_string_ranges_t * const ranges) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_f_string_ranges_increase_
#ifndef _di_f_string_ranges_increase_by_
- f_status_t f_string_ranges_increase_by(const f_array_length_t amount, f_string_ranges_t *ranges) {
+ f_status_t f_string_ranges_increase_by(const f_array_length_t amount, f_string_ranges_t * const ranges) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_f_string_ranges_increase_by_
#ifndef _di_f_string_ranges_resize_
- f_status_t f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t *ranges) {
+ f_status_t f_string_ranges_resize(const f_array_length_t length, f_string_ranges_t * const ranges) {
#ifndef _di_level_0_parameter_checking_
if (!ranges) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_ranges_resize_
#ifndef _di_f_string_rangess_adjust_
- f_status_t f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t *rangess) {
+ f_status_t f_string_rangess_adjust(const f_array_length_t length, f_string_rangess_t * const rangess) {
#ifndef _di_level_0_parameter_checking_
if (!rangess) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_rangess_adjust_
#ifndef _di_f_string_rangess_decimate_by_
- f_status_t f_string_rangess_decimate_by(const f_array_length_t amount, f_string_rangess_t *rangess) {
+ f_status_t f_string_rangess_decimate_by(const f_array_length_t amount, f_string_rangess_t * const rangess) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!rangess) return F_status_set_error(F_parameter);
#endif // _di_f_string_rangess_decimate_by_
#ifndef _di_f_string_rangess_decrease_by_
- f_status_t f_string_rangess_decrease_by(const f_array_length_t amount, f_string_rangess_t *rangess) {
+ f_status_t f_string_rangess_decrease_by(const f_array_length_t amount, f_string_rangess_t * const rangess) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!rangess) return F_status_set_error(F_parameter);
#endif // _di_f_string_rangess_decrease_by_
#ifndef _di_f_string_rangess_increase_
- f_status_t f_string_rangess_increase(const uint16_t step, f_string_rangess_t *rangess) {
+ f_status_t f_string_rangess_increase(const uint16_t step, f_string_rangess_t * const rangess) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!rangess) return F_status_set_error(F_parameter);
#endif // _di_f_string_rangess_increase_
#ifndef _di_f_string_rangess_increase_by_
- f_status_t f_string_rangess_increase_by(const f_array_length_t amount, f_string_rangess_t *rangess) {
+ f_status_t f_string_rangess_increase_by(const f_array_length_t amount, f_string_rangess_t * const rangess) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!rangess) return F_status_set_error(F_parameter);
#endif // _di_f_string_rangess_increase_by_
#ifndef _di_f_string_rangess_resize_
- f_status_t f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t *rangess) {
+ f_status_t f_string_rangess_resize(const f_array_length_t length, f_string_rangess_t * const rangess) {
#ifndef _di_level_0_parameter_checking_
if (!rangess) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif
#ifndef _di_f_string_triples_adjust_
- f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t *triples) {
+ f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_triples_adjust_
#ifndef _di_f_string_triples_append_
- f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t *destination) {
+ f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t * const destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
#endif // _di_f_string_triples_append_
#ifndef _di_f_string_triples_decimate_by_
- f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t *triples) {
+ f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_f_string_triples_decimate_by_
#ifndef _di_f_string_triples_decrease_by_
- f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t *triples) {
+ f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_f_string_triples_decrease_by_
#ifndef _di_f_string_triples_increase_
- f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t *triples) {
+ f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!step) return F_status_set_error(F_parameter);
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_f_string_triples_increase_
#ifndef _di_f_string_triples_increase_by_
- f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t *triples) {
+ f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!amount) return F_status_set_error(F_parameter);
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_f_string_triples_increase_by_
#ifndef _di_f_string_triples_resize_
- f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t *triples) {
+ f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t * const triples) {
#ifndef _di_level_0_parameter_checking_
if (!triples) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_string_triples_adjust_
- extern f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t *triples);
+ extern f_status_t f_string_triples_adjust(const f_array_length_t length, f_string_triples_t * const triples);
#endif // _di_f_string_triples_adjust_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_triples_append_
- extern f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t *destination);
+ extern f_status_t f_string_triples_append(const f_string_triples_t source, f_string_triples_t * const destination);
#endif // _di_f_string_triples_append_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_triples_decimate_by_
- extern f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t *triples);
+ extern f_status_t f_string_triples_decimate_by(const f_array_length_t amount, f_string_triples_t * const triples);
#endif // _di_f_string_triples_decimate_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_triples_decrease_by_
- extern f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t *triples);
+ extern f_status_t f_string_triples_decrease_by(const f_array_length_t amount, f_string_triples_t * const triples);
#endif // _di_f_string_triples_decrease_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_triples_increase_
- extern f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t *triples);
+ extern f_status_t f_string_triples_increase(const uint16_t step, f_string_triples_t * const triples);
#endif // _di_f_string_triples_increase_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_triples_increase_by_
- extern f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t *triples);
+ extern f_status_t f_string_triples_increase_by(const f_array_length_t amount, f_string_triples_t * const triples);
#endif // _di_f_string_triples_increase_by_
/**
* Errors (with error bit) from: f_memory_resize().
*/
#ifndef _di_f_string_triples_resize_
- extern f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t *triples);
+ extern f_status_t f_string_triples_resize(const f_array_length_t length, f_string_triples_t * const triples);
#endif // _di_f_string_triples_resize_
#ifdef __cplusplus
f_status_t f_utf_string_dynamic_terminate(f_utf_string_dynamic_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
- if (destination->used > destination->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!destination->used && destination->size && !destination->string[destination->used - 1]) {
f_status_t f_utf_string_dynamic_terminate_after(f_utf_string_dynamic_t *destination) {
#ifndef _di_level_0_parameter_checking_
if (!destination) return F_status_set_error(F_parameter);
- if (destination->used > destination->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (destination->used) {
paths->array[paths->used].used = 0;
if (total) {
- char buffer[total];
+ char buffer[total + 1];
- for (j = 0, k = 0; j < total; ++j) {
+ for (j = first, k = 0; j < i; ++j) {
- if (!path.string[first + j]) continue;
+ if (!path.string[j]) continue;
- buffer[k++] = path.string[first + j];
+ buffer[k++] = path.string[j];
} // for
- buffer[k++] = f_path_separator_s.string[0];
+ // Guarantee a trailing directory separator.
+ if (buffer[k - 1] != f_path_separator_s.string[0]) {
+ buffer[k++] = f_path_separator_s.string[0];
+ }
status = f_string_dynamic_increase_by(k, &paths->array[paths->used]);
if (F_status_is_error(status)) return status;
buffer[k++] = path.string[r + j + 1];
} // for
- buffer[k++] = f_path_separator_s.string[0];
+ // Guarantee a trailing directory separator.
+ if (buffer[k - 1] != f_path_separator_s.string[0]) {
+ buffer[k++] = f_path_separator_s.string[0];
+ }
status = f_string_dynamic_increase_by(k, &paths->array[paths->used]);
if (F_status_is_error(status)) return status;
if (!arguments) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- const f_status_t status = private_fll_execute_arguments_add_parameter(prefix, name, value, arguments);
+ f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments);
+ if (F_status_is_error(status)) return status;
+
+ status = private_fll_execute_arguments_add_parameter(prefix, name, value, arguments);
if (F_status_is_error(status)) return status;
return F_none;
if (!arguments) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- f_status_t status = F_none;
+ f_status_t status = f_string_dynamics_increase_by(size, arguments);
- for (f_array_length_t i = 0; i < size; ++i) {
+ for (f_array_length_t i = 0; F_status_is_error_not(status) && i < size; ++i) {
status = private_fll_execute_arguments_add_parameter(prefix[i], name[i], value[i], arguments);
- if (F_status_is_error(status)) return status;
} // for
return status;
*
* The arguments are only appended if the length of name and value are not 0.
*
- * This guarantees that an end of string exists at the end of each argument.
+ * This guarantees that NULL exists at the end of each argument (after the argumunets[..].used length).
* This does not check for NULL characters anywhere else in the string.
*
* @param prefix
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: f_string_dynamic_resize().
- * Errors (with error bit) from: f_string_dynamic_terminate().
+ * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fll_execute_arguments_add_parameter_
*
* The arguments are only appended if the length of name and value are not 0.
*
- * This guarantees that an end of string exists at the end of each argument.
+ * This guarantees that NULL exists at the end of each argument (after the argumunets[..].used length).
* This does not check for NULL characters anywhere else in the string.
*
- * @todo functions like this should be changed to accept arrays of f_string_static, reducing the number of parameters passed to it.
- *
* @param prefix
* An array of the strings prepend to the name.
* @param name
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: f_string_dynamic_resize().
- * Errors (with error bit) from: f_string_dynamic_terminate().
+ * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fll_execute_arguments_add_parameter_set_
/**
* Add a set of arguments to the execution arguments array.
*
- * This guarantees that an end of string exists at the end of the copied string.
+ * This guarantees that NULL exists at the end of each argument (after the argumunets[..].used length).
* This does not check for NULL characters anywhere else in the string.
*
* @param source
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: f_string_dynamic_resize().
- * Errors (with error bit) from: f_string_dynamic_terminate().
+ * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fll_execute_arguments_add_set_
#if !defined(_di_fll_execute_arguments_add_parameter_) || !defined(_di_fll_execute_arguments_add_parameter_set_)
f_status_t private_fll_execute_arguments_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments) {
- f_status_t status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments);
- if (F_status_is_error(status)) return status;
-
arguments->array[arguments->used].used = 0;
- status = f_string_dynamic_increase_by(prefix.used + name.used + 1, &arguments->array[arguments->used]);
+ f_status_t status = f_string_dynamic_increase_by(prefix.used + name.used + 1, &arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
status = f_string_dynamic_append(prefix, &arguments->array[arguments->used]);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate(&arguments->array[arguments->used]);
- }
-
+ status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
++arguments->used;
if (F_status_is_error(status)) return status;
status = f_string_dynamic_append(value, &arguments->array[arguments->used]);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate(&arguments->array[arguments->used]);
- }
-
+ status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
++arguments->used;
*
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: f_string_dynamic_resize().
- * Errors (with error bit) from: f_string_dynamic_terminate().
+ * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate()
+ * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
* @see fll_execute_arguments_add_parameter()
* @see fll_execute_arguments_add_parameter_set()
#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_placeholder_s "␣" // Other likely choices: (substitute form 1: '␚', substitute form 2: '␦').
#define BYTE_DUMP_character_incomplete_s "�"
#define BYTE_DUMP_character_unused_s "�"
controller_lock_print(print->to, (controller_thread_t *) process->main_thread);
- fl_print_format("%r%[%SThe %s '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, script_is ? controller_script_s : controller_program_s, print->context);
+ fl_print_format("%r%[%QThe %r '%]", print->to.stream, f_string_eol_s, print->context, print->prefix, script_is ? controller_script_s : controller_program_s, print->context);
fl_print_format("%[%Q%]", print->to.stream, print->notable, name, print->notable);
if (status == F_control_group || status == F_limit || status == F_processor || status == F_schedule) {
const uint8_t code = WIFEXITED(process->result) ? WEXITSTATUS(process->result) : 0;
if (code == F_execute_access) {
- fl_print_format("%[' access denied.%]%r", print->to.stream, print->context, print->context, f_string_eol_s);
+ fl_print_format("%[' cannot be executed, access is denied.%]%r", print->to.stream, print->context, print->context, f_string_eol_s);
}
else if (code == F_execute_bad) {
fl_print_format("%[' cannot execute, unsupported format.%]%r", print->to.stream, print->context, print->context, f_string_eol_s);
#ifndef FAKE_program_version_nano_prefix_s
#define FAKE_program_version_nano_prefix_s
#define FAKE_program_version_nano_prefix_s_length 0
- #endif
+ #endif // FAKE_program_version_major_s_length F_string_ascii_0_s_length
#ifndef FAKE_program_version_nano_s
#define FAKE_program_version_nano_s
#define FAKE_program_version_nano_s_length 0
- #endif
+ #endif // FAKE_program_version_nano_s
#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;
+ extern const f_string_static_t fake_program_version_s;
#endif // _di_fake_program_version_
#ifndef _di_fake_program_name_
#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;
+ extern const f_string_static_t fake_program_name_s;
+ extern const f_string_static_t fake_program_name_long_s;
#endif // _di_fake_program_name_
#ifndef _di_fake_program_help_parameters_
}
}
- f_string_static_t * const argv = main->parameters.arguments.array;
status = F_none;
f_array_length_t operations_length = main->parameters.array[fake_parameter_operation_build_e].locations.used;
}
if (F_status_is_error_not(status)) {
- f_string_static_t stub = f_string_static_t_initialize;
-
- status = fake_build_operate(stub, main);
+ status = fake_build_operate(f_string_empty_s, main);
}
}
else if (main->operation == fake_operation_clean_e) {
char source_string[source.used + 1];
source.string = source_string;
+ source_string[source.used] = 0;
memcpy(source_string, path_sources->string, path_sources->used);
memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
- source_string[source.used] = 0;
*status = fll_execute_arguments_add(source, &arguments);
if (F_status_is_error(*status)) break;
f_string_static_t parameter_file_name_micro = f_string_static_t_initialize;
f_string_static_t parameter_file_name_nano = f_string_static_t_initialize;
+ f_array_length_t strings_length = 1;
+
parameter_file_name.used = fake_build_parameter_library_name_prefix_s.used + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_shared_s.used;
- parameter_file_name_major.used = data_build.setting.version_major.used ? parameter_file_name.used + data_build.setting.version_major_prefix.used + data_build.setting.version_major.used : 0;
- parameter_file_name_minor.used = data_build.setting.version_minor.used ? parameter_file_name_major.used + data_build.setting.version_minor_prefix.used + data_build.setting.version_minor.used : 0;
- parameter_file_name_micro.used = data_build.setting.version_micro.used ? parameter_file_name_micro.used + data_build.setting.version_micro_prefix.used + data_build.setting.version_micro.used : 0;
- parameter_file_name_nano.used = data_build.setting.version_nano.used ? parameter_file_name_nano.used + data_build.setting.version_nano_prefix.used + data_build.setting.version_nano.used : 0;
+
+ if (data_build.setting.version_major.used) {
+ parameter_file_name_major.used = parameter_file_name.used + data_build.setting.version_major_prefix.used + data_build.setting.version_major.used;
+ strings_length = 2;
+
+ if (data_build.setting.version_minor.used) {
+ parameter_file_name_minor.used = parameter_file_name_major.used + data_build.setting.version_minor_prefix.used + data_build.setting.version_minor.used;
+ strings_length = 3;
+
+ if (data_build.setting.version_micro.used) {
+ parameter_file_name_micro.used = parameter_file_name_minor.used + data_build.setting.version_micro_prefix.used + data_build.setting.version_micro.used;
+ strings_length = 4;
+
+ if (data_build.setting.version_nano.used) {
+ parameter_file_name_nano.used = parameter_file_name_micro.used + data_build.setting.version_nano_prefix.used + data_build.setting.version_nano.used;
+ strings_length = 5;
+ }
+ }
+ }
+ }
char parameter_file_name_string[parameter_file_name.used + 1];
char parameter_file_name_major_string[parameter_file_name_major.used + 1];
char parameter_file_name_micro_string[parameter_file_name_micro.used + 1];
char parameter_file_name_nano_string[parameter_file_name_nano.used + 1];
+ parameter_file_name.string = parameter_file_name_string;
+ parameter_file_name_major.string = parameter_file_name_major_string;
+ parameter_file_name_minor.string = parameter_file_name_minor_string;
+ parameter_file_name_micro.string = parameter_file_name_micro_string;
+ parameter_file_name_nano.string = parameter_file_name_nano_string;
+
parameter_file_name_string[parameter_file_name.used] = 0;
parameter_file_name_major_string[parameter_file_name_major.used] = 0;
parameter_file_name_minor_string[parameter_file_name_minor.used] = 0;
parameter_file_name_micro_string[parameter_file_name_micro.used] = 0;
parameter_file_name_nano_string[parameter_file_name_nano.used] = 0;
- memcpy(parameter_file_name_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
- if (parameter_file_name_major.used) {
- memcpy(parameter_file_name_major_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
- if (parameter_file_name_minor.used) {
- memcpy(parameter_file_name_minor_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
- if (parameter_file_name_micro.used) {
- memcpy(parameter_file_name_micro_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
-
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
- }
- }
- }
- }
-
- f_array_length_t count = fake_build_parameter_library_name_prefix_s.used;
-
- memcpy(parameter_file_name_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ f_string_t strings[5] = {
+ parameter_file_name_string,
+ parameter_file_name_major_string,
+ parameter_file_name_minor_string,
+ parameter_file_name_micro_string,
+ parameter_file_name_nano_string,
+ };
- if (parameter_file_name_major.used) {
- memcpy(parameter_file_name_major_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ {
+ f_array_length_t offset = 0;
- if (parameter_file_name_minor.used) {
- memcpy(parameter_file_name_minor_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ uint8_t i = 0;
- if (parameter_file_name_micro.used) {
- memcpy(parameter_file_name_micro_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ for (; i < strings_length; ++i) {
+ memcpy(strings[i], fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
+ } // for
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
- }
- }
- }
- }
+ offset = fake_build_parameter_library_name_prefix_s.used;
- count += data_build.setting.project_name.used;
+ for (i = 0; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ } // for
- memcpy(parameter_file_name_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ offset += data_build.setting.project_name.used;
- if (parameter_file_name_major.used) {
- memcpy(parameter_file_name_major_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ for (i = 0; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ } // for
- if (parameter_file_name_minor.used) {
- memcpy(parameter_file_name_minor_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ offset += fake_build_parameter_library_name_suffix_shared_s.used;
- if (parameter_file_name_micro.used) {
- memcpy(parameter_file_name_micro_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ if (parameter_file_name_major.used) {
+ if (data_build.setting.version_major_prefix.used) {
+ for (i = 1; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
+ } // for
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
- }
+ offset += data_build.setting.version_major_prefix.used;
}
- }
- }
- if (parameter_file_name_major.used) {
- count += fake_build_parameter_library_name_suffix_shared_s.used;
+ for (i = 1; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_major.string, data_build.setting.version_major.used);
+ } // for
- if (data_build.setting.version_major_prefix.used) {
- memcpy(parameter_file_name_major_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
+ offset += data_build.setting.version_major.used;
if (parameter_file_name_minor.used) {
- memcpy(parameter_file_name_minor_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
-
- if (parameter_file_name_micro.used) {
- memcpy(parameter_file_name_micro_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
-
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.used);
- }
- }
- }
+ if (data_build.setting.version_minor_prefix.used) {
+ for (i = 2; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+ } // for
- count += data_build.setting.version_major_prefix.used;
- }
-
- memcpy(parameter_file_name_major_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
-
- if (parameter_file_name_minor.used) {
- memcpy(parameter_file_name_minor_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
-
- if (parameter_file_name_micro.used) {
- memcpy(parameter_file_name_micro_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
-
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_major.string, data_build.setting.version_major.used);
+ offset += data_build.setting.version_minor_prefix.used;
}
- }
- }
- if (parameter_file_name_minor.used) {
- count += data_build.setting.version_major.used;
+ for (i = 2; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
+ } // for
- if (data_build.setting.version_minor_prefix.used) {
- memcpy(parameter_file_name_minor_string + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+ offset += data_build.setting.version_minor.used;
if (parameter_file_name_micro.used) {
- memcpy(parameter_file_name_micro_string + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+ if (data_build.setting.version_micro_prefix.used) {
+ for (i = 3; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used);
+ } // for
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+ offset += data_build.setting.version_micro_prefix.used;
}
- }
- count += data_build.setting.version_minor_prefix.used;
- }
-
- memcpy(parameter_file_name_minor_string + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
-
- if (parameter_file_name_micro.used) {
- memcpy(parameter_file_name_micro_string + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
+ for (i = 3; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
+ } // for
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
- }
- }
-
- if (parameter_file_name_micro.used) {
- count += data_build.setting.version_minor.used;
-
- if (data_build.setting.version_micro_prefix.used) {
- memcpy(parameter_file_name_micro_string + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used);
+ offset += data_build.setting.version_micro.used;
if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.used);
- }
+ if (data_build.setting.version_nano_prefix.used) {
+ for (i = 4; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_nano_prefix.string, data_build.setting.version_nano_prefix.used);
+ } // for
- count += data_build.setting.version_micro_prefix.used;
- }
+ offset += data_build.setting.version_nano_prefix.used;
+ }
- memcpy(parameter_file_name_micro_string + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
+ for (i = 4; i < strings_length; ++i) {
+ memcpy(strings[i] + offset, data_build.setting.version_nano.string, data_build.setting.version_nano.used);
+ } // for
- if (parameter_file_name_nano.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
-
- count += data_build.setting.version_micro.used;
-
- if (data_build.setting.version_nano_prefix.used) {
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_nano_prefix.string, data_build.setting.version_nano_prefix.used);
- count += data_build.setting.version_nano_prefix.used;
+ offset += data_build.setting.version_nano.used;
}
-
- memcpy(parameter_file_name_nano_string + count, data_build.setting.version_nano.string, data_build.setting.version_nano.used);
}
}
}
}
{
- f_string_static_t parameter_linker = f_string_static_t_initialize;
f_string_static_t parameter_file_path = f_string_static_t_initialize;
+ f_string_static_t parameter_linker = f_string_static_t_initialize;
- parameter_linker.used = fake_build_parameter_library_shared_prefix_s.used;
parameter_file_path.used = main->path_build_libraries_shared.used;
+ parameter_linker.used = fake_build_parameter_library_shared_prefix_s.used;
if (data_build.setting.version_file == fake_build_version_type_major_e) {
parameter_file_path.used += parameter_file_name_major.used;
parameter_linker.used += parameter_file_name_nano.used;
}
- char parameter_linker_string[parameter_linker.used + 1];
char parameter_file_path_string[parameter_file_path.used + 1];
+ char parameter_linker_string[parameter_linker.used + 1];
- parameter_linker.string = parameter_linker_string;
parameter_file_path.string = parameter_file_path_string;
+ parameter_linker.string = parameter_linker_string;
+
+ parameter_file_path_string[parameter_file_path.used] = 0;
+ parameter_linker_string[parameter_linker.used] = 0;
- memcpy(parameter_linker_string, fake_build_parameter_library_shared_prefix_s.string, fake_build_parameter_library_shared_prefix_s.used);
memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+ memcpy(parameter_linker_string, fake_build_parameter_library_shared_prefix_s.string, fake_build_parameter_library_shared_prefix_s.used);
if (data_build.setting.version_file == fake_build_version_type_major_e) {
memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_major_string, parameter_file_name_major.used);
memcpy(parameter_linker_string + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_nano_string, parameter_file_name_nano.used);
}
- parameter_linker_string[parameter_linker.used] = 0;
- parameter_file_path_string[parameter_file_path.used] = 0;
-
const f_string_static_t values[] = {
fake_build_parameter_library_shared_s,
parameter_linker,
char parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
-
- memcpy(parameter_file_path.string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
- memcpy(parameter_file_path.string + main->path_build_libraries_shared.used, parameter_file_name.string, parameter_file_name.used);
-
parameter_file_path_string[parameter_file_path.used] = 0;
+ memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name.string, parameter_file_name.used);
+
*status = f_file_link(parameter_file_name_major, parameter_file_path);
if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
if (data_build.setting.version_file != fake_build_version_type_major_e && parameter_file_name_major.used) {
f_string_static_t parameter_file_path = f_string_static_t_initialize;
- parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_major.used;
-
- char parameter_file_path_string[parameter_file_path.used + 1];
- memcpy(parameter_file_path.string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
- memcpy(parameter_file_path.string + main->path_build_libraries_shared.used, parameter_file_name_major.string, parameter_file_name_major.used);
+ {
+ parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_major.used;
- parameter_file_path_string[parameter_file_path.used] = 0;
- parameter_file_path.string = parameter_file_path_string;
+ char parameter_file_path_string[parameter_file_path.used + 1];
+ parameter_file_path.string = parameter_file_path_string;
+ parameter_file_path_string[parameter_file_path.used] = 0;
- *status = f_file_link(parameter_file_name_minor, parameter_file_path);
+ memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_major.string, parameter_file_name_major.used);
- if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
- fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s);
- }
- else if (F_status_is_error(*status)) {
- if (F_status_set_fine(*status) == F_file_found) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ *status = f_file_link(parameter_file_name_minor, parameter_file_path);
- return 0;
+ if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
+ fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s);
}
+ else if (F_status_is_error(*status)) {
+ if (F_status_set_fine(*status) == F_file_found) {
+ fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
+ return 0;
+ }
- return 0;
+ fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, f_file_operation_link_s, fll_error_file_type_file_e);
+
+ return 0;
+ }
}
if (data_build.setting.version_file != fake_build_version_type_minor_e && parameter_file_name_minor.used) {
- f_string_static_t parameter_file_path = f_string_static_t_initialize;
- parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_minor.used;
+ {
+ parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_minor.used;
- char parameter_file_path_string[parameter_file_path.used + 1];
- parameter_file_path.string = parameter_file_path_string;
+ char parameter_file_path_string[parameter_file_path.used + 1];
+ parameter_file_path.string = parameter_file_path_string;
+ parameter_file_path_string[parameter_file_path.used] = 0;
- memcpy(parameter_file_path.string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
- memcpy(parameter_file_path.string + main->path_build_libraries_shared.used, parameter_file_name_minor.string, parameter_file_name_minor.used);
+ memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
+ memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_minor.string, parameter_file_name_minor.used);
- parameter_file_path_string[parameter_file_path.used] = 0;
+ *status = f_file_link(parameter_file_name_micro, parameter_file_path);
- *status = f_file_link(parameter_file_name_micro, parameter_file_path);
+ if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
+ fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s);
+ }
+ else if (F_status_is_error(*status)) {
+ if (F_status_set_fine(*status) == F_file_found) {
+ fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
- if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
- fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s);
- }
- else if (F_status_is_error(*status)) {
- if (F_status_set_fine(*status) == F_file_found) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, f_file_operation_link_s, fll_error_file_type_file_e);
+ return 0;
+ }
+
+ fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
-
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, f_file_operation_link_s, fll_error_file_type_file_e);
-
- return 0;
}
if (data_build.setting.version_file != fake_build_version_type_micro_e && parameter_file_name_micro.used) {
- f_string_static_t parameter_file_path = f_string_static_t_initialize;
parameter_file_path.used = main->path_build_libraries_shared.used + parameter_file_name_micro.used;
char parameter_file_path_string[parameter_file_path.used + 1];
parameter_file_path.string = parameter_file_path_string;
+ parameter_file_path_string[parameter_file_path.used] = 0;
memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_micro.string, parameter_file_name_micro.used);
- parameter_file_path_string[parameter_file_path.used] = 0;
-
*status = f_file_link(parameter_file_name_nano, parameter_file_path);
if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
char destination_string[destination.used + 1];
destination.string = destination_string;
+ destination_string[destination.used] = 0;
destination.used = 0;
memcpy(destination_string + destination.used, fake_build_parameter_library_name_suffix_static_s.string, fake_build_parameter_library_name_suffix_static_s.used);
destination.used += fake_build_parameter_library_name_suffix_static_s.used;
- destination_string[destination.used] = 0;
-
*status = fll_execute_arguments_add(destination, &arguments);
}
char source_string[source.used + 1];
source.string = source_string;
+ source_string[source.used] = 0;
if (source_path.used) {
memcpy(source_string, source_path.string, source_path.used);
memcpy(source_string + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, fake_build_parameter_object_name_suffix_s.used);
}
- source_string[source.used] = 0;
-
*status = fll_execute_arguments_add(source, &arguments);
if (F_status_is_error(*status)) {
char path_file_string[path_file.used + 1];
path_file.string = path_file_string;
+ path_file_string[path_file.used] = 0;
{
f_string_dynamic_t buffer = f_string_dynamic_t_initialize;
memcpy(path_file_string, main->path_data_build.string, main->path_data_build.used);
memcpy(path_file_string + main->path_data_build.used, setting_file.string, setting_file.used);
- path_file_string[main->path_data_build.used + setting_file.used] = 0;
-
*status = fake_file_buffer(main, path_file, &buffer);
}
else {
break;
}
- memcpy(settings_mode_names[j].string, settings_name[j].string, settings_value[j]->used);
- settings_mode_names[j].used = settings_value[j]->used;
+ *status = f_string_dynamic_append(settings_name[j], &settings_mode_names[j]);
- memcpy(settings_mode_names[j].string, f_string_ascii_minus_s.string, f_string_ascii_minus_s.used);
- settings_mode_names[j].used += f_string_ascii_minus_s.used;
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append(f_string_ascii_minus_s, &settings_mode_names[j]);
+ }
- memcpy(settings_mode_names[j].string + settings_mode_names[j].used, modes->array[i].string, modes->array[i].used);
- settings_mode_names[j].used += modes->array[i].used;
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append(modes->array[i], &settings_mode_names[j]);
+ }
+
+ if (F_status_is_error(*status)) {
+ function = "f_string_dynamic_increase_by";
+
+ break;
+ }
} // for
if (*status == F_none) {
if (F_status_is_error(*status)) break;
} // for
- // "build_libraries" is appended after all modes to help assist with static linker file issues (@todo there should likely be more options to have a postfix linker parameter that can be added here instead, such as "build_libraries_last").
+ // The string "build_libraries" is appended after all modes to help assist with static linker file issues (@todo there should likely be more options to have a postfix linker parameter that can be added here instead, such as "build_libraries_last").
if (total_build_libraries) {
- f_string_dynamic_t temporary[total_build_libraries];
+ f_string_static_t temporary[total_build_libraries];
+ // Move the original "build_libraries" into a temporary location.
for (i = 0; i < total_build_libraries; ++i) {
temporary[i].string = setting->build_libraries.array[i].string;
temporary[i].size = setting->build_libraries.array[i].size;
} // for
+ // Move all of the other build library settings to the front of the array.
for (i = 0, j = total_build_libraries; j < setting->build_libraries.used; ++i, ++j) {
setting->build_libraries.array[i].string = setting->build_libraries.array[j].string;
setting->build_libraries.array[i].size = setting->build_libraries.array[j].size;
} // for
+ // Move back the original "build_libraries" back, but at the end of the array.
for (i = setting->build_libraries.used - total_build_libraries, j = 0; j < total_build_libraries; ++i, ++j) {
setting->build_libraries.array[i].string = temporary[j].string;
source.used = path_sources->used + sources[i]->array[j].used;
char source_string[source.used + 1];
+ source.string = source_string;
+ source_string[source.used] = 0;
memcpy(source_string, path_sources->string, path_sources->used);
memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
- source_string[source.used] = 0;
*status = fake_build_get_file_name_without_extension(main, sources[i]->array[j], &file_name);
char destination_string[destination.used + 1];
destination.string = destination_string;
+ destination_string[destination.used] = 0;
if (destination_path.used) {
memcpy(destination_string, destination_path.string, destination_path.used);
memcpy(destination_string + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, fake_build_parameter_object_name_suffix_s.used);
}
- destination_string[destination.used] = 0;
-
const f_string_static_t values[] = {
source,
fake_build_parameter_object_compile_s,
char source_string[source.used + 1];
source.string = source_string;
+ source_string[source.used] = 0;
memcpy(source_string, path_sources->string, path_sources->used);
memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
- source_string[source.used] = 0;
-
*status = fll_execute_arguments_add(source, &arguments);
if (F_status_is_error(*status)) break;
} // for
char parameter_file_name_path_string[parameter_file_name_path.used + 1];
parameter_file_name_path.string = parameter_file_name_path_string;
+ parameter_file_name_path_string[parameter_file_name_path.used] = 0;
memcpy(parameter_file_name_path_string, main->path_build_programs_shared.string, main->path_build_programs_shared.used);
memcpy(parameter_file_name_path_string + main->path_build_programs_shared.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
- parameter_file_name_path_string[parameter_file_name_path.used] = 0;
-
const f_string_static_t values[] = {
fake_build_parameter_library_output_s,
parameter_file_name_path,
} // for
}
- // if project-specific library sources exist, then the -lproject_name needs to be added to the arguments.
+ // If project-specific library sources exist, then the -lproject_name needs to be added to the arguments.
if (F_status_is_error_not(*status) && data_build.setting.build_sources_library.used) {
f_string_static_t link_project_library = f_string_static_t_initialize;
link_project_library.used = fake_build_parameter_library_link_file_s.used + data_build.setting.project_name.used;
char link_project_library_string[link_project_library.used + 1];
link_project_library.string = link_project_library_string;
+ link_project_library_string[link_project_library.used] = 0;
memcpy(link_project_library_string, fake_build_parameter_library_link_file_s.string, fake_build_parameter_library_link_file_s.used);
memcpy(link_project_library_string + fake_build_parameter_library_link_file_s.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
- link_project_library_string[link_project_library.used] = 0;
-
*status = fll_execute_arguments_add(link_project_library, &arguments);
}
char source_string[source.used + 1];
source.string = source_string;
+ source_string[source.used] = 0;
memcpy(source_string, path_sources->string, path_sources->used);
memcpy(source_string + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
- source_string[source.used] = 0;
-
*status = fll_execute_arguments_add(source, &arguments);
if (F_status_is_error(*status)) break;
} // for
char source_library_string[source_library.used + 1];
source_library.string = source_library_string;
+ source_library_string[source_library.used] = 0;
source_library.used = 0;
// Only include the library if there are sources that would result in it being built.
source_library.used += fake_build_parameter_library_name_suffix_static_s.used;
}
- source_library_string[source_library.used] = 0;
-
f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
parameter_file_name_path.used = main->path_build_programs_static.used + data_build.setting.project_name.used;
char parameter_file_name_path_string[parameter_file_name_path.used + 1];
+ parameter_file_name_path.string = parameter_file_name_path_string;
+ parameter_file_name_path_string[parameter_file_name_path.used] = 0;
memcpy(parameter_file_name_path_string, main->path_build_programs_static.string, main->path_build_programs_static.used);
memcpy(parameter_file_name_path_string + main->path_build_programs_static.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
- parameter_file_name_path_string[parameter_file_name_path.used] = 0;
-
const f_string_static_t values[] = {
source_library,
fake_build_parameter_library_static_s,
if (F_status_is_error(*status)) break;
} // for
- if (main->path_work.used) {
+ if (main->path_work.used && F_status_is_error_not(*status)) {
f_string_static_t buffer = f_string_static_t_initialize;
if (F_status_is_error_not(*status)) {
buffer.used = fake_build_parameter_library_include_s.used + main->path_work_includes.used;
char buffer_string[buffer.used + 1];
+ buffer.string = buffer_string;
+ buffer_string[buffer.used] = 0;
memcpy(buffer_string, fake_build_parameter_library_include_s.string, fake_build_parameter_library_include_s.used);
memcpy(buffer_string + fake_build_parameter_library_include_s.used, main->path_work_includes.string, main->path_work_includes.used);
- buffer_string[buffer.used] = 0;
-
*status = fll_execute_arguments_add(buffer, arguments);
}
buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_shared.used;
char buffer_string[buffer.used + 1];
+ buffer.string = buffer_string;
+ buffer_string[buffer.used] = 0;
memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used);
memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_shared.string, main->path_work_libraries_shared.used);
- buffer_string[buffer.used] = 0;
-
*status = fll_execute_arguments_add(buffer, arguments);
}
buffer.used = fake_build_parameter_library_link_path_s.used + main->path_work_libraries_static.used;
char buffer_string[buffer.used + 1];
+ buffer.string = buffer_string;
+ buffer_string[buffer.used] = 0;
memcpy(buffer_string, fake_build_parameter_library_link_path_s.string, fake_build_parameter_library_link_path_s.used);
memcpy(buffer_string + fake_build_parameter_library_link_path_s.used, main->path_work_libraries_static.string, main->path_work_libraries_static.used);
- buffer_string[buffer.used] = 0;
-
*status = fll_execute_arguments_add(buffer, arguments);
}
}
argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_dark_s.used;
char argument_string[argument.used + 1];
+ argument.string = argument_string;
argument_string[argument.used] = 0;
memcpy(argument_string, f_console_symbol_short_disable_s.string, f_console_symbol_short_disable_s.used);
argument.used = f_console_symbol_short_disable_s.used + f_console_standard_short_quiet_s.used;
char argument_string[argument.used + 1];
+ argument.string = argument_string;
argument_string[argument.used] = 0;
memcpy(argument_string, f_console_symbol_short_disable_s.string, f_console_symbol_short_disable_s.used);
}
if (F_status_is_error_not(*status) && data_make->setting_make.load_build) {
- f_string_static_t stub = f_string_static_t_initialize;
-
- fake_build_load_setting(data_make->main, stub, &data_make->setting_build, status);
+ fake_build_load_setting(data_make->main, f_string_empty_s, &data_make->setting_build, status);
if (F_status_is_error(*status) && *status != F_status_set_error(F_interrupt)) {
fll_error_print(data_make->main->error, F_status_set_fine(*status), "fake_build_load_setting", F_true);
}
if (state_process->operation == fake_make_operation_type_build_e) {
- f_string_static_t stub = f_string_static_t_initialize;
-
- *status = fake_build_operate(arguments.used ? arguments.array[0] : stub, data_make->main);
+ *status = fake_build_operate(arguments.used ? arguments.array[0] : f_string_empty_s, data_make->main);
if (F_status_set_fine(*status) == F_interrupt) {
return 0;
char destination_string[destination.used + 1];
destination.string = destination_string;
+ destination_string[destination.used] = 0;
memcpy(destination_string, arguments.array[total].string, arguments.array[total].used);
destination_string[arguments.array[total].used] = f_path_separator_s.string[0];
}
- destination_string[destination.used] = 0;
-
status_file = f_directory_is(arguments.array[i]);
if (status_file == F_true) {
char destination_string[destination.used + 1];
destination.string = destination_string;
+ destination_string[destination.used] = 0;
memcpy(destination_string, arguments.array[total].string, arguments.array[total].used);
destination_string[arguments.array[total].used] = f_path_separator_s.string[0];
}
- destination_string[destination.used] = 0;
-
status_file = fll_file_move(arguments.array[i], destination, recurse);
if (F_status_is_error(status_file)) {
char path_file_string[path_file.used + 1];
path_file.string = path_file_string;
+ path_file_string[path_file.used] = 0;
memcpy(path_file_string, data_make->main->path_data_build.string, data_make->main->path_data_build.used);
memcpy(path_file_string + data_make->main->path_data_build.used, arguments.array[0].string, arguments.array[0].used);
- path_file_string[path_file.used] = 0;
-
f_status_t status_file = f_file_is(path_file, F_file_type_regular_d, F_false);
if (status_file == F_file_found_not) {
--- /dev/null
+#include "firewall.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_firewall_program_help_parameters_
+ const f_string_static_t firewall_program_help_parameters_s = macro_f_string_static_t_initialize(FIREWALL_program_help_parameters_s, 0, FIREWALL_program_help_parameters_s_length);
+#endif // _di_firewall_program_help_parameters_
+
+#ifndef _di_firewall_paths_
+ const f_string_static_t firewall_file_first_s = macro_f_string_static_t_initialize(FIREWALL_file_first_s, 0, FIREWALL_file_first_s_length);
+ const f_string_static_t firewall_file_last_s = macro_f_string_static_t_initialize(FIREWALL_file_last_s, 0, FIREWALL_file_last_s_length);
+ const f_string_static_t firewall_file_other_s = macro_f_string_static_t_initialize(FIREWALL_file_other_s, 0, FIREWALL_file_other_s_length);
+ const f_string_static_t firewall_file_suffix_s = macro_f_string_static_t_initialize(FIREWALL_file_suffix_s, 0, FIREWALL_file_suffix_s_length);
+
+ const f_string_static_t firewall_network_path_s = macro_f_string_static_t_initialize(FIREWALL_network_path_s, 0, FIREWALL_network_path_s_length);
+ const f_string_static_t firewall_network_devices_s = macro_f_string_static_t_initialize(FIREWALL_network_devices_s, 0, FIREWALL_network_devices_s_length);
+#endif // _di_firewall_paths_
+
+#ifndef _di_firewall_defines_
+ const f_string_static_t firewall_action_s = macro_f_string_static_t_initialize(FIREWALL_action_s, 0, FIREWALL_action_s_length);
+ const f_string_static_t firewall_action_append_s = macro_f_string_static_t_initialize(FIREWALL_action_append_s, 0, FIREWALL_action_append_s_length);
+ const f_string_static_t firewall_action_insert_s = macro_f_string_static_t_initialize(FIREWALL_action_insert_s, 0, FIREWALL_action_insert_s_length);
+ const f_string_static_t firewall_action_policy_s = macro_f_string_static_t_initialize(FIREWALL_action_policy_s, 0, FIREWALL_action_policy_s_length);
+ const f_string_static_t firewall_action_none_s = macro_f_string_static_t_initialize(FIREWALL_action_none_s, 0, FIREWALL_action_none_s_length);
+
+ const f_string_static_t firewall_action_append_command_s = macro_f_string_static_t_initialize(FIREWALL_action_append_command_s, 0, FIREWALL_action_append_command_s_length);
+ const f_string_static_t firewall_action_insert_command_s = macro_f_string_static_t_initialize(FIREWALL_action_insert_command_s, 0, FIREWALL_action_insert_command_s_length);
+ const f_string_static_t firewall_action_policy_command_s = macro_f_string_static_t_initialize(FIREWALL_action_policy_command_s, 0, FIREWALL_action_policy_command_s_length);
+
+ const f_string_static_t firewall_chain_s = macro_f_string_static_t_initialize(FIREWALL_chain_s, 0, FIREWALL_chain_s_length);
+ const f_string_static_t firewall_chain_forward_s = macro_f_string_static_t_initialize(FIREWALL_chain_forward_s, 0, FIREWALL_chain_forward_s_length);
+ const f_string_static_t firewall_chain_drop_s = macro_f_string_static_t_initialize(FIREWALL_chain_drop_s, 0, FIREWALL_chain_drop_s_length);
+ const f_string_static_t firewall_chain_input_s = macro_f_string_static_t_initialize(FIREWALL_chain_input_s, 0, FIREWALL_chain_input_s_length);
+ const f_string_static_t firewall_chain_none_s = macro_f_string_static_t_initialize(FIREWALL_chain_none_s, 0, FIREWALL_chain_none_s_length);
+ const f_string_static_t firewall_chain_output_s = macro_f_string_static_t_initialize(FIREWALL_chain_output_s, 0, FIREWALL_chain_output_s_length);
+ const f_string_static_t firewall_chain_postrouting_s = macro_f_string_static_t_initialize(FIREWALL_chain_postrouting_s, 0, FIREWALL_chain_postrouting_s_length);
+ const f_string_static_t firewall_chain_prerouting_s = macro_f_string_static_t_initialize(FIREWALL_chain_prerouting_s, 0, FIREWALL_chain_prerouting_s_length);
+
+ const f_string_static_t firewall_chain_create_command_s = macro_f_string_static_t_initialize(FIREWALL_chain_create_command_s, 0, FIREWALL_chain_create_command_s_length);
+ const f_string_static_t firewall_chain_delete_command_s = macro_f_string_static_t_initialize(FIREWALL_chain_delete_command_s, 0, FIREWALL_chain_delete_command_s_length);
+ const f_string_static_t firewall_chain_flush_command_s = macro_f_string_static_t_initialize(FIREWALL_chain_flush_command_s, 0, FIREWALL_chain_flush_command_s_length);
+
+ const f_string_static_t firewall_command_start_s = macro_f_string_static_t_initialize(FIREWALL_command_start_s, 0, FIREWALL_command_start_s_length);
+ const f_string_static_t firewall_command_stop_s = macro_f_string_static_t_initialize(FIREWALL_command_stop_s, 0, FIREWALL_command_stop_s_length);
+ const f_string_static_t firewall_command_restart_s = macro_f_string_static_t_initialize(FIREWALL_command_restart_s, 0, FIREWALL_command_restart_s_length);
+ const f_string_static_t firewall_command_lock_s = macro_f_string_static_t_initialize(FIREWALL_command_lock_s, 0, FIREWALL_command_lock_s_length);
+ const f_string_static_t firewall_command_show_s = macro_f_string_static_t_initialize(FIREWALL_command_show_s, 0, FIREWALL_command_show_s_length);
+
+ const f_string_static_t firewall_device_s = macro_f_string_static_t_initialize(FIREWALL_device_s, 0, FIREWALL_device_s_length);
+ const f_string_static_t firewall_device_all_s = macro_f_string_static_t_initialize(FIREWALL_device_all_s, 0, FIREWALL_device_all_s_length);
+ const f_string_static_t firewall_device_this_s = macro_f_string_static_t_initialize(FIREWALL_device_this_s, 0, FIREWALL_device_this_s_length);
+ const f_string_static_t firewall_device_loop_s = macro_f_string_static_t_initialize(FIREWALL_device_loop_s, 0, FIREWALL_device_loop_s_length);
+
+ const f_string_static_t firewall_device_input_command_s = macro_f_string_static_t_initialize(FIREWALL_device_input_command_s, 0, FIREWALL_device_input_command_s_length);
+ const f_string_static_t firewall_device_output_command_s = macro_f_string_static_t_initialize(FIREWALL_device_output_command_s, 0, FIREWALL_device_output_command_s_length);
+
+ const f_string_static_t firewall_direction_s = macro_f_string_static_t_initialize(FIREWALL_direction_s, 0, FIREWALL_direction_s_length);
+ const f_string_static_t firewall_direction_input_s = macro_f_string_static_t_initialize(FIREWALL_direction_input_s, 0, FIREWALL_direction_input_s_length);
+ const f_string_static_t firewall_direction_output_s = macro_f_string_static_t_initialize(FIREWALL_direction_output_s, 0, FIREWALL_direction_output_s_length);
+ const f_string_static_t firewall_direction_none_s = macro_f_string_static_t_initialize(FIREWALL_direction_none_s, 0, FIREWALL_direction_none_s_length);
+
+ const f_string_static_t firewall_group_stop_s = macro_f_string_static_t_initialize(FIREWALL_group_stop_s, 0, FIREWALL_group_stop_s_length);
+ const f_string_static_t firewall_group_lock_s = macro_f_string_static_t_initialize(FIREWALL_group_lock_s, 0, FIREWALL_group_lock_s_length);
+ const f_string_static_t firewall_group_main_s = macro_f_string_static_t_initialize(FIREWALL_group_main_s, 0, FIREWALL_group_main_s_length);
+
+ const f_string_static_t firewall_ip_list = macro_f_string_static_t_initialize(FIREWALL_ip_list, 0, FIREWALL_ip_list_length);
+ const f_string_static_t firewall_ip_list_source_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_source_s, 0, FIREWALL_ip_list_source_s_length);
+ const f_string_static_t firewall_ip_list_source_action_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_source_action_s, 0, FIREWALL_ip_list_source_action_s_length);
+ const f_string_static_t firewall_ip_list_destination_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_destination_s, 0, FIREWALL_ip_list_destination_s_length);
+ const f_string_static_t firewall_ip_list_destination_action_s = macro_f_string_static_t_initialize(FIREWALL_ip_list_destination_action_s, 0, FIREWALL_ip_list_destination_action_s_length);
+
+ const f_string_static_t firewall_protocol_s = macro_f_string_static_t_initialize(FIREWALL_protocol_s, 0, FIREWALL_protocol_s_length);
+ const f_string_static_t firewall_protocol_command_s = macro_f_string_static_t_initialize(FIREWALL_protocol_command_s, 0, FIREWALL_protocol_command_s_length);
+ const f_string_static_t firewall_protocol_none_s = macro_f_string_static_t_initialize(FIREWALL_protocol_none_s, 0, FIREWALL_protocol_none_s_length);
+
+ const f_string_static_t firewall_rule_s = macro_f_string_static_t_initialize(FIREWALL_rule_s, 0, FIREWALL_rule_s_length);
+
+ const f_string_static_t firewall_show_mangle_s = macro_f_string_static_t_initialize(FIREWALL_show_mangle_s, 0, FIREWALL_show_mangle_s_length);
+ const f_string_static_t firewall_show_nat_s = macro_f_string_static_t_initialize(FIREWALL_show_nat_s, 0, FIREWALL_show_nat_s_length);
+ const f_string_static_t firewall_show_ports_s = macro_f_string_static_t_initialize(FIREWALL_show_ports_s, 0, FIREWALL_show_ports_s_length);
+
+ const f_string_static_t firewall_show_parameter_exact_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_exact_s, 0, FIREWALL_show_parameter_exact_s_length);
+ const f_string_static_t firewall_show_parameter_verbose_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_verbose_s, 0, FIREWALL_show_parameter_verbose_s_length);
+ const f_string_static_t firewall_show_parameter_table_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_table_s, 0, FIREWALL_show_parameter_table_s_length);
+ const f_string_static_t firewall_show_parameter_numeric_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_numeric_s, 0, FIREWALL_show_parameter_numeric_s_length);
+ const f_string_static_t firewall_show_parameter_list_s = macro_f_string_static_t_initialize(FIREWALL_show_parameter_list_s, 0, FIREWALL_show_parameter_list_s_length);
+
+ const f_string_static_t firewall_tool_s = macro_f_string_static_t_initialize(FIREWALL_tool_s, 0, FIREWALL_tool_s_length);
+ const f_string_static_t firewall_tool_iptables_s = macro_f_string_static_t_initialize(FIREWALL_tool_iptables_s, 0, FIREWALL_tool_iptables_s_length);
+ const f_string_static_t firewall_tool_ip6tables_s = macro_f_string_static_t_initialize(FIREWALL_tool_ip6tables_s, 0, FIREWALL_tool_ip6tables_s_length);
+ const f_string_static_t firewall_tool_ip46tables_s = macro_f_string_static_t_initialize(FIREWALL_tool_ip46tables_s, 0, FIREWALL_tool_ip46tables_s_length);
+ const f_string_static_t firewall_tool_ipset_s = macro_f_string_static_t_initialize(FIREWALL_tool_ipset_s, 0, FIREWALL_tool_ipset_s_length);
+#endif // _di_firewall_defines_
+
+#ifndef _di_firewall_main_delete_
+ f_status_t firewall_main_delete(firewall_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ 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);
+
+ return F_none;
+ }
+#endif // _di_firewall_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Firewall
+ * 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 _firewall_common_h
+#define _firewall_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_program_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_program_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_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_program_help_parameters_
+ #define FIREWALL_program_help_parameters_s "command"
+ #define FIREWALL_program_help_parameters_s_length 7
+
+ extern const f_string_static_t firewall_program_help_parameters_s;
+#endif // _di_firewall_program_help_parameters_
+
+#ifndef _di_firewall_paths_
+ #define FIREWALL_file_first_s "firewall-first"
+ #define FIREWALL_file_last_s "firewall-last"
+ #define FIREWALL_file_other_s "firewall-other"
+ #define FIREWALL_file_suffix_s "-firewall"
+
+ #define FIREWALL_network_path_s "/etc/network/"
+ #define FIREWALL_network_devices_s "/sys/class/net/"
+
+ #define FIREWALL_file_first_s_length 14
+ #define FIREWALL_file_last_s_length 13
+ #define FIREWALL_file_other_s_length 14
+ #define FIREWALL_file_suffix_s_length 9
+
+ #define FIREWALL_network_path_s_length 13
+ #define FIREWALL_network_devices_s_length 15
+
+ extern const f_string_static_t firewall_file_first_s;
+ extern const f_string_static_t firewall_file_last_s;
+ extern const f_string_static_t firewall_file_other_s;
+ extern const f_string_static_t firewall_file_suffix_s;
+
+ extern const f_string_static_t firewall_network_path_s;
+ extern const f_string_static_t firewall_network_devices_s;
+#endif // _di_firewall_paths_
+
+#ifndef _di_firewall_default_allocation_step_
+ #define firewall_default_allocation_step_d F_memory_default_allocation_small_d
+#endif // _di_firewall_default_allocation_step_
+
+#ifndef _di_firewall_defines_
+ #define firewall_signal_check_d 10000
+
+ #define FIREWALL_action_s "action"
+ #define FIREWALL_action_append_s "append"
+ #define FIREWALL_action_insert_s "insert"
+ #define FIREWALL_action_policy_s "policy"
+ #define FIREWALL_action_none_s "none"
+
+ #define FIREWALL_action_append_command_s "-A"
+ #define FIREWALL_action_insert_command_s "-I"
+ #define FIREWALL_action_policy_command_s "-P"
+
+ #define FIREWALL_chain_s "chain"
+ #define FIREWALL_chain_forward_s "FORWARD"
+ #define FIREWALL_chain_drop_s "DROP"
+ #define FIREWALL_chain_input_s "INPUT"
+ #define FIREWALL_chain_none_s "none"
+ #define FIREWALL_chain_output_s "OUTPUT"
+ #define FIREWALL_chain_postrouting_s "POSTROUTING"
+ #define FIREWALL_chain_prerouting_s "PREROUTING"
+
+ #define FIREWALL_chain_create_command_s "-N"
+ #define FIREWALL_chain_delete_command_s "-X"
+ #define FIREWALL_chain_flush_command_s "-F"
+
+ #define FIREWALL_command_start_s "start"
+ #define FIREWALL_command_stop_s "stop"
+ #define FIREWALL_command_restart_s "restart"
+ #define FIREWALL_command_lock_s "lock"
+ #define FIREWALL_command_show_s "show"
+
+ #define FIREWALL_device_s "device"
+ #define FIREWALL_device_all_s "all"
+ #define FIREWALL_device_this_s "this"
+ #define FIREWALL_device_loop_s "lo"
+
+ #define FIREWALL_device_input_command_s "-i"
+ #define FIREWALL_device_output_command_s "-o"
+
+ #define FIREWALL_direction_s "direction"
+ #define FIREWALL_direction_input_s "input"
+ #define FIREWALL_direction_output_s "output"
+ #define FIREWALL_direction_none_s "none"
+
+ #define FIREWALL_group_stop_s "stop"
+ #define FIREWALL_group_lock_s "lock"
+ #define FIREWALL_group_main_s "main"
+
+ #define FIREWALL_ip_list "ip_list"
+ #define FIREWALL_ip_list_source_s "source"
+ #define FIREWALL_ip_list_source_action_s "-s"
+ #define FIREWALL_ip_list_destination_s "destination"
+ #define FIREWALL_ip_list_destination_action_s "-d"
+
+ #define FIREWALL_protocol_s "protocol"
+ #define FIREWALL_protocol_command_s "-p"
+ #define FIREWALL_protocol_none_s "none"
+
+ #define FIREWALL_rule_s "rule"
+
+ #define FIREWALL_show_mangle_s "mangle"
+ #define FIREWALL_show_nat_s "nat"
+ #define FIREWALL_show_ports_s "ports"
+
+ #define FIREWALL_show_parameter_exact_s "-x"
+ #define FIREWALL_show_parameter_verbose_s "-v"
+ #define FIREWALL_show_parameter_table_s "-t"
+ #define FIREWALL_show_parameter_numeric_s "--numeric"
+ #define FIREWALL_show_parameter_list_s "--list"
+
+ #define FIREWALL_tool_s "tool"
+ #define FIREWALL_tool_iptables_s "iptables"
+ #define FIREWALL_tool_ip6tables_s "ip6tables"
+ #define FIREWALL_tool_ip46tables_s "ip46tables"
+ #define FIREWALL_tool_ipset_s "ipset"
+
+ #define FIREWALL_action_length_s 6
+ #define FIREWALL_action_append_s_length 6
+ #define FIREWALL_action_insert_s_length 6
+ #define FIREWALL_action_policy_s_length 6
+ #define FIREWALL_action_none_s_length 4
+
+ #define FIREWALL_action_append_command_s_length 2
+ #define FIREWALL_action_insert_command_s_length 2
+ #define FIREWALL_action_policy_command_s_length 2
+
+ #define FIREWALL_chain_s_length 5
+ #define FIREWALL_chain_forward_s_length 7
+ #define FIREWALL_chain_drop_s_length 4
+ #define FIREWALL_chain_input_s_length 5
+ #define FIREWALL_chain_none_s_length 4
+ #define FIREWALL_chain_output_s_length 6
+ #define FIREWALL_chain_postrouting_s_length 12
+ #define FIREWALL_chain_prerouting_s_length 11
+
+ #define FIREWALL_chain_create_command_s_length 2
+ #define FIREWALL_chain_delete_command_s_length 2
+ #define FIREWALL_chain_flush_command_s_length 2
+
+ #define FIREWALL_command_start_s_length 5
+ #define FIREWALL_command_stop_s_length 4
+ #define FIREWALL_command_restart_s_length 7
+ #define FIREWALL_command_lock_s_length 4
+ #define FIREWALL_command_show_s_length 4
+
+ #define FIREWALL_device_s_length 6
+ #define FIREWALL_device_all_s_length 3
+ #define FIREWALL_device_this_s_length 4
+ #define FIREWALL_device_loop_s_length 2
+
+ #define FIREWALL_device_input_command_length_s 2
+ #define FIREWALL_device_output_command_length_s 2
+
+ #define FIREWALL_direction_s_length 9
+ #define FIREWALL_direction_input_s_length 5
+ #define FIREWALL_direction_output_s_length 6
+ #define FIREWALL_direction_none_s_length 4
+
+ #define FIREWALL_group_stop_s_length 4
+ #define FIREWALL_group_lock_s_length 4
+ #define FIREWALL_group_main_s_length 4
+
+ #define FIREWALL_ip_list_length_s 7
+ #define FIREWALL_ip_list_source_s_length 6
+ #define FIREWALL_ip_list_source_action_s_length 2
+ #define FIREWALL_ip_list_destination_s_length 11
+ #define FIREWALL_ip_list_destination_action_s_length 2
+
+ #define FIREWALL_protocol_s_length 8
+ #define FIREWALL_protocol_command_s_length 2
+ #define FIREWALL_protocol_none_s_length 4
+
+ #define FIREWALL_rule_s_length 4
+
+ #define FIREWALL_show_mangle_s_length 6
+ #define FIREWALL_show_nat_s_length 3
+ #define FIREWALL_show_ports_s_length 5
+
+ #define FIREWALL_show_parameter_exact_s_length 2
+ #define FIREWALL_show_parameter_verbose_s_length 2
+ #define FIREWALL_show_parameter_table_s_length 2
+ #define FIREWALL_show_parameter_numeric_s_length 9
+ #define FIREWALL_show_parameter_list_s_length 6
+
+ #define FIREWALL_tool_s_length 4
+ #define FIREWALL_tool_iptables_s_length 8
+ #define FIREWALL_tool_ip6tables_s_length 9
+ #define FIREWALL_tool_ip46tables_s_length 10
+ #define FIREWALL_tool_ipset_s_length 5
+
+ extern const f_string_static_t firewall_action_s;
+ extern const f_string_static_t firewall_action_append_s;
+ extern const f_string_static_t firewall_action_insert_s;
+ extern const f_string_static_t firewall_action_policy_s;
+ extern const f_string_static_t firewall_action_none_s;
+
+ extern const f_string_static_t firewall_action_append_command_s;
+ extern const f_string_static_t firewall_action_insert_command_s;
+ extern const f_string_static_t firewall_action_policy_command_s;
+
+ extern const f_string_static_t firewall_chain_s;
+ extern const f_string_static_t firewall_chain_forward_s;
+ extern const f_string_static_t firewall_chain_drop_s;
+ extern const f_string_static_t firewall_chain_input_s;
+ extern const f_string_static_t firewall_chain_none_s;
+ extern const f_string_static_t firewall_chain_output_s;
+ extern const f_string_static_t firewall_chain_postrouting_s;
+ extern const f_string_static_t firewall_chain_prerouting_s;
+
+ extern const f_string_static_t firewall_chain_create_command_s;
+ extern const f_string_static_t firewall_chain_delete_command_s;
+ extern const f_string_static_t firewall_chain_flush_command_s;
+
+ extern const f_string_static_t firewall_command_start_s;
+ extern const f_string_static_t firewall_command_stop_s;
+ extern const f_string_static_t firewall_command_restart_s;
+ extern const f_string_static_t firewall_command_lock_s;
+ extern const f_string_static_t firewall_command_show_s;
+
+ extern const f_string_static_t firewall_device_s;
+ extern const f_string_static_t firewall_device_all_s;
+ extern const f_string_static_t firewall_device_this_s;
+ extern const f_string_static_t firewall_device_loop_s;
+
+ extern const f_string_static_t firewall_device_input_command_s;
+ extern const f_string_static_t firewall_device_output_command_s;
+
+ extern const f_string_static_t firewall_direction_s;
+ extern const f_string_static_t firewall_direction_input_s;
+ extern const f_string_static_t firewall_direction_output_s;
+ extern const f_string_static_t firewall_direction_none_s;
+
+ extern const f_string_static_t firewall_group_stop_s;
+ extern const f_string_static_t firewall_group_lock_s;
+ extern const f_string_static_t firewall_group_main_s;
+
+ extern const f_string_static_t firewall_ip_list;
+ extern const f_string_static_t firewall_ip_list_source_s;
+ extern const f_string_static_t firewall_ip_list_source_action_s;
+ extern const f_string_static_t firewall_ip_list_destination_s;
+ extern const f_string_static_t firewall_ip_list_destination_action_s;
+
+ extern const f_string_static_t firewall_protocol_s;
+ extern const f_string_static_t firewall_protocol_command_s;
+ extern const f_string_static_t firewall_protocol_none_s;
+
+ extern const f_string_static_t firewall_rule_s;
+
+ extern const f_string_static_t firewall_show_mangle_s;
+ extern const f_string_static_t firewall_show_nat_s;
+ extern const f_string_static_t firewall_show_ports_s;
+
+ extern const f_string_static_t firewall_show_parameter_exact_s;
+ extern const f_string_static_t firewall_show_parameter_verbose_s;
+ extern const f_string_static_t firewall_show_parameter_table_s;
+ extern const f_string_static_t firewall_show_parameter_numeric_s;
+ extern const f_string_static_t firewall_show_parameter_list_s;
+
+ extern const f_string_static_t firewall_tool_s;
+ extern const f_string_static_t firewall_tool_iptables_s;
+ extern const f_string_static_t firewall_tool_ip6tables_s;
+ extern const f_string_static_t firewall_tool_ip46tables_s;
+ extern const f_string_static_t firewall_tool_ipset_s;
+
+ enum {
+ firewall_program_none_e = 1,
+ firewall_program_iptables_e,
+ firewall_program_ip6tables_e,
+ firewall_program_ip46tables_e,
+ firewall_program_ipset_e,
+ };
+
+ enum {
+ firewall_parameter_help_e,
+ firewall_parameter_light_e,
+ firewall_parameter_dark_e,
+ firewall_parameter_no_color_e,
+ firewall_parameter_verbosity_quiet_e,
+ firewall_parameter_verbosity_normal_e,
+ firewall_parameter_verbosity_verbose_e,
+ firewall_parameter_verbosity_debug_e,
+ firewall_parameter_version_e,
+
+ firewall_parameter_command_start_e,
+ firewall_parameter_command_stop_e,
+ firewall_parameter_command_restart_e,
+ firewall_parameter_command_lock_e,
+ firewall_parameter_command_show_e,
+
+ firewall_direction_input_id_e,
+ firewall_direction_output_id_e,
+ firewall_direction_none_id_e,
+
+ firewall_chain_forward_id_e,
+ firewall_chain_custom_id_e,
+ firewall_chain_input_id_e,
+ firewall_chain_none_id_e,
+ firewall_chain_output_id_e,
+ firewall_chain_postrouting_id_e,
+ firewall_chain_prerouting_id_e,
+
+ firewall_action_append_id_e,
+ firewall_action_insert_id_e,
+ firewall_action_policy_id_e,
+ firewall_action_none_id_e,
+ };
+
+ #define firewall_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(0, 0, firewall_command_start_s.string, F_false, f_console_type_other_e), \
+ macro_f_console_parameter_t_initialize(0, 0, firewall_command_stop_s.string, F_false, f_console_type_other_e), \
+ macro_f_console_parameter_t_initialize(0, 0, firewall_command_restart_s.string, F_false, f_console_type_other_e), \
+ macro_f_console_parameter_t_initialize(0, 0, firewall_command_lock_s.string, F_false, f_console_type_other_e), \
+ macro_f_console_parameter_t_initialize(0, 0, firewall_command_show_s.string, F_false, f_console_type_other_e), \
+ }
+
+ #define firewall_total_parameters_d 14
+#endif // _di_firewall_defines_
+
+#ifndef _di_firewall_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ f_array_lengths_t remaining;
+ bool process_pipe;
+ int child;
+
+ fl_print_t output;
+ fl_print_t error;
+ fl_print_t warning;
+
+ f_signal_t signal;
+
+ f_string_dynamics_t chains;
+ f_string_dynamics_t devices;
+
+ f_color_context_t context;
+ } firewall_main_t;
+
+ #define firewall_main_t_initialize \
+ { \
+ f_console_parameters_t_initialize, \
+ f_array_lengths_t_initialize, \
+ F_false, \
+ 0, \
+ fl_print_t_initialize, \
+ macro_fl_print_t_initialize_error(), \
+ macro_fl_print_t_initialize_warning(), \
+ f_signal_t_initialize, \
+ f_string_dynamics_t_initialize, \
+ f_string_dynamics_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_firewall_main_t_
+
+/**
+ * De-allocate data.
+ *
+ * Be sure to call this after executing firewall_main().
+ *
+ * @param data
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see firewall_main()
+ */
+#ifndef _di_firewall_main_delete_
+ extern f_status_t firewall_main_delete(firewall_main_t * const data);
+#endif // _di_firewall_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _firewall_common_h
flockfile(file.stream);
- fll_program_print_help_header(file, context, firewall_program_name_long_s, firewall_version_s);
+ fll_program_print_help_header(file, context, firewall_program_name_long_s, firewall_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.");
fl_print_format("%r %[%s%] Prevent all communication.", file.stream, f_string_eol_s, context.set.standout, firewall_command_lock_s, context.set.standout);
fl_print_format("%r %[%s%] Show active firewall settings.", file.stream, f_string_eol_s, context.set.standout, firewall_command_show_s, context.set.standout);
- fll_program_print_help_usage(file, context, firewall_program_name_s, "command");
+ fll_program_print_help_usage(file, context, firewall_program_name_s, firewall_program_help_parameters_s);
funlockfile(file.stream);
f_status_t status = F_none;
+ main->child = 0;
+
f_console_parameter_t parameters[] = firewall_console_parameter_t_initialize;
main->parameters.array = parameters;
main->parameters.used = firewall_total_parameters_d;
}
if (main->parameters.array[firewall_parameter_version_e].result == f_console_result_found_e) {
- fll_program_print_version(main->output.to, firewall_version_s);
+ fll_program_print_version(main->output.to, firewall_program_version_s);
firewall_main_delete(main);
if (command == firewall_parameter_command_show_e) {
- // Warning: these are hardcoded print commands (I am not certain how I am going to implement external 'show' rules as the default-firewall setting file is the wrong place to put this)
+ // Warning: these are hardcoded print commands.
bool show_nat = F_true;
bool show_mangle = F_true;
bool show_ports = F_true;
- f_string_dynamics_t parameters = f_string_dynamics_t_initialize;
int return_code = 0;
if (main->remaining.used > 0) {
show_mangle = F_false;
show_ports = F_false;
- f_array_length_t counter = 0;
+ f_array_length_t index = 0;
+
+ for (f_array_length_t i = 0; i < main->remaining.used; ++i) {
- for (; counter < main->remaining.used; ++counter) {
+ index = main->remaining.array[i];
- if (strncmp("nat", arguments->argv[main->remaining.array[counter]], 4) != 0) {
- if (strncmp("mangle", arguments->argv[main->remaining.array[counter]], 7) != 0) {
- if (strncmp("ports", arguments->argv[main->remaining.array[counter]], 6) != 0) {
+ if (fl_string_dynamic_compare(firewall_show_nat_s, argv[index]) == F_equal_to) {
+ show_nat = F_true;
+ }
+ else {
+ if (fl_string_dynamic_compare(firewall_show_mangle_s, argv[index]) == F_equal_to) {
+ show_mangle = F_true;
+ }
+ else {
+ if (fl_string_dynamic_compare(firewall_show_ports_s, argv[index]) == F_equal_to) {
+ show_ports = F_true;
+ }
+ else {
flockfile(main->warning.to.stream);
fl_print_format("%r%[%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("%[%Q%]", main->warning.to.stream, main->warning.notable, argv[index], main->warning.notable);
fl_print_format("%[' is not a valid show option.%]%r", main->warning.to.stream, main->warning.context, main->warning.context, f_string_eol_s);
funlockfile(main->warning.to.stream);
fflush(main->warning.to.stream);
}
- else {
- show_ports = F_true;
- }
}
- else {
- show_mangle = F_true;
- }
- }
- else {
- show_nat = F_true;
}
} // for
}
- macro_f_string_dynamics_t_resize(status, parameters, 7);
+ f_string_statics_t parameters = f_string_statics_t_initialize;
+ parameters.used = 6;
- if (F_status_is_error(status)) {
- firewall_print_error_on_allocation_failure(main->error);
+ f_string_static_t parameters_array[parameters.used];
+ parameters.array = parameters_array;
- firewall_delete_local_data(&local);
- firewall_main_delete(main);
-
- return status;
- }
+ parameters_array[0] = firewall_show_parameter_exact_s;
+ parameters_array[1] = firewall_show_parameter_verbose_s;
+ parameters_array[2] = firewall_show_parameter_table_s;
+ parameters_array[3] = firewall_show_nat_s;
+ parameters_array[4] = firewall_show_parameter_numeric_s;
+ parameters_array[5] = firewall_show_parameter_list_s;
if (show_nat) {
fll_print_format("%[===========================%] %[NAT%] %[============================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
fflush(main->output.to.stream);
- parameters.used = 6;
-
- parameters.array[0].string = (f_string_t) "-x";
- parameters.array[1].string = (f_string_t) "-v";
- parameters.array[2].string = (f_string_t) "-t";
- parameters.array[3].string = (f_string_t) "nat";
- parameters.array[4].string = (f_string_t) "--numeric";
- parameters.array[5].string = (f_string_t) "--list";
-
- parameters.array[0].used = 2;
- parameters.array[1].used = 2;
- parameters.array[2].used = 2;
- parameters.array[3].used = 3;
- parameters.array[4].used = 9;
- parameters.array[5].used = 6;
-
status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- exit(return_code);
+ main->child = return_code;
+
+ firewall_delete_local_data(&local);
+ firewall_main_delete(main);
+
+ return status;
}
fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
fll_print_format("%[==========================%] %[MANGLE%] %[==========================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
fflush(main->output.to.stream);
- parameters.used = 6;
-
- parameters.array[0].string = (f_string_t) "-x";
- parameters.array[1].string = (f_string_t) "-v";
- parameters.array[2].string = (f_string_t) "-t";
- parameters.array[3].string = (f_string_t) "mangle";
- parameters.array[4].string = (f_string_t) "--numeric";
- parameters.array[5].string = (f_string_t) "--list";
-
- parameters.array[0].used = 2;
- parameters.array[1].used = 2;
- parameters.array[2].used = 2;
- parameters.array[3].used = 6;
- parameters.array[4].used = 9;
- parameters.array[5].used = 6;
+ parameters_array[3] = firewall_show_mangle_s;
status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- exit(return_code);
+ main->child = return_code;
+
+ firewall_delete_local_data(&local);
+ firewall_main_delete(main);
+
+ return status;
}
fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
fll_print_format("%[==========================%] %[FILTER%] %[==========================%]%r", main->output.to.stream, main->context.set.standout, main->context.set.standout, main->context.set.title, main->context.set.title, main->context.set.standout, main->context.set.standout, f_string_eol_s);
fflush(main->output.to.stream);
+ parameters_array[0] = firewall_show_parameter_exact_s;
+ parameters_array[1] = firewall_show_parameter_verbose_s;
+ parameters_array[2] = firewall_show_parameter_numeric_s;
+ parameters_array[3] = firewall_show_parameter_list_s;
parameters.used = 4;
- parameters.array[0].string = (f_string_t) "-x";
- parameters.array[1].string = (f_string_t) "-v";
- parameters.array[2].string = (f_string_t) "--numeric";
- parameters.array[3].string = (f_string_t) "--list";
-
- parameters.array[0].used = 2;
- parameters.array[1].used = 2;
- parameters.array[2].used = 9;
- parameters.array[3].used = 6;
-
status = fll_execute_program(firewall_tool_iptables_s, parameters, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- exit(return_code);
+ main->child = return_code;
+
+ firewall_delete_local_data(&local);
+ firewall_main_delete(main);
+
+ return status;
}
fll_print_dynamic_raw(f_string_eol_s, main->output.to.stream);
status = F_status_set_error(status);
}
- parameters.array[0].string = 0;
- parameters.array[1].string = 0;
- parameters.array[2].string = 0;
- parameters.array[3].string = 0;
- parameters.array[4].string = 0;
- parameters.array[5].string = 0;
- parameters.array[6].string = 0;
- parameters.array[0].used = 0;
- parameters.array[1].used = 0;
- parameters.array[2].used = 0;
- parameters.array[3].used = 0;
- parameters.array[4].used = 0;
- parameters.array[5].used = 0;
- parameters.array[6].used = 0;
-
- f_string_dynamics_resize(0, & parameters);
firewall_delete_local_data(&local);
firewall_main_delete(main);
return status;
}
- // load all network devices
- status = f_directory_list((f_string_t) network_devices_s, 0, alphasort, &main->devices);
+ // Load all network devices.
+ status = f_directory_list(firewall_network_devices_s, 0, alphasort, &main->devices);
if (F_status_is_error(status)) {
status = F_status_set_fine(status);
fll_print_format("%r%[%QCould not find any network devices.%]%r", 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("%r%[%QFailed to read the device directory '%s'.%]%r", 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("%r%[%QFailed to read the device directory '%r'.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, firewall_network_devices_s, main->error.context, f_string_eol_s);
}
}
return F_status_set_error(status);
}
- // remove "lo" (loopback) from the device listing
+ // Remove "lo" (loopback) from the device listing.
{
f_array_length_t i = 0;
for (; i < main->devices.used; ++i) {
- if (fl_string_compare((f_string_t) firewall_device_loop_s, main->devices.array[i].string, firewall_device_loop_s_length + 1, main->devices.array[i].used) == F_equal_to) {
- f_string_dynamic_t swap_string = main->devices.array[i];
+ if (fl_string_dynamic_compare(firewall_device_loop_s, main->devices.array[i]) == F_equal_to) {
+ f_string_static_t swap_string = main->devices.array[i];
--main->devices.used;
for (; i < main->devices.used; ++i) {
- main->devices.array[i] = main->devices.array[i+1];
+ main->devices.array[i] = main->devices.array[i + 1];
} // for
main->devices.array[main->devices.used] = swap_string;
}
if (command == firewall_parameter_command_stop_e || command == firewall_parameter_command_restart_e || command == firewall_parameter_command_lock_e) {
- status = firewall_buffer_rules(main, network_path_s firewall_file_other_s, F_false, &local);
+ f_string_static_t path_file_other = f_string_static_t_initialize;
+ path_file_other.used = firewall_network_path_s.used + firewall_file_other_s.used;
- if (F_status_is_error(status)) {
+ char path_file_other_string[path_file_other.used + 1];
+ path_file_other.string = path_file_other_string;
+ path_file_other[path_file_other.used] = 0;
+
+ memcpy(path_file_other_string, firewall_network_path_s.string, firewall_network_path_s.used);
+ memcpy(path_file_other_string + firewall_network_path_s.used, firewall_file_other_s.string, firewall_file_other_s.used);
+
+ status = firewall_buffer_rules(main, path_file_other, F_false, &local);
+
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
return status;
}
- {
- f_array_length_t i = 0;
- f_array_length_t length = 0;
-
- for (; i < local.chain_objects.used; ++i) {
- length = local.chain_objects.array[i].stop - local.chain_objects.array[i].start + 1;
+ for (f_array_length_t i = 0; i < local.chain_objects.used; ++i) {
- if (!reserved.has_stop && fl_string_compare((f_string_t) firewall_group_stop_s, local.buffer.string + local.chain_objects.array[i].start, firewall_group_stop_s_length, length) == F_equal_to) {
- reserved.stop_at = i;
- reserved.has_stop = F_true;
- }
- else if (!reserved.has_lock && fl_string_compare((f_string_t) firewall_group_lock_s, local.buffer.string + local.chain_objects.array[i].start, firewall_group_lock_s_length, length) == F_equal_to) {
- reserved.lock_at = i;
- reserved.has_lock = F_true;
- }
- } // for
- }
+ if (!reserved.has_stop && fl_string_dynamic_partial_compare_string(firewall_group_stop_s.string, local.buffer, firewall_group_stop_s.used, local.chain_objects.array[i]) == F_equal_to) {
+ reserved.stop_at = i;
+ reserved.has_stop = F_true;
+ }
+ else if (!reserved.has_lock && fl_string_dynamic_partial_compare_string(firewall_group_lock_s.string, local.buffer, firewall_group_lock_s.used, local.chain_objects.array[i]) == F_equal_to) {
+ reserved.lock_at = i;
+ reserved.has_lock = F_true;
+ }
+ } // for
if (command == firewall_parameter_command_lock_e) {
if (reserved.has_lock) {
status = firewall_delete_chains(main);
- if (F_status_is_error_not(status)) {
+ if (F_status_is_error_not(status) && status != F_child) {
status = firewall_default_lock(main);
}
- if (F_status_is_error(status)) {
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
return status;
}
- else {
- if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[%QFailed to perform lock request because the lock instructions are missing from: %s.%]%r", 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);
- firewall_main_delete(main);
-
- return F_status_set_error(F_data);
+ if (main->error.verbosity != f_console_verbosity_quiet_e) {
+ fll_print_format("%r%[%QFailed to perform lock request because the lock instructions are missing from: %r.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, path_file_other, main->error.context, f_string_eol_s);
}
+
+ firewall_delete_local_data(&local);
+ firewall_main_delete(main);
+
+ return F_status_set_error(F_data);
}
if (command == firewall_parameter_command_stop_e || command == firewall_parameter_command_restart_e) {
if (reserved.has_stop) {
status = firewall_delete_chains(main);
- if (F_status_is_error_not(status)) {
+ if (F_status_is_error_not(status) && status != F_child) {
status = firewall_default_lock(main);
}
- if (F_status_is_error(status)) {
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
status = firewall_process_rules(main, &input, &local);
- if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+ if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[%QFailed to perform stop request because the lock instructions are missing from: %s.%]%r", 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("%r%[%QFailed to perform stop request because the lock instructions are missing from: %r.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, path_file_other, main->error.context, f_string_eol_s);
}
firewall_delete_local_data(&local);
}
if (command == firewall_parameter_command_start_e || command == firewall_parameter_command_restart_e) {
- status = firewall_buffer_rules(main, network_path_s firewall_file_first_s, F_false, &local);
+ f_string_static_t path_file_first = f_string_static_t_initialize;
+ path_file_first.used = firewall_network_path_s.used + firewall_file_first_s.used;
- if (F_status_is_error(status)) {
+ char path_file_first_string[path_file_first.used + 1];
+ path_file_first.string = path_file_first_string;
+ path_file_first[path_file_first.used] = 0;
+
+ memcpy(path_file_first_string, firewall_network_path_s.string, firewall_network_path_s.used);
+ memcpy(path_file_first_string + firewall_network_path_s.used, firewall_file_first_s.string, firewall_file_first_s.used);
+
+ status = firewall_buffer_rules(main, path_file_first, F_false, &local);
+
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
if (command == firewall_parameter_command_start_e) {
status = firewall_delete_chains(main);
- if (F_status_is_error_not(status)) {
+ if (F_status_is_error_not(status) && status != F_child) {
status = firewall_default_lock(main);
}
- if (F_status_is_error(status)) {
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
status = firewall_create_custom_chains(main, &reserved, &local);
- if (F_status_is_error(status)) {
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
status = firewall_process_rules(main, &input, &local);
- if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+ if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
firewall_delete_local_data(&local);
- for (i = 0; i < main->devices.used; ++i) {
- local.device = i;
+ {
+ f_string_dynamic_t file_path = f_string_dynamic_t_initialize;
+ f_array_length_t j = 0;
+
+ for (i = 0; i < main->devices.used; ++i) {
+
+ file_path.used = 0;
+ local.device = i;
+
+ status = f_string_dynamic_increase_by(firewall_network_path_s.used + main->devices.array[i].used + firewall_file_suffix_s_length + 1, &file_path);
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_append(firewall_network_path_s, &file_path);
+ }
+
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_append(main->devices.array[i], &file_path);
+ }
- {
- f_string_dynamic_t file_path = f_string_dynamic_t_initialize;
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_append(firewall_file_suffix_s, &file_path);
+ }
- macro_f_string_dynamic_t_resize(status, file_path, network_path_s_length + main->devices.array[i].used + firewall_file_suffix_s_length + 1);
+ if (F_status_is_error_not(status)) {
+ status = f_string_dynamic_terminate_after(&file_path);
+ }
if (F_status_is_error(status)) {
firewall_print_error_on_allocation_failure(main->error);
return status;
}
- memcpy((void *)file_path.string, network_path_s, network_path_s_length);
- memcpy((void *)(file_path.string + network_path_s_length), main->devices.array[i].string, main->devices.array[i].used);
- memcpy((void *)(file_path.string + network_path_s_length + main->devices.array[i].used), firewall_file_suffix_s, firewall_file_suffix_s_length);
-
- file_path.used = network_path_s_length + main->devices.array[i].used + firewall_file_suffix_s_length;
- file_path.string[file_path.used] = 0;
+ status = firewall_buffer_rules(main, file_path, F_true, &local);
- status = firewall_buffer_rules(main, file_path.string, F_true, &local);
-
- f_string_dynamic_resize(0, &file_path);
- }
+ if (status == F_child) {
+ firewall_delete_local_data(&local);
- if (F_status_is_error(status)) {
- status = F_status_set_fine(status);
+ f_string_dynamic_resize(0, &file_path);
- firewall_delete_local_data(&local);
+ firewall_main_delete(main);
- if (status == F_file_found_not || status == F_file_open || status == F_file_descriptor || status == F_fss_found_object_content_not) {
- status = F_status_set_error(status);
- continue;
+ return status;
}
- firewall_main_delete(main);
-
- return F_status_set_error(status);
- }
-
- status = firewall_create_custom_chains(main, &reserved, &local);
-
- if (F_status_is_error(status)) {
- firewall_delete_local_data(&local);
- firewall_main_delete(main);
+ if (F_status_is_error(status)) {
+ status = F_status_set_fine(status);
- return status;
- }
+ firewall_delete_local_data(&local);
- f_array_length_t j = 0;
+ if (status == F_file_found_not || status == F_file_open || status == F_file_descriptor || status == F_fss_found_object_content_not) {
+ status = F_status_set_error(status);
- local.is_global = F_false;
- local.is_stop = F_false;
- local.is_lock = F_false;
+ continue;
+ }
- for (; j < local.chain_contents.used; ++j) {
+ f_string_dynamic_resize(0, &file_path);
- input.start = local.chain_contents.array[j].array[0].start;
- input.stop = local.chain_contents.array[j].array[0].stop;
+ firewall_main_delete(main);
- local.is_main = reserved.has_main && j == reserved.main_at ? F_true : F_false;
- local.chain = j;
+ return F_status_set_error(status);
+ }
- status = firewall_process_rules(main, &input, &local);
+ status = firewall_create_custom_chains(main, &reserved, &local);
- if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
return status;
}
+
+ local.is_global = F_false;
+ local.is_stop = F_false;
+ local.is_lock = F_false;
+
+ for (j = 0; j < local.chain_contents.used; ++j) {
+
+ input.start = local.chain_contents.array[j].array[0].start;
+ input.stop = local.chain_contents.array[j].array[0].stop;
+
+ local.is_main = reserved.has_main && j == reserved.main_at ? F_true : F_false;
+ local.chain = j;
+
+ status = firewall_process_rules(main, &input, &local);
+
+ if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
+ firewall_delete_local_data(&local);
+ firewall_main_delete(main);
+
+ return status;
+ }
+ } // for
+
+ firewall_delete_local_data(&local);
} // for
- firewall_delete_local_data(&local);
- } // for
+ f_string_dynamic_resize(0, &file_path);
+ }
status = firewall_buffer_rules(main, network_path_s firewall_file_last_s, F_false, &local);
- if (F_status_is_error(status)) {
+ if (F_status_is_error(status) || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
status = firewall_create_custom_chains(main, &reserved, &local);
- if (F_status_is_error(status)) {
+ if (F_status_is_error(status) || status == F_child) {
f_status_t status2 = F_none;
macro_firewall_delete_fss_buffers(status2, local.buffer, local.chain_objects, local.chain_contents)
status = firewall_process_rules(main, &input, &local);
- if (F_status_is_error(status) || command == firewall_parameter_command_stop_e) {
+ if (F_status_is_error(status) || command == firewall_parameter_command_stop_e || status == F_child) {
firewall_delete_local_data(&local);
firewall_main_delete(main);
} // while
}
- // cleanup
firewall_delete_local_data(&local);
}
else {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[%QYou did not pass a command.%]%r", main->error.to.stream, f_string_eol_s, main->error.context, main->error.prefix, main->error.context, f_string_eol_s);
+ fll_print_format("%r%[%QNo command given.%]%r", 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);
}
#endif // _di_firewall_main_
-#ifndef _di_firewall_main_delete_
- f_status_t firewall_main_delete(firewall_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- 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);
-
- return F_none;
- }
-#endif // _di_firewall_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// Firewall includes.
+#include <program/firewall/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define network_path_s "/etc/network/" // TODO: this should be moved to a network project library, possibly the Paths project in fot the network project
- #define network_devices_s "/sys/class/net/" // TODO: this should also be moved to a network project library
- #define firewall_file_first_s "firewall-first"
- #define firewall_file_last_s "firewall-last"
- #define firewall_file_other_s "firewall-other"
- #define firewall_file_suffix_s "-firewall"
-
- #define network_path_s_length 13
- #define network_devices_s_length 15
- #define firewall_file_first_s_length 14
- #define firewall_file_last_s_length 13
- #define firewall_file_other_s_length 14
- #define firewall_file_suffix_s_length 9
-#endif // _di_firewall_paths_
-
-#ifndef _di_firewall_default_allocation_step_
- #define firewall_default_allocation_step_d F_memory_default_allocation_small_d
-#endif // _di_firewall_default_allocation_step_
-
-#ifndef _di_firewall_defines_
- #define firewall_signal_check_d 10000
-
- #define firewall_tool_s "tool"
- #define firewall_tool_iptables_s "iptables"
- #define firewall_tool_ip6tables_s "ip6tables"
- #define firewall_tool_ip46tables_s "ip46tables"
- #define firewall_tool_ipset_s "ipset"
-
- #define firewall_tool_s_length 4
- #define firewall_tool_iptables_s_length 8
- #define firewall_tool_ip6tables_s_length 9
- #define firewall_tool_ip46tables_s_length 10
- #define firewall_tool_ipset_s_length 5
-
- #define firewall_group_stop_s "stop"
- #define firewall_group_lock_s "lock"
- #define firewall_group_main_s "main"
-
- #define firewall_group_stop_s_length 4
- #define firewall_group_lock_s_length 4
- #define firewall_group_main_s_length 4
-
- #define firewall_command_start_s "start"
- #define firewall_command_stop_s "stop"
- #define firewall_command_restart_s "restart"
- #define firewall_command_lock_s "lock"
- #define firewall_command_show_s "show"
-
- #define firewall_command_start_s_length 5
- #define firewall_command_stop_s_length 4
- #define firewall_command_restart_s_length 7
- #define firewall_command_lock_s_length 4
- #define firewall_command_show_s_length 4
-
- #define firewall_ip_list "ip_list"
- #define firewall_ip_list_source_s "source"
- #define firewall_ip_list_source_action_s "-s"
- #define firewall_ip_list_destination_s "destination"
- #define firewall_ip_list_destination_action_s "-d"
-
- #define firewall_ip_list_length_s 7
- #define firewall_ip_list_source_s_length 6
- #define firewall_ip_list_source_action_s_length 2
- #define firewall_ip_list_destination_s_length 11
- #define firewall_ip_list_destination_action_s_length 2
-
- #define firewall_rule_s "rule"
- #define firewall_rule_s_length 4
-
- #define firewall_chain_s "chain"
- #define firewall_chain_forward_s "FORWARD"
- #define firewall_chain_input_s "INPUT"
- #define firewall_chain_none_s "none"
- #define firewall_chain_output_s "OUTPUT"
- #define firewall_chain_postrouting_s "POSTROUTING"
- #define firewall_chain_prerouting_s "PREROUTING"
-
- #define firewall_chain_s_length 5
- #define firewall_chain_forward_s_length 7
- #define firewall_chain_input_s_length 5
- #define firewall_chain_none_s_length 4
- #define firewall_chain_output_s_length 6
- #define firewall_chain_postrouting_s_length 12
- #define firewall_chain_prerouting_s_length 11
-
- #define firewall_direction_s "direction"
- #define firewall_direction_input_s "input"
- #define firewall_direction_output_s "output"
- #define firewall_direction_none_s "none"
-
- #define firewall_direction_s_length 9
- #define firewall_direction_input_s_length 5
- #define firewall_direction_output_s_length 6
- #define firewall_direction_none_s_length 4
-
- #define firewall_action_s "action"
- #define firewall_action_append_s "append"
- #define firewall_action_insert_s "insert"
- #define firewall_action_policy_s "policy"
- #define firewall_action_none_s "none"
-
- #define firewall_action_length_s 6
- #define firewall_action_append_s_length 6
- #define firewall_action_insert_s_length 6
- #define firewall_action_policy_s_length 6
- #define firewall_action_none_s_length 4
-
- #define firewall_action_append_command_s "-A"
- #define firewall_action_insert_command_s "-I"
- #define firewall_action_policy_command_s "-P"
-
- #define firewall_action_append_command_s_length 2
- #define firewall_action_insert_command_s_length 2
- #define firewall_action_policy_command_s_length 2
-
- #define firewall_device_s "device"
- #define firewall_device_all_s "all"
- #define firewall_device_this_s "this"
- #define firewall_device_loop_s "lo"
-
- #define firewall_device_s_length 6
- #define firewall_device_all_s_length 3
- #define firewall_device_this_s_length 4
- #define firewall_device_loop_s_length 2
-
- #define firewall_device_input_command_s "-i"
- #define firewall_device_output_command_s "-o"
-
- #define firewall_device_input_command_length_s 2
- #define firewall_device_output_command_length_s 2
-
- #define firewall_protocol_s "protocol"
- #define firewall_protocol_none_s "none"
-
- #define firewall_protocol_s_length 8
- #define firewall_protocol_none_s_length 4
-
- #define firewall_protocol_command_s "-p"
- #define firewall_protocol_command_s_length 2
-
- #define firewall_chain_create_command_s "-N"
- #define firewall_chain_delete_command_s "-X"
-
- #define firewall_chain_create_command_s_length 2
- #define firewall_chain_delete_command_s_length 2
-
- enum {
- firewall_program_none_e = 1,
- firewall_program_iptables_e,
- firewall_program_ip6tables_e,
- firewall_program_ip46tables_e,
- firewall_program_ipset_e,
- };
-
- enum {
- firewall_parameter_help_e,
- firewall_parameter_light_e,
- firewall_parameter_dark_e,
- firewall_parameter_no_color_e,
- firewall_parameter_verbosity_quiet_e,
- firewall_parameter_verbosity_normal_e,
- firewall_parameter_verbosity_verbose_e,
- firewall_parameter_verbosity_debug_e,
- firewall_parameter_version_e,
-
- firewall_parameter_command_start_e,
- firewall_parameter_command_stop_e,
- firewall_parameter_command_restart_e,
- firewall_parameter_command_lock_e,
- firewall_parameter_command_show_e,
-
- firewall_direction_input_id_e,
- firewall_direction_output_id_e,
- firewall_direction_none_id_e,
-
- firewall_chain_forward_id_e,
- firewall_chain_custom_id_e,
- firewall_chain_input_id_e,
- firewall_chain_none_id_e,
- firewall_chain_output_id_e,
- firewall_chain_postrouting_id_e,
- firewall_chain_prerouting_id_e,
-
- firewall_action_append_id_e,
- firewall_action_insert_id_e,
- firewall_action_policy_id_e,
- firewall_action_none_id_e,
- };
-
- #define firewall_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(0, 0, firewall_command_start_s, F_false, f_console_type_other_e), \
- macro_f_console_parameter_t_initialize(0, 0, firewall_command_stop_s, F_false, f_console_type_other_e), \
- macro_f_console_parameter_t_initialize(0, 0, firewall_command_restart_s, F_false, f_console_type_other_e), \
- macro_f_console_parameter_t_initialize(0, 0, firewall_command_lock_s, F_false, f_console_type_other_e), \
- macro_f_console_parameter_t_initialize(0, 0, firewall_command_show_s, F_false, f_console_type_other_e), \
- }
-
- #define firewall_total_parameters_d 14
-#endif // _di_firewall_defines_
-
-#ifndef _di_firewall_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_dynamics_t chains;
- f_string_dynamics_t devices;
-
- f_color_context_t context;
- } firewall_main_t;
-
- #define firewall_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_dynamics_t_initialize, \
- f_string_dynamics_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_firewall_main_t_
-
/**
* Print help.
*
extern f_status_t firewall_main(firewall_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_firewall_main_
-/**
- * De-allocate data.
- *
- * Be sure to call this after executing firewall_main().
- *
- * @param data
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see firewall_main()
- */
-#ifndef _di_firewall_main_delete_
- extern f_status_t firewall_main_delete(firewall_main_t * const data);
-#endif // _di_firewall_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
fll_program_standard_setdown(&data.signal);
+ if (status == F_child) {
+ exit(data.child);
+ }
+
if (F_status_is_error(status)) return 1;
return 0;
extern "C" {
#endif
-void firewall_print_debug_tool(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) {
+void firewall_print_debug_tool(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) {
if (output.verbosity != f_console_verbosity_debug_e) return;
flockfile(output.to.stream);
- fl_print_format("%[%s", output.to.stream, output.context, tool);
+ fl_print_format("%[%r", output.to.stream, output.context, tool);
for (f_array_length_t i = 0; i < arguments.used; ++i) {
fl_print_format(" %Q", output.to.stream, arguments.array[i]);
if (output.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%r%[%sUnable to allocate memory.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, output.context, f_string_eol_s);
+ fll_print_format("%r%[%QUnable to allocate memory.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, output.context, f_string_eol_s);
}
void firewall_print_error_on_invalid_parameter(const fl_print_t output, const f_string_t function) {
if (output.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%r%[%sInvalid parameter when calling %S().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, output.context, f_string_eol_s);
+ fll_print_format("%r%[%QInvalid parameter when calling %s().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, output.context, f_string_eol_s);
}
-void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_t filename) {
+void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_static_t filename) {
if (output.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%r%[%sInvalid parameter when calling %S() for the file '%S'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, filename, output.context, f_string_eol_s);
+ fll_print_format("%r%[%QInvalid parameter when calling %s() for the file '%Q'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, function, filename, output.context, f_string_eol_s);
}
-void firewall_print_error_on_operation(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) {
+void firewall_print_error_on_operation(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) {
if (output.verbosity == f_console_verbosity_quiet_e) return;
flockfile(output.to.stream);
- fl_print_format("%r%[%sFailed to perform requested %s operation:%]", output.to.stream, f_string_eol_s, output.context, output.prefix, tool, output.context);
- fl_print_format("%r %[%s", output.to.stream, f_string_eol_s, output.context, tool);
+ fl_print_format("%r%[%QFailed to perform requested %r operation:%]", output.to.stream, f_string_eol_s, output.context, output.prefix, tool, output.context);
+ fl_print_format("%r %[%r", output.to.stream, f_string_eol_s, output.context, tool);
for (f_array_length_t i = 0; i < arguments.used; ++i) {
fl_print_format(" %Q", output.to.stream, arguments.array[i]);
if (output.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%r%[%sAn unhandled error (%ui) has occurred while calling %S().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, output.context, f_string_eol_s);
+ fll_print_format("%r%[%QAn unhandled error (%ui) has occurred while calling %s().%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, output.context, f_string_eol_s);
}
-void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) {
+void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_static_t filename) {
if (output.verbosity == f_console_verbosity_quiet_e) return;
- fll_print_format("%r%[%sAn unhandled error (%ui) has occurred while calling %S() for the file '%S'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, filename, output.context, f_string_eol_s);
+ fll_print_format("%r%[%QAn unhandled error (%ui) has occurred while calling %s() for the file '%Q'.%]%r", output.to.stream, f_string_eol_s, output.context, output.prefix, status, function, filename, output.context, f_string_eol_s);
}
#ifndef _di_firewall_print_signal_received_
* @param arguments
* The arguments passed to the tool.
*/
-extern void firewall_print_debug_tool(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) F_attribute_visibility_internal_d;
+extern void firewall_print_debug_tool(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) F_attribute_visibility_internal_d;
/**
* Print an memory allocation error.
* @param filename
* The name of the file.
*/
-extern void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_t filename) F_attribute_visibility_internal_d;
+extern void firewall_print_error_on_invalid_parameter_for_file(const fl_print_t output, const f_string_t function, const f_string_static_t filename) F_attribute_visibility_internal_d;
/**
* Print an error about the given operation failed.
* @param arguments
* The arguments passed to the tool.
*/
-extern void firewall_print_error_on_operation(const fl_print_t output, const f_string_t tool, const f_string_dynamics_t arguments) F_attribute_visibility_internal_d;
+extern void firewall_print_error_on_operation(const fl_print_t output, const f_string_static_t tool, const f_string_statics_t arguments) F_attribute_visibility_internal_d;
/**
* Print an unhandled error for the given function.
* @param filename
* The name of the file.
*/
-extern void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_t filename) F_attribute_visibility_internal_d;
+extern void firewall_print_error_on_unhandled_for_file(const fl_print_t output, const f_string_t function, const f_status_t status, const f_string_static_t filename) F_attribute_visibility_internal_d;
/**
* Print a message about a process signal being recieved, such as an interrupt signal.
bool is_ip_list = F_false;
f_string_dynamic_t ip_list = f_string_dynamic_t_initialize;
- // iptables command arguments
+ // Iptables command arguments
bool device_all = F_false;
bool ip_list_direction = F_false; // false = source, true = destination
bool use_protocol = F_false;
}
}
- // for custom chains, the chain command may not be specified.
+ // For custom chains, the chain command may not be specified.
if (!(local.is_main || local.is_stop || local.is_lock)) {
chain = firewall_chain_custom_id_e;
}
f_string_dynamic_resize(0, &ip_list);
- // process chain rule
+ // Process chain rule
if (length >= firewall_chain_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_chain_s, length, firewall_chain_s_length) == 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.
+ // Custom chains can only apply to themselves, so silently ignore chain commands specified within a custom chain.
fll_print_format("%r%[%QAt line %ul, the chain option is meaningless inside of a custom chain.%]%r", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, i, main->warning.context, f_string_eol_s);
+
continue;
}
if (!invalid) continue;
}
- // process direction rule
+
+ // Process direction rule
else if (length >= firewall_direction_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_direction_s, length, firewall_direction_s_length) == F_equal_to) {
length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
direction = firewall_direction_none_id_e;
}
else {
- // direction must be specified, and no custom directions are allowed.
+
+ // Direction must be specified, and no custom directions are allowed.
invalid = F_true;
}
if (!invalid) continue;
}
- // process device rule.
+
+ // Process device rule.
else if (length >= firewall_device_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_device_s, length, firewall_device_s_length) == F_equal_to) {
length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
continue;
}
}
- // process action rule.
+
+ // Process action rule.
else if (length >= firewall_action_length_s && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_action_s, length, firewall_action_length_s) == F_equal_to) {
length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
if (!invalid) continue;
}
- // process ip_list rule.
+
+ // Process ip_list rule.
else if (length >= firewall_ip_list_length_s && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_ip_list, length, firewall_ip_list_length_s) == F_equal_to) {
length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
is_ip_list = F_true;
continue;
}
}
- // process tool rule.
+
+ // Process tool rule.
else if (length >= firewall_tool_s_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_tool_s, length, firewall_tool_s_length) == F_equal_to) {
length = macro_firewall_structure_size(local.rule_contents.array[i], 0);
if (!invalid) continue;
}
}
- // process rule rule, if the remaining rule does not match as firewall_rule_s, then it is an invalid rule.
+
+ // Process rule rule, if the remaining rule does not match as firewall_rule_s, then it is an invalid rule.
else if (length < firewall_rule_s_length || fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_rule_s, length, firewall_rule_s_length) == F_equal_to_not) {
if (length) {
flockfile(main->warning.to.stream);
for (r = repeat; r > 0; --r) {
- // first add the program name
+ // First add the program name
f_string_dynamics_resize(0, &arguments);
status = f_string_dynamics_increase(F_memory_default_allocation_small_d, &arguments);
if (F_status_is_error(status)) break;
- // process the action when a non-none chain is specified.
+ // Process the action when a non-none chain is specified.
if (chain != firewall_chain_none_id_e && action != firewall_action_none_id_e) {
if (action == firewall_action_append_id_e) {
macro_f_string_dynamic_t_resize(status, argument, firewall_action_append_command_s_length);
break;
}
- // process the chain, which is required by the action.
+ // Process the chain, which is required by the action.
if (chain == firewall_chain_custom_id_e) {
if (main->chains.array[local.chain_ids.array[local.chain]].used > 0) {
macro_f_string_dynamic_t_resize(status, argument, main->chains.array[local.chain_ids.array[local.chain]].used);
}
}
- // add the device if and only if a non-none direction is specified.
+ // Add the device if and only if a non-none direction is specified.
if (device.used > 0 && (direction == firewall_direction_input_id_e || direction == firewall_direction_output_id_e)) {
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_not) {
if (direction == firewall_direction_input_id_e) {
}
}
- // add the device.
+ // Add the device.
if (device.used > 0) {
macro_f_string_dynamic_t_resize(status, argument, device.used);
}
}
- // last up is the "rule"
+ // Last up is the "rule"
if ((!is_ip_list && local.rule_contents.array[i].used > 0) || (is_ip_list && local.rule_contents.array[i].used > 1)) {
f_array_length_t subcounter = 0;
if (is_ip_list) {
- // skip past the chain
+ // Skip past the chain
++subcounter;
length = macro_firewall_structure_size(local.rule_contents.array[i], subcounter);
macro_f_string_dynamic_t_resize(status, ip_list, length);
if (F_status_is_error(status)) {
- // prevent the loop below from being processed.
+ // Prevent the loop below from being processed.
subcounter = local.rule_contents.array[i].used;
}
else {
break;
}
- // now execute the generated commands.
+ // Now execute the generated commands.
if (arguments.used > 1) {
if (is_ip_list) {
f_file_t file = f_file_t_initialize;
}
else if (status == F_file_found_not) {
- // the file does not have to exist
+ // 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("%r%[%QCannot find the file '%Q'.%]%r", main->warning.to.stream, f_string_eol_s, main->warning.context, main->warning.prefix, file_path, main->warning.context, f_string_eol_s);
}
firewall_print_error_on_invalid_parameter_for_file(main->error, "fll_fss_basic_read", file_path.used ? file_path.string : "");
}
else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
- // empty files are to be silently ignored
+ // Empty files are to be silently ignored
}
else if (status == F_memory_not) {
firewall_print_error_on_allocation_failure(main->error);
status = fll_execute_program(current_tool, arguments, 0, 0, (void *) &return_code);
- // Immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
f_string_dynamic_resize(0, &ip_list);
f_string_dynamic_resize(0, &argument);
f_string_dynamic_resize(0, &device);
f_string_dynamic_resize(0, &protocol);
- exit(return_code);
+ main->child = return_code;
+
+ return status;
}
if (F_status_is_error(status)) {
status = fll_execute_program(current_tool, arguments, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
f_string_dynamic_resize(0, &ip_list);
f_string_dynamic_resize(0, &argument);
f_string_dynamic_resize(0, &device);
f_string_dynamic_resize(0, &protocol);
- exit(return_code);
+ main->child = return_code;
+
+ return status;
}
if (F_status_is_error(status)) {
}
}
- // skip globally reserved chain name: main
+ // Skip globally reserved chain name: main
range.start = 0;
range.stop = firewall_group_main_s_length - 1;
fixed_string.string = firewall_group_main_s;
reserved->main_at = i;
}
- // skip globally reserved chain name: stop
+ // Skip globally reserved chain name: stop
range.start = 0;
range.stop = firewall_group_stop_s_length - 1;
fixed_string.string = firewall_group_stop_s;
reserved->stop_at = i;
}
- // skip globally reserved chain name: lock
+ // Skip globally reserved chain name: lock
range.start = 0;
range.stop = firewall_group_lock_s_length - 1;
fixed_string.string = firewall_group_lock_s;
reserved->lock_at = i;
}
- // skip globally reserved chain name: none
+ // Skip globally reserved chain name: none
range.start = 0;
range.stop = firewall_group_lock_s_length - 1;
fixed_string.string = firewall_chain_none_s;
tool = firewall_program_iptables_e;
status = fll_execute_program(firewall_tool_iptables_s, arguments, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
f_string_dynamics_resize(0, &arguments);
- exit(return_code);
+ main->child = return_code;
+
+ return status;
}
if (F_status_is_error_not(status)) {
tool = firewall_program_ip6tables_e;
status = fll_execute_program((f_string_t) firewall_tool_ip6tables_s, arguments, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
f_string_dynamics_resize(0, &arguments);
- exit(return_code);
+ main->child = return_code;
+
+ return status;
}
}
return F_status_set_error(F_interrupt);
}
- f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- f_string_dynamic_t argument[1] = f_string_dynamic_t_initialize;
- int return_code = 0;
+ f_string_statics_t arguments = f_string_statics_t_initialize;
+ arguments.used = 1;
- argument[0].string = "-F";
- argument[0].size = 2;
- argument[0].used = 2;
+ f_string_static_t arguments_array[arguments.used];
+ arguments_array[0] = firewall_chain_forward_s;
+ arguments.array = arguments_array;
- arguments.array = argument;
- arguments.size = 1;
- arguments.used = 1;
+ int return_code = 0;
firewall_print_debug_tool(main->warning, tools[i], arguments);
status = fll_execute_program(tools[i], arguments, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- exit(return_code);
+ main->child = return_code;
+
+ return status;
}
if (F_status_is_error(status)) {
status = fll_execute_program(tools[i], arguments, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- exit(return_code);
+ main->child = return_code;
+
+ return status;
}
if (F_status_is_error(status)) {
f_status_t firewall_default_lock(firewall_main_t * const main) {
- const f_string_t chains[3] = { firewall_chain_input_s, firewall_chain_output_s, firewall_chain_forward_s };
- const f_string_t tools[2] = { firewall_tool_iptables_s, firewall_tool_ip6tables_s };
-
- const f_array_length_t lengths[3] = { firewall_chain_input_s_length, firewall_chain_output_s_length, firewall_chain_forward_s_length };
+ const f_string_static_t chains[3] = { firewall_chain_input_s, firewall_chain_output_s, firewall_chain_forward_s };
+ const f_string_static_t tools[2] = { firewall_tool_iptables_s, firewall_tool_ip6tables_s };
f_status_t status = F_none;
for (f_array_length_t i = 0; i < 3; ++i) {
- f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- f_string_dynamic_t argument[3];
+ f_string_statics_t arguments = f_string_statics_t_initialize;
+ f_string_static_t argument[3];
arguments.array = argument;
arguments.used = 3;
arguments.size = arguments.used;
- arguments.array[0].string = firewall_action_policy_command_s;
- arguments.array[1].string = chains[i];
+ arguments.array[0] = firewall_action_policy_command_s;
+ arguments.array[1] = chains[i];
arguments.array[2].string = "DROP";
- arguments.array[0].used = firewall_action_append_command_s_length;
- arguments.array[1].used = lengths[i];
arguments.array[2].used = 4;
- arguments.array[0].size = arguments.array[0].used;
- arguments.array[1].size = arguments.array[1].used;
arguments.array[2].size = arguments.array[2].used;
for (f_array_length_t j = 0; j < 2; ++j) {
status = fll_execute_program(tools[j], arguments, 0, 0, (void *) &return_code);
- // immediately exit child process, @todo this may require additional memory deallocation and relating changes.
if (status == F_child) {
- exit(return_code);
+ main->child = return_code;
+
+ return status;
}
if (firewall_signal_received(main)) {
return status;
}
-f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_t filename, const bool optional, firewall_local_data_t *local) {
+f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_static_t filename, const bool optional, firewall_local_data_t *local) {
f_file_t file = f_file_t_initialize;
firewall_print_error_on_invalid_parameter(main->error, "f_file_open");
}
else if (status == F_file_found_not) {
- fll_print_format("%r%[%QUnable to find the file '%S'.%]%r", 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("%r%[%QUnable to find the file '%Q'.%]%r", 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("%r%[%QUnable to open the file '%S'.%]%r", 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("%r%[%QUnable to open the file '%Q'.%]%r", 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("%r%[%QFile descriptor error while trying to open the file '%S'.%]%r", 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("%r%[%QFile descriptor error while trying to open the file '%Q'.%]%r", 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("%r%[%QInteger overflow while trying to buffer the file '%S'.%]%r", 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("%r%[%QInteger overflow while trying to buffer the file '%Q'.%]%r", 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("%r%[%QThe file '%S' is no longer open.%]%r", 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("%r%[%QThe file '%Q' is no longer open.%]%r", 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("%r%[%QA seek error occurred while accessing the file '%S'.%]%r", 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("%r%[%QA seek error occurred while accessing the file '%Q'.%]%r", 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("%r%[%QA read error occurred while accessing the file '%S'.%]%r", 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("%r%[%QA read error occurred while accessing the file '%Q'.%]%r", 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("%r%[%QNo relevant main was found within the file '%s'.%]%r", 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("%r%[%QNo relevant main was found within the file '%Q'.%]%r", 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);
if (F_status_is_error_not(status)) {
status = firewall_perform_commands(main, *local);
+ if (status == F_child) {
+ macro_f_fss_objects_t_delete_simple(local->rule_objects);
+ macro_f_fss_contents_t_delete_simple(local->rule_contents);
+
+ return status;
+ }
+
if (F_status_is_error(status)) {
status = F_status_set_fine(status);
firewall_print_error_on_allocation_failure(main->error);
}
else if (status == F_failure) {
- // the error message has already been displayed.
+ // The error message has already been displayed.
}
else {
firewall_print_error_on_unhandled(main->error, "firewall_perform_commands", status);
macro_f_fss_objects_t_delete_simple(local->rule_objects);
macro_f_fss_contents_t_delete_simple(local->rule_contents);
+
return status;
}
}
*
* @return
* F_none on success.
+ * F_child on child process exiting.
*
* F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
*
*
* @return
* F_none on success.
+ * F_child on child process exiting.
*
* F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
*
*
* @return
* F_none on success.
+ * F_child on child process exiting.
*
* F_interrupt (with error bit) on receiving a process signal, such as an interrupt signal.
*
*
* @return
* F_none on success.
+ * F_child on child process exiting.
*
* Status codes (with error bit) are returned on any problem.
*/
*
* @return
* F_none on success.
+ * F_child on child process exiting.
*
* Status codes (with error bit) are returned on any problem.
*/
-extern f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_t filename, const bool optional, firewall_local_data_t *local) F_attribute_visibility_internal_d;
+extern f_status_t firewall_buffer_rules(firewall_main_t * const main, const f_string_static_t filename, const bool optional, firewall_local_data_t *local) F_attribute_visibility_internal_d;
/**
* Process buffered rules.
*
* @return
* F_none on success.
+ * F_child on child process exiting.
*
* Status codes (with error bit) are returned on any problem.
*/
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library firewall.c private-common.c private-firewall.c
+build_sources_library firewall.c common.c private-common.c private-firewall.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 firewall.h
+build_sources_headers firewall.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_basic_list_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_list_read_main_delete_
+ f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic List Read
+ * 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 _fss_basic_list_read_common_h
+#define _fss_basic_list_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_basic_list_read_program_version_
+ #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
+
+ #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
+
+ #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))
+
+ #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_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_
+ #define fss_basic_list_read_signal_check_d 10000
+
+ #define fss_basic_list_read_pipe_content_end_s '\f'
+ #define fss_basic_list_read_pipe_content_ignore_s '\v'
+ #define fss_basic_list_read_pipe_content_start_s '\b'
+
+ #define fss_basic_list_read_short_at_s "a"
+ #define fss_basic_list_read_short_content_s "c"
+ #define fss_basic_list_read_short_columns_s "C"
+ #define fss_basic_list_read_short_delimit_s "D"
+ #define fss_basic_list_read_short_depth_s "d"
+ #define fss_basic_list_read_short_empty_s "e"
+ #define fss_basic_list_read_short_line_s "l"
+ #define fss_basic_list_read_short_name_s "n"
+ #define fss_basic_list_read_short_object_s "o"
+ #define fss_basic_list_read_short_pipe_s "p"
+ #define fss_basic_list_read_short_raw_s "R"
+ #define fss_basic_list_read_short_select_s "s"
+ #define fss_basic_list_read_short_total_s "t"
+ #define fss_basic_list_read_short_trim_s "T"
+
+ #define fss_basic_list_read_long_at_s "at"
+ #define fss_basic_list_read_long_content_s "content"
+ #define fss_basic_list_read_long_columns_s "columns"
+ #define fss_basic_list_read_long_delimit_s "delimit"
+ #define fss_basic_list_read_long_depth_s "depth"
+ #define fss_basic_list_read_long_empty_s "empty"
+ #define fss_basic_list_read_long_line_s "line"
+ #define fss_basic_list_read_long_name_s "name"
+ #define fss_basic_list_read_long_object_s "object"
+ #define fss_basic_list_read_long_pipe_s "pipe"
+ #define fss_basic_list_read_long_raw_s "raw"
+ #define fss_basic_list_read_long_select_s "select"
+ #define fss_basic_list_read_long_total_s "total"
+ #define fss_basic_list_read_long_trim_s "trim"
+
+ enum {
+ fss_basic_list_read_parameter_help_e,
+ fss_basic_list_read_parameter_light_e,
+ fss_basic_list_read_parameter_dark_e,
+ fss_basic_list_read_parameter_no_color_e,
+ fss_basic_list_read_parameter_verbosity_quiet_e,
+ fss_basic_list_read_parameter_verbosity_normal_e,
+ fss_basic_list_read_parameter_verbosity_verbose_e,
+ fss_basic_list_read_parameter_verbosity_debug_e,
+ fss_basic_list_read_parameter_version_e,
+
+ fss_basic_list_read_parameter_at_e,
+ fss_basic_list_read_parameter_content_e,
+ fss_basic_list_read_parameter_columns_e,
+ fss_basic_list_read_parameter_delimit_e,
+ fss_basic_list_read_parameter_depth_e,
+ fss_basic_list_read_parameter_empty_e,
+ fss_basic_list_read_parameter_line_e,
+ fss_basic_list_read_parameter_name_e,
+ fss_basic_list_read_parameter_object_e,
+ fss_basic_list_read_parameter_pipe_e,
+ fss_basic_list_read_parameter_raw_e,
+ fss_basic_list_read_parameter_select_e,
+ fss_basic_list_read_parameter_total_e,
+ fss_basic_list_read_parameter_trim_e,
+ };
+
+ #define fss_basic_list_read_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, F_false, 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(fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_columns_s, fss_basic_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_delimit_s, fss_basic_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_depth_s, fss_basic_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_empty_s, fss_basic_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_line_s, fss_basic_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_name_s, fss_basic_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_object_s, fss_basic_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_pipe_s, fss_basic_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_raw_s, fss_basic_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_select_s, fss_basic_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_basic_list_total_parameters_d 23
+#endif // _di_fss_basic_list_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_basic_list_read_delimit_mode_*:
+ * - all: All delimits are to be aplied.
+ * - content: Content are to have delimits applied.
+ * - content_greater: Content at this number or higher are to have delimits applied.
+ * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ * - content_lesser: Content at this number or lower are to have delimits applied.
+ * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
+ * - content_object: Objects and Content are to have delimits applied
+ * - object: Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_basic_list_read_delimit_mode_
+ #define fss_basic_list_read_delimit_mode_name_none_s "none"
+ #define fss_basic_list_read_delimit_mode_name_all_s "all"
+ #define fss_basic_list_read_delimit_mode_name_object_s "object"
+ #define fss_basic_list_read_delimit_mode_name_greater_s "+"
+ #define fss_basic_list_read_delimit_mode_name_lesser_s "-"
+
+ #define fss_basic_list_read_delimit_mode_name_none_s_length 4
+ #define fss_basic_list_read_delimit_mode_name_all_s_length 3
+ #define fss_basic_list_read_delimit_mode_name_object_s_length 6
+ #define fss_basic_list_read_delimit_mode_name_greater_s_length 1
+ #define fss_basic_list_read_delimit_mode_name_lesser_s_length 1
+
+ enum {
+ fss_basic_list_read_delimit_mode_none_e = 1,
+ fss_basic_list_read_delimit_mode_all_e,
+ fss_basic_list_read_delimit_mode_content_e,
+ fss_basic_list_read_delimit_mode_content_greater_e,
+ fss_basic_list_read_delimit_mode_content_greater_object_e,
+ fss_basic_list_read_delimit_mode_content_lesser_e,
+ fss_basic_list_read_delimit_mode_content_lesser_object_e,
+ fss_basic_list_read_delimit_mode_content_object_e,
+ fss_basic_list_read_delimit_mode_object_e,
+ };
+#endif // _di_fss_basic_list_read_delimit_modes_
+
+#ifndef _di_fss_basic_list_read_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_basic_list_read_main_t;
+
+ #define fss_basic_list_read_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_basic_list_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_list_read_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_list_read_main()
+ */
+#ifndef _di_fss_basic_list_read_main_delete_
+ extern f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main);
+#endif // _di_fss_basic_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_list_read_common_h
}
#endif // _di_fss_basic_list_read_main_
-#ifndef _di_fss_basic_list_read_main_delete_
- f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_basic_list_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Basic List Read includes.
+#include <program/fss_basic_list_read/common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_basic_list_read_program_version_
- #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
-
- #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
-
- #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))
-
- #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_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_
- #define fss_basic_list_read_signal_check_d 10000
-
- #define fss_basic_list_read_pipe_content_end_s '\f'
- #define fss_basic_list_read_pipe_content_ignore_s '\v'
- #define fss_basic_list_read_pipe_content_start_s '\b'
-
- #define fss_basic_list_read_short_at_s "a"
- #define fss_basic_list_read_short_content_s "c"
- #define fss_basic_list_read_short_columns_s "C"
- #define fss_basic_list_read_short_delimit_s "D"
- #define fss_basic_list_read_short_depth_s "d"
- #define fss_basic_list_read_short_empty_s "e"
- #define fss_basic_list_read_short_line_s "l"
- #define fss_basic_list_read_short_name_s "n"
- #define fss_basic_list_read_short_object_s "o"
- #define fss_basic_list_read_short_pipe_s "p"
- #define fss_basic_list_read_short_raw_s "R"
- #define fss_basic_list_read_short_select_s "s"
- #define fss_basic_list_read_short_total_s "t"
- #define fss_basic_list_read_short_trim_s "T"
-
- #define fss_basic_list_read_long_at_s "at"
- #define fss_basic_list_read_long_content_s "content"
- #define fss_basic_list_read_long_columns_s "columns"
- #define fss_basic_list_read_long_delimit_s "delimit"
- #define fss_basic_list_read_long_depth_s "depth"
- #define fss_basic_list_read_long_empty_s "empty"
- #define fss_basic_list_read_long_line_s "line"
- #define fss_basic_list_read_long_name_s "name"
- #define fss_basic_list_read_long_object_s "object"
- #define fss_basic_list_read_long_pipe_s "pipe"
- #define fss_basic_list_read_long_raw_s "raw"
- #define fss_basic_list_read_long_select_s "select"
- #define fss_basic_list_read_long_total_s "total"
- #define fss_basic_list_read_long_trim_s "trim"
-
- enum {
- fss_basic_list_read_parameter_help_e,
- fss_basic_list_read_parameter_light_e,
- fss_basic_list_read_parameter_dark_e,
- fss_basic_list_read_parameter_no_color_e,
- fss_basic_list_read_parameter_verbosity_quiet_e,
- fss_basic_list_read_parameter_verbosity_normal_e,
- fss_basic_list_read_parameter_verbosity_verbose_e,
- fss_basic_list_read_parameter_verbosity_debug_e,
- fss_basic_list_read_parameter_version_e,
-
- fss_basic_list_read_parameter_at_e,
- fss_basic_list_read_parameter_content_e,
- fss_basic_list_read_parameter_columns_e,
- fss_basic_list_read_parameter_delimit_e,
- fss_basic_list_read_parameter_depth_e,
- fss_basic_list_read_parameter_empty_e,
- fss_basic_list_read_parameter_line_e,
- fss_basic_list_read_parameter_name_e,
- fss_basic_list_read_parameter_object_e,
- fss_basic_list_read_parameter_pipe_e,
- fss_basic_list_read_parameter_raw_e,
- fss_basic_list_read_parameter_select_e,
- fss_basic_list_read_parameter_total_e,
- fss_basic_list_read_parameter_trim_e,
- };
-
- #define fss_basic_list_read_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, F_false, 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(fss_basic_list_read_short_at_s, fss_basic_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_content_s, fss_basic_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_columns_s, fss_basic_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_delimit_s, fss_basic_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_depth_s, fss_basic_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_empty_s, fss_basic_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_line_s, fss_basic_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_name_s, fss_basic_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_object_s, fss_basic_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_pipe_s, fss_basic_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_raw_s, fss_basic_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_select_s, fss_basic_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_total_s, fss_basic_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_read_short_trim_s, fss_basic_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_basic_list_total_parameters_d 23
-#endif // _di_fss_basic_list_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_basic_list_read_delimit_mode_*:
- * - all: All delimits are to be aplied.
- * - content: Content are to have delimits applied.
- * - content_greater: Content at this number or higher are to have delimits applied.
- * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- * - content_lesser: Content at this number or lower are to have delimits applied.
- * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
- * - content_object: Objects and Content are to have delimits applied
- * - object: Objects arre to have delimits applied.
- */
-#ifndef _di_fss_basic_list_read_delimit_mode_
- #define fss_basic_list_read_delimit_mode_name_none_s "none"
- #define fss_basic_list_read_delimit_mode_name_all_s "all"
- #define fss_basic_list_read_delimit_mode_name_object_s "object"
- #define fss_basic_list_read_delimit_mode_name_greater_s "+"
- #define fss_basic_list_read_delimit_mode_name_lesser_s "-"
-
- #define fss_basic_list_read_delimit_mode_name_none_s_length 4
- #define fss_basic_list_read_delimit_mode_name_all_s_length 3
- #define fss_basic_list_read_delimit_mode_name_object_s_length 6
- #define fss_basic_list_read_delimit_mode_name_greater_s_length 1
- #define fss_basic_list_read_delimit_mode_name_lesser_s_length 1
-
- enum {
- fss_basic_list_read_delimit_mode_none_e = 1,
- fss_basic_list_read_delimit_mode_all_e,
- fss_basic_list_read_delimit_mode_content_e,
- fss_basic_list_read_delimit_mode_content_greater_e,
- fss_basic_list_read_delimit_mode_content_greater_object_e,
- fss_basic_list_read_delimit_mode_content_lesser_e,
- fss_basic_list_read_delimit_mode_content_lesser_object_e,
- fss_basic_list_read_delimit_mode_content_object_e,
- fss_basic_list_read_delimit_mode_object_e,
- };
-#endif // _di_fss_basic_list_read_delimit_modes_
-
-#ifndef _di_fss_basic_list_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_basic_list_read_main_t;
-
- #define fss_basic_list_read_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_list_read_main_t_
-
/**
* Print help.
*
extern f_status_t fss_basic_list_read_main(fss_basic_list_read_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_list_read_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_list_read_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_list_read_main()
- */
-#ifndef _di_fss_basic_list_read_main_delete_
- extern f_status_t fss_basic_list_read_main_delete(fss_basic_list_read_main_t * const main);
-#endif // _di_fss_basic_list_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_basic_list_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_basic_list_read.c common.c private-common.c private-print.c private-read.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 fss_basic_list_read.h
+build_sources_headers fss_basic_list_read.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_basic_list_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_list_write_main_delete_
+ f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic List Write
+ * 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 _fss_basic_list_write_common_h
+#define _fss_basic_list_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_basic_list_write_signal_check_d 10000
+
+ #define fss_basic_list_write_pipe_content_end_s '\f'
+ #define fss_basic_list_write_pipe_content_ignore_s '\v'
+ #define fss_basic_list_write_pipe_content_start_s '\b'
+
+ #define fss_basic_list_write_short_file_s "f"
+ #define fss_basic_list_write_short_content_s "c"
+ #define fss_basic_list_write_short_double_s "d"
+ #define fss_basic_list_write_short_ignore_s "I"
+ #define fss_basic_list_write_short_object_s "o"
+ #define fss_basic_list_write_short_partial_s "p"
+ #define fss_basic_list_write_short_prepend_s "P"
+ #define fss_basic_list_write_short_single_s "s"
+ #define fss_basic_list_write_short_trim_s "T"
+
+ #define fss_basic_list_write_long_file_s "file"
+ #define fss_basic_list_write_long_content_s "content"
+ #define fss_basic_list_write_long_double_s "double"
+ #define fss_basic_list_write_long_ignore_s "ignore"
+ #define fss_basic_list_write_long_object_s "object"
+ #define fss_basic_list_write_long_partial_s "partial"
+ #define fss_basic_list_write_long_prepend_s "prepend"
+ #define fss_basic_list_write_long_single_s "single"
+ #define fss_basic_list_write_long_trim_s "trim"
+
+ enum {
+ fss_basic_list_write_parameter_help_e,
+ fss_basic_list_write_parameter_light_e,
+ fss_basic_list_write_parameter_dark_e,
+ fss_basic_list_write_parameter_no_color_e,
+ fss_basic_list_write_parameter_verbosity_quiet_e,
+ fss_basic_list_write_parameter_verbosity_normal_e,
+ fss_basic_list_write_parameter_verbosity_verbose_e,
+ fss_basic_list_write_parameter_verbosity_debug_e,
+ fss_basic_list_write_parameter_version_e,
+
+ fss_basic_list_write_parameter_file_e,
+ fss_basic_list_write_parameter_content_e,
+ fss_basic_list_write_parameter_double_e,
+ fss_basic_list_write_parameter_ignore_e,
+ fss_basic_list_write_parameter_object_e,
+ fss_basic_list_write_parameter_partial_e,
+ fss_basic_list_write_parameter_prepend_e,
+ fss_basic_list_write_parameter_single_e,
+ fss_basic_list_write_parameter_trim_e,
+ };
+
+ #define fss_basic_list_write_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, F_false, 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(fss_basic_list_write_short_file_s, fss_basic_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_content_s, fss_basic_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_double_s, fss_basic_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_ignore_s, fss_basic_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_object_s, fss_basic_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_partial_s, fss_basic_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_prepend_s, fss_basic_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_single_s, fss_basic_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_list_write_short_trim_s, fss_basic_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_basic_list_write_total_parameters_d 18
+#endif // _di_fss_basic_list_write_defines_
+
+#ifndef _di_fss_basic_list_write_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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_string_static_t prepend;
+
+ f_color_context_t context;
+ } fss_basic_list_write_main_t;
+
+ #define fss_basic_list_write_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_static_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_basic_list_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_list_write_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_list_write_main()
+ */
+#ifndef _di_fss_basic_list_write_main_delete_
+ extern f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main);
+#endif // _di_fss_basic_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_list_write_common_h
}
#endif // _di_fss_basic_list_write_main_
-#ifndef _di_fss_basic_list_write_main_delete_
- f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_basic_list_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Basic List Write includes.
+#include <program/fss_basic_list_write/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_basic_list_write_signal_check_d 10000
-
- #define fss_basic_list_write_pipe_content_end_s '\f'
- #define fss_basic_list_write_pipe_content_ignore_s '\v'
- #define fss_basic_list_write_pipe_content_start_s '\b'
-
- #define fss_basic_list_write_short_file_s "f"
- #define fss_basic_list_write_short_content_s "c"
- #define fss_basic_list_write_short_double_s "d"
- #define fss_basic_list_write_short_ignore_s "I"
- #define fss_basic_list_write_short_object_s "o"
- #define fss_basic_list_write_short_partial_s "p"
- #define fss_basic_list_write_short_prepend_s "P"
- #define fss_basic_list_write_short_single_s "s"
- #define fss_basic_list_write_short_trim_s "T"
-
- #define fss_basic_list_write_long_file_s "file"
- #define fss_basic_list_write_long_content_s "content"
- #define fss_basic_list_write_long_double_s "double"
- #define fss_basic_list_write_long_ignore_s "ignore"
- #define fss_basic_list_write_long_object_s "object"
- #define fss_basic_list_write_long_partial_s "partial"
- #define fss_basic_list_write_long_prepend_s "prepend"
- #define fss_basic_list_write_long_single_s "single"
- #define fss_basic_list_write_long_trim_s "trim"
-
- enum {
- fss_basic_list_write_parameter_help_e,
- fss_basic_list_write_parameter_light_e,
- fss_basic_list_write_parameter_dark_e,
- fss_basic_list_write_parameter_no_color_e,
- fss_basic_list_write_parameter_verbosity_quiet_e,
- fss_basic_list_write_parameter_verbosity_normal_e,
- fss_basic_list_write_parameter_verbosity_verbose_e,
- fss_basic_list_write_parameter_verbosity_debug_e,
- fss_basic_list_write_parameter_version_e,
-
- fss_basic_list_write_parameter_file_e,
- fss_basic_list_write_parameter_content_e,
- fss_basic_list_write_parameter_double_e,
- fss_basic_list_write_parameter_ignore_e,
- fss_basic_list_write_parameter_object_e,
- fss_basic_list_write_parameter_partial_e,
- fss_basic_list_write_parameter_prepend_e,
- fss_basic_list_write_parameter_single_e,
- fss_basic_list_write_parameter_trim_e,
- };
-
- #define fss_basic_list_write_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, F_false, 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(fss_basic_list_write_short_file_s, fss_basic_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_content_s, fss_basic_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_double_s, fss_basic_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_ignore_s, fss_basic_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_object_s, fss_basic_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_partial_s, fss_basic_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_prepend_s, fss_basic_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_single_s, fss_basic_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_list_write_short_trim_s, fss_basic_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_basic_list_write_total_parameters_d 18
-#endif // _di_fss_basic_list_write_defines_
-
-#ifndef _di_fss_basic_list_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_static_t prepend;
-
- f_color_context_t context;
- } fss_basic_list_write_main_t;
-
- #define fss_basic_list_write_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_list_write_main_t_
-
/**
* Print help.
*
extern f_status_t fss_basic_list_write_main(fss_basic_list_write_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_list_write_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_list_write_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_list_write_main()
- */
-#ifndef _di_fss_basic_list_write_main_delete_
- extern f_status_t fss_basic_list_write_main_delete(fss_basic_list_write_main_t * const main);
-#endif // _di_fss_basic_list_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_basic_list_write.c private-common.c private-write.c
+build_sources_library fss_basic_list_write.c common.c private-common.c private-write.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 fss_basic_list_write.h
+build_sources_headers fss_basic_list_write.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_basic_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_read_main_delete_
+ f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic Read
+ * 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 _fss_basic_read_common_h
+#define _fss_basic_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_basic_read_signal_check_d 10000
+
+ #define fss_basic_read_pipe_content_end_s '\f'
+ #define fss_basic_read_pipe_content_ignore_s '\v'
+ #define fss_basic_read_pipe_content_start_s '\b'
+
+ #define fss_basic_read_short_at_s "a"
+ #define fss_basic_read_short_content_s "c"
+ #define fss_basic_read_short_columns_s "C"
+ #define fss_basic_read_short_delimit_s "D"
+ #define fss_basic_read_short_depth_s "d"
+ #define fss_basic_read_short_empty_s "e"
+ #define fss_basic_read_short_line_s "l"
+ #define fss_basic_read_short_name_s "n"
+ #define fss_basic_read_short_object_s "o"
+ #define fss_basic_read_short_pipe_s "p"
+ #define fss_basic_read_short_raw_s "R"
+ #define fss_basic_read_short_select_s "s"
+ #define fss_basic_read_short_total_s "t"
+ #define fss_basic_read_short_trim_s "T"
+
+ #define fss_basic_read_long_at_s "at"
+ #define fss_basic_read_long_content_s "content"
+ #define fss_basic_read_long_columns_s "columns"
+ #define fss_basic_read_long_delimit_s "delimit"
+ #define fss_basic_read_long_depth_s "depth"
+ #define fss_basic_read_long_empty_s "empty"
+ #define fss_basic_read_long_line_s "line"
+ #define fss_basic_read_long_name_s "name"
+ #define fss_basic_read_long_object_s "object"
+ #define fss_basic_read_long_pipe_s "pipe"
+ #define fss_basic_read_long_raw_s "raw"
+ #define fss_basic_read_long_select_s "select"
+ #define fss_basic_read_long_total_s "total"
+ #define fss_basic_read_long_trim_s "trim"
+
+ enum {
+ fss_basic_read_parameter_help_e,
+ fss_basic_read_parameter_light_e,
+ fss_basic_read_parameter_dark_e,
+ fss_basic_read_parameter_no_color_e,
+ fss_basic_read_parameter_verbosity_quiet_e,
+ fss_basic_read_parameter_verbosity_normal_e,
+ fss_basic_read_parameter_verbosity_verbose_e,
+ fss_basic_read_parameter_verbosity_debug_e,
+ fss_basic_read_parameter_version_e,
+
+ fss_basic_read_parameter_at_e,
+ fss_basic_read_parameter_content_e,
+ fss_basic_read_parameter_columns_e,
+ fss_basic_read_parameter_delimit_e,
+ fss_basic_read_parameter_depth_e,
+ fss_basic_read_parameter_empty_e,
+ fss_basic_read_parameter_line_e,
+ fss_basic_read_parameter_name_e,
+ fss_basic_read_parameter_object_e,
+ fss_basic_read_parameter_pipe_e,
+ fss_basic_read_parameter_raw_e,
+ fss_basic_read_parameter_select_e,
+ fss_basic_read_parameter_total_e,
+ fss_basic_read_parameter_trim_e,
+ };
+
+ #define fss_basic_read_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(fss_basic_read_short_at_s, fss_basic_read_long_at_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_content_s, fss_basic_read_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_columns_s, fss_basic_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_delimit_s, fss_basic_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_depth_s, fss_basic_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_empty_s, fss_basic_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_line_s, fss_basic_read_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_name_s, fss_basic_read_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_object_s, fss_basic_read_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_pipe_s, fss_basic_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_raw_s, fss_basic_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_select_s, fss_basic_read_long_select_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_total_s, fss_basic_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_basic_read_total_parameters_d 23
+#endif // _di_fss_basic_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_basic_read_delimit_mode_*:
+ * - all: All delimits are to be aplied.
+ * - content: Content are to have delimits applied.
+ * - content_greater: Content at this number or higher are to have delimits applied.
+ * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ * - content_lesser: Content at this number or lower are to have delimits applied.
+ * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
+ * - content_object: Objects and Content are to have delimits applied
+ * - object: Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_basic_read_delimit_mode_
+ #define fss_basic_read_delimit_mode_name_none_s "none"
+ #define fss_basic_read_delimit_mode_name_all_s "all"
+ #define fss_basic_read_delimit_mode_name_object_s "object"
+ #define fss_basic_read_delimit_mode_name_greater_s "+"
+ #define fss_basic_read_delimit_mode_name_lesser_s "-"
+
+ #define fss_basic_read_delimit_mode_name_none_s_length 4
+ #define fss_basic_read_delimit_mode_name_all_s_length 3
+ #define fss_basic_read_delimit_mode_name_object_s_length 6
+ #define fss_basic_read_delimit_mode_name_greater_s_length 1
+ #define fss_basic_read_delimit_mode_name_lesser_s_length 1
+
+ enum {
+ fss_basic_read_delimit_mode_none_e = 1,
+ fss_basic_read_delimit_mode_all_e,
+ fss_basic_read_delimit_mode_content_e,
+ fss_basic_read_delimit_mode_content_greater_e,
+ fss_basic_read_delimit_mode_content_greater_object_e,
+ fss_basic_read_delimit_mode_content_lesser_e,
+ fss_basic_read_delimit_mode_content_lesser_object_e,
+ fss_basic_read_delimit_mode_content_object_e,
+ fss_basic_read_delimit_mode_object_e,
+ };
+#endif // _di_fss_basic_read_delimit_modes_
+
+#ifndef _di_fss_basic_read_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_basic_read_main_t;
+
+ #define fss_basic_read_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_basic_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_read_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_read_main()
+ */
+#ifndef _di_fss_basic_read_main_delete_
+ extern f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main);
+#endif // _di_fss_basic_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_read_common_h
}
#endif // _di_fss_basic_read_main_
-#ifndef _di_fss_basic_read_main_delete_
- f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_basic_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Basic Read includes.
+#include <program/fss_basic_read/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_basic_read_signal_check_d 10000
-
- #define fss_basic_read_pipe_content_end_s '\f'
- #define fss_basic_read_pipe_content_ignore_s '\v'
- #define fss_basic_read_pipe_content_start_s '\b'
-
- #define fss_basic_read_short_at_s "a"
- #define fss_basic_read_short_content_s "c"
- #define fss_basic_read_short_columns_s "C"
- #define fss_basic_read_short_delimit_s "D"
- #define fss_basic_read_short_depth_s "d"
- #define fss_basic_read_short_empty_s "e"
- #define fss_basic_read_short_line_s "l"
- #define fss_basic_read_short_name_s "n"
- #define fss_basic_read_short_object_s "o"
- #define fss_basic_read_short_pipe_s "p"
- #define fss_basic_read_short_raw_s "R"
- #define fss_basic_read_short_select_s "s"
- #define fss_basic_read_short_total_s "t"
- #define fss_basic_read_short_trim_s "T"
-
- #define fss_basic_read_long_at_s "at"
- #define fss_basic_read_long_content_s "content"
- #define fss_basic_read_long_columns_s "columns"
- #define fss_basic_read_long_delimit_s "delimit"
- #define fss_basic_read_long_depth_s "depth"
- #define fss_basic_read_long_empty_s "empty"
- #define fss_basic_read_long_line_s "line"
- #define fss_basic_read_long_name_s "name"
- #define fss_basic_read_long_object_s "object"
- #define fss_basic_read_long_pipe_s "pipe"
- #define fss_basic_read_long_raw_s "raw"
- #define fss_basic_read_long_select_s "select"
- #define fss_basic_read_long_total_s "total"
- #define fss_basic_read_long_trim_s "trim"
-
- enum {
- fss_basic_read_parameter_help_e,
- fss_basic_read_parameter_light_e,
- fss_basic_read_parameter_dark_e,
- fss_basic_read_parameter_no_color_e,
- fss_basic_read_parameter_verbosity_quiet_e,
- fss_basic_read_parameter_verbosity_normal_e,
- fss_basic_read_parameter_verbosity_verbose_e,
- fss_basic_read_parameter_verbosity_debug_e,
- fss_basic_read_parameter_version_e,
-
- fss_basic_read_parameter_at_e,
- fss_basic_read_parameter_content_e,
- fss_basic_read_parameter_columns_e,
- fss_basic_read_parameter_delimit_e,
- fss_basic_read_parameter_depth_e,
- fss_basic_read_parameter_empty_e,
- fss_basic_read_parameter_line_e,
- fss_basic_read_parameter_name_e,
- fss_basic_read_parameter_object_e,
- fss_basic_read_parameter_pipe_e,
- fss_basic_read_parameter_raw_e,
- fss_basic_read_parameter_select_e,
- fss_basic_read_parameter_total_e,
- fss_basic_read_parameter_trim_e,
- };
-
- #define fss_basic_read_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(fss_basic_read_short_at_s, fss_basic_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_content_s, fss_basic_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_columns_s, fss_basic_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_delimit_s, fss_basic_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_depth_s, fss_basic_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_empty_s, fss_basic_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_line_s, fss_basic_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_name_s, fss_basic_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_object_s, fss_basic_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_pipe_s, fss_basic_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_raw_s, fss_basic_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_select_s, fss_basic_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_total_s, fss_basic_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_read_short_trim_s, fss_basic_read_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_basic_read_total_parameters_d 23
-#endif // _di_fss_basic_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_basic_read_delimit_mode_*:
- * - all: All delimits are to be aplied.
- * - content: Content are to have delimits applied.
- * - content_greater: Content at this number or higher are to have delimits applied.
- * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- * - content_lesser: Content at this number or lower are to have delimits applied.
- * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
- * - content_object: Objects and Content are to have delimits applied
- * - object: Objects arre to have delimits applied.
- */
-#ifndef _di_fss_basic_read_delimit_mode_
- #define fss_basic_read_delimit_mode_name_none_s "none"
- #define fss_basic_read_delimit_mode_name_all_s "all"
- #define fss_basic_read_delimit_mode_name_object_s "object"
- #define fss_basic_read_delimit_mode_name_greater_s "+"
- #define fss_basic_read_delimit_mode_name_lesser_s "-"
-
- #define fss_basic_read_delimit_mode_name_none_s_length 4
- #define fss_basic_read_delimit_mode_name_all_s_length 3
- #define fss_basic_read_delimit_mode_name_object_s_length 6
- #define fss_basic_read_delimit_mode_name_greater_s_length 1
- #define fss_basic_read_delimit_mode_name_lesser_s_length 1
-
- enum {
- fss_basic_read_delimit_mode_none_e = 1,
- fss_basic_read_delimit_mode_all_e,
- fss_basic_read_delimit_mode_content_e,
- fss_basic_read_delimit_mode_content_greater_e,
- fss_basic_read_delimit_mode_content_greater_object_e,
- fss_basic_read_delimit_mode_content_lesser_e,
- fss_basic_read_delimit_mode_content_lesser_object_e,
- fss_basic_read_delimit_mode_content_object_e,
- fss_basic_read_delimit_mode_object_e,
- };
-#endif // _di_fss_basic_read_delimit_modes_
-
-#ifndef _di_fss_basic_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_basic_read_main_t;
-
- #define fss_basic_read_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_read_main_t_
-
/**
* Print help.
*
extern f_status_t fss_basic_read_main(fss_basic_read_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_read_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_read_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_read_main()
- */
-#ifndef _di_fss_basic_read_main_delete_
- extern f_status_t fss_basic_read_main_delete(fss_basic_read_main_t * const main);
-#endif // _di_fss_basic_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_basic_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_basic_read.c common.c private-common.c private-print.c private-read.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 fss_basic_read.h
+build_sources_headers fss_basic_read.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_basic_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_basic_write_main_delete_
+ f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_basic_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Basic Write
+ * 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 _fss_basic_write_common_h
+#define _fss_basic_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_basic_write_signal_check_d 10000
+
+ #define fss_basic_write_pipe_content_end_s '\f'
+ #define fss_basic_write_pipe_content_ignore_s '\v'
+ #define fss_basic_write_pipe_content_start_s '\b'
+
+ #define fss_basic_write_short_file_s "f"
+ #define fss_basic_write_short_content_s "c"
+ #define fss_basic_write_short_double_s "d"
+ #define fss_basic_write_short_ignore_s "I"
+ #define fss_basic_write_short_object_s "o"
+ #define fss_basic_write_short_partial_s "p"
+ #define fss_basic_write_short_prepend_s "P"
+ #define fss_basic_write_short_single_s "s"
+ #define fss_basic_write_short_trim_s "T"
+
+ #define fss_basic_write_long_file_s "file"
+ #define fss_basic_write_long_content_s "content"
+ #define fss_basic_write_long_double_s "double"
+ #define fss_basic_write_long_ignore_s "ignore"
+ #define fss_basic_write_long_object_s "object"
+ #define fss_basic_write_long_partial_s "partial"
+ #define fss_basic_write_long_prepend_s "prepend"
+ #define fss_basic_write_long_single_s "single"
+ #define fss_basic_write_long_trim_s "trim"
+
+ enum {
+ fss_basic_write_parameter_help_e,
+ fss_basic_write_parameter_light_e,
+ fss_basic_write_parameter_dark_e,
+ fss_basic_write_parameter_no_color_e,
+ fss_basic_write_parameter_verbosity_quiet_e,
+ fss_basic_write_parameter_verbosity_normal_e,
+ fss_basic_write_parameter_verbosity_verbose_e,
+ fss_basic_write_parameter_verbosity_debug_e,
+ fss_basic_write_parameter_version_e,
+
+ fss_basic_write_parameter_file_e,
+ fss_basic_write_parameter_content_e,
+ fss_basic_write_parameter_double_e,
+ fss_basic_write_parameter_ignore_e,
+ fss_basic_write_parameter_object_e,
+ fss_basic_write_parameter_partial_e,
+ fss_basic_write_parameter_prepend_e,
+ fss_basic_write_parameter_single_e,
+ fss_basic_write_parameter_trim_e,
+ };
+
+ #define fss_basic_write_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(fss_basic_write_short_file_s, fss_basic_write_long_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_content_s, fss_basic_write_long_content_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_double_s, fss_basic_write_long_double_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_ignore_s, fss_basic_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_object_s, fss_basic_write_long_object_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_partial_s, fss_basic_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_prepend_s, fss_basic_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_single_s, fss_basic_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_basic_write_short_trim_s, fss_basic_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_basic_write_total_parameters_d 18
+#endif // _di_fss_basic_write_defines_
+
+#ifndef _di_fss_basic_write_data_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_basic_write_main_t;
+
+ #define fss_basic_write_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_basic_write_data_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_basic_write_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_basic_write_main()
+ */
+#ifndef _di_fss_basic_write_main_delete_
+ extern f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main);
+#endif // _di_fss_basic_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_basic_write_common_h
}
#endif // _di_fss_basic_write_main_
-#ifndef _di_fss_basic_write_main_delete_
- f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_basic_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Basic Write includes.
+#include <program/fss_basic_write/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_basic_write_signal_check_d 10000
-
- #define fss_basic_write_pipe_content_end_s '\f'
- #define fss_basic_write_pipe_content_ignore_s '\v'
- #define fss_basic_write_pipe_content_start_s '\b'
-
- #define fss_basic_write_short_file_s "f"
- #define fss_basic_write_short_content_s "c"
- #define fss_basic_write_short_double_s "d"
- #define fss_basic_write_short_ignore_s "I"
- #define fss_basic_write_short_object_s "o"
- #define fss_basic_write_short_partial_s "p"
- #define fss_basic_write_short_prepend_s "P"
- #define fss_basic_write_short_single_s "s"
- #define fss_basic_write_short_trim_s "T"
-
- #define fss_basic_write_long_file_s "file"
- #define fss_basic_write_long_content_s "content"
- #define fss_basic_write_long_double_s "double"
- #define fss_basic_write_long_ignore_s "ignore"
- #define fss_basic_write_long_object_s "object"
- #define fss_basic_write_long_partial_s "partial"
- #define fss_basic_write_long_prepend_s "prepend"
- #define fss_basic_write_long_single_s "single"
- #define fss_basic_write_long_trim_s "trim"
-
- enum {
- fss_basic_write_parameter_help_e,
- fss_basic_write_parameter_light_e,
- fss_basic_write_parameter_dark_e,
- fss_basic_write_parameter_no_color_e,
- fss_basic_write_parameter_verbosity_quiet_e,
- fss_basic_write_parameter_verbosity_normal_e,
- fss_basic_write_parameter_verbosity_verbose_e,
- fss_basic_write_parameter_verbosity_debug_e,
- fss_basic_write_parameter_version_e,
-
- fss_basic_write_parameter_file_e,
- fss_basic_write_parameter_content_e,
- fss_basic_write_parameter_double_e,
- fss_basic_write_parameter_ignore_e,
- fss_basic_write_parameter_object_e,
- fss_basic_write_parameter_partial_e,
- fss_basic_write_parameter_prepend_e,
- fss_basic_write_parameter_single_e,
- fss_basic_write_parameter_trim_e,
- };
-
- #define fss_basic_write_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(fss_basic_write_short_file_s, fss_basic_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_content_s, fss_basic_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_double_s, fss_basic_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_ignore_s, fss_basic_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_object_s, fss_basic_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_partial_s, fss_basic_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_prepend_s, fss_basic_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_single_s, fss_basic_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_basic_write_short_trim_s, fss_basic_write_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_basic_write_total_parameters_d 18
-#endif // _di_fss_basic_write_defines_
-
-#ifndef _di_fss_basic_write_data_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_basic_write_main_t;
-
- #define fss_basic_write_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_basic_write_data_
-
/**
* Print help.
*
extern f_status_t fss_basic_write_main(fss_basic_write_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_basic_write_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_basic_write_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_basic_write_main()
- */
-#ifndef _di_fss_basic_write_main_delete_
- extern f_status_t fss_basic_write_main_delete(fss_basic_write_main_t * const main);
-#endif // _di_fss_basic_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_basic_write.c private-common.c private-write.c
+build_sources_library fss_basic_write.c common.c private-common.c private-write.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 fss_basic_write.h
+build_sources_headers fss_basic_write.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_embedded_list_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_embedded_list_read_main_delete_
+ f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ macro_f_fss_nest_t_delete_simple(main->nest);
+
+ f_string_dynamic_resize(0, &main->buffer);
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_embedded_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Embedded List Read
+ * 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 _fss_embedded_list_read_common_h
+#define _fss_embedded_list_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_embedded_list_read_signal_check_d 10000
+
+ #define fss_embedded_list_read_pipe_content_end_s '\f'
+ #define fss_embedded_list_read_pipe_content_ignore_s '\v'
+ #define fss_embedded_list_read_pipe_content_start_s '\b'
+
+ #define fss_embedded_list_read_short_at_s "a"
+ #define fss_embedded_list_read_short_content_s "c"
+ #define fss_embedded_list_read_short_columns_s "C"
+ #define fss_embedded_list_read_short_delimit_s "D"
+ #define fss_embedded_list_read_short_depth_s "d"
+ #define fss_embedded_list_read_short_empty_s "e"
+ #define fss_embedded_list_read_short_line_s "l"
+ #define fss_embedded_list_read_short_name_s "n"
+ #define fss_embedded_list_read_short_object_s "o"
+ #define fss_embedded_list_read_short_pipe_s "p"
+ #define fss_embedded_list_read_short_raw_s "R"
+ #define fss_embedded_list_read_short_select_s "s"
+ #define fss_embedded_list_read_short_total_s "t"
+ #define fss_embedded_list_read_short_trim_s "T"
+
+ #define fss_embedded_list_read_long_at_s "at"
+ #define fss_embedded_list_read_long_content_s "content"
+ #define fss_embedded_list_read_long_columns_s "columns"
+ #define fss_embedded_list_read_long_delimit_s "delimit"
+ #define fss_embedded_list_read_long_depth_s "depth"
+ #define fss_embedded_list_read_long_empty_s "empty"
+ #define fss_embedded_list_read_long_line_s "line"
+ #define fss_embedded_list_read_long_name_s "name"
+ #define fss_embedded_list_read_long_object_s "object"
+ #define fss_embedded_list_read_long_pipe_s "pipe"
+ #define fss_embedded_list_read_long_raw_s "raw"
+ #define fss_embedded_list_read_long_select_s "select"
+ #define fss_embedded_list_read_long_total_s "total"
+ #define fss_embedded_list_read_long_trim_s "trim"
+
+ enum {
+ fss_embedded_list_read_parameter_help_e,
+ fss_embedded_list_read_parameter_light_e,
+ fss_embedded_list_read_parameter_dark_e,
+ fss_embedded_list_read_parameter_no_color_e,
+ fss_embedded_list_read_parameter_verbosity_quiet_e,
+ fss_embedded_list_read_parameter_verbosity_normal_e,
+ fss_embedded_list_read_parameter_verbosity_verbose_e,
+ fss_embedded_list_read_parameter_verbosity_debug_e,
+ fss_embedded_list_read_parameter_version_e,
+
+ fss_embedded_list_read_parameter_at_e,
+ fss_embedded_list_read_parameter_content_e,
+ fss_embedded_list_read_parameter_columns_e,
+ fss_embedded_list_read_parameter_delimit_e,
+ fss_embedded_list_read_parameter_depth_e,
+ fss_embedded_list_read_parameter_empty_e,
+ fss_embedded_list_read_parameter_line_e,
+ fss_embedded_list_read_parameter_name_e,
+ fss_embedded_list_read_parameter_object_e,
+ fss_embedded_list_read_parameter_pipe_e,
+ fss_embedded_list_read_parameter_raw_e,
+ fss_embedded_list_read_parameter_select_e,
+ fss_embedded_list_read_parameter_total_e,
+ fss_embedded_list_read_parameter_trim_e,
+ };
+
+ #define fss_embedded_list_read_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(fss_embedded_list_read_short_at_s, fss_embedded_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_content_s, fss_embedded_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_columns_s, fss_embedded_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_delimit_s, fss_embedded_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_depth_s, fss_embedded_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_empty_s, fss_embedded_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_line_s, fss_embedded_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_name_s, fss_embedded_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_object_s, fss_embedded_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_pipe_s, fss_embedded_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_raw_s, fss_embedded_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_select_s, fss_embedded_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_embedded_list_read_total_parameters_d 23
+#endif // _di_fss_embedded_list_read_defines_
+
+#ifndef _di_fss_embedded_list_read_delimit_mode_
+ #define fss_embedded_list_read_delimit_mode_name_none_s "none"
+ #define fss_embedded_list_read_delimit_mode_name_all_s "all"
+ #define fss_embedded_list_read_delimit_mode_name_greater_s "+"
+ #define fss_embedded_list_read_delimit_mode_name_lesser_s "-"
+
+ #define fss_embedded_list_read_delimit_mode_name_none_s_length 4
+ #define fss_embedded_list_read_delimit_mode_name_all_s_length 3
+ #define fss_embedded_list_read_delimit_mode_name_greater_s_length 1
+ #define fss_embedded_list_read_delimit_mode_name_lesser_s_length 1
+
+ enum {
+ fss_embedded_list_read_delimit_mode_none_e = 1,
+ fss_embedded_list_read_delimit_mode_all_e,
+ fss_embedded_list_read_delimit_mode_depth_e,
+ fss_embedded_list_read_delimit_mode_depth_greater_e,
+ fss_embedded_list_read_delimit_mode_depth_lesser_e,
+ };
+#endif // _di_fss_embedded_list_read_delimit_modes_
+
+#ifndef _di_fss_embedded_list_read_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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_string_dynamic_t buffer;
+ f_fss_nest_t nest;
+ f_string_quantity_t quantity;
+
+ uint8_t delimit_mode;
+ f_array_length_t delimit_depth;
+
+ f_color_context_t context;
+ } fss_embedded_list_read_main_t;
+
+ #define fss_embedded_list_read_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_dynamic_t_initialize, \
+ f_fss_nest_t_initialize, \
+ f_string_quantity_t_initialize, \
+ fss_embedded_list_read_delimit_mode_all_e, \
+ 0, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_embedded_list_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_embedded_list_read_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_embedded_list_read_main()
+ */
+#ifndef _di_fss_embedded_list_read_main_delete_
+ extern f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main);
+#endif // _di_fss_embedded_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_embedded_list_read_common_h
if (arguments->argv[location][length - 1] == fss_embedded_list_read_delimit_mode_name_greater_s.string[0]) {
main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_greater_e;
- // shorten the length to better convert the remainder to a number.
+ // Shorten the length to better convert the remainder to a number.
--length;
}
else if (arguments->argv[location][length - 1] == fss_embedded_list_read_delimit_mode_name_lesser_s.string[0]) {
main->delimit_mode = fss_embedded_list_read_delimit_mode_depth_lesser_e;
- // shorten the length to better convert the remainder to a number.
+ // Shorten the length to better convert the remainder to a number.
--length;
}
f_string_range_t range = macro_f_string_range_t_initialize(length);
- // ignore leading plus sign.
+ // Ignore leading plus sign.
if (arguments->argv[location][0] == '+') {
++range.start;
}
}
#endif // _di_fss_embedded_list_read_main_
-#ifndef _di_fss_embedded_list_read_main_delete_
- f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- macro_f_fss_nest_t_delete_simple(main->nest);
-
- f_string_dynamic_resize(0, &main->buffer);
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_embedded_list_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Embedded List Read includes.
+#include <program/fss_embedded_list_read/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_embedded_list_read_signal_check_d 10000
-
- #define fss_embedded_list_read_pipe_content_end_s '\f'
- #define fss_embedded_list_read_pipe_content_ignore_s '\v'
- #define fss_embedded_list_read_pipe_content_start_s '\b'
-
- #define fss_embedded_list_read_short_at_s "a"
- #define fss_embedded_list_read_short_content_s "c"
- #define fss_embedded_list_read_short_columns_s "C"
- #define fss_embedded_list_read_short_delimit_s "D"
- #define fss_embedded_list_read_short_depth_s "d"
- #define fss_embedded_list_read_short_empty_s "e"
- #define fss_embedded_list_read_short_line_s "l"
- #define fss_embedded_list_read_short_name_s "n"
- #define fss_embedded_list_read_short_object_s "o"
- #define fss_embedded_list_read_short_pipe_s "p"
- #define fss_embedded_list_read_short_raw_s "R"
- #define fss_embedded_list_read_short_select_s "s"
- #define fss_embedded_list_read_short_total_s "t"
- #define fss_embedded_list_read_short_trim_s "T"
-
- #define fss_embedded_list_read_long_at_s "at"
- #define fss_embedded_list_read_long_content_s "content"
- #define fss_embedded_list_read_long_columns_s "columns"
- #define fss_embedded_list_read_long_delimit_s "delimit"
- #define fss_embedded_list_read_long_depth_s "depth"
- #define fss_embedded_list_read_long_empty_s "empty"
- #define fss_embedded_list_read_long_line_s "line"
- #define fss_embedded_list_read_long_name_s "name"
- #define fss_embedded_list_read_long_object_s "object"
- #define fss_embedded_list_read_long_pipe_s "pipe"
- #define fss_embedded_list_read_long_raw_s "raw"
- #define fss_embedded_list_read_long_select_s "select"
- #define fss_embedded_list_read_long_total_s "total"
- #define fss_embedded_list_read_long_trim_s "trim"
-
- enum {
- fss_embedded_list_read_parameter_help_e,
- fss_embedded_list_read_parameter_light_e,
- fss_embedded_list_read_parameter_dark_e,
- fss_embedded_list_read_parameter_no_color_e,
- fss_embedded_list_read_parameter_verbosity_quiet_e,
- fss_embedded_list_read_parameter_verbosity_normal_e,
- fss_embedded_list_read_parameter_verbosity_verbose_e,
- fss_embedded_list_read_parameter_verbosity_debug_e,
- fss_embedded_list_read_parameter_version_e,
-
- fss_embedded_list_read_parameter_at_e,
- fss_embedded_list_read_parameter_content_e,
- fss_embedded_list_read_parameter_columns_e,
- fss_embedded_list_read_parameter_delimit_e,
- fss_embedded_list_read_parameter_depth_e,
- fss_embedded_list_read_parameter_empty_e,
- fss_embedded_list_read_parameter_line_e,
- fss_embedded_list_read_parameter_name_e,
- fss_embedded_list_read_parameter_object_e,
- fss_embedded_list_read_parameter_pipe_e,
- fss_embedded_list_read_parameter_raw_e,
- fss_embedded_list_read_parameter_select_e,
- fss_embedded_list_read_parameter_total_e,
- fss_embedded_list_read_parameter_trim_e,
- };
-
- #define fss_embedded_list_read_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(fss_embedded_list_read_short_at_s, fss_embedded_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_content_s, fss_embedded_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_columns_s, fss_embedded_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_delimit_s, fss_embedded_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_depth_s, fss_embedded_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_empty_s, fss_embedded_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_line_s, fss_embedded_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_name_s, fss_embedded_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_object_s, fss_embedded_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_pipe_s, fss_embedded_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_raw_s, fss_embedded_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_select_s, fss_embedded_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_total_s, fss_embedded_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_read_short_trim_s, fss_embedded_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_embedded_list_read_total_parameters_d 23
-#endif // _di_fss_embedded_list_read_defines_
-
-#ifndef _di_fss_embedded_list_read_delimit_mode_
- #define fss_embedded_list_read_delimit_mode_name_none_s "none"
- #define fss_embedded_list_read_delimit_mode_name_all_s "all"
- #define fss_embedded_list_read_delimit_mode_name_greater_s "+"
- #define fss_embedded_list_read_delimit_mode_name_lesser_s "-"
-
- #define fss_embedded_list_read_delimit_mode_name_none_s_length 4
- #define fss_embedded_list_read_delimit_mode_name_all_s_length 3
- #define fss_embedded_list_read_delimit_mode_name_greater_s_length 1
- #define fss_embedded_list_read_delimit_mode_name_lesser_s_length 1
-
- enum {
- fss_embedded_list_read_delimit_mode_none_e = 1,
- fss_embedded_list_read_delimit_mode_all_e,
- fss_embedded_list_read_delimit_mode_depth_e,
- fss_embedded_list_read_delimit_mode_depth_greater_e,
- fss_embedded_list_read_delimit_mode_depth_lesser_e,
- };
-#endif // _di_fss_embedded_list_read_delimit_modes_
-
-#ifndef _di_fss_embedded_list_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_dynamic_t buffer;
- f_fss_nest_t nest;
- f_string_quantity_t quantity;
-
- uint8_t delimit_mode;
- f_array_length_t delimit_depth;
-
- f_color_context_t context;
- } fss_embedded_list_read_main_t;
-
- #define fss_embedded_list_read_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_dynamic_t_initialize, \
- f_fss_nest_t_initialize, \
- f_string_quantity_t_initialize, \
- fss_embedded_list_read_delimit_mode_all_e, \
- 0, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_embedded_list_read_main_t_
-
/**
* Print help.
*
extern f_status_t fss_embedded_list_read_main(fss_embedded_list_read_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_embedded_list_read_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_embedded_list_read_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_embedded_list_read_main()
- */
-#ifndef _di_fss_embedded_list_read_main_delete_
- extern f_status_t fss_embedded_list_read_main_delete(fss_embedded_list_read_main_t * const main);
-#endif // _di_fss_embedded_list_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_embedded_list_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_embedded_list_read.c common.c private-common.c private-print.c private-read.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 fss_embedded_list_read.h
+build_sources_headers fss_embedded_list_read.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_embedded_list_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_embedded_list_write_main_delete_
+ f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_embedded_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Embedded List Write
+ * 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 _fss_embedded_list_write_common_h
+#define _fss_embedded_list_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_embedded_list_write_signal_check_d 10000
+
+ #define fss_embedded_list_write_pipe_content_end_s '\f'
+ #define fss_embedded_list_write_pipe_content_ignore_s '\v'
+ #define fss_embedded_list_write_pipe_content_start_s '\b'
+
+ #define fss_embedded_list_write_short_file_s "f"
+ #define fss_embedded_list_write_short_content_s "c"
+ #define fss_embedded_list_write_short_double_s "d"
+ #define fss_embedded_list_write_short_ignore_s "I"
+ #define fss_embedded_list_write_short_object_s "o"
+ #define fss_embedded_list_write_short_partial_s "p"
+ #define fss_embedded_list_write_short_prepend_s "P"
+ #define fss_embedded_list_write_short_single_s "s"
+ #define fss_embedded_list_write_short_trim_s "T"
+
+ #define fss_embedded_list_write_long_file_s "file"
+ #define fss_embedded_list_write_long_content_s "content"
+ #define fss_embedded_list_write_long_double_s "double"
+ #define fss_embedded_list_write_long_ignore_s "ignore"
+ #define fss_embedded_list_write_long_object_s "object"
+ #define fss_embedded_list_write_long_partial_s "partial"
+ #define fss_embedded_list_write_long_prepend_s "prepend"
+ #define fss_embedded_list_write_long_single_s "single"
+ #define fss_embedded_list_write_long_trim_s "trim"
+
+ enum {
+ fss_embedded_list_write_parameter_help_e,
+ fss_embedded_list_write_parameter_light_e,
+ fss_embedded_list_write_parameter_dark_e,
+ fss_embedded_list_write_parameter_no_color_e,
+ fss_embedded_list_write_parameter_verbosity_quiet_e,
+ fss_embedded_list_write_parameter_verbosity_normal_e,
+ fss_embedded_list_write_parameter_verbosity_verbose_e,
+ fss_embedded_list_write_parameter_verbosity_debug_e,
+ fss_embedded_list_write_parameter_version_e,
+
+ fss_embedded_list_write_parameter_file_e,
+ fss_embedded_list_write_parameter_content_e,
+ fss_embedded_list_write_parameter_double_e,
+ fss_embedded_list_write_parameter_ignore_e,
+ fss_embedded_list_write_parameter_object_e,
+ fss_embedded_list_write_parameter_partial_e,
+ fss_embedded_list_write_parameter_prepend_e,
+ fss_embedded_list_write_parameter_single_e,
+ fss_embedded_list_write_parameter_trim_e,
+ };
+
+ #define fss_embedded_list_write_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, F_false, 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(fss_embedded_list_write_short_file_s, fss_embedded_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_content_s, fss_embedded_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_double_s, fss_embedded_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_ignore_s, fss_embedded_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_object_s, fss_embedded_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_partial_s, fss_embedded_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_prepend_s, fss_embedded_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_single_s, fss_embedded_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_trim_s, fss_embedded_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_embedded_list_write_total_parameters_d 18
+#endif // _di_fss_embedded_list_write_defines_
+
+#ifndef _di_fss_embedded_list_write_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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_string_static_t prepend;
+
+ f_color_context_t context;
+ } fss_embedded_list_write_main_t;
+
+ #define fss_embedded_list_write_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_static_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_embedded_list_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_embedded_list_write_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_embedded_list_write_main()
+ */
+#ifndef _di_fss_embedded_list_write_main_delete_
+ extern f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main);
+#endif // _di_fss_embedded_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_embedded_list_write_common_h
}
#endif // _di_fss_embedded_list_write_main_
-#ifndef _di_fss_embedded_list_write_main_delete_
- f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_embedded_list_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Embedded List Write includes.
+#include <program/fss_embedded_list_write/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_embedded_list_write_signal_check_d 10000
-
- #define fss_embedded_list_write_pipe_content_end_s '\f'
- #define fss_embedded_list_write_pipe_content_ignore_s '\v'
- #define fss_embedded_list_write_pipe_content_start_s '\b'
-
- #define fss_embedded_list_write_short_file_s "f"
- #define fss_embedded_list_write_short_content_s "c"
- #define fss_embedded_list_write_short_double_s "d"
- #define fss_embedded_list_write_short_ignore_s "I"
- #define fss_embedded_list_write_short_object_s "o"
- #define fss_embedded_list_write_short_partial_s "p"
- #define fss_embedded_list_write_short_prepend_s "P"
- #define fss_embedded_list_write_short_single_s "s"
- #define fss_embedded_list_write_short_trim_s "T"
-
- #define fss_embedded_list_write_long_file_s "file"
- #define fss_embedded_list_write_long_content_s "content"
- #define fss_embedded_list_write_long_double_s "double"
- #define fss_embedded_list_write_long_ignore_s "ignore"
- #define fss_embedded_list_write_long_object_s "object"
- #define fss_embedded_list_write_long_partial_s "partial"
- #define fss_embedded_list_write_long_prepend_s "prepend"
- #define fss_embedded_list_write_long_single_s "single"
- #define fss_embedded_list_write_long_trim_s "trim"
-
- enum {
- fss_embedded_list_write_parameter_help_e,
- fss_embedded_list_write_parameter_light_e,
- fss_embedded_list_write_parameter_dark_e,
- fss_embedded_list_write_parameter_no_color_e,
- fss_embedded_list_write_parameter_verbosity_quiet_e,
- fss_embedded_list_write_parameter_verbosity_normal_e,
- fss_embedded_list_write_parameter_verbosity_verbose_e,
- fss_embedded_list_write_parameter_verbosity_debug_e,
- fss_embedded_list_write_parameter_version_e,
-
- fss_embedded_list_write_parameter_file_e,
- fss_embedded_list_write_parameter_content_e,
- fss_embedded_list_write_parameter_double_e,
- fss_embedded_list_write_parameter_ignore_e,
- fss_embedded_list_write_parameter_object_e,
- fss_embedded_list_write_parameter_partial_e,
- fss_embedded_list_write_parameter_prepend_e,
- fss_embedded_list_write_parameter_single_e,
- fss_embedded_list_write_parameter_trim_e,
- };
-
- #define fss_embedded_list_write_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, F_false, 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(fss_embedded_list_write_short_file_s, fss_embedded_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_content_s, fss_embedded_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_double_s, fss_embedded_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_ignore_s, fss_embedded_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_object_s, fss_embedded_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_partial_s, fss_embedded_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_prepend_s, fss_embedded_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_single_s, fss_embedded_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_embedded_list_write_short_trim_s, fss_embedded_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_embedded_list_write_total_parameters_d 18
-#endif // _di_fss_embedded_list_write_defines_
-
-#ifndef _di_fss_embedded_list_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_static_t prepend;
-
- f_color_context_t context;
- } fss_embedded_list_write_main_t;
-
- #define fss_embedded_list_write_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_embedded_list_write_main_t_
-
/**
* Print help.
*
extern f_status_t fss_embedded_list_write_main(fss_embedded_list_write_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_embedded_list_write_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_embedded_list_write_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_embedded_list_write_main()
- */
-#ifndef _di_fss_embedded_list_write_main_delete_
- extern f_status_t fss_embedded_list_write_main_delete(fss_embedded_list_write_main_t * const main);
-#endif // _di_fss_embedded_list_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_embedded_list_write.c private-common.c private-write.c
+build_sources_library fss_embedded_list_write.c common.c private-common.c private-write.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 fss_embedded_list_write.h
+build_sources_headers fss_embedded_list_write.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_extended_list_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_list_read_main_delete_
+ f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended List Read
+ * 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 _fss_extended_list_read_common_h
+#define _fss_extended_list_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_extended_list_read_signal_check_d 10000
+
+ #define fss_extended_list_read_pipe_content_end '\f'
+ #define fss_extended_list_read_pipe_content_ignore '\v'
+ #define fss_extended_list_read_pipe_content_start '\b'
+
+ #define fss_extended_list_read_short_at_s "a"
+ #define fss_extended_list_read_short_content_s "c"
+ #define fss_extended_list_read_short_columns_s "C"
+ #define fss_extended_list_read_short_delimit_s "D"
+ #define fss_extended_list_read_short_depth_s "d"
+ #define fss_extended_list_read_short_empty_s "e"
+ #define fss_extended_list_read_short_line_s "l"
+ #define fss_extended_list_read_short_name_s "n"
+ #define fss_extended_list_read_short_object_s "o"
+ #define fss_extended_list_read_short_pipe_s "p"
+ #define fss_extended_list_read_short_raw_s "R"
+ #define fss_extended_list_read_short_select_s "s"
+ #define fss_extended_list_read_short_total_s "t"
+ #define fss_extended_list_read_short_trim_s "T"
+
+ #define fss_extended_list_read_long_at_s "at"
+ #define fss_extended_list_read_long_content_s "content"
+ #define fss_extended_list_read_long_columns_s "columns"
+ #define fss_extended_list_read_long_delimit_s "delimit"
+ #define fss_extended_list_read_long_depth_s "depth"
+ #define fss_extended_list_read_long_empty_s "empty"
+ #define fss_extended_list_read_long_line_s "line"
+ #define fss_extended_list_read_long_name_s "name"
+ #define fss_extended_list_read_long_object_s "object"
+ #define fss_extended_list_read_long_pipe_s "pipe"
+ #define fss_extended_list_read_long_raw_s "raw"
+ #define fss_extended_list_read_long_select_s "select"
+ #define fss_extended_list_read_long_total_s "total"
+ #define fss_extended_list_read_long_trim_s "trim"
+
+ enum {
+ fss_extended_list_read_parameter_help_e,
+ fss_extended_list_read_parameter_light_e,
+ fss_extended_list_read_parameter_dark_e,
+ fss_extended_list_read_parameter_no_color_e,
+ fss_extended_list_read_parameter_verbosity_quiet_e,
+ fss_extended_list_read_parameter_verbosity_normal_e,
+ fss_extended_list_read_parameter_verbosity_verbose_e,
+ fss_extended_list_read_parameter_verbosity_debug_e,
+ fss_extended_list_read_parameter_version_e,
+
+ fss_extended_list_read_parameter_at_e,
+ fss_extended_list_read_parameter_content_e,
+ fss_extended_list_read_parameter_columns_e,
+ fss_extended_list_read_parameter_delimit_e,
+ fss_extended_list_read_parameter_depth_e,
+ fss_extended_list_read_parameter_empty_e,
+ fss_extended_list_read_parameter_line_e,
+ fss_extended_list_read_parameter_name_e,
+ fss_extended_list_read_parameter_object_e,
+ fss_extended_list_read_parameter_pipe_e,
+ fss_extended_list_read_parameter_raw_e,
+ fss_extended_list_read_parameter_select_e,
+ fss_extended_list_read_parameter_total_e,
+ fss_extended_list_read_parameter_trim_e,
+ };
+
+ #define fss_extended_list_read_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, F_false, 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(fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_columns_s, fss_extended_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_delimit_s, fss_extended_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_depth_s, fss_extended_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_empty_s, fss_extended_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_line_s, fss_extended_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_name_s, fss_extended_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_object_s, fss_extended_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_pipe_s, fss_extended_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_raw_s, fss_extended_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_select_s, fss_extended_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_extended_list_read_total_parameters_d 23
+#endif // _di_fss_extended_list_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_extended_list_read_delimit_mode_*:
+ * - all: All delimits are to be aplied.
+ * - content: Content are to have delimits applied.
+ * - content_greater: Content at this number or higher are to have delimits applied.
+ * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ * - content_lesser: Content at this number or lower are to have delimits applied.
+ * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
+ * - content_object: Objects and Content are to have delimits applied
+ * - object: Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_extended_list_read_delimit_mode_
+ #define fss_extended_list_read_delimit_mode_name_none_s "none"
+ #define fss_extended_list_read_delimit_mode_name_all_s "all"
+ #define fss_extended_list_read_delimit_mode_name_object_s "object"
+ #define fss_extended_list_read_delimit_mode_name_greater_s "+"
+ #define fss_extended_list_read_delimit_mode_name_lesser_s "-"
+
+ #define fss_extended_list_read_delimit_mode_name_none_s_length 4
+ #define fss_extended_list_read_delimit_mode_name_all_s_length 3
+ #define fss_extended_list_read_delimit_mode_name_object_s_length 6
+ #define fss_extended_list_read_delimit_mode_name_greater_s_length 1
+ #define fss_extended_list_read_delimit_mode_name_lesser_s_length 1
+
+ enum {
+ fss_extended_list_read_delimit_mode_none_e = 1,
+ fss_extended_list_read_delimit_mode_all_e,
+ fss_extended_list_read_delimit_mode_content_e,
+ fss_extended_list_read_delimit_mode_content_greater_e,
+ fss_extended_list_read_delimit_mode_content_greater_object_e,
+ fss_extended_list_read_delimit_mode_content_lesser_e,
+ fss_extended_list_read_delimit_mode_content_lesser_object_e,
+ fss_extended_list_read_delimit_mode_content_object_e,
+ fss_extended_list_read_delimit_mode_object_e,
+ };
+#endif // _di_fss_extended_list_read_delimit_modes_
+
+#ifndef _di_fss_extended_list_read_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_extended_list_read_main_t;
+
+ #define fss_extended_list_read_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_extended_list_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_list_read_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_list_read_main()
+ */
+#ifndef _di_fss_extended_list_read_main_delete_
+ extern f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main);
+#endif // _di_fss_extended_list_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_list_read_common_h
}
#endif // _di_fss_extended_list_read_main_
-#ifndef _di_fss_extended_list_read_main_delete_
- f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_extended_list_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Extended List Read includes.
+#include <program/fss_extended_list_read/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_extended_list_read_signal_check_d 10000
-
- #define fss_extended_list_read_pipe_content_end '\f'
- #define fss_extended_list_read_pipe_content_ignore '\v'
- #define fss_extended_list_read_pipe_content_start '\b'
-
- #define fss_extended_list_read_short_at_s "a"
- #define fss_extended_list_read_short_content_s "c"
- #define fss_extended_list_read_short_columns_s "C"
- #define fss_extended_list_read_short_delimit_s "D"
- #define fss_extended_list_read_short_depth_s "d"
- #define fss_extended_list_read_short_empty_s "e"
- #define fss_extended_list_read_short_line_s "l"
- #define fss_extended_list_read_short_name_s "n"
- #define fss_extended_list_read_short_object_s "o"
- #define fss_extended_list_read_short_pipe_s "p"
- #define fss_extended_list_read_short_raw_s "R"
- #define fss_extended_list_read_short_select_s "s"
- #define fss_extended_list_read_short_total_s "t"
- #define fss_extended_list_read_short_trim_s "T"
-
- #define fss_extended_list_read_long_at_s "at"
- #define fss_extended_list_read_long_content_s "content"
- #define fss_extended_list_read_long_columns_s "columns"
- #define fss_extended_list_read_long_delimit_s "delimit"
- #define fss_extended_list_read_long_depth_s "depth"
- #define fss_extended_list_read_long_empty_s "empty"
- #define fss_extended_list_read_long_line_s "line"
- #define fss_extended_list_read_long_name_s "name"
- #define fss_extended_list_read_long_object_s "object"
- #define fss_extended_list_read_long_pipe_s "pipe"
- #define fss_extended_list_read_long_raw_s "raw"
- #define fss_extended_list_read_long_select_s "select"
- #define fss_extended_list_read_long_total_s "total"
- #define fss_extended_list_read_long_trim_s "trim"
-
- enum {
- fss_extended_list_read_parameter_help_e,
- fss_extended_list_read_parameter_light_e,
- fss_extended_list_read_parameter_dark_e,
- fss_extended_list_read_parameter_no_color_e,
- fss_extended_list_read_parameter_verbosity_quiet_e,
- fss_extended_list_read_parameter_verbosity_normal_e,
- fss_extended_list_read_parameter_verbosity_verbose_e,
- fss_extended_list_read_parameter_verbosity_debug_e,
- fss_extended_list_read_parameter_version_e,
-
- fss_extended_list_read_parameter_at_e,
- fss_extended_list_read_parameter_content_e,
- fss_extended_list_read_parameter_columns_e,
- fss_extended_list_read_parameter_delimit_e,
- fss_extended_list_read_parameter_depth_e,
- fss_extended_list_read_parameter_empty_e,
- fss_extended_list_read_parameter_line_e,
- fss_extended_list_read_parameter_name_e,
- fss_extended_list_read_parameter_object_e,
- fss_extended_list_read_parameter_pipe_e,
- fss_extended_list_read_parameter_raw_e,
- fss_extended_list_read_parameter_select_e,
- fss_extended_list_read_parameter_total_e,
- fss_extended_list_read_parameter_trim_e,
- };
-
- #define fss_extended_list_read_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, F_false, 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(fss_extended_list_read_short_at_s, fss_extended_list_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_content_s, fss_extended_list_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_columns_s, fss_extended_list_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_delimit_s, fss_extended_list_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_depth_s, fss_extended_list_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_empty_s, fss_extended_list_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_line_s, fss_extended_list_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_name_s, fss_extended_list_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_object_s, fss_extended_list_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_pipe_s, fss_extended_list_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_raw_s, fss_extended_list_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_select_s, fss_extended_list_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_total_s, fss_extended_list_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_read_short_trim_s, fss_extended_list_read_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_extended_list_read_total_parameters_d 23
-#endif // _di_fss_extended_list_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_extended_list_read_delimit_mode_*:
- * - all: All delimits are to be aplied.
- * - content: Content are to have delimits applied.
- * - content_greater: Content at this number or higher are to have delimits applied.
- * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- * - content_lesser: Content at this number or lower are to have delimits applied.
- * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
- * - content_object: Objects and Content are to have delimits applied
- * - object: Objects arre to have delimits applied.
- */
-#ifndef _di_fss_extended_list_read_delimit_mode_
- #define fss_extended_list_read_delimit_mode_name_none_s "none"
- #define fss_extended_list_read_delimit_mode_name_all_s "all"
- #define fss_extended_list_read_delimit_mode_name_object_s "object"
- #define fss_extended_list_read_delimit_mode_name_greater_s "+"
- #define fss_extended_list_read_delimit_mode_name_lesser_s "-"
-
- #define fss_extended_list_read_delimit_mode_name_none_s_length 4
- #define fss_extended_list_read_delimit_mode_name_all_s_length 3
- #define fss_extended_list_read_delimit_mode_name_object_s_length 6
- #define fss_extended_list_read_delimit_mode_name_greater_s_length 1
- #define fss_extended_list_read_delimit_mode_name_lesser_s_length 1
-
- enum {
- fss_extended_list_read_delimit_mode_none_e = 1,
- fss_extended_list_read_delimit_mode_all_e,
- fss_extended_list_read_delimit_mode_content_e,
- fss_extended_list_read_delimit_mode_content_greater_e,
- fss_extended_list_read_delimit_mode_content_greater_object_e,
- fss_extended_list_read_delimit_mode_content_lesser_e,
- fss_extended_list_read_delimit_mode_content_lesser_object_e,
- fss_extended_list_read_delimit_mode_content_object_e,
- fss_extended_list_read_delimit_mode_object_e,
- };
-#endif // _di_fss_extended_list_read_delimit_modes_
-
-#ifndef _di_fss_extended_list_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_extended_list_read_main_t;
-
- #define fss_extended_list_read_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_list_read_main_t_
-
/**
* Print help.
*
extern f_status_t fss_extended_list_read_main(fss_extended_list_read_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_list_read_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_list_read_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_list_read_main()
- */
-#ifndef _di_fss_extended_list_read_main_delete_
- extern f_status_t fss_extended_list_read_main_delete(fss_extended_list_read_main_t *main);
-#endif // _di_fss_extended_list_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_extended_list_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_extended_list_read.c common.c private-common.c private-print.c private-read.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 fss_extended_list_read.h
+build_sources_headers fss_extended_list_read.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_extended_list_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_list_write_main_delete_
+ f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended List Write
+ * 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 _fss_extended_list_write_common_h
+#define _fss_extended_list_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_extended_list_write_signal_check_d 10000
+
+ #define fss_extended_list_write_pipe_content_end_s '\f'
+ #define fss_extended_list_write_pipe_content_ignore_s '\v'
+ #define fss_extended_list_write_pipe_content_start_s '\b'
+
+ #define fss_extended_list_write_short_file_s "f"
+ #define fss_extended_list_write_short_content_s "c"
+ #define fss_extended_list_write_short_double_s "d"
+ #define fss_extended_list_write_short_ignore_s "I"
+ #define fss_extended_list_write_short_object_s "o"
+ #define fss_extended_list_write_short_partial_s "p"
+ #define fss_extended_list_write_short_prepend_s "P"
+ #define fss_extended_list_write_short_single_s "s"
+ #define fss_extended_list_write_short_trim_s "T"
+
+ #define fss_extended_list_write_long_file_s "file"
+ #define fss_extended_list_write_long_content_s "content"
+ #define fss_extended_list_write_long_double_s "double"
+ #define fss_extended_list_write_long_ignore_s "ignore"
+ #define fss_extended_list_write_long_object_s "object"
+ #define fss_extended_list_write_long_partial_s "partial"
+ #define fss_extended_list_write_long_prepend_s "prepend"
+ #define fss_extended_list_write_long_single_s "single"
+ #define fss_extended_list_write_long_trim_s "trim"
+
+ enum {
+ fss_extended_list_write_parameter_help_e,
+ fss_extended_list_write_parameter_light_e,
+ fss_extended_list_write_parameter_dark_e,
+ fss_extended_list_write_parameter_no_color_e,
+ fss_extended_list_write_parameter_verbosity_quiet_e,
+ fss_extended_list_write_parameter_verbosity_normal_e,
+ fss_extended_list_write_parameter_verbosity_verbose_e,
+ fss_extended_list_write_parameter_verbosity_debug_e,
+ fss_extended_list_write_parameter_version_e,
+
+ fss_extended_list_write_parameter_file_e,
+ fss_extended_list_write_parameter_content_e,
+ fss_extended_list_write_parameter_double_e,
+ fss_extended_list_write_parameter_ignore_e,
+ fss_extended_list_write_parameter_object_e,
+ fss_extended_list_write_parameter_partial_e,
+ fss_extended_list_write_parameter_prepend_e,
+ fss_extended_list_write_parameter_single_e,
+ fss_extended_list_write_parameter_trim_e,
+ };
+
+ #define fss_extended_list_write_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, F_false, 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(fss_extended_list_write_short_file_s, fss_extended_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_content_s, fss_extended_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_double_s, fss_extended_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_ignore_s, fss_extended_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_object_s, fss_extended_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_partial_s, fss_extended_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_prepend_s, fss_extended_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_single_s, fss_extended_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_list_write_short_trim_s, fss_extended_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_extended_list_write_total_parameters_d 18
+#endif // _di_fss_extended_list_write_defines_
+
+#ifndef _di_fss_extended_list_write_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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_string_static_t prepend;
+
+ f_color_context_t context;
+ } fss_extended_list_write_main_t;
+
+ #define fss_extended_list_write_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_static_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_extended_list_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_list_write_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_list_write_main()
+ */
+#ifndef _di_fss_extended_list_write_main_delete_
+ extern f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main);
+#endif // _di_fss_extended_list_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_list_write_common_h
}
#endif // _di_fss_extended_list_write_main_
-#ifndef _di_fss_extended_list_write_main_delete_
- f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_extended_list_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Extended List Write includes.
+#include <program/fss_extended_list_write/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_extended_list_write_signal_check_d 10000
-
- #define fss_extended_list_write_pipe_content_end_s '\f'
- #define fss_extended_list_write_pipe_content_ignore_s '\v'
- #define fss_extended_list_write_pipe_content_start_s '\b'
-
- #define fss_extended_list_write_short_file_s "f"
- #define fss_extended_list_write_short_content_s "c"
- #define fss_extended_list_write_short_double_s "d"
- #define fss_extended_list_write_short_ignore_s "I"
- #define fss_extended_list_write_short_object_s "o"
- #define fss_extended_list_write_short_partial_s "p"
- #define fss_extended_list_write_short_prepend_s "P"
- #define fss_extended_list_write_short_single_s "s"
- #define fss_extended_list_write_short_trim_s "T"
-
- #define fss_extended_list_write_long_file_s "file"
- #define fss_extended_list_write_long_content_s "content"
- #define fss_extended_list_write_long_double_s "double"
- #define fss_extended_list_write_long_ignore_s "ignore"
- #define fss_extended_list_write_long_object_s "object"
- #define fss_extended_list_write_long_partial_s "partial"
- #define fss_extended_list_write_long_prepend_s "prepend"
- #define fss_extended_list_write_long_single_s "single"
- #define fss_extended_list_write_long_trim_s "trim"
-
- enum {
- fss_extended_list_write_parameter_help_e,
- fss_extended_list_write_parameter_light_e,
- fss_extended_list_write_parameter_dark_e,
- fss_extended_list_write_parameter_no_color_e,
- fss_extended_list_write_parameter_verbosity_quiet_e,
- fss_extended_list_write_parameter_verbosity_normal_e,
- fss_extended_list_write_parameter_verbosity_verbose_e,
- fss_extended_list_write_parameter_verbosity_debug_e,
- fss_extended_list_write_parameter_version_e,
-
- fss_extended_list_write_parameter_file_e,
- fss_extended_list_write_parameter_content_e,
- fss_extended_list_write_parameter_double_e,
- fss_extended_list_write_parameter_ignore_e,
- fss_extended_list_write_parameter_object_e,
- fss_extended_list_write_parameter_partial_e,
- fss_extended_list_write_parameter_prepend_e,
- fss_extended_list_write_parameter_single_e,
- fss_extended_list_write_parameter_trim_e,
- };
-
- #define fss_extended_list_write_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, F_false, 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(fss_extended_list_write_short_file_s, fss_extended_list_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_content_s, fss_extended_list_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_double_s, fss_extended_list_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_ignore_s, fss_extended_list_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_object_s, fss_extended_list_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_partial_s, fss_extended_list_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_prepend_s, fss_extended_list_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_single_s, fss_extended_list_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_list_write_short_trim_s, fss_extended_list_write_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_extended_list_write_total_parameters_d 18
-#endif // _di_fss_extended_list_write_defines_
-
-#ifndef _di_fss_extended_list_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_static_t prepend;
-
- f_color_context_t context;
- } fss_extended_list_write_main_t;
-
- #define fss_extended_list_write_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_list_write_main_t_
-
/**
* Print help.
*
extern f_status_t fss_extended_list_write_main(fss_extended_list_write_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_list_write_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_list_write_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_list_write_main()
- */
-#ifndef _di_fss_extended_list_write_main_delete_
- extern f_status_t fss_extended_list_write_main_delete(fss_extended_list_write_main_t *main);
-#endif // _di_fss_extended_list_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_extended_list_write.c private-common.c private-write.c
+build_sources_library fss_extended_list_write.c common.c private-common.c private-write.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 fss_extended_list_write.h
+build_sources_headers fss_extended_list_write.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_extended_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_read_main_delete_
+ f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended Read
+ * 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 _fss_extended_read_common_h
+#define _fss_extended_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_extended_read_signal_check_d 10000
+
+ #define fss_extended_read_pipe_content_end_s '\f'
+ #define fss_extended_read_pipe_content_ignore_s '\v'
+ #define fss_extended_read_pipe_content_start_s '\b'
+
+ #define fss_extended_read_short_at_s "a"
+ #define fss_extended_read_short_content_s "c"
+ #define fss_extended_read_short_columns_s "C"
+ #define fss_extended_read_short_delimit_s "D"
+ #define fss_extended_read_short_depth_s "d"
+ #define fss_extended_read_short_empty_s "e"
+ #define fss_extended_read_short_line_s "l"
+ #define fss_extended_read_short_name_s "n"
+ #define fss_extended_read_short_object_s "o"
+ #define fss_extended_read_short_pipe_s "p"
+ #define fss_extended_read_short_raw_s "R"
+ #define fss_extended_read_short_select_s "s"
+ #define fss_extended_read_short_total_s "t"
+ #define fss_extended_read_short_trim_s "T"
+
+ #define fss_extended_read_long_at_s "at"
+ #define fss_extended_read_long_content_s "content"
+ #define fss_extended_read_long_columns_s "columns"
+ #define fss_extended_read_long_delimit_s "delimit"
+ #define fss_extended_read_long_depth_s "depth"
+ #define fss_extended_read_long_empty_s "empty"
+ #define fss_extended_read_long_line_s "line"
+ #define fss_extended_read_long_name_s "name"
+ #define fss_extended_read_long_object_s "object"
+ #define fss_extended_read_long_pipe_s "pipe"
+ #define fss_extended_read_long_raw_s "raw"
+ #define fss_extended_read_long_select_s "select"
+ #define fss_extended_read_long_total_s "total"
+ #define fss_extended_read_long_trim_s "trim"
+
+ enum {
+ fss_extended_read_parameter_help_e,
+ fss_extended_read_parameter_light_e,
+ fss_extended_read_parameter_dark_e,
+ fss_extended_read_parameter_no_color_e,
+ fss_extended_read_parameter_verbosity_quiet_e,
+ fss_extended_read_parameter_verbosity_normal_e,
+ fss_extended_read_parameter_verbosity_verbose_e,
+ fss_extended_read_parameter_verbosity_debug_e,
+ fss_extended_read_parameter_version_e,
+
+ fss_extended_read_parameter_at_e,
+ fss_extended_read_parameter_content_e,
+ fss_extended_read_parameter_columns_e,
+ fss_extended_read_parameter_delimit_e,
+ fss_extended_read_parameter_depth_e,
+ fss_extended_read_parameter_empty_e,
+ fss_extended_read_parameter_line_e,
+ fss_extended_read_parameter_name_e,
+ fss_extended_read_parameter_object_e,
+ fss_extended_read_parameter_pipe_e,
+ fss_extended_read_parameter_raw_e,
+ fss_extended_read_parameter_select_e,
+ fss_extended_read_parameter_total_e,
+ fss_extended_read_parameter_trim_e,
+ };
+
+ #define fss_extended_read_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(fss_extended_read_short_at_s, fss_extended_read_long_at_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_content_s, fss_extended_read_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_delimit_s, fss_extended_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_depth_s, fss_extended_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_empty_s, fss_extended_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_line_s, fss_extended_read_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_name_s, fss_extended_read_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_object_s, fss_extended_read_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_pipe_s, fss_extended_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_raw_s, fss_extended_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_select_s, fss_extended_read_long_select_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_total_s, fss_extended_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_extended_read_total_parameters_d 23
+#endif // _di_fss_extended_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_extended_read_delimit_mode_*:
+ * - all: All delimits are to be aplied.
+ * - content: Content are to have delimits applied.
+ * - content_greater: Content at this number or higher are to have delimits applied.
+ * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ * - content_lesser: Content at this number or lower are to have delimits applied.
+ * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
+ * - content_object: Objects and Content are to have delimits applied
+ * - object: Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_extended_read_delimit_mode_
+ #define fss_extended_read_delimit_mode_name_none "none"
+ #define fss_extended_read_delimit_mode_name_all "all"
+ #define fss_extended_read_delimit_mode_name_object "object"
+ #define fss_extended_read_delimit_mode_name_greater "+"
+ #define fss_extended_read_delimit_mode_name_lesser "-"
+
+ #define fss_extended_read_delimit_mode_name_none_length 4
+ #define fss_extended_read_delimit_mode_name_all_length 3
+ #define fss_extended_read_delimit_mode_name_object_length 6
+ #define fss_extended_read_delimit_mode_name_greater_length 1
+ #define fss_extended_read_delimit_mode_name_lesser_length 1
+
+ enum {
+ fss_extended_read_delimit_mode_none_e = 1,
+ fss_extended_read_delimit_mode_all_e,
+ fss_extended_read_delimit_mode_content_e,
+ fss_extended_read_delimit_mode_content_greater_e,
+ fss_extended_read_delimit_mode_content_greater_object_e,
+ fss_extended_read_delimit_mode_content_lesser_e,
+ fss_extended_read_delimit_mode_content_lesser_object_e,
+ fss_extended_read_delimit_mode_content_object_e,
+ fss_extended_read_delimit_mode_object_e,
+ };
+#endif // _di_fss_extended_read_delimit_modes_
+
+
+#ifndef _di_fss_extended_read_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_extended_read_main_t;
+
+ #define fss_extended_read_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_extended_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_read_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_read_main()
+ */
+#ifndef _di_fss_extended_read_main_delete_
+ extern f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main);
+#endif // _di_fss_extended_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_read_common_h
}
#endif // _di_fss_extended_read_main_
-#ifndef _di_fss_extended_read_main_delete_
- f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_extended_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Extended Read includes.
+#include <program/fss_extended_read/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_extended_read_signal_check_d 10000
-
- #define fss_extended_read_pipe_content_end_s '\f'
- #define fss_extended_read_pipe_content_ignore_s '\v'
- #define fss_extended_read_pipe_content_start_s '\b'
-
- #define fss_extended_read_short_at_s "a"
- #define fss_extended_read_short_content_s "c"
- #define fss_extended_read_short_columns_s "C"
- #define fss_extended_read_short_delimit_s "D"
- #define fss_extended_read_short_depth_s "d"
- #define fss_extended_read_short_empty_s "e"
- #define fss_extended_read_short_line_s "l"
- #define fss_extended_read_short_name_s "n"
- #define fss_extended_read_short_object_s "o"
- #define fss_extended_read_short_pipe_s "p"
- #define fss_extended_read_short_raw_s "R"
- #define fss_extended_read_short_select_s "s"
- #define fss_extended_read_short_total_s "t"
- #define fss_extended_read_short_trim_s "T"
-
- #define fss_extended_read_long_at_s "at"
- #define fss_extended_read_long_content_s "content"
- #define fss_extended_read_long_columns_s "columns"
- #define fss_extended_read_long_delimit_s "delimit"
- #define fss_extended_read_long_depth_s "depth"
- #define fss_extended_read_long_empty_s "empty"
- #define fss_extended_read_long_line_s "line"
- #define fss_extended_read_long_name_s "name"
- #define fss_extended_read_long_object_s "object"
- #define fss_extended_read_long_pipe_s "pipe"
- #define fss_extended_read_long_raw_s "raw"
- #define fss_extended_read_long_select_s "select"
- #define fss_extended_read_long_total_s "total"
- #define fss_extended_read_long_trim_s "trim"
-
- enum {
- fss_extended_read_parameter_help_e,
- fss_extended_read_parameter_light_e,
- fss_extended_read_parameter_dark_e,
- fss_extended_read_parameter_no_color_e,
- fss_extended_read_parameter_verbosity_quiet_e,
- fss_extended_read_parameter_verbosity_normal_e,
- fss_extended_read_parameter_verbosity_verbose_e,
- fss_extended_read_parameter_verbosity_debug_e,
- fss_extended_read_parameter_version_e,
-
- fss_extended_read_parameter_at_e,
- fss_extended_read_parameter_content_e,
- fss_extended_read_parameter_columns_e,
- fss_extended_read_parameter_delimit_e,
- fss_extended_read_parameter_depth_e,
- fss_extended_read_parameter_empty_e,
- fss_extended_read_parameter_line_e,
- fss_extended_read_parameter_name_e,
- fss_extended_read_parameter_object_e,
- fss_extended_read_parameter_pipe_e,
- fss_extended_read_parameter_raw_e,
- fss_extended_read_parameter_select_e,
- fss_extended_read_parameter_total_e,
- fss_extended_read_parameter_trim_e,
- };
-
- #define fss_extended_read_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(fss_extended_read_short_at_s, fss_extended_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_content_s, fss_extended_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_columns_s, fss_extended_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_delimit_s, fss_extended_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_depth_s, fss_extended_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_empty_s, fss_extended_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_line_s, fss_extended_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_name_s, fss_extended_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_object_s, fss_extended_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_pipe_s, fss_extended_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_raw_s, fss_extended_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_select_s, fss_extended_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_total_s, fss_extended_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_read_short_trim_s, fss_extended_read_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_extended_read_total_parameters_d 23
-#endif // _di_fss_extended_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_extended_read_delimit_mode_*:
- * - all: All delimits are to be aplied.
- * - content: Content are to have delimits applied.
- * - content_greater: Content at this number or higher are to have delimits applied.
- * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- * - content_lesser: Content at this number or lower are to have delimits applied.
- * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
- * - content_object: Objects and Content are to have delimits applied
- * - object: Objects arre to have delimits applied.
- */
-#ifndef _di_fss_extended_read_delimit_mode_
- #define fss_extended_read_delimit_mode_name_none "none"
- #define fss_extended_read_delimit_mode_name_all "all"
- #define fss_extended_read_delimit_mode_name_object "object"
- #define fss_extended_read_delimit_mode_name_greater "+"
- #define fss_extended_read_delimit_mode_name_lesser "-"
-
- #define fss_extended_read_delimit_mode_name_none_length 4
- #define fss_extended_read_delimit_mode_name_all_length 3
- #define fss_extended_read_delimit_mode_name_object_length 6
- #define fss_extended_read_delimit_mode_name_greater_length 1
- #define fss_extended_read_delimit_mode_name_lesser_length 1
-
- enum {
- fss_extended_read_delimit_mode_none_e = 1,
- fss_extended_read_delimit_mode_all_e,
- fss_extended_read_delimit_mode_content_e,
- fss_extended_read_delimit_mode_content_greater_e,
- fss_extended_read_delimit_mode_content_greater_object_e,
- fss_extended_read_delimit_mode_content_lesser_e,
- fss_extended_read_delimit_mode_content_lesser_object_e,
- fss_extended_read_delimit_mode_content_object_e,
- fss_extended_read_delimit_mode_object_e,
- };
-#endif // _di_fss_extended_read_delimit_modes_
-
-
-#ifndef _di_fss_extended_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_extended_read_main_t;
-
- #define fss_extended_read_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_read_main_t_
-
/**
* Print help.
*
extern f_status_t fss_extended_read_main(fss_extended_read_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_read_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_read_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_read_main()
- */
-#ifndef _di_fss_extended_read_main_delete_
- extern f_status_t fss_extended_read_main_delete(fss_extended_read_main_t * const main);
-#endif // _di_fss_extended_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_extended_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_extended_read.c common.c private-common.c private-print.c private-read.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 fss_extended_read.h
+build_sources_headers fss_extended_read.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_extended_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_extended_write_main_delete_
+ f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_extended_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Extended Write
+ * 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 _fss_extended_write_common_h
+#define _fss_extended_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_extended_write_signal_check_d 10000
+
+ #define fss_extended_write_pipe_content_end_s '\f'
+ #define fss_extended_write_pipe_content_ignore_s '\v'
+ #define fss_extended_write_pipe_content_start_s '\b'
+
+ #define fss_extended_write_short_file_s "f"
+ #define fss_extended_write_short_content_s "c"
+ #define fss_extended_write_short_double_s "d"
+ #define fss_extended_write_short_ignore_s "I"
+ #define fss_extended_write_short_object_s "o"
+ #define fss_extended_write_short_partial_s "p"
+ #define fss_extended_write_short_prepend_s "P"
+ #define fss_extended_write_short_single_s "s"
+ #define fss_extended_write_short_trim_s "T"
+
+ #define fss_extended_write_long_file_s "file"
+ #define fss_extended_write_long_content_s "content"
+ #define fss_extended_write_long_double_s "double"
+ #define fss_extended_write_long_ignore_s "ignore"
+ #define fss_extended_write_long_object_s "object"
+ #define fss_extended_write_long_partial_s "partial"
+ #define fss_extended_write_long_prepend_s "prepend"
+ #define fss_extended_write_long_single_s "single"
+ #define fss_extended_write_long_trim_s "trim"
+
+ enum {
+ fss_extended_write_parameter_help_e,
+ fss_extended_write_parameter_light_e,
+ fss_extended_write_parameter_dark_e,
+ fss_extended_write_parameter_no_color_e,
+ fss_extended_write_parameter_verbosity_quiet_e,
+ fss_extended_write_parameter_verbosity_normal_e,
+ fss_extended_write_parameter_verbosity_verbose_e,
+ fss_extended_write_parameter_verbosity_debug_e,
+ fss_extended_write_parameter_version_e,
+
+ fss_extended_write_parameter_file_e,
+ fss_extended_write_parameter_content_e,
+ fss_extended_write_parameter_double_e,
+ fss_extended_write_parameter_ignore_e,
+ fss_extended_write_parameter_object_e,
+ fss_extended_write_parameter_partial_e,
+ fss_extended_write_parameter_prepend_e,
+ fss_extended_write_parameter_single_e,
+ fss_extended_write_parameter_trim_e,
+ };
+
+ #define fss_extended_write_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, F_false, f_console_type_inverse_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_file_s, fss_extended_write_long_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_content_s, fss_extended_write_long_content_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_double_s, fss_extended_write_long_double_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_ignore_s, fss_extended_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_object_s, fss_extended_write_long_object_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_partial_s, fss_extended_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_prepend_s, fss_extended_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_single_s, fss_extended_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_extended_write_short_trim_s, fss_extended_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_extended_write_total_parameters_d 18
+#endif // _di_fss_extended_write_defines_
+
+#ifndef _di_fss_extended_write_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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_string_static_t prepend;
+
+ f_color_context_t context;
+ } fss_extended_write_main_t;
+
+ #define fss_extended_write_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_static_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_extended_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_extended_write_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_extended_write_main()
+ */
+#ifndef _di_fss_extended_write_main_delete_
+ extern f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main);
+#endif // _di_fss_extended_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_extended_write_common_h
}
#endif // _di_fss_extended_write_main_
-#ifndef _di_fss_extended_write_main_delete_
- f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_extended_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Extended Write includes.
+#include <program/fss_extended_write/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_extended_write_signal_check_d 10000
-
- #define fss_extended_write_pipe_content_end_s '\f'
- #define fss_extended_write_pipe_content_ignore_s '\v'
- #define fss_extended_write_pipe_content_start_s '\b'
-
- #define fss_extended_write_short_file_s "f"
- #define fss_extended_write_short_content_s "c"
- #define fss_extended_write_short_double_s "d"
- #define fss_extended_write_short_ignore_s "I"
- #define fss_extended_write_short_object_s "o"
- #define fss_extended_write_short_partial_s "p"
- #define fss_extended_write_short_prepend_s "P"
- #define fss_extended_write_short_single_s "s"
- #define fss_extended_write_short_trim_s "T"
-
- #define fss_extended_write_long_file_s "file"
- #define fss_extended_write_long_content_s "content"
- #define fss_extended_write_long_double_s "double"
- #define fss_extended_write_long_ignore_s "ignore"
- #define fss_extended_write_long_object_s "object"
- #define fss_extended_write_long_partial_s "partial"
- #define fss_extended_write_long_prepend_s "prepend"
- #define fss_extended_write_long_single_s "single"
- #define fss_extended_write_long_trim_s "trim"
-
- enum {
- fss_extended_write_parameter_help_e,
- fss_extended_write_parameter_light_e,
- fss_extended_write_parameter_dark_e,
- fss_extended_write_parameter_no_color_e,
- fss_extended_write_parameter_verbosity_quiet_e,
- fss_extended_write_parameter_verbosity_normal_e,
- fss_extended_write_parameter_verbosity_verbose_e,
- fss_extended_write_parameter_verbosity_debug_e,
- fss_extended_write_parameter_version_e,
-
- fss_extended_write_parameter_file_e,
- fss_extended_write_parameter_content_e,
- fss_extended_write_parameter_double_e,
- fss_extended_write_parameter_ignore_e,
- fss_extended_write_parameter_object_e,
- fss_extended_write_parameter_partial_e,
- fss_extended_write_parameter_prepend_e,
- fss_extended_write_parameter_single_e,
- fss_extended_write_parameter_trim_e,
- };
-
- #define fss_extended_write_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, F_false, f_console_type_inverse_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_file_s, fss_extended_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_content_s, fss_extended_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_double_s, fss_extended_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_ignore_s, fss_extended_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_object_s, fss_extended_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_partial_s, fss_extended_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_prepend_s, fss_extended_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_single_s, fss_extended_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_extended_write_short_trim_s, fss_extended_write_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_extended_write_total_parameters_d 18
-#endif // _di_fss_extended_write_defines_
-
-#ifndef _di_fss_extended_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_static_t prepend;
-
- f_color_context_t context;
- } fss_extended_write_main_t;
-
- #define fss_extended_write_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_extended_write_main_t_
-
/**
* Print help.
*
extern f_status_t fss_extended_write_main(fss_extended_write_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_extended_write_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_extended_write_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_extended_write_main()
- */
-#ifndef _di_fss_extended_write_main_delete_
- extern f_status_t fss_extended_write_main_delete(fss_extended_write_main_t * const main);
-#endif // _di_fss_extended_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_extended_write.c private-common.c private-write.c
+build_sources_library fss_extended_write.c common.c private-common.c private-write.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 fss_extended_write.h
+build_sources_headers fss_extended_write.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_identify.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_identify_main_delete_
+ f_status_t fss_identify_main_delete(fss_identify_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_identify_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Identify
+ * 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 _fss_identify_common_h
+#define _fss_identify_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_identify_signal_check_d 10000
+
+ #define fss_identify_short_content_s "c"
+ #define fss_identify_short_line_s "l"
+ #define fss_identify_short_name_s "n"
+ #define fss_identify_short_object_s "o"
+ #define fss_identify_short_total_s "t"
+
+ #define fss_identify_long_content_s "content"
+ #define fss_identify_long_line_s "line"
+ #define fss_identify_long_name_s "name"
+ #define fss_identify_long_object_s "object"
+ #define fss_identify_long_total_s "total"
+
+ enum {
+ fss_identify_parameter_help_e,
+ fss_identify_parameter_light_e,
+ fss_identify_parameter_dark_e,
+ fss_identify_parameter_no_color_e,
+ fss_identify_parameter_verbosity_quiet_e,
+ fss_identify_parameter_verbosity_normal_e,
+ fss_identify_parameter_verbosity_verbose_e,
+ fss_identify_parameter_verbosity_debug_e,
+ fss_identify_parameter_version_e,
+
+ fss_identify_parameter_content_e,
+ fss_identify_parameter_line_e,
+ fss_identify_parameter_name_e,
+ fss_identify_parameter_object_e,
+ fss_identify_parameter_total_e,
+ };
+
+ #define fss_identify_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(fss_identify_short_content_s, fss_identify_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_line_s, fss_identify_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_name_s, fss_identify_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_object_s, fss_identify_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_identify_short_total_s, fss_identify_long_total_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_identify_total_parameters_d 14
+#endif // _di_fss_identify_defines_
+
+#ifndef _di_fss_identify_data_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_identify_main_t;
+
+ #define fss_identify_data_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_identify_data_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_identify_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_identify_main()
+ */
+#ifndef _di_fss_identify_main_delete_
+ extern f_status_t fss_identify_main_delete(fss_identify_main_t * const main);
+#endif // _di_fss_identify_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_identify_common_h
}
#endif // _di_fss_identify_main_
-#ifndef _di_fss_identify_main_delete_
- f_status_t fss_identify_main_delete(fss_identify_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_identify_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Identify includes.
+#include <program/fss_identify/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_identify_signal_check_d 10000
-
- #define fss_identify_short_content_s "c"
- #define fss_identify_short_line_s "l"
- #define fss_identify_short_name_s "n"
- #define fss_identify_short_object_s "o"
- #define fss_identify_short_total_s "t"
-
- #define fss_identify_long_content_s "content"
- #define fss_identify_long_line_s "line"
- #define fss_identify_long_name_s "name"
- #define fss_identify_long_object_s "object"
- #define fss_identify_long_total_s "total"
-
- enum {
- fss_identify_parameter_help_e,
- fss_identify_parameter_light_e,
- fss_identify_parameter_dark_e,
- fss_identify_parameter_no_color_e,
- fss_identify_parameter_verbosity_quiet_e,
- fss_identify_parameter_verbosity_normal_e,
- fss_identify_parameter_verbosity_verbose_e,
- fss_identify_parameter_verbosity_debug_e,
- fss_identify_parameter_version_e,
-
- fss_identify_parameter_content_e,
- fss_identify_parameter_line_e,
- fss_identify_parameter_name_e,
- fss_identify_parameter_object_e,
- fss_identify_parameter_total_e,
- };
-
- #define fss_identify_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(fss_identify_short_content_s, fss_identify_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_line_s, fss_identify_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_name_s, fss_identify_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_object_s, fss_identify_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_identify_short_total_s, fss_identify_long_total_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_identify_total_parameters_d 14
-#endif // _di_fss_identify_defines_
-
-#ifndef _di_fss_identify_data_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_identify_main_t;
-
- #define fss_identify_data_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_identify_data_t_
-
/**
* Print help.
*
extern f_status_t fss_identify_main(fss_identify_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_identify_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_identify_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_identify_main()
- */
-#ifndef _di_fss_identify_main_delete_
- extern f_status_t fss_identify_main_delete(fss_identify_main_t * const main);
-#endif // _di_fss_identify_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_identify.c private-common.c private-identify.c private-print.c
+build_sources_library fss_identify.c common.c private-common.c private-identify.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 fss_identify.h
+build_sources_headers fss_identify.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_payload_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_payload_read_main_delete_
+ f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_payload_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Payload Read
+ * 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 _fss_payload_read_common_h
+#define _fss_payload_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_fss_payload_read_program_version_
+ #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
+
+ #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
+
+ #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))
+
+ #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_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_
+ #define fss_payload_read_signal_check_d 10000
+
+ #define fss_payload_read_pipe_content_end_s '\f'
+ #define fss_payload_read_pipe_content_ignore_s '\v'
+ #define fss_payload_read_pipe_content_start_s '\b'
+
+ #define fss_payload_read_short_at_s "a"
+ #define fss_payload_read_short_content_s "c"
+ #define fss_payload_read_short_columns_s "C"
+ #define fss_payload_read_short_delimit_s "D"
+ #define fss_payload_read_short_depth_s "d"
+ #define fss_payload_read_short_empty_s "e"
+ #define fss_payload_read_short_line_s "l"
+ #define fss_payload_read_short_name_s "n"
+ #define fss_payload_read_short_object_s "o"
+ #define fss_payload_read_short_pipe_s "p"
+ #define fss_payload_read_short_raw_s "R"
+ #define fss_payload_read_short_select_s "s"
+ #define fss_payload_read_short_total_s "t"
+ #define fss_payload_read_short_trim_s "T"
+
+ #define fss_payload_read_long_at_s "at"
+ #define fss_payload_read_long_content_s "content"
+ #define fss_payload_read_long_columns_s "columns"
+ #define fss_payload_read_long_delimit_s "delimit"
+ #define fss_payload_read_long_depth_s "depth"
+ #define fss_payload_read_long_empty_s "empty"
+ #define fss_payload_read_long_line_s "line"
+ #define fss_payload_read_long_name_s "name"
+ #define fss_payload_read_long_object_s "object"
+ #define fss_payload_read_long_pipe_s "pipe"
+ #define fss_payload_read_long_raw_s "raw"
+ #define fss_payload_read_long_select_s "select"
+ #define fss_payload_read_long_total_s "total"
+ #define fss_payload_read_long_trim_s "trim"
+
+ enum {
+ fss_payload_read_parameter_help_e,
+ fss_payload_read_parameter_light_e,
+ fss_payload_read_parameter_dark_e,
+ fss_payload_read_parameter_no_color_e,
+ fss_payload_read_parameter_verbosity_quiet_e,
+ fss_payload_read_parameter_verbosity_normal_e,
+ fss_payload_read_parameter_verbosity_verbose_e,
+ fss_payload_read_parameter_verbosity_debug_e,
+ fss_payload_read_parameter_version_e,
+
+ fss_payload_read_parameter_at_e,
+ fss_payload_read_parameter_content_e,
+ fss_payload_read_parameter_columns_e,
+ fss_payload_read_parameter_delimit_e,
+ fss_payload_read_parameter_depth_e,
+ fss_payload_read_parameter_empty_e,
+ fss_payload_read_parameter_line_e,
+ fss_payload_read_parameter_name_e,
+ fss_payload_read_parameter_object_e,
+ fss_payload_read_parameter_pipe_e,
+ fss_payload_read_parameter_raw_e,
+ fss_payload_read_parameter_select_e,
+ fss_payload_read_parameter_total_e,
+ fss_payload_read_parameter_trim_e,
+ };
+
+ #define fss_payload_read_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, F_false, 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(fss_payload_read_short_at_s, fss_payload_read_long_at_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_content_s, fss_payload_read_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_columns_s, fss_payload_read_long_columns_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_delimit_s, fss_payload_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_depth_s, fss_payload_read_long_depth_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_empty_s, fss_payload_read_long_empty_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_line_s, fss_payload_read_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_name_s, fss_payload_read_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_object_s, fss_payload_read_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_pipe_s, fss_payload_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_raw_s, fss_payload_read_long_raw_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_select_s, fss_payload_read_long_select_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_total_s, fss_payload_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_payload_total_parameters_d 23
+#endif // _di_fss_payload_read_defines_
+
+/**
+ * FSS Delimit Parameter data.
+ *
+ * fss_payload_read_delimit_mode_*:
+ * - all: All delimits are to be aplied.
+ * - content: Content are to have delimits applied.
+ * - content_greater: Content at this number or higher are to have delimits applied.
+ * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
+ * - content_lesser: Content at this number or lower are to have delimits applied.
+ * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
+ * - content_object: Objects and Content are to have delimits applied
+ * - object: Objects arre to have delimits applied.
+ */
+#ifndef _di_fss_payload_read_delimit_mode_
+ #define fss_payload_read_delimit_mode_name_none_s "none"
+ #define fss_payload_read_delimit_mode_name_all_s "all"
+ #define fss_payload_read_delimit_mode_name_object_s "object"
+ #define fss_payload_read_delimit_mode_name_greater_s "+"
+ #define fss_payload_read_delimit_mode_name_lesser_s "-"
+
+ #define fss_payload_read_delimit_mode_name_none_s_length 4
+ #define fss_payload_read_delimit_mode_name_all_s_length 3
+ #define fss_payload_read_delimit_mode_name_object_s_length 6
+ #define fss_payload_read_delimit_mode_name_greater_s_length 1
+ #define fss_payload_read_delimit_mode_name_lesser_s_length 1
+
+ enum {
+ fss_payload_read_delimit_mode_none_e = 1,
+ fss_payload_read_delimit_mode_all_e,
+ fss_payload_read_delimit_mode_content_e,
+ fss_payload_read_delimit_mode_content_greater_e,
+ fss_payload_read_delimit_mode_content_greater_object_e,
+ fss_payload_read_delimit_mode_content_lesser_e,
+ fss_payload_read_delimit_mode_content_lesser_object_e,
+ fss_payload_read_delimit_mode_content_object_e,
+ fss_payload_read_delimit_mode_object_e,
+ };
+#endif // _di_fss_payload_read_delimit_modes_
+
+#ifndef _di_fss_payload_read_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_payload_read_main_t;
+
+ #define fss_payload_read_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_payload_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_payload_read_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_payload_read_main()
+ */
+#ifndef _di_fss_payload_read_main_delete_
+ extern f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main);
+#endif // _di_fss_payload_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_payload_read_common_h
}
#endif // _di_fss_payload_read_main_
-#ifndef _di_fss_payload_read_main_delete_
- f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_payload_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Payload Read includes.
+#include <program/fss_payload_read/common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _di_fss_payload_read_program_version_
- #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
-
- #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
-
- #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))
-
- #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_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_
- #define fss_payload_read_signal_check_d 10000
-
- #define fss_payload_read_pipe_content_end_s '\f'
- #define fss_payload_read_pipe_content_ignore_s '\v'
- #define fss_payload_read_pipe_content_start_s '\b'
-
- #define fss_payload_read_short_at_s "a"
- #define fss_payload_read_short_content_s "c"
- #define fss_payload_read_short_columns_s "C"
- #define fss_payload_read_short_delimit_s "D"
- #define fss_payload_read_short_depth_s "d"
- #define fss_payload_read_short_empty_s "e"
- #define fss_payload_read_short_line_s "l"
- #define fss_payload_read_short_name_s "n"
- #define fss_payload_read_short_object_s "o"
- #define fss_payload_read_short_pipe_s "p"
- #define fss_payload_read_short_raw_s "R"
- #define fss_payload_read_short_select_s "s"
- #define fss_payload_read_short_total_s "t"
- #define fss_payload_read_short_trim_s "T"
-
- #define fss_payload_read_long_at_s "at"
- #define fss_payload_read_long_content_s "content"
- #define fss_payload_read_long_columns_s "columns"
- #define fss_payload_read_long_delimit_s "delimit"
- #define fss_payload_read_long_depth_s "depth"
- #define fss_payload_read_long_empty_s "empty"
- #define fss_payload_read_long_line_s "line"
- #define fss_payload_read_long_name_s "name"
- #define fss_payload_read_long_object_s "object"
- #define fss_payload_read_long_pipe_s "pipe"
- #define fss_payload_read_long_raw_s "raw"
- #define fss_payload_read_long_select_s "select"
- #define fss_payload_read_long_total_s "total"
- #define fss_payload_read_long_trim_s "trim"
-
- enum {
- fss_payload_read_parameter_help_e,
- fss_payload_read_parameter_light_e,
- fss_payload_read_parameter_dark_e,
- fss_payload_read_parameter_no_color_e,
- fss_payload_read_parameter_verbosity_quiet_e,
- fss_payload_read_parameter_verbosity_normal_e,
- fss_payload_read_parameter_verbosity_verbose_e,
- fss_payload_read_parameter_verbosity_debug_e,
- fss_payload_read_parameter_version_e,
-
- fss_payload_read_parameter_at_e,
- fss_payload_read_parameter_content_e,
- fss_payload_read_parameter_columns_e,
- fss_payload_read_parameter_delimit_e,
- fss_payload_read_parameter_depth_e,
- fss_payload_read_parameter_empty_e,
- fss_payload_read_parameter_line_e,
- fss_payload_read_parameter_name_e,
- fss_payload_read_parameter_object_e,
- fss_payload_read_parameter_pipe_e,
- fss_payload_read_parameter_raw_e,
- fss_payload_read_parameter_select_e,
- fss_payload_read_parameter_total_e,
- fss_payload_read_parameter_trim_e,
- };
-
- #define fss_payload_read_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, F_false, 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(fss_payload_read_short_at_s, fss_payload_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_content_s, fss_payload_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_columns_s, fss_payload_read_long_columns_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_delimit_s, fss_payload_read_long_delimit_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_depth_s, fss_payload_read_long_depth_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_empty_s, fss_payload_read_long_empty_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_line_s, fss_payload_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_name_s, fss_payload_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_object_s, fss_payload_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_pipe_s, fss_payload_read_long_pipe_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_raw_s, fss_payload_read_long_raw_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_select_s, fss_payload_read_long_select_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_total_s, fss_payload_read_long_total_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_read_short_trim_s, fss_payload_read_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_payload_total_parameters_d 23
-#endif // _di_fss_payload_read_defines_
-
-/**
- * FSS Delimit Parameter data.
- *
- * fss_payload_read_delimit_mode_*:
- * - all: All delimits are to be aplied.
- * - content: Content are to have delimits applied.
- * - content_greater: Content at this number or higher are to have delimits applied.
- * - content_greater_object: Objects and Content at this number or higher are to have delimits applied.
- * - content_lesser: Content at this number or lower are to have delimits applied.
- * - content_lesser_object: Objects and Content at this number or lower are to have delimits applied.
- * - content_object: Objects and Content are to have delimits applied
- * - object: Objects arre to have delimits applied.
- */
-#ifndef _di_fss_payload_read_delimit_mode_
- #define fss_payload_read_delimit_mode_name_none_s "none"
- #define fss_payload_read_delimit_mode_name_all_s "all"
- #define fss_payload_read_delimit_mode_name_object_s "object"
- #define fss_payload_read_delimit_mode_name_greater_s "+"
- #define fss_payload_read_delimit_mode_name_lesser_s "-"
-
- #define fss_payload_read_delimit_mode_name_none_s_length 4
- #define fss_payload_read_delimit_mode_name_all_s_length 3
- #define fss_payload_read_delimit_mode_name_object_s_length 6
- #define fss_payload_read_delimit_mode_name_greater_s_length 1
- #define fss_payload_read_delimit_mode_name_lesser_s_length 1
-
- enum {
- fss_payload_read_delimit_mode_none_e = 1,
- fss_payload_read_delimit_mode_all_e,
- fss_payload_read_delimit_mode_content_e,
- fss_payload_read_delimit_mode_content_greater_e,
- fss_payload_read_delimit_mode_content_greater_object_e,
- fss_payload_read_delimit_mode_content_lesser_e,
- fss_payload_read_delimit_mode_content_lesser_object_e,
- fss_payload_read_delimit_mode_content_object_e,
- fss_payload_read_delimit_mode_object_e,
- };
-#endif // _di_fss_payload_read_delimit_modes_
-
-#ifndef _di_fss_payload_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_payload_read_main_t;
-
- #define fss_payload_read_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_payload_read_main_t_
-
/**
* Print help.
*
extern f_status_t fss_payload_read_main(fss_payload_read_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_payload_read_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_payload_read_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_payload_read_main()
- */
-#ifndef _di_fss_payload_read_main_delete_
- extern f_status_t fss_payload_read_main_delete(fss_payload_read_main_t * const main);
-#endif // _di_fss_payload_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_payload_read.c private-common.c private-print.c private-read.c
+build_sources_library fss_payload_read.c common.c private-common.c private-print.c private-read.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 fss_payload_read.h
+build_sources_headers fss_payload_read.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_payload_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_payload_write_main_delete_
+ f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_payload_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Payload Write
+ * 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 _fss_payload_write_common_h
+#define _fss_payload_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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 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_
+ #define fss_payload_write_signal_check_d 10000
+
+ #define fss_payload_write_pipe_content_end_s '\f'
+ #define fss_payload_write_pipe_content_ignore_s '\v'
+ #define fss_payload_write_pipe_content_start_s '\b'
+
+ #define fss_payload_write_short_file_s "f"
+ #define fss_payload_write_short_content_s "c"
+ #define fss_payload_write_short_double_s "d"
+ #define fss_payload_write_short_ignore_s "I"
+ #define fss_payload_write_short_object_s "o"
+ #define fss_payload_write_short_partial_s "p"
+ #define fss_payload_write_short_prepend_s "P"
+ #define fss_payload_write_short_single_s "s"
+ #define fss_payload_write_short_trim_s "T"
+
+ #define fss_payload_write_long_file_s "file"
+ #define fss_payload_write_long_content_s "content"
+ #define fss_payload_write_long_double_s "double"
+ #define fss_payload_write_long_ignore_s "ignore"
+ #define fss_payload_write_long_object_s "object"
+ #define fss_payload_write_long_partial_s "partial"
+ #define fss_payload_write_long_prepend_s "prepend"
+ #define fss_payload_write_long_single_s "single"
+ #define fss_payload_write_long_trim_s "trim"
+
+ enum {
+ fss_payload_write_parameter_help_e,
+ fss_payload_write_parameter_light_e,
+ fss_payload_write_parameter_dark_e,
+ fss_payload_write_parameter_no_color_e,
+ fss_payload_write_parameter_verbosity_quiet_e,
+ fss_payload_write_parameter_verbosity_normal_e,
+ fss_payload_write_parameter_verbosity_verbose_e,
+ fss_payload_write_parameter_verbosity_debug_e,
+ fss_payload_write_parameter_version_e,
+
+ fss_payload_write_parameter_file_e,
+ fss_payload_write_parameter_content_e,
+ fss_payload_write_parameter_double_e,
+ fss_payload_write_parameter_ignore_e,
+ fss_payload_write_parameter_object_e,
+ fss_payload_write_parameter_partial_e,
+ fss_payload_write_parameter_prepend_e,
+ fss_payload_write_parameter_single_e,
+ fss_payload_write_parameter_trim_e,
+ };
+
+ #define fss_payload_write_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, F_false, 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(fss_payload_write_short_file_s, fss_payload_write_long_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_content_s, fss_payload_write_long_content_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_double_s, fss_payload_write_long_double_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_ignore_s, fss_payload_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_object_s, fss_payload_write_long_object_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_partial_s, fss_payload_write_long_partial_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_prepend_s, fss_payload_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_single_s, fss_payload_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_payload_write_short_trim_s, fss_payload_write_long_trim_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_payload_write_total_parameters_d 18
+#endif // _di_fss_payload_write_defines_
+
+#ifndef _di_fss_payload_write_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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_string_static_t prepend;
+
+ f_color_context_t context;
+ } fss_payload_write_main_t;
+
+ #define fss_payload_write_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_static_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_payload_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_payload_write_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_payload_write_main()
+ */
+#ifndef _di_fss_payload_write_main_delete_
+ extern f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main);
+#endif // _di_fss_payload_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_payload_write_common_h
}
#endif // _di_fss_payload_write_main_
-#ifndef _di_fss_payload_write_main_delete_
- f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_payload_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// FSS Payload Write includes.
+#include <program/fss_payload_write/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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 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_
- #define fss_payload_write_signal_check_d 10000
-
- #define fss_payload_write_pipe_content_end_s '\f'
- #define fss_payload_write_pipe_content_ignore_s '\v'
- #define fss_payload_write_pipe_content_start_s '\b'
-
- #define fss_payload_write_short_file_s "f"
- #define fss_payload_write_short_content_s "c"
- #define fss_payload_write_short_double_s "d"
- #define fss_payload_write_short_ignore_s "I"
- #define fss_payload_write_short_object_s "o"
- #define fss_payload_write_short_partial_s "p"
- #define fss_payload_write_short_prepend_s "P"
- #define fss_payload_write_short_single_s "s"
- #define fss_payload_write_short_trim_s "T"
-
- #define fss_payload_write_long_file_s "file"
- #define fss_payload_write_long_content_s "content"
- #define fss_payload_write_long_double_s "double"
- #define fss_payload_write_long_ignore_s "ignore"
- #define fss_payload_write_long_object_s "object"
- #define fss_payload_write_long_partial_s "partial"
- #define fss_payload_write_long_prepend_s "prepend"
- #define fss_payload_write_long_single_s "single"
- #define fss_payload_write_long_trim_s "trim"
-
- enum {
- fss_payload_write_parameter_help_e,
- fss_payload_write_parameter_light_e,
- fss_payload_write_parameter_dark_e,
- fss_payload_write_parameter_no_color_e,
- fss_payload_write_parameter_verbosity_quiet_e,
- fss_payload_write_parameter_verbosity_normal_e,
- fss_payload_write_parameter_verbosity_verbose_e,
- fss_payload_write_parameter_verbosity_debug_e,
- fss_payload_write_parameter_version_e,
-
- fss_payload_write_parameter_file_e,
- fss_payload_write_parameter_content_e,
- fss_payload_write_parameter_double_e,
- fss_payload_write_parameter_ignore_e,
- fss_payload_write_parameter_object_e,
- fss_payload_write_parameter_partial_e,
- fss_payload_write_parameter_prepend_e,
- fss_payload_write_parameter_single_e,
- fss_payload_write_parameter_trim_e,
- };
-
- #define fss_payload_write_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, F_false, 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(fss_payload_write_short_file_s, fss_payload_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_content_s, fss_payload_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_double_s, fss_payload_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_ignore_s, fss_payload_write_long_ignore_s, 0, 2, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_object_s, fss_payload_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_partial_s, fss_payload_write_long_partial_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_prepend_s, fss_payload_write_long_prepend_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_single_s, fss_payload_write_long_single_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_payload_write_short_trim_s, fss_payload_write_long_trim_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_payload_write_total_parameters_d 18
-#endif // _di_fss_payload_write_defines_
-
-#ifndef _di_fss_payload_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_static_t prepend;
-
- f_color_context_t context;
- } fss_payload_write_main_t;
-
- #define fss_payload_write_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_static_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_payload_write_main_t_
-
/**
* Print help.
*
extern f_status_t fss_payload_write_main(fss_payload_write_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_payload_write_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_payload_write_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_payload_write_main()
- */
-#ifndef _di_fss_payload_write_main_delete_
- extern f_status_t fss_payload_write_main_delete(fss_payload_write_main_t * const main);
-#endif // _di_fss_payload_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_payload_write.c private-common.c private-write.c
+build_sources_library fss_payload_write.c common.c private-common.c private-write.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 fss_payload_write.h
+build_sources_headers fss_payload_write.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "fss_status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_fss_status_code_main_delete_
+ f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_fss_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: FSS Status code
+ * 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 _fss_status_code_common_h
+#define _fss_status_code_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define fss_status_code_signal_check_d 10000
+
+ #define fss_status_code_short_is_fine_s "f"
+ #define fss_status_code_short_is_warning_s "w"
+ #define fss_status_code_short_is_error_s "e"
+ #define fss_status_code_short_number_s "n"
+
+ #define fss_status_code_long_is_fine_s "is_fine"
+ #define fss_status_code_long_is_warning_s "is_warning"
+ #define fss_status_code_long_is_error_s "is_error"
+ #define fss_status_code_long_number_s "number"
+
+ enum {
+ fss_status_code_parameter_help_e,
+ fss_status_code_parameter_light_e,
+ fss_status_code_parameter_dark_e,
+ fss_status_code_parameter_no_color_e,
+ fss_status_code_parameter_verbosity_quiet_e,
+ fss_status_code_parameter_verbosity_normal_e,
+ fss_status_code_parameter_verbosity_verbose_e,
+ fss_status_code_parameter_verbosity_debug_e,
+ fss_status_code_parameter_version_e,
+
+ fss_status_code_parameter_is_fine_e,
+ fss_status_code_parameter_is_warning_e,
+ fss_status_code_parameter_is_error_e,
+ fss_status_code_parameter_number_e,
+ };
+
+ #define fss_status_code_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(fss_status_code_short_is_fine_s, fss_status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_status_code_short_is_warning_s, fss_status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(fss_status_code_short_number_s, fss_status_code_long_number_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define fss_status_code_total_parameters_d 13
+#endif // _di_fss_status_code_defines_
+
+#ifndef _di_fss_status_code_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } fss_status_code_main_t;
+
+ #define fss_status_code_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_fss_status_code_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing fss_status_code_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see fss_status_code_main()
+ */
+#ifndef _di_fss_status_code_main_delete_
+ extern f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main);
+#endif // _di_fss_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _fss_status_code_common_h
}
#endif // _di_fss_status_code_main_
-#ifndef _di_fss_status_code_main_delete_
- f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_fss_status_code_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/program.h>
#include <fll/level_2/status_string.h>
+// FSS Status Code includes.
+#include <program/fss_status_code/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define fss_status_code_signal_check_d 10000
-
- #define fss_status_code_short_is_fine_s "f"
- #define fss_status_code_short_is_warning_s "w"
- #define fss_status_code_short_is_error_s "e"
- #define fss_status_code_short_number_s "n"
-
- #define fss_status_code_long_is_fine_s "is_fine"
- #define fss_status_code_long_is_warning_s "is_warning"
- #define fss_status_code_long_is_error_s "is_error"
- #define fss_status_code_long_number_s "number"
-
- enum {
- fss_status_code_parameter_help_e,
- fss_status_code_parameter_light_e,
- fss_status_code_parameter_dark_e,
- fss_status_code_parameter_no_color_e,
- fss_status_code_parameter_verbosity_quiet_e,
- fss_status_code_parameter_verbosity_normal_e,
- fss_status_code_parameter_verbosity_verbose_e,
- fss_status_code_parameter_verbosity_debug_e,
- fss_status_code_parameter_version_e,
-
- fss_status_code_parameter_is_fine_e,
- fss_status_code_parameter_is_warning_e,
- fss_status_code_parameter_is_error_e,
- fss_status_code_parameter_number_e,
- };
-
- #define fss_status_code_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(fss_status_code_short_is_fine_s, fss_status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_status_code_short_is_warning_s, fss_status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_status_code_short_is_error_s, fss_status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(fss_status_code_short_number_s, fss_status_code_long_number_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define fss_status_code_total_parameters_d 13
-#endif // _di_fss_status_code_defines_
-
-#ifndef _di_fss_status_code_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } fss_status_code_main_t;
-
- #define fss_status_code_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_fss_status_code_main_t_
-
/**
* Print help.
*
extern f_status_t fss_status_code_main(fss_status_code_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_fss_status_code_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing fss_status_code_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see fss_status_code_main()
- */
-#ifndef _di_fss_status_code_main_delete_
- extern f_status_t fss_status_code_main_delete(fss_status_code_main_t * const main);
-#endif // _di_fss_status_code_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library fss_status_code.c private-common.c private-fss_status_code.c
+build_sources_library fss_status_code.c common.c private-common.c private-fss_status_code.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 fss_status_code.h
+build_sources_headers fss_status_code.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "iki_read.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_iki_read_main_delete_
+ f_status_t iki_read_main_delete(iki_read_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ f_string_dynamic_resize(0, &main->buffer);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_iki_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: IKI Read
+ * 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 _iki_read_common_h
+#define _iki_read_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define iki_read_signal_check_d 10000
+
+ enum {
+ iki_read_mode_content_e = 1,
+ iki_read_mode_literal_e,
+ iki_read_mode_object_e,
+ iki_read_mode_total_e,
+ };
+
+ #define iki_read_short_at_s "a"
+ #define iki_read_short_content_s "c"
+ #define iki_read_short_line_s "l"
+ #define iki_read_short_literal_s "L"
+ #define iki_read_short_name_s "n"
+ #define iki_read_short_object_s "o"
+ #define iki_read_short_substitute_s "s"
+ #define iki_read_short_total_s "t"
+ #define iki_read_short_whole_s "w"
+
+ #define iki_read_long_at_s "at"
+ #define iki_read_long_content_s "content"
+ #define iki_read_long_line_s "line"
+ #define iki_read_long_literal_s "literal"
+ #define iki_read_long_name_s "name"
+ #define iki_read_long_object_s "object"
+ #define iki_read_long_substitute_s "substitute"
+ #define iki_read_long_total_s "total"
+ #define iki_read_long_whole_s "whole"
+
+ enum {
+ iki_read_parameter_help_e,
+ iki_read_parameter_light_e,
+ iki_read_parameter_dark_e,
+ iki_read_parameter_no_color_e,
+ iki_read_parameter_verbosity_quiet_e,
+ iki_read_parameter_verbosity_normal_e,
+ iki_read_parameter_verbosity_verbose_e,
+ iki_read_parameter_verbosity_debug_e,
+ iki_read_parameter_version_e,
+
+ iki_read_parameter_at_e,
+ iki_read_parameter_content_e,
+ iki_read_parameter_line_e,
+ iki_read_parameter_literal_e,
+ iki_read_parameter_name_e,
+ iki_read_parameter_object_e,
+ iki_read_parameter_whole_e,
+ iki_read_parameter_substitute_e,
+ iki_read_parameter_total_e,
+ };
+
+ #define iki_read_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_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_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_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(iki_read_short_at_s, iki_read_long_at_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_content_s, iki_read_long_content_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_line_s, iki_read_long_line_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_literal_s, iki_read_long_literal_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_name_s, iki_read_long_name_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_object_s, iki_read_long_object_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_whole_s, iki_read_long_whole_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_substitute_s, iki_read_long_substitute_s, 0, 3, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_read_short_total_s, iki_read_long_total_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define iki_read_total_parameters_d 18
+#endif // _di_iki_read_defines_
+
+#ifndef _di_iki_read_substitution_t_
+ #define iki_read_substitution_vocabulary_s "vocabulary"
+ #define iki_read_substitution_replace_s "replace"
+ #define iki_read_substitution_with_s "with"
+
+ typedef struct {
+ f_string_static_t replace;
+ f_string_static_t with;
+ } iki_read_substitution_t;
+
+ #define iki_read_substitution_t_initialize \
+ { \
+ f_string_static_t_initialize, \
+ f_string_static_t_initialize, \
+ }
+
+ #define macro_iki_read_substitution_t_initialize(replace, with) \
+ { \
+ macro_f_string_static_t_initialize2(replace), \
+ macro_f_string_static_t_initialize2(with), \
+ }
+#endif // _di_iki_read_substitution_t_
+
+#ifndef _di_iki_read_substitutions_t_
+ typedef struct {
+ iki_read_substitution_t *array;
+
+ f_array_length_t size;
+ f_array_length_t used;
+ } iki_read_substitutions_t;
+
+ #define iki_read_substitutions_t_initialize { 0, 0, 0 }
+
+ #define macro_iki_read_substitutions_t_clear(replacements) macro_f_memory_structure_clear(replacements)
+
+ #define macro_iki_read_substitutions_t_delete_simple(replacements) macro_f_memory_structure_delete_simple(replacements, iki_read_substitution_t)
+ #define macro_iki_read_substitutions_t_destroy_simple(replacements) macro_f_memory_structure_destroy_simple(replacements, iki_read_substitution_t)
+
+ #define macro_iki_read_substitutions_t_resize(status, replacements, length) macro_f_memory_structure_resize(status, replacements, iki_read_substitution_t, length)
+ #define macro_iki_read_substitutions_t_adjust(status, replacements, length) macro_f_memory_structure_adjust(status, replacements, iki_read_substitution_t, length)
+#endif // _di_iki_read_substitutions_t_
+
+#ifndef _di_iki_read_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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 mode;
+
+ f_number_unsigned_t at;
+ f_number_unsigned_t line;
+
+ f_string_dynamic_t buffer;
+
+ iki_read_substitutions_t replacements;
+
+ f_color_context_t context;
+ } iki_read_main_t;
+
+ #define iki_read_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_dynamic_t_initialize, \
+ iki_read_substitutions_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_iki_read_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing iki_read_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see iki_read_main()
+ */
+#ifndef _di_iki_read_main_delete_
+ extern f_status_t iki_read_main_delete(iki_read_main_t * const main);
+#endif // _di_iki_read_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_read_common_h
}
#endif // _di_iki_read_main_
-#ifndef _di_iki_read_main_delete_
- f_status_t iki_read_main_delete(iki_read_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- f_string_dynamic_resize(0, &main->buffer);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_iki_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// IKI Read includes.
+#include <program/iki_read/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define iki_read_signal_check_d 10000
-
- enum {
- iki_read_mode_content_e = 1,
- iki_read_mode_literal_e,
- iki_read_mode_object_e,
- iki_read_mode_total_e,
- };
-
- #define iki_read_short_at_s "a"
- #define iki_read_short_content_s "c"
- #define iki_read_short_line_s "l"
- #define iki_read_short_literal_s "L"
- #define iki_read_short_name_s "n"
- #define iki_read_short_object_s "o"
- #define iki_read_short_substitute_s "s"
- #define iki_read_short_total_s "t"
- #define iki_read_short_whole_s "w"
-
- #define iki_read_long_at_s "at"
- #define iki_read_long_content_s "content"
- #define iki_read_long_line_s "line"
- #define iki_read_long_literal_s "literal"
- #define iki_read_long_name_s "name"
- #define iki_read_long_object_s "object"
- #define iki_read_long_substitute_s "substitute"
- #define iki_read_long_total_s "total"
- #define iki_read_long_whole_s "whole"
-
- enum {
- iki_read_parameter_help_e,
- iki_read_parameter_light_e,
- iki_read_parameter_dark_e,
- iki_read_parameter_no_color_e,
- iki_read_parameter_verbosity_quiet_e,
- iki_read_parameter_verbosity_normal_e,
- iki_read_parameter_verbosity_verbose_e,
- iki_read_parameter_verbosity_debug_e,
- iki_read_parameter_version_e,
-
- iki_read_parameter_at_e,
- iki_read_parameter_content_e,
- iki_read_parameter_line_e,
- iki_read_parameter_literal_e,
- iki_read_parameter_name_e,
- iki_read_parameter_object_e,
- iki_read_parameter_whole_e,
- iki_read_parameter_substitute_e,
- iki_read_parameter_total_e,
- };
-
- #define iki_read_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_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_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_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(iki_read_short_at_s, iki_read_long_at_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_content_s, iki_read_long_content_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_line_s, iki_read_long_line_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_literal_s, iki_read_long_literal_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_name_s, iki_read_long_name_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_object_s, iki_read_long_object_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_whole_s, iki_read_long_whole_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_substitute_s, iki_read_long_substitute_s, 0, 3, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_read_short_total_s, iki_read_long_total_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define iki_read_total_parameters_d 18
-#endif // _di_iki_read_defines_
-
-#ifndef _di_iki_read_substitution_t_
- #define iki_read_substitution_vocabulary_s "vocabulary"
- #define iki_read_substitution_replace_s "replace"
- #define iki_read_substitution_with_s "with"
-
- typedef struct {
- f_string_static_t replace;
- f_string_static_t with;
- } iki_read_substitution_t;
-
- #define iki_read_substitution_t_initialize \
- { \
- f_string_static_t_initialize, \
- f_string_static_t_initialize, \
- }
-
- #define macro_iki_read_substitution_t_initialize(replace, with) \
- { \
- macro_f_string_static_t_initialize2(replace), \
- macro_f_string_static_t_initialize2(with), \
- }
-#endif // _di_iki_read_substitution_t_
-
-#ifndef _di_iki_read_substitutions_t_
- typedef struct {
- iki_read_substitution_t *array;
-
- f_array_length_t size;
- f_array_length_t used;
- } iki_read_substitutions_t;
-
- #define iki_read_substitutions_t_initialize { 0, 0, 0 }
-
- #define macro_iki_read_substitutions_t_clear(replacements) macro_f_memory_structure_clear(replacements)
-
- #define macro_iki_read_substitutions_t_delete_simple(replacements) macro_f_memory_structure_delete_simple(replacements, iki_read_substitution_t)
- #define macro_iki_read_substitutions_t_destroy_simple(replacements) macro_f_memory_structure_destroy_simple(replacements, iki_read_substitution_t)
-
- #define macro_iki_read_substitutions_t_resize(status, replacements, length) macro_f_memory_structure_resize(status, replacements, iki_read_substitution_t, length)
- #define macro_iki_read_substitutions_t_adjust(status, replacements, length) macro_f_memory_structure_adjust(status, replacements, iki_read_substitution_t, length)
-#endif // _di_iki_read_substitutions_t_
-
-#ifndef _di_iki_read_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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 mode;
-
- f_number_unsigned_t at;
- f_number_unsigned_t line;
-
- f_string_dynamic_t buffer;
-
- iki_read_substitutions_t replacements;
-
- f_color_context_t context;
- } iki_read_main_t;
-
- #define iki_read_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_dynamic_t_initialize, \
- iki_read_substitutions_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_iki_read_main_t_
-
/**
* Print help.
*
extern f_status_t iki_read_main(iki_read_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_iki_read_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing iki_read_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see iki_read_main()
- */
-#ifndef _di_iki_read_main_delete_
- extern f_status_t iki_read_main_delete(iki_read_main_t * const main);
-#endif // _di_iki_read_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library iki_read.c private-common.c private-print.c private-read.c
+build_sources_library iki_read.c common.c private-common.c private-print.c private-read.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 iki_read.h
+build_sources_headers iki_read.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "iki_write.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_iki_write_main_delete_
+ f_status_t iki_write_main_delete(iki_write_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+ f_string_dynamic_resize(0, &main->buffer);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_iki_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: IKI Write
+ * 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 _iki_write_common_h
+#define _iki_write_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_
+ #define iki_write_signal_check_d 10000
+
+ #define iki_write_short_file_s "f"
+ #define iki_write_short_content_s "c"
+ #define iki_write_short_double_s "d"
+ #define iki_write_short_object_s "o"
+ #define iki_write_short_single_s "s"
+
+ #define iki_write_long_file_s "file"
+ #define iki_write_long_content_s "content"
+ #define iki_write_long_double_s "double"
+ #define iki_write_long_object_s "object"
+ #define iki_write_long_single_s "single"
+
+ enum {
+ iki_write_parameter_help_e,
+ iki_write_parameter_light_e,
+ iki_write_parameter_dark_e,
+ iki_write_parameter_no_color_e,
+ iki_write_parameter_verbosity_quiet_e,
+ iki_write_parameter_verbosity_normal_e,
+ iki_write_parameter_verbosity_verbose_e,
+ iki_write_parameter_verbosity_debug_e,
+ iki_write_parameter_version_e,
+
+ iki_write_parameter_file_e,
+ iki_write_parameter_content_e,
+ iki_write_parameter_double_e,
+ iki_write_parameter_object_e,
+ iki_write_parameter_single_e,
+ };
+
+ #define iki_write_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(iki_write_short_file_s, iki_write_long_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_content_s, iki_write_long_content_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_double_s, iki_write_long_double_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_object_s, iki_write_long_object_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(iki_write_short_single_s, iki_write_long_single_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define iki_write_total_parameters_d 14
+#endif // _di_iki_write_defines_
+
+#ifndef _di_iki_write_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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_string_static_t quote;
+ f_string_dynamic_t buffer;
+
+ f_color_context_t context;
+ } iki_write_main_t;
+
+ #define iki_write_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_string_static_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_iki_write_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing iki_write_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see iki_write_main()
+ */
+#ifndef _di_iki_write_main_delete_
+ extern f_status_t iki_write_main_delete(iki_write_main_t * const main);
+#endif // _di_iki_write_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _iki_write_common_h
}
#endif // _di_iki_write_main_
-#ifndef _di_iki_write_main_delete_
- f_status_t iki_write_main_delete(iki_write_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
- f_string_dynamic_resize(0, &main->buffer);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_iki_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// IKI Write includes.
+#include <program/iki_write/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_
- #define iki_write_signal_check_d 10000
-
- #define iki_write_short_file_s "f"
- #define iki_write_short_content_s "c"
- #define iki_write_short_double_s "d"
- #define iki_write_short_object_s "o"
- #define iki_write_short_single_s "s"
-
- #define iki_write_long_file_s "file"
- #define iki_write_long_content_s "content"
- #define iki_write_long_double_s "double"
- #define iki_write_long_object_s "object"
- #define iki_write_long_single_s "single"
-
- enum {
- iki_write_parameter_help_e,
- iki_write_parameter_light_e,
- iki_write_parameter_dark_e,
- iki_write_parameter_no_color_e,
- iki_write_parameter_verbosity_quiet_e,
- iki_write_parameter_verbosity_normal_e,
- iki_write_parameter_verbosity_verbose_e,
- iki_write_parameter_verbosity_debug_e,
- iki_write_parameter_version_e,
-
- iki_write_parameter_file_e,
- iki_write_parameter_content_e,
- iki_write_parameter_double_e,
- iki_write_parameter_object_e,
- iki_write_parameter_single_e,
- };
-
- #define iki_write_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(iki_write_short_file_s, iki_write_long_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_content_s, iki_write_long_content_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_double_s, iki_write_long_double_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_object_s, iki_write_long_object_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(iki_write_short_single_s, iki_write_long_single_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define iki_write_total_parameters_d 14
-#endif // _di_iki_write_defines_
-
-#ifndef _di_iki_write_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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_string_static_t quote;
- f_string_dynamic_t buffer;
-
- f_color_context_t context;
- } iki_write_main_t;
-
- #define iki_write_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_string_static_t_initialize, \
- f_string_dynamic_t_initialize, \
- f_color_context_t_initialize, \
- }
-#endif // _di_iki_write_main_t_
-
/**
* Print help.
*
extern f_status_t iki_write_main(iki_write_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_iki_write_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing iki_write_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see iki_write_main()
- */
-#ifndef _di_iki_write_main_delete_
- extern f_status_t iki_write_main_delete(iki_write_main_t * const main);
-#endif // _di_iki_write_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library iki_write.c private-common.c private-write.c
+build_sources_library iki_write.c common.c private-common.c private-write.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 iki_write.h
+build_sources_headers iki_write.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "status_code.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_status_code_main_delete_
+ f_status_t status_code_main_delete(status_code_main_t * const main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: Status Code
+ * 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 _status_code_common_h
+#define _status_code_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+ #define status_code_signal_check_d 10000
+
+ #define status_code_short_is_fine_s "f"
+ #define status_code_short_is_warning_s "w"
+ #define status_code_short_is_error_s "e"
+ #define status_code_short_number_s "n"
+
+ #define status_code_long_is_fine_s "is_fine"
+ #define status_code_long_is_warning_s "is_warning"
+ #define status_code_long_is_error_s "is_error"
+ #define status_code_long_number_s "number"
+
+ enum {
+ status_code_parameter_help_e,
+ status_code_parameter_light_e,
+ status_code_parameter_dark_e,
+ status_code_parameter_no_color_e,
+ status_code_parameter_verbosity_quiet_e,
+ status_code_parameter_verbosity_normal_e,
+ status_code_parameter_verbosity_verbose_e,
+ status_code_parameter_verbosity_debug_e,
+ status_code_parameter_version_e,
+
+ status_code_parameter_is_fine_e,
+ status_code_parameter_is_warning_e,
+ status_code_parameter_is_error_e,
+ status_code_parameter_number_e,
+ };
+
+ #define status_code_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(status_code_short_is_fine_s, status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(status_code_short_is_warning_s, status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(status_code_short_is_error_s, status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(status_code_short_number_s, status_code_long_number_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define status_code_total_parameters_d 13
+#endif // _di_status_code_defines_
+
+#ifndef _di_status_code_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } status_code_main_t;
+
+ #define status_code_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_status_code_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing status_code_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see status_code_main()
+ */
+#ifndef _di_status_code_main_delete_
+ extern f_status_t status_code_main_delete(status_code_main_t * const main);
+#endif // _di_status_code_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _status_code_common_h
}
#endif // _di_status_code_main_
-#ifndef _di_status_code_main_delete_
- f_status_t status_code_main_delete(status_code_main_t * const main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_status_code_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/program.h>
#include <fll/level_2/status_string.h>
+// Status Code includes.
+#include <program/status_code/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
- #define status_code_signal_check_d 10000
-
- #define status_code_short_is_fine_s "f"
- #define status_code_short_is_warning_s "w"
- #define status_code_short_is_error_s "e"
- #define status_code_short_number_s "n"
-
- #define status_code_long_is_fine_s "is_fine"
- #define status_code_long_is_warning_s "is_warning"
- #define status_code_long_is_error_s "is_error"
- #define status_code_long_number_s "number"
-
- enum {
- status_code_parameter_help_e,
- status_code_parameter_light_e,
- status_code_parameter_dark_e,
- status_code_parameter_no_color_e,
- status_code_parameter_verbosity_quiet_e,
- status_code_parameter_verbosity_normal_e,
- status_code_parameter_verbosity_verbose_e,
- status_code_parameter_verbosity_debug_e,
- status_code_parameter_version_e,
-
- status_code_parameter_is_fine_e,
- status_code_parameter_is_warning_e,
- status_code_parameter_is_error_e,
- status_code_parameter_number_e,
- };
-
- #define status_code_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(status_code_short_is_fine_s, status_code_long_is_fine_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(status_code_short_is_warning_s, status_code_long_is_warning_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(status_code_short_is_error_s, status_code_long_is_error_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(status_code_short_number_s, status_code_long_number_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define status_code_total_parameters_d 13
-#endif // _di_status_code_defines_
-
-#ifndef _di_status_code_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } status_code_main_t;
-
- #define status_code_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_status_code_main_t_
-
/**
* Print help.
*
extern f_status_t status_code_main(status_code_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_status_code_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing status_code_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see status_code_main()
- */
-#ifndef _di_status_code_main_delete_
- extern f_status_t status_code_main_delete(status_code_main_t * const main);
-#endif // _di_status_code_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library status_code.c private-common.c private-status_code.c
+build_sources_library status_code.c common.c private-common.c private-status_code.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 status_code.h
+build_sources_headers status_code.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script
--- /dev/null
+#include "utf8.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _di_firewall_program_version_
+ const f_string_static_t firewall_program_version_s = macro_f_string_static_t_initialize(FIREWALL_version_s, 0, FIREWALL_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_initialize(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_initialize(FIREWALL_program_name_long_s, 0, FIREWALL_program_name_long_s_length);
+#endif // _di_firewall_program_name_
+
+#ifndef _di_utf8_main_delete_
+ f_status_t utf8_main_delete(utf8_main_t *main) {
+
+ f_console_parameters_delete(&main->parameters);
+
+ f_type_array_lengths_resize(0, &main->remaining);
+
+ macro_f_color_context_t_delete_simple(main->context);
+
+ return F_none;
+ }
+#endif // _di_utf8_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
--- /dev/null
+/**
+ * FLL - Level 3
+ *
+ * Project: UTF-8
+ * 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 _utf8_common_h
+#define _utf8_common_h
+
+#ifdef __cplusplus
+extern "C" {
+#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_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
+
+ #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))
+
+ #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_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_
+
+/**
+ * Set to at least 4 to provide a UTF-8 friendly allocation step.
+ */
+#ifndef _di_utf8_default_allocation_step_
+ #define utf8_default_allocation_step_d 16
+#endif // _di_utf8_default_allocation_step_
+
+#ifndef _di_utf8_defines_
+ #define utf8_signal_check_d 10000
+
+ #define utf8_string_from_s "from"
+ #define utf8_string_to_s "to"
+
+ #define utf8_string_verified_valid_s "Verified Valid"
+ #define utf8_string_verified_valid_not_s "Verified Invalid"
+
+ #define utf8_string_combining_is_s "C"
+ #define utf8_string_combining_not_s "N"
+ #define utf8_string_unknown_s "?"
+
+ #define utf8_string_width_0_s "0"
+ #define utf8_string_width_1_s "1"
+ #define utf8_string_width_2_s "2"
+
+ #define utf8_string_from_s_length 4
+ #define utf8_string_to_s_length 2
+
+ #define utf8_string_verified_valid_s_length 14
+ #define utf8_string_verified_valid_not_s_length 16
+
+ #define utf8_string_combining_is_s_length 1
+ #define utf8_string_combining_not_s_length 1
+ #define utf8_string_unknown_s_length 1
+
+ #define utf8_string_width_0_s_length 1
+ #define utf8_string_width_1_s_length 1
+ #define utf8_string_width_2_s_length 1
+
+ #define utf8_character_valid_not_s "�"
+
+ #define utf8_short_from_binary_s "b"
+ #define utf8_short_from_codepoint_s "c"
+ #define utf8_short_from_file_s "f"
+
+ #define utf8_short_headers_s "H"
+ #define utf8_short_separate_s "S"
+ #define utf8_short_strip_invalid_s "s"
+ #define utf8_short_verify_s "v"
+
+ #define utf8_short_to_binary_s "B"
+ #define utf8_short_to_codepoint_s "C"
+ #define utf8_short_to_combining_s "O"
+ #define utf8_short_to_file_s "F"
+ #define utf8_short_to_width_s "W"
+
+ #define utf8_long_from_binary_s "from_binary"
+ #define utf8_long_from_codepoint_s "from_codepoint"
+ #define utf8_long_from_file_s "from_file"
+
+ #define utf8_long_headers_s "headers"
+ #define utf8_long_separate_s "separate"
+ #define utf8_long_strip_invalid_s "strip_invalid"
+ #define utf8_long_verify_s "verify"
+
+ #define utf8_long_to_binary_s "to_binary"
+ #define utf8_long_to_codepoint_s "to_codepoint"
+ #define utf8_long_to_combining_s "to_combining"
+ #define utf8_long_to_file_s "to_file"
+ #define utf8_long_to_width_s "to_width"
+
+ enum {
+ utf8_parameter_help_e,
+ utf8_parameter_light_e,
+ utf8_parameter_dark_e,
+ utf8_parameter_no_color_e,
+ utf8_parameter_verbosity_quiet_e,
+ utf8_parameter_verbosity_normal_e,
+ utf8_parameter_verbosity_verbose_e,
+ utf8_parameter_verbosity_debug_e,
+ utf8_parameter_version_e,
+
+ utf8_parameter_from_binary_e,
+ utf8_parameter_from_codepoint_e,
+ utf8_parameter_from_file_e,
+
+ utf8_parameter_headers_e,
+ utf8_parameter_separate_e,
+ utf8_parameter_strip_invalid_e,
+
+ utf8_parameter_to_binary_e,
+ utf8_parameter_to_codepoint_e,
+ utf8_parameter_to_combining_e,
+ utf8_parameter_to_file_e,
+ utf8_parameter_to_width_e,
+
+ utf8_parameter_verify_e,
+ };
+
+ #define utf8_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(utf8_short_from_binary_s, utf8_long_from_binary_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_from_file_s, utf8_long_from_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_headers_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_separate_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_binary_s, utf8_long_to_binary_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_combining_s, utf8_long_to_combining_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_file_s, utf8_long_to_file_s, 0, 1, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_to_width_s, utf8_long_to_width_s, 0, 0, f_console_type_normal_e), \
+ macro_f_console_parameter_t_initialize(utf8_short_verify_s, utf8_long_verify_s, 0, 0, f_console_type_normal_e), \
+ }
+
+ #define utf8_total_parameters_d 21
+#endif // _di_utf8_defines_
+
+/**
+ * Modes used to designate how to the input and output are to be processed.
+ *
+ * utf8_mode_from_*:
+ * - binary: The input format is binary.
+ * - codepoint: The input format is codepoint (U+XXXX or U+XXXXXX).
+ *
+ * utf8_mode_to_*:
+ * - binary: The outout format is binary.
+ * - codepoint: The outout format is codepoint (U+XXXX or U+XXXXXX).
+ * - combining: The outout format is whether or not character is combining (may be used with "width").
+ * - width: The outout format is how wide the character is (may be used with "combining").
+ */
+#ifndef _di_utf8_modes_
+ #define utf8_mode_from_binary_d 0x1
+ #define utf8_mode_from_codepoint_d 0x2
+ #define utf8_mode_to_binary_d 0x4
+ #define utf8_mode_to_codepoint_d 0x8
+ #define utf8_mode_to_combining_d 0x10
+ #define utf8_mode_to_width_d 0x20
+#endif // _di_utf8_modes_
+
+/**
+ * The main program data.
+ *
+ * parameters: The state of pre-defined parameters passed to the program.
+ * remaining: The remaining, non-pre-defined parameters, passed to the program.
+ * process_pipe: Designate whether or not to process the input pipe.
+ * output: The output file for general printing.
+ * error: The output file for error printing.
+ * warning: The output file for warning printing.
+ * signal: The process signal management structure.
+ * context: The color context.
+ */
+#ifndef _di_utf8_main_t_
+ typedef struct {
+ f_console_parameters_t parameters;
+
+ 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;
+ } utf8_main_t;
+
+ #define utf8_main_t_initialize \
+ { \
+ f_console_parameters_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, \
+ f_color_context_t_initialize, \
+ }
+#endif // _di_utf8_main_t_
+
+/**
+ * Deallocate main.
+ *
+ * Be sure to call this after executing utf8_main().
+ *
+ * @param main
+ * The main program data.
+ *
+ * @return
+ * F_none on success.
+ *
+ * Status codes (with error bit) are returned on any problem.
+ *
+ * @see utf8_main()
+ */
+#ifndef _di_utf8_main_delete_
+ extern f_status_t utf8_main_delete(utf8_main_t *main);
+#endif // _di_utf8_main_delete_
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // _utf8_common_h
}
#endif // _di_utf8_main_
-#ifndef _di_utf8_main_delete_
- f_status_t utf8_main_delete(utf8_main_t *main) {
-
- f_console_parameters_delete(&main->parameters);
-
- f_type_array_lengths_resize(0, &main->remaining);
-
- macro_f_color_context_t_delete_simple(main->context);
-
- return F_none;
- }
-#endif // _di_utf8_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
#include <fll/level_2/print.h>
#include <fll/level_2/program.h>
+// UTF-8 includes.
+#include <program/utf8/common.h>
+
#ifdef __cplusplus
extern "C" {
#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_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
-
- #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))
-
- #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_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_
-
-/**
- * Set to at least 4 to provide a UTF-8 friendly allocation step.
- */
-#ifndef _di_utf8_default_allocation_step_
- #define utf8_default_allocation_step_d 16
-#endif // _di_utf8_default_allocation_step_
-
-#ifndef _di_utf8_defines_
- #define utf8_signal_check_d 10000
-
- #define utf8_string_from_s "from"
- #define utf8_string_to_s "to"
-
- #define utf8_string_verified_valid_s "Verified Valid"
- #define utf8_string_verified_valid_not_s "Verified Invalid"
-
- #define utf8_string_combining_is_s "C"
- #define utf8_string_combining_not_s "N"
- #define utf8_string_unknown_s "?"
-
- #define utf8_string_width_0_s "0"
- #define utf8_string_width_1_s "1"
- #define utf8_string_width_2_s "2"
-
- #define utf8_string_from_s_length 4
- #define utf8_string_to_s_length 2
-
- #define utf8_string_verified_valid_s_length 14
- #define utf8_string_verified_valid_not_s_length 16
-
- #define utf8_string_combining_is_s_length 1
- #define utf8_string_combining_not_s_length 1
- #define utf8_string_unknown_s_length 1
-
- #define utf8_string_width_0_s_length 1
- #define utf8_string_width_1_s_length 1
- #define utf8_string_width_2_s_length 1
-
- #define utf8_character_valid_not_s "�"
-
- #define utf8_short_from_binary_s "b"
- #define utf8_short_from_codepoint_s "c"
- #define utf8_short_from_file_s "f"
-
- #define utf8_short_headers_s "H"
- #define utf8_short_separate_s "S"
- #define utf8_short_strip_invalid_s "s"
- #define utf8_short_verify_s "v"
-
- #define utf8_short_to_binary_s "B"
- #define utf8_short_to_codepoint_s "C"
- #define utf8_short_to_combining_s "O"
- #define utf8_short_to_file_s "F"
- #define utf8_short_to_width_s "W"
-
- #define utf8_long_from_binary_s "from_binary"
- #define utf8_long_from_codepoint_s "from_codepoint"
- #define utf8_long_from_file_s "from_file"
-
- #define utf8_long_headers_s "headers"
- #define utf8_long_separate_s "separate"
- #define utf8_long_strip_invalid_s "strip_invalid"
- #define utf8_long_verify_s "verify"
-
- #define utf8_long_to_binary_s "to_binary"
- #define utf8_long_to_codepoint_s "to_codepoint"
- #define utf8_long_to_combining_s "to_combining"
- #define utf8_long_to_file_s "to_file"
- #define utf8_long_to_width_s "to_width"
-
- enum {
- utf8_parameter_help_e,
- utf8_parameter_light_e,
- utf8_parameter_dark_e,
- utf8_parameter_no_color_e,
- utf8_parameter_verbosity_quiet_e,
- utf8_parameter_verbosity_normal_e,
- utf8_parameter_verbosity_verbose_e,
- utf8_parameter_verbosity_debug_e,
- utf8_parameter_version_e,
-
- utf8_parameter_from_binary_e,
- utf8_parameter_from_codepoint_e,
- utf8_parameter_from_file_e,
-
- utf8_parameter_headers_e,
- utf8_parameter_separate_e,
- utf8_parameter_strip_invalid_e,
-
- utf8_parameter_to_binary_e,
- utf8_parameter_to_codepoint_e,
- utf8_parameter_to_combining_e,
- utf8_parameter_to_file_e,
- utf8_parameter_to_width_e,
-
- utf8_parameter_verify_e,
- };
-
- #define utf8_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(utf8_short_from_binary_s, utf8_long_from_binary_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_from_codepoint_s, utf8_long_from_codepoint_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_from_file_s, utf8_long_from_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_headers_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_separate_s, utf8_long_headers_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_strip_invalid_s, utf8_long_strip_invalid_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_binary_s, utf8_long_to_binary_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_codepoint_s, utf8_long_to_codepoint_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_combining_s, utf8_long_to_combining_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_file_s, utf8_long_to_file_s, 0, 1, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_to_width_s, utf8_long_to_width_s, 0, 0, f_console_type_normal_e), \
- macro_f_console_parameter_t_initialize(utf8_short_verify_s, utf8_long_verify_s, 0, 0, f_console_type_normal_e), \
- }
-
- #define utf8_total_parameters_d 21
-#endif // _di_utf8_defines_
-
-/**
- * Modes used to designate how to the input and output are to be processed.
- *
- * utf8_mode_from_*:
- * - binary: The input format is binary.
- * - codepoint: The input format is codepoint (U+XXXX or U+XXXXXX).
- *
- * utf8_mode_to_*:
- * - binary: The outout format is binary.
- * - codepoint: The outout format is codepoint (U+XXXX or U+XXXXXX).
- * - combining: The outout format is whether or not character is combining (may be used with "width").
- * - width: The outout format is how wide the character is (may be used with "combining").
- */
-#ifndef _di_utf8_modes_
- #define utf8_mode_from_binary_d 0x1
- #define utf8_mode_from_codepoint_d 0x2
- #define utf8_mode_to_binary_d 0x4
- #define utf8_mode_to_codepoint_d 0x8
- #define utf8_mode_to_combining_d 0x10
- #define utf8_mode_to_width_d 0x20
-#endif // _di_utf8_modes_
-
-/**
- * The main program data.
- *
- * parameters: The state of pre-defined parameters passed to the program.
- * remaining: The remaining, non-pre-defined parameters, passed to the program.
- * process_pipe: Designate whether or not to process the input pipe.
- * output: The output file for general printing.
- * error: The output file for error printing.
- * warning: The output file for warning printing.
- * signal: The process signal management structure.
- * context: The color context.
- */
-#ifndef _di_utf8_main_t_
- typedef struct {
- f_console_parameters_t parameters;
-
- 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;
- } utf8_main_t;
-
- #define utf8_main_t_initialize \
- { \
- f_console_parameters_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, \
- f_color_context_t_initialize, \
- }
-#endif // _di_utf8_main_t_
-
/**
* Print help.
*
extern f_status_t utf8_main(utf8_main_t * const main, const f_console_arguments_t *arguments);
#endif // _di_utf8_main_
-/**
- * Deallocate main.
- *
- * Be sure to call this after executing utf8_main().
- *
- * @param main
- * The main program data.
- *
- * @return
- * F_none on success.
- *
- * Status codes (with error bit) are returned on any problem.
- *
- * @see utf8_main()
- */
-#ifndef _di_utf8_main_delete_
- extern f_status_t utf8_main_delete(utf8_main_t *main);
-#endif // _di_utf8_main_delete_
-
#ifdef __cplusplus
} // extern "C"
#endif
build_libraries-monolithic -lfll
build_libraries_shared
build_libraries_static
-build_sources_library utf8.c private-common.c private-print.c private-utf8.c private-utf8_binary.c private-utf8_codepoint.c
+build_sources_library utf8.c common.c private-common.c private-print.c private-utf8.c private-utf8_binary.c private-utf8_codepoint.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 utf8.h
+build_sources_headers utf8.h common.h
build_sources_headers_shared
build_sources_headers_static
build_sources_script