After switching from f_string_t to f_string_static_t, the NULL terminated string problem has become apparent.
If at any point in time these strings are passed to a standard function that expects NULL terminated strings, then an invalid read (or write) can occur.
Manually appending a NULL termination every time its needed has made the code messier than I would like.
This commit changes the behavior to instead always append a NULL termination after the string.used when appending strings.
I accept the additional resource cost of 1-byte per string to guarantee this.
This should make the program more easily more secure by catering to the NULL terminated string code out there.
This project still doesn't need the or care about NULL termination for most (but not all) of its functions.
#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 * const destination) {
- if (destination->used + length > destination->size) {
- const f_status_t status = private_f_string_dynamic_increase_by(length, destination);
+ if (destination->used + length + 1 > destination->size) {
+ const f_status_t status = private_f_string_dynamic_increase_by(length + 1, destination);
if (F_status_is_error(status)) return status;
}
memcpy(destination->string + destination->used, source, length);
destination->used += length;
+ destination->string[destination->used] = 0;
return F_none;
}
#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 * const destination) {
- if (destination->used + length > F_string_t_size_d) {
- return F_status_set_error(F_string_too_large);
- }
-
f_status_t status = F_none;
f_array_length_t i = 0;
- f_array_length_t first = 0;
f_array_length_t size = 0;
+ // Count all of the NULLs and subtract them from the total size.
for (; i < length; ++i) {
+ if (source[i]) ++size;
+ } // for
+
+ if (destination->used + size + 1 > destination->size) {
+ status = private_f_string_dynamic_increase_by(size + 1, destination);
+ if (F_status_is_error(status)) return status;
+ }
+
+ f_array_length_t first = 0;
+
+ for (i = 0, size = 0; i < length; ++i) {
if (source[i]) continue;
if (i && i > first) {
size = i - first;
- if (destination->used + size > destination->size) {
- status = private_f_string_dynamic_increase_by(size, destination);
- if (F_status_is_error(status)) return status;
- }
-
memcpy(destination->string + destination->used, source + first, size);
destination->used += size;
}
if (i > first) {
size = i - first;
- if (destination->used + size > destination->size) {
- status = private_f_string_dynamic_increase_by(size, destination);
- if (F_status_is_error(status)) return status;
- }
-
memcpy(destination->string + destination->used, source + first, size);
destination->used += size;
}
+ destination->string[destination->used] = 0;
+
return F_none;
}
#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_)
environment->array[environment->used].name.used = 0;
environment->array[environment->used].value.used = 0;
- status = f_string_dynamic_increase_by(name.used + 1, &environment->array[environment->used].name);
-
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_append_nulless(name, &environment->array[environment->used].name);
- }
-
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&environment->array[environment->used].name);
- }
+ status = f_string_dynamic_append_nulless(name, &environment->array[environment->used].name);
if (F_status_is_error_not(status)) {
status = f_environment_get(name, &environment->array[environment->used].value);
environment->array[environment->used].name.used = 0;
environment->array[environment->used].value.used = 0;
- status = f_string_dynamic_increase_by(names.array[i].used + 1, &environment->array[environment->used].name);
-
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_append_nulless(names.array[i], &environment->array[environment->used].name);
- }
-
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&environment->array[environment->used].name);
- }
+ status = f_string_dynamic_append_nulless(names.array[i], &environment->array[environment->used].name);
if (F_status_is_error_not(status)) {
status = f_environment_get(names.array[i], &environment->array[environment->used].value);
}
-
- if (F_status_is_error(status)) {
+ else {
environment->array[environment->used].name.used = 0;
environment->array[environment->used].value.used = 0;
*
* Errors (with error bit) from: f_environment_get().
* Errors (with error bit) from: f_string_dynamic_append_nulless().
- * Errors (with error bit) from: f_string_dynamic_increase_by().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_maps_increase_by().
*
* @see f_environment_get()
* @see f_string_dynamic_append_nulless()
- * @see f_string_dynamic_increase_by()
- * @see f_string_dynamic_terminate_after()
* @see f_string_maps_increase_by()
*/
#ifndef _di_fl_environment_load_name_
*
* @param names
* An array of valid environment variable names.
+ * The strings in the array must be NULL terminated.
* @param environment
* An array of maps generated from the loaded environment variable names.
* All environment names loaded are appended to this.
status = f_string_dynamic_append(program_name, &paths.array[i]);
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&paths.array[i]);
- }
-
- if (F_status_is_error_not(status)) {
status = f_file_exists(paths.array[i]);
if (status == F_true) {
status = f_string_dynamic_append(program_name, &paths.array[i]);
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&paths.array[i]);
- }
-
- if (F_status_is_error_not(status)) {
status = f_file_exists(paths.array[i]);
if (status == F_true) {
*
* Errors (with error bit) from: f_string_dynamic_append().
* Errors (with error bit) from: f_string_dynamic_resize().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_dynamic_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fll_execute_arguments_add_
*
* 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_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fll_execute_arguments_add_parameter_
*
* 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_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fll_execute_arguments_add_parameter_set_
*
* 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_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fll_execute_arguments_add_set_
*
* Errors (with error bit) from: f_environment_get().
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: fl_environment_path_explode().
*
* @see execv()
*
* @see f_environment_get()
* @see f_string_dynamic_append()
- * @see f_string_dynamic_terminate_after()
* @see fl_environment_path_explode()
*/
#ifndef _di_fll_execute_into_
* Errors (with error bit) from: f_signal_mask().
* 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_after().
* Errors (with error bit) from: f_string_dynamics_resize().
* Errors (with error bit) from: f_thread_signal_mask().
* Errors (with error bit) from: fl_environment_path_explode().
* @see f_limit_process()
* @see f_signal_mask()
* @see f_string_dynamic_append()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_resize()
* @see f_thread_signal_mask()
* @see fl_control_group_apply()
status = f_string_dynamic_append(source, &arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
- status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
- if (F_status_is_error(status)) return status;
-
++arguments->used;
return F_none;
status = f_string_dynamic_append(prefix, &arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
- status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
- if (F_status_is_error(status)) return status;
-
++arguments->used;
status = f_string_dynamics_increase(F_memory_default_allocation_small_d, arguments);
status = f_string_dynamic_append(value, &arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
- status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
- if (F_status_is_error(status)) return status;
-
++arguments->used;
return F_none;
*
* Errors (with error bit) from: f_string_dynamic_increase_by().
* Errors (with error bit) from: f_string_dynamic_resize().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_dynamic_increase_by()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_)
*
* 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_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_append()
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
* @see fll_execute_arguments_add_parameter()
* @see fll_execute_arguments_add_parameter_set()
status = f_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]);
if (F_status_is_error(status)) return status;
- status = f_string_dynamic_terminate_after(&values[j]->array[values[j]->used]);
- if (F_status_is_error(status)) return status;
-
++values[j]->used;
if (indexs) {
--canonical->used;
}
- status = f_string_dynamic_terminate_after(canonical);
- if (F_status_is_error(status)) return status;
-
return F_none;
}
#endif // _di_fll_path_canonical_
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: f_string_append_assure().
* Errors (with error bit) from: f_string_dynamic_append_assure().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see f_path_current()
* @see f_string_append()
* @see f_string_append_assure()
* @see f_string_dynamic_append_assure()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_fll_path_canonical_
extern f_status_t fll_path_canonical(const f_string_static_t path, f_string_dynamic_t *canonical);
fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true);
}
}
- else {
- status = f_string_dynamic_terminate_after(&data->cache.buffer_small);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- }
status = f_file_exists(data->cache.buffer_small);
} // for
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&data->cache.buffer_small);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- }
-
- if (F_status_is_error_not(status)) {
status = f_file_exists(data->cache.buffer_small);
if (F_status_is_error(status) || status == F_false) {
* Errors (with error bit) from: f_string_append_assure().
* Errors (with error bit) from: f_string_dynamic_append_nulless().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_resize().
* Errors (with error bit) from: fl_fss_apply_delimit().
* Errors (with error bit) from: fll_fss_extended_read().
* @see f_string_append_assure()
* @see f_string_dynamic_append_nulless()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_resize()
* @see fl_fss_apply_delimit()
* @see fll_fss_extended_read()
const f_string_static_t controller_wish_s = macro_f_string_static_t_initialize(CONTROLLER_wish_s, 0, CONTROLLER_wish_s_length);
const f_string_static_t controller_with_s = macro_f_string_static_t_initialize(CONTROLLER_with_s, 0, CONTROLLER_with_s_length);
const f_string_static_t controller_yes_s = macro_f_string_static_t_initialize(CONTROLLER_yes_s, 0, CONTROLLER_yes_s_length);
+
+ const f_string_static_t controller_Entry_s = macro_f_string_static_t_initialize(CONTROLLER_Entry_s, 0, CONTROLLER_Entry_s_length);
+ const f_string_static_t controller_Exit_s = macro_f_string_static_t_initialize(CONTROLLER_Exit_s, 0, CONTROLLER_Exit_s_length);
#endif // _di_controller_string_s_
#ifdef __cplusplus
#define CONTROLLER_with_s "with"
#define CONTROLLER_yes_s "yes"
+ #define CONTROLLER_Entry_s "Entry"
+ #define CONTROLLER_Exit_s "Exit"
+
#define CONTROLLER_action_s_length 6
#define CONTROLLER_actions_s_length 7
#define CONTROLLER_affinity_s_length 8
#define CONTROLLER_with_s_length 4
#define CONTROLLER_yes_s_length 3
+ #define CONTROLLER_Entry_s_length 5
+ #define CONTROLLER_Exit_s_length 4
+
extern const f_string_static_t controller_action_s;
extern const f_string_static_t controller_actions_s;
extern const f_string_static_t controller_affinity_s;
extern const f_string_static_t controller_wish_s;
extern const f_string_static_t controller_with_s;
extern const f_string_static_t controller_yes_s;
+
+ extern const f_string_static_t controller_Entry_s;
+ extern const f_string_static_t controller_Exit_s;
#endif // _di_controller_string_s_
/**
return status;
}
- status = f_string_dynamic_terminate_after(&setting.name_entry);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- controller_main_delete(main);
-
- return status;
- }
-
if (main->parameters.array[controller_parameter_init_e].result == f_console_result_found_e) {
main->as_init = F_true;
}
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
}
- else {
- status = f_string_dynamic_terminate_after(&setting.path_pid);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- }
}
if (F_status_is_error_not(status)) {
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true);
}
- else {
- status = f_string_dynamic_terminate_after(&setting.path_cgroup);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- }
}
}
else {
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true);
}
- else {
- status = f_string_dynamic_terminate_after(&setting.path_cgroup);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- }
}
}
}
#ifndef _di_controller_string_dynamic_rip_nulless_terminated_
f_status_t controller_dynamic_rip_nulless_terminated(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
- f_status_t status = fl_string_dynamic_rip_nulless(source, range, destination);
- if (F_status_is_error(status)) return status;
-
- return f_string_dynamic_terminate_after(destination);
+ return fl_string_dynamic_rip_nulless(source, range, destination);
}
#endif // _di_controller_string_dynamic_rip_nulless_terminated_
#ifndef _di_controller_string_dynamic_append_terminated_
f_status_t controller_dynamic_append_terminated(const f_string_static_t source, f_string_dynamic_t *destination) {
- f_status_t status = f_string_dynamic_append_nulless(source, destination);
- if (F_status_is_error(status)) return status;
-
- return f_string_dynamic_terminate_after(destination);
+ return f_string_dynamic_append_nulless(source, destination);
}
#endif // _di_controller_string_dynamic_append_terminated_
#ifndef _di_controller_string_dynamic_partial_append_terminated_
f_status_t controller_dynamic_partial_append_terminated(const f_string_static_t source, const f_string_range_t range, f_string_dynamic_t *destination) {
- f_status_t status = f_string_dynamic_partial_append(source, range, destination);
- if (F_status_is_error(status)) return status;
-
- return f_string_dynamic_terminate_after(destination);
+ return f_string_dynamic_partial_append(source, range, destination);
}
#endif // _di_controller_string_dynamic_partial_append_terminated_
return status;
}
- status = f_string_dynamic_terminate_after(&cache->action.name_file);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
-
f_string_static_t path = f_string_static_t_initialize;
if (global.setting->path_setting.used) {
* @return
* F_none on success.
*
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: fl_string_dynamic_rip_nulless().
*
- * @see f_string_dynamic_terminate_after()
* @see fl_string_dynamic_rip_nulless()
*/
#ifndef _di_controller_string_dynamic_rip_nulless_terminated_
* F_none on success.
*
* Errors (with error bit) from: f_string_dynamic_append_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see f_string_dynamic_append_nulless()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_controller_string_dynamic_append_terminated_
extern f_status_t controller_dynamic_append_terminated(const f_string_static_t from, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
* F_none on success.
*
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see f_string_dynamic_append()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_controller_string_dynamic_partial_append_terminated_
extern f_status_t controller_dynamic_partial_append_terminated(const f_string_static_t from, const f_string_range_t range, f_string_dynamic_t *destination) F_attribute_visibility_internal_d;
* Errors (with error bit) from: f_file_stream_open().
* Errors (with error bit) from: f_file_stream_read().
* Errors (with error bit) from: f_string_append().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see f_file_stat()
* @see f_file_stream_open()
* @see f_file_stream_read()
* @see f_string_append()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_controller_file_load_
extern f_status_t controller_file_load(const controller_global_t global, const bool required, const f_string_static_t path_prefix, const f_string_static_t path_name, const f_string_static_t path_suffix, controller_cache_t * const cache) F_attribute_visibility_internal_d;
if (F_status_is_error(status)) {
controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, global.thread);
}
- else {
- status = f_string_dynamic_terminate_after(&action->parameters.array[j]);
-
- if (F_status_is_error(status)) {
- controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, global.thread);
- }
- }
}
++action->parameters.used;
}
else {
if (fl_string_dynamic_compare(action->parameters.array[1], cache->buffer_path) == F_equal_to_not) {
-
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
- status = f_string_dynamic_terminate_after(&cache->buffer_path);
-
- if (F_status_is_error(status)) {
- controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, global.thread);
-
- action->status = status;
-
- if (F_status_set_fine(status) == F_memory_not) {
- status_action = status;
- }
-
- break;
- }
-
flockfile(global.main->error.to.stream);
fl_print_format("%r%[%QThe %r item action second parameter '%]", global.main->error.to.stream, f_string_eol_s, global.main->error.context, global.main->error.prefix, is_entry ? controller_entry_s : controller_exit_s, global.main->error.context);
}
}
- status = f_string_dynamic_terminate_after(&cache->action.generic);
-
- if (F_status_is_error(status)) {
- controller_entry_print_error(is_entry, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, global.thread);
-
- global.setting->path_control.used = 0;
-
- break;
- }
-
status = fll_path_canonical(cache->action.generic, &global.setting->path_control);
if (F_status_is_error(status)) {
* Errors (with error bit) from: fl_fss_apply_delimit().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
* Errors (with error bit) from: fl_string_dynamic_rip_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase_by().
* Errors (with error bit) from: fll_fss_extended_read().
*
* @see controller_entry_actions_increase_by()
* @see f_fss_count_lines()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase_by()
* @see fl_fss_apply_delimit()
* @see fl_string_dynamic_rip_nulless()
*
* Errors (with error bit) from: macro_f_array_lengths_t_increase_by().
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* This will detect and report all errors, but only the first error is returned.
* Memory related errors return immediately.
* @see macro_f_array_lengths_t_increase_by()
* @see f_string_dynamic_append()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_controller_entry_preprocess_
extern f_status_t controller_entry_preprocess(const controller_global_t global, const bool is_entry, controller_cache_t * const cache) F_attribute_visibility_internal_d;
controller_lock_print(print.to, thread);
- fl_print_format("%r%[%Q%s setting%S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, is_entry ? "Entry" : "Exit", before, print.context);
+ fl_print_format("%r%[%Q%r setting%S '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, is_entry ? controller_Entry_s : controller_Exit_s, before, print.context);
fl_print_format("%[%/Q%]", print.to.stream, print.notable, cache->buffer_file, range, print.notable);
fl_print_format("%['%S.%]%r", print.to.stream, print.context, after, print.context, f_string_eol_s);
fl_print_format("%[%Q%]", global.main->error.to.stream, global.main->error.notable, cache.action.name_action, global.main->error.notable);
fl_print_format("%[' requires exactly %]", global.main->error.to.stream, global.main->error.context, global.main->error.context);
fl_print_format("%[%un%]", global.main->error.to.stream, global.main->error.notable, total, global.main->error.notable);
- fl_print_format("%[' %s.%]%r", global.main->error.to.stream, global.main->error.context, total > 1 ? controller_parameters_s : controller_parameter_s, global.main->error.context, f_string_eol_s);
+ fl_print_format("%[' %r.%]%r", global.main->error.to.stream, global.main->error.context, total > 1 ? controller_parameters_s : controller_parameter_s, global.main->error.context, f_string_eol_s);
controller_entry_print_error_cache(is_entry, global.main->error, cache.action);
status = f_string_dynamic_append(alias, &process->rule.alias);
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&process->rule.alias);
+ process->id = global.thread->processs.used++;
+ status = F_none;
- if (F_status_is_error_not(status)) {
- process->id = global.thread->processs.used++;
- status = F_none;
-
- if (id) {
- *id = process->id;
- }
+ if (id) {
+ *id = process->id;
}
}
* F_lock (with error bit) if failed to re-establish read lock on global.thread->lock.process while returning.
*
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* Errors (with error bit) from: controller_lock_read().
* Errors (with error bit) from: controller_lock_write().
*
* @see f_string_dynamic_append()
- * @see f_string_dynamic_terminate_after()
* @see controller_lock_read()
* @see controller_lock_write()
*/
return status;
}
- status = f_string_dynamic_terminate_after(¶meters->array[0]);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
-
++parameters->used;
}
return status;
}
- status = f_string_dynamic_terminate_after(¶meters->array[parameters->used]);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
-
++parameters->used;
} // for
}
if (F_status_is_error(status)) {
controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
}
-
- status = f_string_dynamic_terminate_after(&actions->array[actions->used].parameters.array[0]);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
else {
actions->array[actions->used++].parameters.used = 1;
}
if (F_status_is_error(status)) {
controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "fl_string_dynamic_rip", F_true);
}
- else {
- status = f_string_dynamic_terminate_after(&item->pid_file);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- }
}
else if (type == controller_rule_action_type_rerun_e) {
uint8_t type_rerun = 0;
controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_partial_mash_nulless", F_true);
}
else {
- status = f_string_dynamic_terminate_after(&actions->array[actions->used].parameters.array[0]);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- else {
- actions->array[actions->used++].parameters.used = 1;
- }
+ actions->array[actions->used++].parameters.used = 1;
}
}
}
#ifndef _di_controller_rule_copy_
f_status_t controller_rule_copy(const controller_rule_t source, controller_rule_t *destination) {
- f_status_t status = F_none;
-
// Delete the third party structures.
macro_f_control_group_t_delete_simple(destination->cgroup)
f_capability_delete(&destination->capability);
destination->ons.used = 0;
destination->items.used = 0;
+ f_status_t status = F_none;
+
if (source.alias.used) {
status = f_string_dynamic_append(source.alias, &destination->alias);
if (F_status_is_error(status)) return status;
status = f_string_dynamic_append(item_source->pid_file, &item_destination->pid_file);
if (F_status_is_error(status)) return status;
- status = f_string_dynamic_terminate_after(&item_destination->pid_file);
- if (F_status_is_error(status)) return status;
-
for (j = 0; j < controller_rule_action_type_execute__enum_size_e; ++j) {
item_destination->reruns[j].is = item_source->reruns[j].is;
item_destination->reruns[j].failure.count = item_source->reruns[j].failure.count;
return status;
}
- status = f_string_dynamic_terminate_after(alias);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
-
return status;
}
#endif // _di_controller_rule_id_construct_
return status;
}
- status = f_string_dynamic_terminate_after(&process->cache.action.name_file);
-
- if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, process->cache.action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_true);
-
- return status;
- }
-
if ((process->options & controller_process_option_simulate_d) && (process->options & controller_process_option_validate_d)) {
controller_rule_validate(global, process->rule, process->action, process->options, &process->cache);
}
controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
}
else {
- status = f_string_dynamic_terminate_after(&rule->alias);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
- }
- else {
- status = controller_file_load(global, F_true, controller_rules_s, rule->alias, controller_rule_s, cache);
- }
+ status = controller_file_load(global, F_true, controller_rules_s, rule->alias, controller_rule_s, cache);
}
if (F_status_is_error_not(status)) {
break;
}
- status = f_string_dynamic_terminate_after(&cache->buffer_item);
-
- if (F_status_is_error(status)) {
- controller_print_error(global.thread, global.main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
if (rule->items.array[rule->items.used].type) {
// Initialize the item with settings.
if (F_status_is_error(status)) {
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
- }
- else {
- status = f_string_dynamic_terminate_after(&cache->action.name_item);
- if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false);
- }
- }
-
- if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
if (F_status_is_error(status)) {
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
- }
- else {
- status = f_string_dynamic_terminate_after(&cache->action.name_action);
-
- if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false);
- }
- }
-
- if (F_status_is_error(status)) {
// Get the current line number within the settings item.
cache->action.line_item = line_item;
if (F_status_is_error(status)) {
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
- }
- else {
- status = f_string_dynamic_terminate_after(&setting_maps->array[setting_maps->used].value);
- if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false);
- }
- }
-
- if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
if (F_status_is_error(status)) {
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
- }
- else {
- status = f_string_dynamic_terminate_after(setting_value);
- if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false);
- }
- }
-
- if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_memory_not) {
status_return = status;
}
}
- status = f_string_dynamic_terminate_after(&cache->action.generic);
-
- if (F_status_is_error(status)) {
-
- // Get the current line number within the settings item.
- cache->action.line_item = line_item;
- f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
-
- cache->action.line_action = ++cache->action.line_item;
-
- controller_lock_print(global.main->error.to, global.thread);
-
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false);
-
- controller_rule_print_error_cache(global.main->error, cache->action, F_false);
-
- controller_unlock_print_flush(global.main->error.to, global.thread);
-
- if (F_status_set_fine(status) == F_memory_not) {
- status_return = status;
-
- break;
- }
-
- if (F_status_is_error_not(status_return)) {
- status_return = F_status_set_error(F_valid_not);
- }
- }
-
status = f_capability_from_text(cache->action.generic, &rule->capability);
if (F_status_is_error(status) && F_status_set_fine(status) != F_supported_not) {
status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&cache->action.generic);
- }
-
if (F_status_is_error(status)) {
// Get the current line number within the settings item.
controller_lock_print(global.main->error.to, global.thread);
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), cache->action.generic.used ? "f_string_dynamic_partial_append_nulless" : "f_string_dynamic_terminate_after", F_true, F_false);
+ controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
controller_rule_print_error_cache(global.main->error, cache->action, F_false);
status = f_string_dynamic_partial_append_nulless(cache->buffer_item, cache->content_actions.array[i].array[0], &cache->action.generic);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&cache->action.generic);
- }
-
controller_rule_setting_read_print_value(global, controller_user_s, f_string_empty_s, cache->action.generic, 0);
}
}
}
else {
- // get the current line number within the settings item.
+ // Get the current line number within the settings item.
cache->action.line_item = line_item;
f_fss_count_lines(cache->buffer_item, cache->object_actions.array[i].start, &cache->action.line_item);
if (F_status_is_error(status)) {
controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_partial_append_nulless", F_true, F_false);
- }
- else {
- status = f_string_dynamic_terminate_after(&setting_values->array[setting_values->used]);
- if (F_status_is_error(status)) {
- controller_rule_print_error(global.thread, global.main->error, cache->action, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true, F_false);
- }
- }
-
- if (F_status_is_error(status)) {
setting_values->array[setting_values->used].used = 0;
if (F_status_set_fine(status) == F_memory_not) {
if (global.main->error.verbosity == f_console_verbosity_debug_e || (global.main->error.verbosity == f_console_verbosity_verbose_e && global.main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e)) {
controller_lock_print(global.main->output.to, global.thread);
- fl_print_format("%rProcessing rule item action '%[%S%]', adding ", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, controller_on_s, global.main->context.set.title);
+ fl_print_format("%rProcessing rule item action '%[%r%]', adding ", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, controller_on_s, global.main->context.set.title);
fl_print_format("'%[%/Q%]' of ", global.main->output.to.stream, global.main->context.set.notable, cache->buffer_item, cache->content_actions.array[i].array[1], global.main->context.set.notable);
fl_print_format("'%[%/Q%]/", global.main->output.to.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[i].array[2], global.main->context.set.important);
fl_print_format("%[%/Q%]'.%r", global.main->output.to.stream, global.main->context.set.important, cache->buffer_item, cache->content_actions.array[i].array[3], global.main->context.set.important, f_string_eol_s);
* F_none on success.
*
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see f_string_append()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_controller_rule_id_construct_
extern f_status_t controller_rule_id_construct(const controller_global_t global, const f_string_static_t source, const f_string_range_t directory, const f_string_range_t basename, f_string_dynamic_t * const alias) F_attribute_visibility_internal_d;
*
* Errors (with error bit) from: f_fss_count_lines().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see controller_rule_action_read()
* @see f_fss_count_lines()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_controller_rule_item_read_
extern f_status_t controller_rule_item_read(const controller_global_t global, const bool is_normal, controller_cache_t * const cache, controller_rule_item_t * const item) F_attribute_visibility_internal_d;
* @see fl_fss_apply_delimit().
* @see f_string_dynamic_partial_append().
* @see f_string_dynamic_partial_append_nulless().
- * @see f_string_dynamic_terminate_after().
* @see fll_fss_basic_list_read().
*/
#ifndef _di_controller_rule_read_
break;
}
- *status = f_string_dynamic_terminate_after(&source_path);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
source.used = source_path.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
else {
break;
}
-
- *status = f_string_dynamic_terminate_after(settings_single_destination[i]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
}
if (!settings_single_source[i]->used) continue;
break;
}
-
- *status = f_string_dynamic_terminate_after(settings_single_destination[i]);
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
}
}
} // for
return;
}
-
- *status = f_string_dynamic_terminate_after(&main->path_sources);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- return;
- }
}
if (main->parameters.array[fake_parameter_shared_disabled_e].result == f_console_result_found_e) {
break;
}
-
- *status = f_string_dynamic_terminate_after(values[i]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
} // for
f_string_dynamic_resize(0, &settings_file_base);
* Errors (with error bit) from: f_path_directory_cleanup().
* Errors (with error bit) from: f_string_dynamic_append().
* Errors (with error bit) from: f_string_dynamic_increase_by().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: fll_fss_snatch_apart().
*
* @see f_path_directory_cleanup()
* @see f_string_dynamic_append()
* @see f_string_dynamic_increase_by()
- * @see f_string_dynamic_terminate_after()
* @see fll_fss_snatch_apart()
*/
#ifndef _di_fake_build_load_setting_process_
break;
}
- *status = f_string_dynamic_terminate_after(&destination_path);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
*status = f_directory_exists(destination_path);
if (*status == F_false) {
break;
}
- *status = f_string_dynamic_terminate_after(&path_source);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
*status = f_directory_is(path_source);
if (*status == F_true) {
break;
}
- *status = f_string_dynamic_terminate_after(&destination_directory);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
*status = fl_directory_copy(path_source, destination_directory, mode, recurse);
if (F_status_is_error(*status)) {
break;
}
- *status = f_string_dynamic_terminate_after(&destination_directory);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
*status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d);
if (F_status_is_error(*status)) {
}
}
- *status = f_string_dynamic_terminate_after(&destination_file);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
*status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, F_false);
if (F_status_is_error(*status)) {
return 0;
}
-
- *status = f_string_dynamic_terminate_after(&defines);
-
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- f_string_dynamic_resize(0, &defines);
- f_string_dynamics_resize(0, &arguments);
-
- return 0;
- }
}
const f_string_static_t parameters_prefix[] = {
}
f_string_dynamic_t path = f_string_dynamic_t_initialize;
- f_string_t function = 0;
-
- {
- function = "f_string_dynamic_append_nulless";
-
- if (process_script.string[0] != '/') {
- *status = f_string_dynamic_append_nulless(main->path_data_build, &path);
- }
- if (F_status_is_error_not(*status)) {
- *status = f_string_dynamic_append_nulless(process_script, &path);
- }
+ if (process_script.string[0] != '/') {
+ *status = f_string_dynamic_append_nulless(main->path_data_build, &path);
+ }
- if (F_status_is_error_not(*status)) {
- function = "f_string_dynamic_terminate_after";
- *status = f_string_dynamic_terminate_after(&path);
- }
+ if (F_status_is_error_not(*status)) {
+ *status = f_string_dynamic_append_nulless(process_script, &path);
+ }
- if (F_status_is_error(*status)) {
- fll_error_print(main->error, F_status_set_fine(*status), function, F_true);
+ if (F_status_is_error(*status)) {
+ fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
- f_string_dynamic_resize(0, &path);
- f_string_dynamics_resize(0, &arguments);
+ f_string_dynamic_resize(0, &path);
+ f_string_dynamics_resize(0, &arguments);
- return 0;
- }
+ return 0;
}
int return_code = 0;
}
} // for
- status = f_string_dynamic_terminate_after(name);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
-
return F_none;
}
#endif // _di_fake_build_get_file_name_without_extension_
}
}
- {
- f_string_dynamic_t * const parameters_value[] = {
- &main->path_build_documents,
- &main->path_build_includes,
- &main->path_build_libraries,
- &main->path_build_libraries_script,
- &main->path_build_libraries_shared,
- &main->path_build_libraries_static,
- &main->path_build_objects,
- &main->path_build_objects_script,
- &main->path_build_objects_shared,
- &main->path_build_objects_static,
- &main->path_build_programs,
- &main->path_build_programs_script,
- &main->path_build_programs_shared,
- &main->path_build_programs_static,
- &main->path_build_settings,
- &main->path_build_stage,
- &main->path_data_build,
- &main->path_data_settings,
- &main->path_documents,
- &main->path_licenses,
- &main->path_sources,
- &main->path_work_includes,
- &main->path_work_libraries,
- &main->path_work_libraries_script,
- &main->path_work_libraries_shared,
- &main->path_work_libraries_static,
- &main->path_work_programs,
- &main->path_work_programs_script,
- &main->path_work_programs_shared,
- &main->path_work_programs_static,
- &main->file_data_build_defines,
- &main->file_data_build_dependencies,
- &main->file_data_build_process_post_s,
- &main->file_data_build_process_pre_s,
- &main->file_data_build_fakefile,
- &main->file_data_build_settings,
- &main->file_documents_readme,
- };
-
- for (i = 0; i < 37; ++i) {
-
- if (!parameters_value[i]->used) continue;
-
- status = f_string_dynamic_terminate_after(parameters_value[i]);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
- } // for
- }
-
return F_none;
}
#endif // _di_fake_path_generate_
return status;
}
}
-
- status = f_string_dynamic_terminate_after(parameters_value[i]);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
} // for
}
return status;
}
}
-
- status = f_string_dynamic_terminate_after(parameters_value[i]);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
} // for
}
}
if (F_status_is_error_not(*status)) {
- function_name = "f_string_dynamic_terminate_after";
- *status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].name);
- }
-
- if (F_status_is_error_not(*status)) {
function_name = "f_string_dynamics_resize";
*status = f_string_dynamics_resize(1, &data_make->setting_make.parameter.array[0].value);
}
- if (F_status_is_error_not(*status)) {
- function_name = "f_string_dynamic_terminate_after";
- *status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]);
- }
-
if (F_status_is_error(*status)) {
fll_error_print(data_make->main->error, F_status_set_fine(*status), function_name, F_true);
if (F_status_is_error(status)) break;
- status = f_string_dynamic_terminate_after(&combined);
-
- if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
status = f_environment_set(define.array[i].name, combined, F_true);
if (F_status_is_error(status)) {
break;
}
- status = f_string_dynamic_terminate_after(&name_define);
-
- if (F_status_is_error(status)) {
- fll_error_print(data_make->main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
// The environment settings are stored in the build settings rather than the make settings.
if (fake_make_operate_validate_define_name(name_define) == F_true) {
for (j = 0; j < data_make->setting_build.environment.used; ++j) {
break;
}
- status = f_string_dynamic_terminate_after(&data_make->setting_build.environment.array[data_make->setting_build.environment.used]);
-
- if (F_status_is_error(status)) {
- fll_error_print(data_make->main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
++data_make->setting_build.environment.used;
}
else if (data_make->main->warning.verbosity == f_console_verbosity_verbose_e) {
break;
}
- status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]);
-
- if (F_status_is_error(status)) {
- fll_error_print(data_make->main->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
status = f_string_dynamic_append_assure(f_string_space_s, &data_make->setting_make.parameter.array[0].value.array[0]);
if (F_status_is_error(status)) {
*
* Errors (with error bit) from: f_environment_set().
* Errors (with error bit) from: f_string_dynamic_mash_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: fll_fss_snatch_map_apart().
*
* @see f_environment_set()
* @see f_string_dynamic_mash_nulless()
- * @see f_string_dynamic_terminate_after()
* @see fll_fss_snatch_map_apart()
*/
#ifndef _di_fake_make_load_fakefile_setting_define_and_parameter_
*
* Errors (with error bit) from: f_string_dynamic_append().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_dynamic_append()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fake_make_load_fakefile_setting_environment_
*
* Errors (with error bit) from: f_string_append_assure().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see f_string_append_assure()
* @see f_string_dynamic_partial_append_nulless()
- * @see f_string_dynamic_terminate_after()
*
* @see fake_make_load_fakefile_setting_define_and_parameter()
*/
}
}
- *status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
// Unquoted empty Content after IKI variable substitution are not used as an argument.
if (used_content < arguments->array[arguments->used].used || quotes.array[i]) {
++arguments->used;
break;
}
- *status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
-
- if (F_status_is_error(*status)) {
- fll_error_print(data_make->error, F_status_set_fine(*status), "f_string_dynamic_terminate_after", F_true);
-
- break;
- }
-
++arguments->used;
}
status = f_string_dynamic_append_nulless(value, &arguments->array[arguments->used]);
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
-
- if (F_status_is_error_not(status)) {
- ++arguments->used;
- }
+ ++arguments->used;
}
}
}
status = f_string_dynamic_append_nulless(*context, &arguments->array[arguments->used]);
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
-
- if (F_status_is_error_not(status)) {
- ++arguments->used;
- }
+ ++arguments->used;
}
}
}
}
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&data_make->cache_1);
- }
-
- if (F_status_is_error_not(status)) {
status = f_environment_get(data_make->cache_1, &data_make->cache_2);
}
status = f_string_dynamic_append_nulless(data_make->cache_2, &arguments->array[arguments->used]);
}
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
- }
-
if (F_status_is_error(status)) return status;
if (!quoted) {
* Errors (with error bit) from: f_string_dynamic_append_nulless().
* Errors (with error bit) from: f_string_dynamic_partial_append_nulless().
* Errors (with error bit) from: f_string_dynamic_increase_by().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_increase().
*
* @see f_string_dynamic_append_nulless()
* @see f_string_dynamic_partial_append_nulless()
* @see f_string_dynamic_increase_by()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_increase()
*/
#ifndef _di_fake_make_operate_expand_environment_
return status;
}
- status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[0].value.array[0]);
-
- if (F_status_is_error(status)) {
- fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
-
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
* Errors (with error bit) from: f_conversion_number_signed_to_string().
* Errors (with error bit) from: f_string_append().
* Errors (with error bit) from: f_string_dynamic_append().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
*
* @see f_conversion_number_signed_to_string()
* @see f_string_append()
* @see f_string_dynamic_append()
- * @see f_string_dynamic_terminate_after()
*/
#ifndef _di_fake_make_operate_process_return_
extern f_status_t fake_make_operate_process_return(fake_make_data_t * const data_make, const int return_code) F_attribute_visibility_internal_d;
return status;
}
- status = f_string_dynamic_terminate_after(&data_make->setting_make.parameter.array[data_make->setting_make.parameter.used].name);
-
- if (F_status_is_error(status)) {
- fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_terminate_after", F_true);
-
- return status;
- }
-
i = data_make->setting_make.parameter.used++;
}
* F_none on success.
*
* Errors (with error bit) from: f_string_dynamic_resize().
- * Errors (with error bit) from: f_string_dynamic_terminate_after().
* Errors (with error bit) from: f_string_dynamics_resize().
* Errors (with error bit) from: f_string_map_multis_resize().
*
* @see f_string_dynamic_resize()
- * @see f_string_dynamic_terminate_after()
* @see f_string_dynamics_resize()
* @see f_string_map_multis_resize()
*/
status = f_string_dynamic_append(firewall_file_suffix_s, &path_file);
}
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&path_file);
- }
-
if (F_status_is_error(status)) {
firewall_print_error_on_allocation_failure(main->error);
status = f_string_dynamic_append(main->devices.array[local.device], &device);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&device);
- }
-
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_memory_not) {
firewall_print_error_on_allocation_failure(main->error);
if (length) {
status = f_string_dynamic_partial_append(local.buffer, local.rule_contents.array[i].array[0], &device);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&device);
- }
-
if (F_status_is_error(status)) break;
}
status = f_string_dynamic_partial_append(local.buffer, local.rule_contents.array[i].array[0], &protocol);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&protocol);
- }
-
if (F_status_is_error(status)) break;
use_protocol = F_true;
status = f_string_dynamic_append(firewall_action_policy_command_s, &arguments.array[arguments.used]);
}
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
if (action == firewall_action_append_id_e || action == firewall_action_insert_id_e || action == firewall_action_policy_id_e) {
status = f_string_dynamic_append(firewall_chain_output_s, &arguments.array[arguments.used]);
}
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
if (status == F_data_not) {
if (direction == firewall_direction_input_id_e) {
status = f_string_dynamic_append(firewall_device_input_command_s, &arguments.array[arguments.used]);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
++arguments.used;
else if (direction == firewall_direction_output_id_e) {
status = f_string_dynamic_append(firewall_device_output_command_s, &arguments.array[arguments.used]);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
++arguments.used;
status = f_string_dynamic_append(device, &arguments.array[arguments.used]);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
++arguments.used;
status = f_string_dynamic_append(firewall_protocol_command_s, &arguments.array[arguments.used]);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
++arguments.used;
status = f_string_dynamic_append(protocol, &arguments.array[arguments.used]);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
++arguments.used;
status = f_string_dynamic_partial_append(local.buffer, local.rule_contents.array[i].array[subcounter], &ip_list);
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&ip_list);
- }
-
if (F_status_is_error(status)) {
// Prevent the loop below from being processed.
arguments.array[arguments.used].used = 0;
status = f_string_dynamic_partial_append(local.buffer, local.rule_contents.array[i].array[subcounter], &arguments.array[arguments.used]);
-
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
++arguments.used;
arguments.array[arguments.used].used = 0;
status = f_string_dynamic_partial_append(local_buffer, basic_objects.array[at], &arguments.array[arguments.used]);
-
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[arguments.used]);
- }
-
if (F_status_is_error(status)) break;
++arguments.used;
status = f_string_dynamic_append(firewall_chain_create_command_s, &arguments.array[0]);
if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments.array[0]);
- }
-
- if (F_status_is_error_not(status)) {
status = f_string_dynamic_increase(F_memory_default_allocation_small_d, &arguments.array[1]);
}
-
- if (F_status_is_error(status)) {
+ else {
f_string_dynamics_resize(0, &arguments);
return status;