} f_console_parameters_t;
#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 }
#endif // _di_f_console_parameters_t_
/**
#endif // _di_f_file_type_
#ifndef _di_f_file_operation_strings_
+ const f_string_static_t f_file_operation_access_s = macro_f_string_static_t_initialize(F_file_operation_access_s, 0, F_file_operation_access_s_length);
+ const f_string_static_t f_file_operation_analyze_s = macro_f_string_static_t_initialize(F_file_operation_analyze_s, 0, F_file_operation_analyze_s_length);
const f_string_static_t f_file_operation_append_s = macro_f_string_static_t_initialize(F_file_operation_append_s, 0, F_file_operation_append_s_length);
+ const f_string_static_t f_file_operation_change_group_s = macro_f_string_static_t_initialize(F_file_operation_change_group_s, 0, F_file_operation_change_group_s_length);
+ const f_string_static_t f_file_operation_change_mode_s = macro_f_string_static_t_initialize(F_file_operation_change_mode_s, 0, F_file_operation_change_mode_s_length);
+ const f_string_static_t f_file_operation_change_owner_s = macro_f_string_static_t_initialize(F_file_operation_change_owner_s, 0, F_file_operation_change_owner_s_length);
+ const f_string_static_t f_file_operation_change_type_s = macro_f_string_static_t_initialize(F_file_operation_change_type_s, 0, F_file_operation_change_type_s_length);
const f_string_static_t f_file_operation_clone_s = macro_f_string_static_t_initialize(F_file_operation_clone_s, 0, F_file_operation_clone_s_length);
const f_string_static_t f_file_operation_close_s = macro_f_string_static_t_initialize(F_file_operation_close_s, 0, F_file_operation_close_s_length);
const f_string_static_t f_file_operation_concatenate_s = macro_f_string_static_t_initialize(F_file_operation_concatenate_s, 0, F_file_operation_concatenate_s_length);
const f_string_static_t f_file_operation_connect_s = macro_f_string_static_t_initialize(F_file_operation_connect_s, 0, F_file_operation_connect_s_length);
const f_string_static_t f_file_operation_copy_s = macro_f_string_static_t_initialize(F_file_operation_copy_s, 0, F_file_operation_copy_s_length);
const f_string_static_t f_file_operation_create_s = macro_f_string_static_t_initialize(F_file_operation_create_s, 0, F_file_operation_create_s_length);
+ const f_string_static_t f_file_operation_decrypt_s = macro_f_string_static_t_initialize(F_file_operation_decrypt_s, 0, F_file_operation_decrypt_s_length);
const f_string_static_t f_file_operation_delete_s = macro_f_string_static_t_initialize(F_file_operation_delete_s, 0, F_file_operation_delete_s_length);
const f_string_static_t f_file_operation_disconnect_s = macro_f_string_static_t_initialize(F_file_operation_disconnect_s, 0, F_file_operation_disconnect_s_length);
+ const f_string_static_t f_file_operation_encrypt_s = macro_f_string_static_t_initialize(F_file_operation_encrypt_s, 0, F_file_operation_encrypt_s_length);
const f_string_static_t f_file_operation_find_s = macro_f_string_static_t_initialize(F_file_operation_find_s, 0, F_file_operation_find_s_length);
const f_string_static_t f_file_operation_from_s = macro_f_string_static_t_initialize(F_file_operation_from_s, 0, F_file_operation_from_s_length);
const f_string_static_t f_file_operation_flush_s = macro_f_string_static_t_initialize(F_file_operation_flush_s, 0, F_file_operation_flush_s_length);
+ const f_string_static_t f_file_operation_get_group_s = macro_f_string_static_t_initialize(F_file_operation_get_group_s, 0, F_file_operation_get_group_s_length);
+ const f_string_static_t f_file_operation_get_mode_s = macro_f_string_static_t_initialize(F_file_operation_get_mode_s, 0, F_file_operation_get_mode_s_length);
+ const f_string_static_t f_file_operation_get_owner_s = macro_f_string_static_t_initialize(F_file_operation_get_owner_s, 0, F_file_operation_get_owner_s_length);
+ const f_string_static_t f_file_operation_get_type_s = macro_f_string_static_t_initialize(F_file_operation_get_type_s, 0, F_file_operation_get_type_s_length);
+ const f_string_static_t f_file_operation_identify_s = macro_f_string_static_t_initialize(F_file_operation_identify_s, 0, F_file_operation_identify_s_length);
const f_string_static_t f_file_operation_link_s = macro_f_string_static_t_initialize(F_file_operation_link_s, 0, F_file_operation_link_s_length);
const f_string_static_t f_file_operation_list_s = macro_f_string_static_t_initialize(F_file_operation_list_s, 0, F_file_operation_list_s_length);
+ const f_string_static_t f_file_operation_move_s = macro_f_string_static_t_initialize(F_file_operation_move_s, 0, F_file_operation_move_s_length);
const f_string_static_t f_file_operation_open_s = macro_f_string_static_t_initialize(F_file_operation_open_s, 0, F_file_operation_open_s_length);
+ const f_string_static_t f_file_operation_pipe_s = macro_f_string_static_t_initialize(F_file_operation_pipe_s, 0, F_file_operation_pipe_s_length);
const f_string_static_t f_file_operation_process_s = macro_f_string_static_t_initialize(F_file_operation_process_s, 0, F_file_operation_process_s_length);
const f_string_static_t f_file_operation_read_s = macro_f_string_static_t_initialize(F_file_operation_read_s, 0, F_file_operation_read_s_length);
const f_string_static_t f_file_operation_receive_s = macro_f_string_static_t_initialize(F_file_operation_receive_s, 0, F_file_operation_receive_s_length);
+ const f_string_static_t f_file_operation_rename_s = macro_f_string_static_t_initialize(F_file_operation_rename_s, 0, F_file_operation_rename_s_length);
const f_string_static_t f_file_operation_send_s = macro_f_string_static_t_initialize(F_file_operation_send_s, 0, F_file_operation_send_s_length);
+ const f_string_static_t f_file_operation_shred_s = macro_f_string_static_t_initialize(F_file_operation_shred_s, 0, F_file_operation_shred_s_length);
+ const f_string_static_t f_file_operation_stat_s = macro_f_string_static_t_initialize(F_file_operation_stat_s, 0, F_file_operation_stat_s_length);
const f_string_static_t f_file_operation_to_s = macro_f_string_static_t_initialize(F_file_operation_to_s, 0, F_file_operation_to_s_length);
+ const f_string_static_t f_file_operation_touch_s = macro_f_string_static_t_initialize(F_file_operation_touch_s, 0, F_file_operation_touch_s_length);
const f_string_static_t f_file_operation_truncate_s = macro_f_string_static_t_initialize(F_file_operation_truncate_s, 0, F_file_operation_truncate_s_length);
const f_string_static_t f_file_operation_unlink_s = macro_f_string_static_t_initialize(F_file_operation_unlink_s, 0, F_file_operation_unlink_s_length);
const f_string_static_t f_file_operation_verify_s = macro_f_string_static_t_initialize(F_file_operation_verify_s, 0, F_file_operation_verify_s_length);
* Provide common file operation strings.
*
* F_file_operation_*:
- * - append: Append to a file.
- * - clone: Clone a file.
- * - close: Close a file.
- * - concatenate: Concatenate a file.
- * - connect: Connect to a file (such as a socket file).
- * - copy: Copy a file.
- * - create: Create a file.
- * - delete: Delete a file.
- * - disconnect: Disconnect from a file (such as a socket file).
- * - find: Find a file.
- * - from: Do something from a file.
- * - flush: Flush a file.
- * - link: Link a file.
- * - list: List a file.
- * - open: Open a file.
- * - process: Process a file.
- * - read: Read a file.
- * - receive: Receive a file.
- * - send: Send a file.
- * - to: Do someting to a file.
- * - truncate: Truncate a file.
- * - unlink: Unlink a file.
- * - verify: Verify a file.
- * - wipe: Wipe a file.
- * - write: Write a file.
+ * - access: Access a file.
+ * - analyze: Analyze a file.
+ * - append: Append to a file.
+ * - change_group: Change group of a file.
+ * - change_mode: Change mode of a file (read, write, execute, etc.. permissions).
+ * - change_owner: Change owner of a file.
+ * - change_type: Change type of a file.
+ * - clone: Clone a file.
+ * - close: Close a file.
+ * - concatenate: Concatenate a file.
+ * - connect: Connect to a file (such as a socket file).
+ * - copy: Copy a file.
+ * - create: Create a file.
+ * - decrypt: Decrypt a file.
+ * - delete: Delete a file.
+ * - disconnect: Disconnect from a file (such as a socket file).
+ * - encrypt: Encrypt a file.
+ * - find: Find a file.
+ * - from: Do something from a file.
+ * - flush: Flush a file.
+ * - get_group: Get group of a file.
+ * - get_mode: Get mode of a file (read, write, execute, etc.. permissions).
+ * - get_owner: Get owner of a file.
+ * - get_type: Get type of a file.
+ * - identify: Identify a file.
+ * - link: Link a file.
+ * - list: List a file.
+ * - move: Move a file.
+ * - open: Open a file.
+ * - pipe: Pipe a file.
+ * - process: Process a file.
+ * - read: Read a file.
+ * - receive: Receive a file.
+ * - rename: Rename a file.
+ * - send: Send a file.
+ * - shred: Shred a file.
+ * - stat: Determine file statistics.
+ * - to: Do someting to a file.
+ * - touch: Touch a file (Create it if it does not exist or update its last write time stamp).
+ * - truncate: Truncate a file.
+ * - unlink: Unlink a file.
+ * - verify: Verify a file.
+ * - wipe: Wipe a file.
+ * - write: Write a file.
*/
#ifndef _di_f_file_operation_strings_
- #define F_file_operation_append_s "append"
- #define F_file_operation_clone_s "clone"
- #define F_file_operation_close_s "close"
- #define F_file_operation_concatenate_s "concatenate"
- #define F_file_operation_connect_s "connect"
- #define F_file_operation_copy_s "copy"
- #define F_file_operation_create_s "create"
- #define F_file_operation_delete_s "delete"
- #define F_file_operation_disconnect_s "disconnect"
- #define F_file_operation_find_s "find"
- #define F_file_operation_from_s "from"
- #define F_file_operation_flush_s "flush"
- #define F_file_operation_link_s "link"
- #define F_file_operation_list_s "list"
- #define F_file_operation_open_s "open"
- #define F_file_operation_process_s "process"
- #define F_file_operation_read_s "read"
- #define F_file_operation_receive_s "receive"
- #define F_file_operation_send_s "send"
- #define F_file_operation_to_s "to"
- #define F_file_operation_truncate_s "truncate"
- #define F_file_operation_unlink_s "unlink"
- #define F_file_operation_verify_s "verify"
- #define F_file_operation_wipe_s "wipe"
- #define F_file_operation_write_s "write"
-
- #define F_file_operation_append_s_length 6
- #define F_file_operation_clone_s_length 5
- #define F_file_operation_close_s_length 5
- #define F_file_operation_concatenate_s_length 11
- #define F_file_operation_connect_s_length 7
- #define F_file_operation_copy_s_length 4
- #define F_file_operation_create_s_length 6
- #define F_file_operation_delete_s_length 6
- #define F_file_operation_disconnect_s_length 10
- #define F_file_operation_find_s_length 4
- #define F_file_operation_from_s_length 4
- #define F_file_operation_flush_s_length 5
- #define F_file_operation_link_s_length 4
- #define F_file_operation_list_s_length 4
- #define F_file_operation_open_s_length 4
- #define F_file_operation_process_s_length 7
- #define F_file_operation_read_s_length 4
- #define F_file_operation_receive_s_length 7
- #define F_file_operation_send_s_length 4
- #define F_file_operation_to_s_length 2
- #define F_file_operation_truncate_s_length 8
- #define F_file_operation_unlink_s_length 6
- #define F_file_operation_verify_s_length 6
- #define F_file_operation_wipe_s_length 4
- #define F_file_operation_write_s_length 5
-
+ #define F_file_operation_access_s "access"
+ #define F_file_operation_analyze_s "analyze"
+ #define F_file_operation_append_s "append"
+ #define F_file_operation_change_group_s "change group of"
+ #define F_file_operation_change_mode_s "change mode of"
+ #define F_file_operation_change_owner_s "change owner of"
+ #define F_file_operation_change_type_s "change type of"
+ #define F_file_operation_clone_s "clone"
+ #define F_file_operation_close_s "close"
+ #define F_file_operation_concatenate_s "concatenate"
+ #define F_file_operation_connect_s "connect"
+ #define F_file_operation_copy_s "copy"
+ #define F_file_operation_create_s "create"
+ #define F_file_operation_decrypt_s "decrypt"
+ #define F_file_operation_delete_s "delete"
+ #define F_file_operation_disconnect_s "disconnect"
+ #define F_file_operation_encrypt_s "encrypt"
+ #define F_file_operation_find_s "find"
+ #define F_file_operation_from_s "from"
+ #define F_file_operation_flush_s "flush"
+ #define F_file_operation_get_group_s "get group of"
+ #define F_file_operation_get_mode_s "get mode of"
+ #define F_file_operation_get_owner_s "get owner of"
+ #define F_file_operation_get_type_s "get type of"
+ #define F_file_operation_identify_s "identify"
+ #define F_file_operation_link_s "link"
+ #define F_file_operation_list_s "list"
+ #define F_file_operation_move_s "move"
+ #define F_file_operation_open_s "open"
+ #define F_file_operation_pipe_s "pipe"
+ #define F_file_operation_process_s "process"
+ #define F_file_operation_read_s "read"
+ #define F_file_operation_receive_s "receive"
+ #define F_file_operation_rename_s "rename"
+ #define F_file_operation_send_s "send"
+ #define F_file_operation_shred_s "shred"
+ #define F_file_operation_stat_s "stat"
+ #define F_file_operation_to_s "to"
+ #define F_file_operation_touch_s "touch"
+ #define F_file_operation_truncate_s "truncate"
+ #define F_file_operation_unlink_s "unlink"
+ #define F_file_operation_verify_s "verify"
+ #define F_file_operation_wipe_s "wipe"
+ #define F_file_operation_write_s "write"
+
+ #define F_file_operation_access_s_length 6
+ #define F_file_operation_analyze_s_length 7
+ #define F_file_operation_append_s_length 6
+ #define F_file_operation_change_group_s_length 15
+ #define F_file_operation_change_mode_s_length 14
+ #define F_file_operation_change_owner_s_length 15
+ #define F_file_operation_change_type_s_length 14
+ #define F_file_operation_clone_s_length 5
+ #define F_file_operation_close_s_length 5
+ #define F_file_operation_concatenate_s_length 11
+ #define F_file_operation_connect_s_length 7
+ #define F_file_operation_copy_s_length 4
+ #define F_file_operation_create_s_length 6
+ #define F_file_operation_decrypt_s_length 7
+ #define F_file_operation_delete_s_length 6
+ #define F_file_operation_disconnect_s_length 10
+ #define F_file_operation_encrypt_s_length 7
+ #define F_file_operation_find_s_length 4
+ #define F_file_operation_from_s_length 4
+ #define F_file_operation_flush_s_length 5
+ #define F_file_operation_get_group_s_length 12
+ #define F_file_operation_get_mode_s_length 11
+ #define F_file_operation_get_owner_s_length 12
+ #define F_file_operation_get_type_s_length 11
+ #define F_file_operation_identify_s_length 8
+ #define F_file_operation_link_s_length 4
+ #define F_file_operation_list_s_length 4
+ #define F_file_operation_move_s_length 4
+ #define F_file_operation_open_s_length 4
+ #define F_file_operation_pipe_s_length 4
+ #define F_file_operation_process_s_length 7
+ #define F_file_operation_read_s_length 4
+ #define F_file_operation_rename_s_length 6
+ #define F_file_operation_receive_s_length 7
+ #define F_file_operation_send_s_length 4
+ #define F_file_operation_shred_s_length 5
+ #define F_file_operation_stat_s_length 4
+ #define F_file_operation_to_s_length 2
+ #define F_file_operation_touch_s_length 5
+ #define F_file_operation_truncate_s_length 8
+ #define F_file_operation_unlink_s_length 6
+ #define F_file_operation_verify_s_length 6
+ #define F_file_operation_wipe_s_length 4
+ #define F_file_operation_write_s_length 5
+
+ extern const f_string_static_t f_file_operation_access_s;
+ extern const f_string_static_t f_file_operation_analyze_s;
extern const f_string_static_t f_file_operation_append_s;
+ extern const f_string_static_t f_file_operation_change_group_s;
+ extern const f_string_static_t f_file_operation_change_mode_s;
+ extern const f_string_static_t f_file_operation_change_owner_s;
+ extern const f_string_static_t f_file_operation_change_type_s;
extern const f_string_static_t f_file_operation_clone_s;
extern const f_string_static_t f_file_operation_close_s;
extern const f_string_static_t f_file_operation_concatenate_s;
extern const f_string_static_t f_file_operation_connect_s;
extern const f_string_static_t f_file_operation_copy_s;
extern const f_string_static_t f_file_operation_create_s;
+ extern const f_string_static_t f_file_operation_decrypt_s;
extern const f_string_static_t f_file_operation_delete_s;
extern const f_string_static_t f_file_operation_disconnect_s;
+ extern const f_string_static_t f_file_operation_encrypt_s;
extern const f_string_static_t f_file_operation_find_s;
extern const f_string_static_t f_file_operation_from_s;
extern const f_string_static_t f_file_operation_flush_s;
+ extern const f_string_static_t f_file_operation_get_group_s;
+ extern const f_string_static_t f_file_operation_get_mode_s;
+ extern const f_string_static_t f_file_operation_get_owner_s;
+ extern const f_string_static_t f_file_operation_get_type_s;
+ extern const f_string_static_t f_file_operation_identify_s;
extern const f_string_static_t f_file_operation_link_s;
extern const f_string_static_t f_file_operation_list_s;
+ extern const f_string_static_t f_file_operation_move_s;
extern const f_string_static_t f_file_operation_open_s;
+ extern const f_string_static_t f_file_operation_pipe_s;
extern const f_string_static_t f_file_operation_process_s;
extern const f_string_static_t f_file_operation_read_s;
extern const f_string_static_t f_file_operation_receive_s;
+ extern const f_string_static_t f_file_operation_rename_s;
extern const f_string_static_t f_file_operation_send_s;
+ extern const f_string_static_t f_file_operation_shred_s;
+ extern const f_string_static_t f_file_operation_stat_s;
extern const f_string_static_t f_file_operation_to_s;
+ extern const f_string_static_t f_file_operation_touch_s;
extern const f_string_static_t f_file_operation_truncate_s;
extern const f_string_static_t f_file_operation_unlink_s;
extern const f_string_static_t f_file_operation_verify_s;
#ifndef _di_f_file_read_
f_status_t f_file_read(const f_file_t file, f_string_dynamic_t *buffer) {
#ifndef _di_level_0_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (file.id == -1) {
#ifndef _di_f_file_read_block_
f_status_t f_file_read_block(const f_file_t file, f_string_dynamic_t *buffer) {
#ifndef _di_level_0_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (file.id == -1) {
#ifndef _di_f_file_read_until_
f_status_t f_file_read_until(const f_file_t file, const f_array_length_t total, f_string_dynamic_t *buffer) {
#ifndef _di_level_0_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (file.id == -1) {
#ifndef _di_f_file_stream_read_
f_status_t f_file_stream_read(const f_file_t file, f_string_dynamic_t *buffer) {
#ifndef _di_level_0_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!file.stream) {
#ifndef _di_f_file_stream_read_until_
f_status_t f_file_stream_read_until(const f_file_t file, const f_array_length_t total, f_string_dynamic_t *buffer) {
#ifndef _di_level_0_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
if (!file.stream) return F_status_set_error(F_file_closed);
bool exclusive;
f_file_t output;
- void (*verbose)(const f_file_t, const f_string_t, const f_string_t);
+ void (*verbose)(const f_file_t, const f_string_static_t, const f_string_static_t);
f_directory_statuss_t *failures;
} fl_directory_recurse_t;
}
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source.string, destination.string);
+ recurse.verbose(recurse.output, source, destination);
}
return status;
status = private_fl_directory_clone(static_source, static_destination, role, recurse, 1);
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source.string, destination.string);
+ recurse.verbose(recurse.output, source, destination);
}
return status;
}
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source.string, destination.string);
+ recurse.verbose(recurse.output, source, destination);
}
return status;
}
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source.string, destination.string);
+ recurse.verbose(recurse.output, source, destination);
}
return status;
status = private_fl_directory_clone(source_sub, destination_sub, role, recurse, depth + 1);
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source_sub.string, destination_sub.string);
+ recurse.verbose(recurse.output, source_sub, destination_sub);
}
}
} // for
}
if ((!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, path_source.string, path_destination.string);
+ recurse.verbose(recurse.output, path_source, path_destination);
}
return F_none;
status = private_fl_directory_copy(source_sub, destination_sub, mode, recurse, depth + 1);
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source_sub.string, destination_sub.string);
+ recurse.verbose(recurse.output, source_sub, destination_sub);
}
}
} // for
}
if ((!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, path_source.string, path_destination.string);
+ recurse.verbose(recurse.output, path_source, path_destination);
}
return F_none;
* - "q": Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed).
* - "Q": Type is a f_string_static_t or f_string_dynamic_t and NULLs are ignored (not printed), where control characters and invalid UTF-8 are replaced.
* - "r": Type is a f_string_static_t or f_string_dynamic_t and NULLs (and all other control characters) are printed.
- * - "R": Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, but control characters and invalid UTF-8 are replaced. @todo not yet implemented.
+ * - "R": Type is a f_string_static_t or f_string_dynamic_t and NULLs are printed, but control characters and invalid UTF-8 are replaced.
* - "uii", "UII": Type is a uint8_t digit.
* - "ui", "UI": Type is a uint16_t digit.
* - "u", "U": Type is a uint32_t digit.
#ifndef _di_fl_utf_file_read_
f_status_t fl_utf_file_read(const f_file_t file, f_utf_string_dynamic_t *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (file.id < 0) {
#ifndef _di_fl_utf_file_read_block_
f_status_t fl_utf_file_read_block(const f_file_t file, f_utf_string_dynamic_t *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (file.id < 0) return F_status_set_error(F_file);
#ifndef _di_fl_utf_file_read_until_
f_status_t fl_utf_file_read_until(const f_file_t file, const f_array_length_t total, f_utf_string_dynamic_t *buffer) {
#ifndef _di_level_1_parameter_checking_
- if (!file.size_read) return F_status_set_error(F_parameter);
- if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
+ if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (file.id < 0) {
#ifndef _di_fll_control_group_prepare_
f_status_t fll_control_group_prepare(const f_control_group_t control_group) {
+
f_status_t status = F_none;
if (control_group.path.used) {
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(source, 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(source, 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(source[i], arguments);
- if (F_status_is_error(status)) return status;
} // for
return status;
memcpy(&program_path, found->string, found->used);
- f_string_dynamics_resize(0, &paths);
-
program_name.string = program_path;
program_name.used = found->used;
+ f_string_dynamics_resize(0, &paths);
+
if (parameter && (parameter->option & FL_execute_parameter_option_path_d)) {
fixed_arguments[0] = program_path;
}
#if !defined(_di_fll_execute_arguments_add_) || !defined(_di_fll_execute_arguments_add_set_)
f_status_t private_fll_execute_arguments_add(const f_string_static_t source, 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(source.used + 1, &arguments->array[arguments->used]);
+ f_status_t status = f_string_dynamic_increase_by(source.used + 1, &arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
status = f_string_dynamic_append(source, &arguments->array[arguments->used]);
+ if (F_status_is_error(status)) return status;
- if (F_status_is_error_not(status)) {
- status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
- }
-
+ status = f_string_dynamic_terminate_after(&arguments->array[arguments->used]);
if (F_status_is_error(status)) return status;
++arguments->used;
// Close the write pipe for the child.
close(descriptors[1]);
- char string_response[2] = { 0, 0 };
-
- f_string_static_t response = f_string_static_t_initialize;
-
- response.string = string_response;
- response.used = 0;
- response.size = 2;
+ f_string_dynamic_t response = f_string_dynamic_t_initialize;
const f_file_t file = macro_f_file_t_initialize(0, descriptors[0], F_file_flag_read_only_d, 1, 1);
f_file_read_block(file, &response);
if (!response.used || response.string[0] == '1') {
+ f_string_dynamic_resize(0, &response);
+
close(descriptors[0]);
if (result) {
int *r = (int *) result;
+
*r = F_execute_failure;
}
return F_child;
}
+
+ f_string_dynamic_resize(0, &response);
}
if (parameter && parameter->signals) {
// Wait for parent to tell child to begin.
if (as) {
- char string_response[2] = { 0, 0 };
-
- f_string_static_t response = f_string_static_t_initialize;
-
- response.string = string_response;
- response.used = 0;
- response.size = 2;
+ f_string_dynamic_t response = f_string_dynamic_t_initialize;
const f_file_t file = macro_f_file_t_initialize(0, descriptors[0], F_file_flag_read_only_d, 1, 1);
f_file_read_block(file, &response);
if (!response.used || response.string[0] == '1') {
+ f_string_dynamic_resize(0, &response);
+
close(descriptors[0]);
if (result) {
f_status_t *r = (f_status_t *) result;
+
*r = F_status_set_error(F_failure);
}
return F_child;
}
+
+ f_string_dynamic_resize(0, &response);
}
if (parameter && parameter->signals) {
* The full path to the program or the program name to copy from.
* @param arguments
* An array of strings representing the arguments.
+ * The strings must be NULL terminated.
* @param last_slash
* A pointer to the last slash.
* Set to NULL if there is no slash in the program_path.
* The destination to copy the name to.
* @param fixed_arguments
* The array of arguments to be updated with the program name.
+ * This is a array of simple strings intended to be eventually directly passed to functions like exec().
*
* @return
* F_none on success.
if (F_status_set_fine(status) != F_mount) {
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source.string, destination.string);
+ recurse.verbose(recurse.output, source, destination);
}
return status;
status = f_directory_remove(source, recurse.depth_max, F_false);
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source.string, destination.string);
+ recurse.verbose(recurse.output, source, destination);
}
}
else {
status = f_file_remove(source);
if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
- recurse.verbose(recurse.output, source.string, destination.string);
+ recurse.verbose(recurse.output, source, destination);
}
}
#endif
#ifndef _di_fll_path_canonical_
- f_status_t fll_path_canonical(const f_string_t path, f_string_dynamic_t *canonical) {
+ f_status_t fll_path_canonical(const f_string_static_t path, f_string_dynamic_t *canonical) {
#ifndef _di_level_2_parameter_checking_
if (!canonical) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
f_status_t status = F_none;
+
+ if (!path.used) {
+ status = f_path_current(F_true, canonical);
+ if (F_status_is_error(status)) return status;
+
+ return F_none;
+ }
+
f_array_length_t at = 0;
uint8_t previous_1 = f_path_separator_s.string[0];
canonical->used = 0;
- if (path[0] == f_path_separator_s.string[0]) {
+ if (path.string[0] == f_path_separator_s.string[0]) {
at = 1;
}
else {
status = f_path_current(F_true, canonical);
if (F_status_is_error(status)) return status;
- if (!path[0]) {
+ if (!path.string[0] || path.used == 1) {
return F_none;
}
status = f_string_dynamic_append_assure(f_path_separator_s, canonical);
if (F_status_is_error(status)) return status;
- for (; path[at]; ++at) {
+ for (; at < path.used && path.string[at]; ++at) {
- if (!size_chunk && path[at] == f_path_separator_current_s.string[0]) {
+ if (!size_chunk && path.string[at] == f_path_separator_current_s.string[0]) {
if (!previous_1 || previous_1 == f_path_separator_s.string[0]) {
previous_1 = f_path_separator_current_s.string[0];
previous_2 = 0;
}
}
}
- else if (path[at] == f_path_separator_s.string[0]) {
+ else if (path.string[at] == f_path_separator_s.string[0]) {
if (previous_1 == f_path_separator_s.string[0]) {
size_chunk = 0;
position = 0;
}
else {
if (++size_chunk) {
- status = f_string_append(path + position, size_chunk, canonical);
+ status = f_string_append(path.string + position, size_chunk, canonical);
if (F_status_is_error(status)) return status;
}
}
}
else if (!(previous_1 == f_path_separator_current_s.string[0] || previous_1 == f_path_separator_s.string[0])) {
if (size_chunk) {
- status = f_string_append(path + position, size_chunk, canonical);
+ status = f_string_append(path.string + position, size_chunk, canonical);
if (F_status_is_error(status)) return status;
}
}
* This does not process symbolic links.
* This has a max size of F_string_t_size_d.
*
+ * An empty path (first character is NULL or path.used is 0) appends only the current path to canonical.
+ *
* @param path
* The source path to determine what the canonical path is.
- * This is a NULL terminated string.
+ * This need not be NULL terminated.
* @param canonical
* The (allocated) canonical file path.
* The canonical->used is reset to 0 before processing.
* Errors (with error bit) from: f_path_current().
* 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_t path, f_string_dynamic_t *canonical);
+ extern f_status_t fll_path_canonical(const f_string_static_t path, f_string_dynamic_t *canonical);
#endif // _di_fll_path_canonical_
#ifdef __cplusplus
memset(&address, 0, setting.control_socket.length);
if (main->remaining.used) {
- status = f_string_append_nulless(arguments->argv[main->remaining.array[0]], strnlen(arguments->argv[main->remaining.array[0]], F_console_parameter_size_d), &setting.name_entry);
+ status = f_string_dynamic_append(argv[main->remaining.array[0]], &setting.name_entry);
}
else {
- status = f_string_dynamic_append_nulless(controller_default_s, &setting.name_entry);
+ status = f_string_dynamic_append(controller_default_s, &setting.name_entry);
}
if (F_status_is_error(status)) {
- fll_error_print(main->error, F_status_set_fine(status), main->remaining.used ? "f_string_append_nulless" : "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(main->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
controller_main_delete(main);
status = F_status_set_error(F_parameter);
}
else if (main->parameters.array[controller_parameter_settings_e].locations.used) {
- const f_array_length_t location = main->parameters.array[controller_parameter_settings_e].values.array[main->parameters.array[controller_parameter_settings_e].values.used - 1];
+ const f_array_length_t index = main->parameters.array[controller_parameter_settings_e].values.array[main->parameters.array[controller_parameter_settings_e].values.used - 1];
- status = fll_path_canonical(arguments->argv[location], &setting.path_setting);
+ status = fll_path_canonical(argv[index], &setting.path_setting);
if (F_status_is_error(status)) {
- const f_string_static_t argv = macro_f_string_static_t_initialize(arguments->argv[location], 0, strnlen(arguments->argv[location], F_console_parameter_size_d);
-
- fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, argv, f_file_operation_verify_s, fll_error_file_type_path_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, argv[index], f_file_operation_verify_s, fll_error_file_type_path_e);
}
}
else {
status = F_status_set_error(F_parameter);
}
else if (main->parameters.array[controller_parameter_pid_e].locations.used) {
- const f_array_length_t location = main->parameters.array[controller_parameter_pid_e].values.array[main->parameters.array[controller_parameter_pid_e].values.used - 1];
+ const f_array_length_t index = main->parameters.array[controller_parameter_pid_e].values.array[main->parameters.array[controller_parameter_pid_e].values.used - 1];
- if (strnlen(arguments->argv[location], F_console_parameter_size_d)) {
- status = fll_path_canonical(arguments->argv[location], &setting.path_pid);
+ if (argv[index].used) {
+ status = fll_path_canonical(argv[index], &setting.path_pid);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, arguments->argv[location], "verify", fll_error_file_type_path_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, argv[index], f_file_operation_verify_s, fll_error_file_type_path_e);
}
}
else {
status = F_status_set_error(F_parameter);
}
else if (main->parameters.array[controller_parameter_cgroup_e].locations.used) {
- const f_array_length_t location = main->parameters.array[controller_parameter_cgroup_e].values.array[main->parameters.array[controller_parameter_cgroup_e].values.used - 1];
+ const f_array_length_t index = main->parameters.array[controller_parameter_cgroup_e].values.array[main->parameters.array[controller_parameter_cgroup_e].values.used - 1];
- if (strnlen(arguments->argv[location], F_console_parameter_size_d)) {
- status = fll_path_canonical(arguments->argv[location], &setting.path_cgroup);
+ if (argv[index].used) {
+ status = fll_path_canonical(argv[index], &setting.path_cgroup);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, arguments->argv[location], "verify", fll_error_file_type_path_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fll_path_canonical", F_true, argv[index], f_file_operation_verify_s, fll_error_file_type_path_e);
}
else {
status = f_string_append_assure(F_path_separator_s, 1, &setting.path_cgroup);
controller_unlock_print_flush(main->warning.to, 0);
}
else if (F_status_set_fine(status_delete) != F_interrupt) {
- fll_error_file_print(main->warning, F_status_set_fine(status_delete), "controller_file_pid_delete", F_true, setting.path_pid.string, "delete", fll_error_file_type_file_e);
+ fll_error_file_print(main->warning, F_status_set_fine(status_delete), "controller_file_pid_delete", F_true, setting.path_pid, f_file_operation_delete_s, fll_error_file_type_file_e);
}
}
}
f_socket_disconnect(&setting.control_socket, f_socket_close_read_write_e);
if (!setting.control_readonly) {
- f_file_remove(setting.path_control.string);
+ f_file_remove(setting.path_control);
}
}
return status;
}
- const f_array_length_t path_length = global.setting->path_setting.used ? global.setting->path_setting.used + F_path_separator_s_length + cache->action.name_file.used : cache->action.name_file.used;
- char path[path_length + 1];
+ f_string_static_t path = f_string_static_t_initialize;
if (global.setting->path_setting.used) {
- memcpy(path, global.setting->path_setting.string, global.setting->path_setting.used);
- memcpy(path + global.setting->path_setting.used + F_path_separator_s_length, cache->action.name_file.string, cache->action.name_file.used);
+ path.used = global.setting->path_setting.used + F_path_separator_s_length + cache->action.name_file.used;
+ }
+ else {
+ path.used = cache->action.name_file.used;
+ }
- path[global.setting->path_setting.used] = f_path_separator_s.string[0];
+ char path_string[path.used + 1];
+ path.string = path_string;
+
+ if (global.setting->path_setting.used) {
+ memcpy(path_string, global.setting->path_setting.string, global.setting->path_setting.used);
+ memcpy(path_string + global.setting->path_setting.used + F_path_separator_s_length, cache->action.name_file.string, cache->action.name_file.used);
+
+ path_string[global.setting->path_setting.used] = f_path_separator_s.string[0];
+ }
+ else {
+ memcpy(path_string, cache->action.name_file.string, cache->action.name_file.used);
}
- path[path_length] = 0;
+ path_string[path.used] = 0;
+
status = f_file_stream_open(path, f_string_empty_s, &file);
if (F_status_is_error(status)) {
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
- controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stream_read", F_true, path, "read", fll_error_file_type_file_e);
+ controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stream_read", F_true, path, f_file_operation_read_s, fll_error_file_type_file_e);
}
}
}
if (F_status_is_error(status)) {
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
- controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stat", F_true, path, "stat", fll_error_file_type_file_e);
+ controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "f_file_stat", F_true, path, f_file_operation_stat_s, fll_error_file_type_file_e);
}
}
else {
f_status_t status = F_none;
// the file exists, do not attempt to overwrite.
- if (f_file_exists(path.string) == F_true) {
+ if (f_file_exists(path) == F_true) {
return F_status_set_error(F_file_found);
}
{
f_string_dynamic_t path_directory = f_string_dynamic_t_initialize;
- status = f_file_name_directory(path.string, path.used, &path_directory);
+ status = f_file_name_directory(path, &path_directory);
if (F_status_is_error_not(status)) {
- status = f_directory_exists(path_directory.string);
+ status = f_directory_exists(path_directory);
}
f_string_dynamic_resize(0, &path_directory);
file.flag = F_file_flag_write_only_d;
- status = f_file_stream_open(path.string, f_file_open_mode_truncate_s.string, &file);
+ status = f_file_stream_open(path, f_file_open_mode_truncate_s, &file);
if (F_status_is_error(status)) return status;
fll_print_format("%i%r", file.stream, pid, f_string_eol_s);
f_status_t controller_file_pid_delete(const pid_t pid, const f_string_static_t path) {
// only delete if the file exists and there is no error while checking.
- if (f_file_exists(path.string) != F_true) {
+ if (f_file_exists(path) != F_true) {
return F_none;
}
f_status_t status = F_none;
f_file_t pid_file = f_file_t_initialize;
- status = f_file_stream_open(path.string, f_file_open_mode_read_s.string, &pid_file);
+ status = f_file_stream_open(path, f_file_open_mode_read_s, &pid_file);
if (F_status_is_error(status)) return status;
f_string_dynamic_t pid_buffer = f_string_dynamic_t_initialize;
status = fl_conversion_string_to_decimal_unsigned(pid_buffer.string, range, &number);
if (F_status_is_error_not(status) && number == pid) {
- status = f_file_remove(path.string);
+ status = f_file_remove(path);
}
else {
status = F_status_set_error(F_number_not);
*pid = 0;
- f_status_t status = f_file_exists(path.string);
+ f_status_t status = f_file_exists(path);
if (F_status_is_error(status)) return status;
if (status != F_true) {
f_file_t pid_file = f_file_t_initialize;
- status = f_file_stream_open(path.string, f_file_open_mode_read_s.string, &pid_file);
+ status = f_file_stream_open(path, f_file_open_mode_read_s, &pid_file);
if (F_status_is_error(status)) return status;
f_string_dynamic_t pid_buffer = f_string_dynamic_t_initialize;
if (global->main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global->main->error.to, global->thread);
- controller_print_error_file(0, global->main->error, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid.string, "create", fll_error_file_type_file_e);
+ controller_print_error_file(0, global->main->error, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid, f_file_operation_create_s, fll_error_file_type_file_e);
flockfile(global->main->error.to.stream);
fl_print_format("%[' could not be written because the destination is read only.%]%r", global->main->warning.to.stream, global->main->warning.context, global->main->warning.context, f_string_eol_s);
}
else {
- controller_print_error_file(0, global->main->warning, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid.string, "create", fll_error_file_type_file_e);
+ controller_print_error_file(0, global->main->warning, F_status_set_fine(status), "controller_file_pid_create", F_true, global->setting->path_pid, f_file_operation_create_s, fll_error_file_type_file_e);
}
controller_entry_print_error_cache(is_entry, global->main->warning, cache->action);
if (global->setting->path_control.used) {
if (global->setting->control_readonly) {
- if (f_file_exists(global->setting->path_control.string) != F_true) {
+ if (f_file_exists(global->setting->path_control) != F_true) {
if (global->main->output.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global->main->output.to, global->thread);
}
}
else {
- status = f_file_remove(global->setting->path_control.string);
+ status = f_file_remove(global->setting->path_control);
if (F_status_set_fine(status) == F_memory_not) {
controller_print_error(global->thread, global->main->error, F_status_set_fine(status), "f_file_remove", F_true);
}
}
else {
- status = f_file_role_change(global->setting->path_control.string, global->setting->control_user, global->setting->control_group, F_true);
+ status = f_file_role_change(global->setting->path_control, global->setting->control_user, global->setting->control_group, F_true);
if (F_status_is_error(status)) {
f_socket_disconnect(&global->setting->control_socket, f_socket_close_fast_e);
}
}
else {
- status = f_file_mode_set(global->setting->path_control.string, global->setting->control_mode);
+ status = f_file_mode_set(global->setting->path_control, global->setting->control_mode);
if (F_status_is_error(status)) {
f_socket_disconnect(&global->setting->control_socket, f_socket_close_fast_e);
if (action->parameters.array[0].used) {
// Force the path to be canonical (removing all '../' parts).
- status = fll_path_canonical(action->parameters.array[0].string, &cache->buffer_path);
+ status = fll_path_canonical(action->parameters.array[0], &cache->buffer_path);
if (F_status_is_error(status)) {
// @todo instead call: fll_error_file_print().
if (action->parameters.array[1].used) {
cache->buffer_path.used = 0;
- status = f_file_name_base(action->parameters.array[1].string, action->parameters.array[1].used, &cache->buffer_path);
+ status = f_file_name_base(action->parameters.array[1], &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_file_name_base", F_true, global.thread);
if (f_path_is_relative(global.setting->path_control.string, global.setting->path_control.used) == F_true) {
// Use the PID file path for creating a relative path to the control socket.
- status = f_file_name_directory(global.setting->path_pid.string, global.setting->path_pid.used, &cache->action.generic);
+ status = f_file_name_directory(global.setting->path_pid, &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_file_name_directory", F_true, global.thread);
break;
}
- status = fll_path_canonical(cache->action.generic.string, &global.setting->path_control);
+ status = fll_path_canonical(cache->action.generic, &global.setting->path_control);
if (F_status_is_error(status)) {
- controller_entry_print_error_file(is_entry, global.main->error, cache->action, F_status_set_fine(status), "fll_path_canonical", F_true, cache->action.generic.string, "analyze", fll_error_file_type_path_e, global.thread);
+ controller_entry_print_error_file(is_entry, global.main->error, cache->action, F_status_set_fine(status), "fll_path_canonical", F_true, cache->action.generic, f_file_operation_analyze_s, fll_error_file_type_path_e, global.thread);
global.setting->path_control.used = 0;
break;
}
- status = f_file_mode_from_string(cache->action.generic.string, global.main->umask, &mode_file, &replace);
+ status = f_file_mode_from_string(cache->action.generic, global.main->umask, &mode_file, &replace);
if (F_status_is_error(status)) {
controller_entry_setting_read_print_error_with_range(is_entry, global.main->error, " has an unsupported mode", cache->content_actions.array[i].array[0], ", because the format is unknown or contains invalid data", global.thread, cache);
fl_print_format("%r%[%QThe pid file '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context);
fl_print_format("%['Critical failure while attempting to establish '%]", print.to.stream, print.context, print.context);
- fl_print_format("%[%s lock%]", print.to.stream, print.notable, read ? "read" : "write", print.notable);
+ fl_print_format("%[%r lock%]", print.to.stream, print.notable, read ? f_file_operation_read_s : f_file_operation_write_s, print.notable);
if (status != F_failure) {
fl_print_format(" %['due to%] ", print.to.stream, print.context, print.context);
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_controller_rule_string_s_
+ const f_string_static_t controller_rule_needed_s = macro_f_string_static_t_initialize(CONTROLLER_rule_needed_s, 0, CONTROLLER_rule_needed_s_length);
+ const f_string_static_t controller_rule_wanted_s = macro_f_string_static_t_initialize(CONTROLLER_rule_wanted_s, 0, CONTROLLER_rule_wanted_s_length);
+ const f_string_static_t controller_rule_wished_s = macro_f_string_static_t_initialize(CONTROLLER_rule_wished_s, 0, CONTROLLER_rule_wished_s_length);
+#endif // _di_controller_rule_print_string_s_
#ifndef _di_controller_rule_action_method_name_
f_string_static_t controller_rule_action_method_name(const uint8_t type) {
status = fll_control_group_prepare(process->rule.cgroup);
if (F_status_is_error(status)) {
- controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "fll_control_group_prepare", F_true, process->rule.cgroup.path.string, "prepare control groups for", fll_error_file_type_directory_e);
+ controller_print_error_file(global.thread, global.main->error, F_status_set_fine(status), "fll_control_group_prepare", F_true, process->rule.cgroup.path, controller_rule_print_control_groups_prepare_s, fll_error_file_type_directory_e);
return status;
}
success = F_status_set_error(F_failure);
// @todo make this more specific.
- controller_rule_action_print_error_missing_pid(global.main->error, process->rule.alias.string);
+ controller_rule_action_print_error_missing_pid(global.main->error, process->rule.alias);
}
}
else if (process->rule.items.array[i].type == controller_rule_item_type_utility_e) {
success = F_status_set_error(F_failure);
// @todo make this more specific.
- controller_rule_action_print_error_missing_pid(global.main->error, process->rule.alias.string);
+ controller_rule_action_print_error_missing_pid(global.main->error, process->rule.alias);
}
}
else {
}
}
- status = f_file_exists(pid_file.string);
+ status = f_file_exists(pid_file);
if (F_status_is_error(status)) {
- controller_print_error_file(thread, main->error, F_status_set_fine(status), "f_file_exists", F_true, pid_file.string, f_file_operation_find_s, fll_error_file_type_file_e);
+ controller_print_error_file(thread, main->error, F_status_set_fine(status), "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e);
return status;
}
if (status == F_true) {
- controller_print_error_file(thread, main->error, F_file_found, "f_file_exists", F_true, pid_file.string, f_file_operation_find_s, fll_error_file_type_file_e);
+ controller_print_error_file(thread, main->error, F_file_found, "f_file_exists", F_true, pid_file, f_file_operation_find_s, fll_error_file_type_file_e);
return F_status_set_error(F_file_found);
}
uint8_t options_process = 0;
- const f_string_t strings[3] = {
- "needed",
- "wanted",
- "wished for",
+ const f_string_static_t strings[3] = {
+ controller_rule_needed_s,
+ controller_rule_wanted_s,
+ controller_rule_wished_s,
};
f_string_dynamics_t empty = f_string_dynamics_t_initialize;
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- controller_rule_item_print_error_rule_not_loaded(global.main->error, dynamics[i]->array[j].string);
+ controller_rule_item_print_error_rule_not_loaded(global.main->error, dynamics[i]->array[j]);
controller_rule_print_error_cache(global.main->error, process->cache.action, F_false);
controller_unlock_print_flush(global.main->error.to, global.thread);
if (i == 0) {
controller_lock_print(global.main->error.to, global.thread);
- controller_rule_item_print_error_need_want_wish(global.main->error, strings[i], dynamics[i]->array[j].string, "was not found");
+ controller_rule_item_print_error_need_want_wish(global.main->error, strings[i], dynamics[i]->array[j], "was not found");
controller_rule_print_error_cache(global.main->error, process->cache.action, F_true);
controller_unlock_print_flush(global.main->error.to, global.thread);
if (global.main->warning.verbosity == f_console_verbosity_debug_e) {
controller_lock_print(global.main->warning.to, global.thread);
- controller_rule_item_print_error_need_want_wish(global.main->warning, strings[i], dynamics[i]->array[j].string, "was not found");
+ controller_rule_item_print_error_need_want_wish(global.main->warning, strings[i], dynamics[i]->array[j], "was not found");
controller_rule_print_error_cache(global.main->warning, process->cache.action, F_true);
if (found) {
- // the dependency may have write locks, which needs to be avoided, so copy the alias from the rule.
- char alias_other_buffer[global.setting->rules.array[id_rule].alias.used + 1];
+ // The dependency may have write locks, which needs to be avoided, so copy the alias from the rule.
+ f_string_static_t alias_other_buffer = f_string_static_t_initialize;
+ alias_other_buffer.used = global.setting->rules.array[id_rule].alias.used;
- memcpy(alias_other_buffer, global.setting->rules.array[id_rule].alias.string, global.setting->rules.array[id_rule].alias.used);
- alias_other_buffer[global.setting->rules.array[id_rule].alias.used] = 0;
+ char alias_other_buffer_string[alias_other_buffer.used + 1];
+ alias_other_buffer.string = alias_other_buffer_string;
- const f_string_static_t alias_other = macro_f_string_static_t_initialize2(alias_other_buffer, global.setting->rules.array[id_rule].alias.used);
+ memcpy(alias_other_buffer_string, global.setting->rules.array[id_rule].alias.string, alias_other_buffer.used);
+ alias_other_buffer_string[alias_other_buffer.used] = 0;
f_thread_unlock(&global.thread->lock.rule);
}
// Synchronously execute dependency.
- status = controller_rule_process_begin(global, 0, alias_other, process->action, options_process, process->type, process->stack, dependency->cache);
+ status = controller_rule_process_begin(global, 0, alias_other_buffer, process->action, options_process, process->type, process->stack, dependency->cache);
if (status == F_child || F_status_set_fine(status) == F_interrupt) {
f_thread_unlock(&dependency->active);
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- controller_rule_item_print_error_rule_not_loaded(global.main->error, alias_rule.string);
+ controller_rule_item_print_error_rule_not_loaded(global.main->error, alias_rule);
controller_rule_print_error_cache(global.main->error, cache.action, F_false);
controller_unlock_print_flush(global.main->error.to, global.thread);
if (global.main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(global.main->error.to, global.thread);
- controller_rule_item_print_error_rule_not_loaded(global.main->error, process->rule.alias.string);
+ controller_rule_item_print_error_rule_not_loaded(global.main->error, process->rule.alias);
controller_rule_print_error_cache(global.main->error, process->cache.action, F_false);
controller_unlock_print_flush(global.main->error.to, global.thread);
cache->buffer_path.used = 0;
- status = f_file_name_base(setting_values->array[setting_values->used].string, setting_values->array[setting_values->used + 1].used, &cache->buffer_path);
+ status = f_file_name_base(setting_values->array[setting_values->used], &cache->buffer_path);
if (F_status_is_error(status)) {
setting_values->array[setting_values->used].used = 0;
#endif
/**
+ * Special strings used for rules.
+ */
+#ifndef _di_controller_rule_string_s_
+ #define CONTROLLER_rule_needed_s "needed"
+ #define CONTROLLER_rule_wanted_s "wanted"
+ #define CONTROLLER_rule_wished_s "wished for"
+
+ #define CONTROLLER_rule_needed_s_length 6
+ #define CONTROLLER_rule_wanted_s_length 6
+ #define CONTROLLER_rule_wished_s_length 10
+
+ extern const f_string_static_t controller_rule_needed_s;
+ extern const f_string_static_t controller_rule_wanted_s;
+ extern const f_string_static_t controller_rule_wished_s;
+#endif // _di_controller_rule_print_string_s_
+
+/**
* Get a string representing the rule action method.
*
* @param type
#ifdef __cplusplus
extern "C" {
#endif
+#ifndef _di_controller_rule_print_string_s_
+ const f_string_static_t controller_rule_print_control_groups_prepare_s = macro_f_string_static_t_initialize(CONTROLLER_rule_print_control_groups_prepare_s, 0, CONTROLLER_rule_print_control_groups_prepare_s_length);
+#endif // _di_controller_rule_print_string_s_
#ifndef _di_controller_rule_print_error_
void controller_rule_print_error(controller_thread_t * const thread, const fl_print_t print, const controller_cache_action_t cache, const f_status_t status, const f_string_t function, const bool fallback, const bool item) {
#endif // _di_controller_rule_item_print_error_execute_
#ifndef _di_controller_rule_action_print_error_missing_pid_
- void controller_rule_action_print_error_missing_pid(const fl_print_t print, const f_string_t alias) {
+ void controller_rule_action_print_error_missing_pid(const fl_print_t print, const f_string_static_t alias) {
if (print.verbosity == f_console_verbosity_quiet_e) return;
fl_print_format("%r%[%QThe rule '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context);
- fl_print_format("%[%S%]", print.to.stream, print.notable, alias, print.notable);
+ fl_print_format("%[%Q%]", print.to.stream, print.notable, alias, print.notable);
fl_print_format("%[' is not designating a pid file.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
}
#endif // _di_controller_rule_action_print_error_missing_pid_
#ifndef _di_controller_rule_item_print_error_need_want_wish_
- void controller_rule_item_print_error_need_want_wish(const fl_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) {
+ void controller_rule_item_print_error_need_want_wish(const fl_print_t print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) {
if (print.verbosity == f_console_verbosity_quiet_e) return;
- fl_print_format("%r%[%QThe %s rule '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, need_want_wish, print.context);
- fl_print_format("%[%S%]", print.to.stream, print.notable, value, print.notable);
+ fl_print_format("%r%[%QThe %r rule '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, need_want_wish, print.context);
+ fl_print_format("%[%Q%]", print.to.stream, print.notable, value, print.notable);
fl_print_format("%[' %S.%]%r", print.to.stream, print.context, why, print.context, f_string_eol_s);
}
#endif // _di_controller_rule_item_print_error_need_want_wish_
#ifndef _di_controller_rule_item_print_error_rule_not_loaded_
- void controller_rule_item_print_error_rule_not_loaded(const fl_print_t print, const f_string_t alias) {
+ void controller_rule_item_print_error_rule_not_loaded(const fl_print_t print, const f_string_static_t alias) {
if (print.verbosity == f_console_verbosity_quiet_e) return;
fl_print_format("%r%[%QThe rule '%]", print.to.stream, f_string_eol_s, print.context, print.prefix, print.context);
- fl_print_format("%[%S%]", print.to.stream, print.notable, alias, print.notable);
+ fl_print_format("%[%Q%]", print.to.stream, print.notable, alias, print.notable);
fl_print_format("%[' is no longer loaded.%]%r", print.to.stream, print.context, print.context, f_string_eol_s);
}
#endif // _di_controller_rule_item_print_error_rule_not_loaded_
fl_print_format("%rProcessing rule item action '%[%Q%]' setting ", global.main->output.to.stream, f_string_eol_s, global.main->context.set.title, name, global.main->context.set.title);
if (name_sub.used) {
- fl_print_format("'%[%S%]'", global.main->output.to.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable);
+ fl_print_format("'%[%Q%]'", global.main->output.to.stream, global.main->context.set.notable, name_sub, global.main->context.set.notable);
}
else {
f_print_terminated("value", global.main->output.to.stream);
#endif
/**
+ * Special strings used for printing.
+ */
+#ifndef _di_controller_rule_print_string_s_
+ #define CONTROLLER_rule_print_control_groups_prepare_s "prepare control groups for"
+ #define CONTROLLER_rule_print_control_groups_prepare_s_length 24
+
+ extern const f_string_static_t controller_rule_print_control_groups_prepare_s;
+#endif // _di_controller_rule_print_string_s_
+
+/**
* Print generic error/warning information.
*
* This is essentially a wrapper to fll_error_print() that includes locking.
* The rule alias of the rule that is missing the pid file designation.
*/
#ifndef _di_controller_rule_action_print_error_missing_pid_
- extern void controller_rule_action_print_error_missing_pid(const fl_print_t print, const f_string_t alias) F_attribute_visibility_internal_d;
+ extern void controller_rule_action_print_error_missing_pid(const fl_print_t print, const f_string_static_t alias) F_attribute_visibility_internal_d;
#endif // _di_controller_rule_action_print_error_missing_pid_
/**
* A short explanation on why this is an error or warning.
*/
#ifndef _di_controller_rule_item_print_error_need_want_wish_
- extern void controller_rule_item_print_error_need_want_wish(const fl_print_t print, const f_string_t need_want_wish, const f_string_t value, const f_string_t why) F_attribute_visibility_internal_d;
+ extern void controller_rule_item_print_error_need_want_wish(const fl_print_t print, const f_string_static_t need_want_wish, const f_string_static_t value, const f_string_t why) F_attribute_visibility_internal_d;
#endif // _di_controller_rule_item_print_error_need_want_wish_
/**
* The rule alias of the rule that is not loaded.
*/
#ifndef _di_controller_rule_item_print_error_rule_not_loaded_
- extern void controller_rule_item_print_error_rule_not_loaded(const fl_print_t print, const f_string_t alias) F_attribute_visibility_internal_d;
+ extern void controller_rule_item_print_error_rule_not_loaded(const fl_print_t print, const f_string_static_t alias) F_attribute_visibility_internal_d;
#endif // _di_controller_rule_item_print_error_rule_not_loaded_
/**
for (; j < process->path_pids.used; ++j) {
- if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j].string) == F_true) {
+ if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j]) == F_true) {
break;
}
} // for
if (main->parameters.array[controller_parameter_daemon_e].result == f_console_result_found_e) {
setting->ready = controller_setting_ready_done_e;
- if (f_file_exists(setting->path_pid.string) == F_true) {
+ if (f_file_exists(setting->path_pid) == F_true) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, &thread);
if (F_status_is_error_not(*status) && *status != F_child) {
if (main->parameters.array[controller_parameter_validate_e].result == f_console_result_none_e || main->parameters.array[controller_parameter_simulate_e].result == f_console_result_found_e) {
- if (entry->setting->entry.pid == controller_entry_pid_require_e && f_file_exists(entry->setting->path_pid.string) == F_true) {
+ if (entry->setting->entry.pid == controller_entry_pid_require_e && f_file_exists(entry->setting->path_pid) == F_true) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
controller_lock_print(main->error.to, entry->global->thread);
for (j = 0; j < process->path_pids.used; ++j) {
- if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j].string) == F_true) {
+ if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j]) == F_true) {
status = controller_file_pid_read(process->path_pids.array[j], &pid);
if (pid) {
for (; spent < controller_thread_exit_process_cancel_total_d; ++spent) {
- if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j].string) == F_true) {
+ if (process->path_pids.array[j].used && f_file_exists(process->path_pids.array[j]) == F_true) {
status = controller_file_pid_read(process->path_pids.array[j], &pid);
if (pid) {
continue;
}
else {
- f_file_remove(process->path_pids.array[j].string);
+ f_file_remove(process->path_pids.array[j]);
process->path_pids.array[j].used = 0;
}
}
for (j = 0; j < process->path_pids.used; ++j) {
- if (f_file_exists(process->path_pids.array[j].string) == F_true) {
+ if (f_file_exists(process->path_pids.array[j]) == F_true) {
status = controller_file_pid_read(process->path_pids.array[j], &pid);
if (pid) {
f_signal_send(F_signal_kill, pid);
}
- f_file_remove(process->path_pids.array[j].string);
+ f_file_remove(process->path_pids.array[j]);
process->path_pids.array[j].used = 0;
}
} // for
f_string_dynamic_resize(0, &main->file_data_build_defines);
f_string_dynamic_resize(0, &main->file_data_build_dependencies);
+ f_string_dynamic_resize(0, &main->file_data_build_process_post_s);
+ f_string_dynamic_resize(0, &main->file_data_build_process_pre_s);
f_string_dynamic_resize(0, &main->file_data_build_fakefile);
f_string_dynamic_resize(0, &main->file_data_build_settings);
f_string_dynamic_t file_data_build_defines;
f_string_dynamic_t file_data_build_dependencies;
f_string_dynamic_t file_data_build_fakefile;
+ f_string_dynamic_t file_data_build_process_post_s;
+ f_string_dynamic_t file_data_build_process_pre_s;
f_string_dynamic_t file_data_build_settings;
f_string_dynamic_t file_documents_readme;
#define fake_main_t_initialize \
{ \
- macro_f_console_parameters_t_initialize(fake_console_parameter_t_initialize, fake_total_parameters_d) \
+ f_console_parameters_t_initialize, \
f_array_lengths_t_initialize, \
F_false, \
fl_print_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
+ f_string_dynamic_t_initialize, \
f_color_context_t_initialize, \
}
#endif // _di_fake_main_t_
#ifndef _di_fake_build_library_script_
int fake_build_library_script(fake_main_t * const main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
fake_build_touch(main, file_stage, status);
#ifndef _di_fake_build_library_shared_
int fake_build_library_shared(fake_main_t * const main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
if (!data_build.setting.build_sources_library.used) return 0;
if (main->output.verbosity != f_console_verbosity_quiet_e) {
}
}
- const f_array_length_t parameter_file_name_length = fake_build_parameter_library_name_prefix_s.used + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_shared_s.used;
- const f_array_length_t parameter_file_name_major_length = data_build.setting.version_major.used ? parameter_file_name_length + data_build.setting.version_major_prefix.used + data_build.setting.version_major.used : 0;
- const f_array_length_t parameter_file_name_minor_length = data_build.setting.version_minor.used ? parameter_file_name_major_length + data_build.setting.version_minor_prefix.used + data_build.setting.version_minor.used : 0;
- const f_array_length_t parameter_file_name_micro_length = data_build.setting.version_micro.used ? parameter_file_name_minor_length + data_build.setting.version_micro_prefix.used + data_build.setting.version_micro.used : 0;
- const f_array_length_t parameter_file_name_nano_length = data_build.setting.version_nano.used ? parameter_file_name_micro_length + data_build.setting.version_nano_prefix.used + data_build.setting.version_nano.used : 0;
+ f_string_static_t parameter_file_name = f_string_static_t_initialize;
+ f_string_static_t parameter_file_name_major = f_string_static_t_initialize;
+ f_string_static_t parameter_file_name_minor = f_string_static_t_initialize;
+ 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;
- char parameter_file_name[parameter_file_name_length + 1];
- char parameter_file_name_major[parameter_file_name_major_length + 1];
- char parameter_file_name_minor[parameter_file_name_minor_length + 1];
- char parameter_file_name_micro[parameter_file_name_micro_length + 1];
- char parameter_file_name_nano[parameter_file_name_nano_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;
- parameter_file_name[parameter_file_name_length] = 0;
- parameter_file_name_major[parameter_file_name_major_length] = 0;
- parameter_file_name_minor[parameter_file_name_minor_length] = 0;
- parameter_file_name_micro[parameter_file_name_micro_length] = 0;
- parameter_file_name_nano[parameter_file_name_nano_length] = 0;
+ 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_minor_string[parameter_file_name_minor.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];
- memcpy(parameter_file_name, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
+ 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;
- if (parameter_file_name_major_length) {
- memcpy(parameter_file_name_major, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
+ 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_minor_length) {
- memcpy(parameter_file_name_minor, 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_micro_length) {
- memcpy(parameter_file_name_micro, 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_nano_length) {
- memcpy(parameter_file_name_nano, 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 + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ memcpy(parameter_file_name_string + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
- if (parameter_file_name_major_length) {
- memcpy(parameter_file_name_major + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ 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);
- if (parameter_file_name_minor_length) {
- memcpy(parameter_file_name_minor + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ 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);
- if (parameter_file_name_micro_length) {
- memcpy(parameter_file_name_micro + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ 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);
- if (parameter_file_name_nano_length) {
- memcpy(parameter_file_name_nano + count, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ 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);
}
}
}
count += data_build.setting.project_name.used;
- memcpy(parameter_file_name + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ memcpy(parameter_file_name_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_length) {
- memcpy(parameter_file_name_major + 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) {
+ 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);
- if (parameter_file_name_minor_length) {
- memcpy(parameter_file_name_minor + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ 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);
- if (parameter_file_name_micro_length) {
- memcpy(parameter_file_name_micro + count, fake_build_parameter_library_name_suffix_shared_s.string, 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_nano_length) {
- memcpy(parameter_file_name_nano + count, fake_build_parameter_library_name_suffix_shared_s.string, fake_build_parameter_library_name_suffix_shared_s.used);
+ 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);
}
}
}
}
- if (parameter_file_name_major_length) {
+ if (parameter_file_name_major.used) {
count += fake_build_parameter_library_name_suffix_shared_s.used;
if (data_build.setting.version_major_prefix.used) {
- memcpy(parameter_file_name_major + count, data_build.setting.version_major_prefix.string, 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);
- if (parameter_file_name_minor_length) {
- memcpy(parameter_file_name_minor + count, data_build.setting.version_major_prefix.string, data_build.setting.version_major_prefix.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_length) {
- memcpy(parameter_file_name_micro + 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_length) {
- memcpy(parameter_file_name_nano + 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);
}
}
}
count += data_build.setting.version_major_prefix.used;
}
- memcpy(parameter_file_name_major + count, data_build.setting.version_major.string, data_build.setting.version_major.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_length) {
- memcpy(parameter_file_name_minor + 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_length) {
- memcpy(parameter_file_name_micro + 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_length) {
- memcpy(parameter_file_name_nano + 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);
}
}
}
- if (parameter_file_name_minor_length) {
+ if (parameter_file_name_minor.used) {
count += data_build.setting.version_major.used;
if (data_build.setting.version_minor_prefix.used) {
- memcpy(parameter_file_name_minor + count, data_build.setting.version_minor_prefix.string, 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);
- if (parameter_file_name_micro_length) {
- memcpy(parameter_file_name_micro + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.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 (parameter_file_name_nano_length) {
- memcpy(parameter_file_name_nano + count, data_build.setting.version_minor_prefix.string, data_build.setting.version_minor_prefix.used);
+ 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);
}
}
count += data_build.setting.version_minor_prefix.used;
}
- memcpy(parameter_file_name_minor + count, data_build.setting.version_minor.string, data_build.setting.version_minor.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_length) {
- memcpy(parameter_file_name_micro + 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);
- if (parameter_file_name_nano_length) {
- memcpy(parameter_file_name_nano + count, data_build.setting.version_minor.string, data_build.setting.version_minor.used);
+ 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_length) {
+ 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 + count, data_build.setting.version_micro_prefix.string, 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);
- if (parameter_file_name_nano_length) {
- memcpy(parameter_file_name_nano + count, data_build.setting.version_micro_prefix.string, data_build.setting.version_micro_prefix.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);
}
count += data_build.setting.version_micro_prefix.used;
}
- memcpy(parameter_file_name_micro + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
+ memcpy(parameter_file_name_micro_string + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
- if (parameter_file_name_nano_length) {
- memcpy(parameter_file_name_nano + count, data_build.setting.version_micro.string, data_build.setting.version_micro.used);
+ 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 + count, data_build.setting.version_nano_prefix.string, 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;
}
- memcpy(parameter_file_name_nano + count, data_build.setting.version_nano.string, 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_array_length_t parameter_linker_length = fake_build_parameter_library_shared_prefix_s.used;
- f_array_length_t parameter_file_path_length = main->path_build_libraries_shared.used;
+ f_string_static_t parameter_linker = f_string_static_t_initialize;
+ f_string_static_t parameter_file_path = 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;
if (data_build.setting.version_file == fake_build_version_type_major_e) {
- parameter_file_path_length += parameter_file_name_major_length;
+ parameter_file_path.used += parameter_file_name_major.used;
}
else if (data_build.setting.version_file == fake_build_version_type_minor_e) {
- parameter_file_path_length += parameter_file_name_minor_length;
+ parameter_file_path.used += parameter_file_name_minor.used;
}
else if (data_build.setting.version_file == fake_build_version_type_micro_e) {
- parameter_file_path_length += parameter_file_name_micro_length;
+ parameter_file_path.used += parameter_file_name_micro.used;
}
else if (data_build.setting.version_file == fake_build_version_type_nano_e) {
- parameter_file_path_length += parameter_file_name_nano_length;
+ parameter_file_path.used += parameter_file_name_nano.used;
}
if (data_build.setting.version_target == fake_build_version_type_major_e) {
- parameter_linker_length += parameter_file_name_major_length;
+ parameter_linker.used += parameter_file_name_major.used;
}
else if (data_build.setting.version_target == fake_build_version_type_minor_e) {
- parameter_linker_length += parameter_file_name_minor_length;
+ parameter_linker.used += parameter_file_name_minor.used;
}
else if (data_build.setting.version_target == fake_build_version_type_micro_e) {
- parameter_linker_length += parameter_file_name_micro_length;
+ parameter_linker.used += parameter_file_name_micro.used;
}
else if (data_build.setting.version_target == fake_build_version_type_nano_e) {
- parameter_linker_length += parameter_file_name_nano_length;
+ parameter_linker.used += parameter_file_name_nano.used;
}
- char parameter_linker[parameter_linker_length + 1];
- char parameter_file_path[parameter_file_path_length + 1];
+ char parameter_linker_string[parameter_linker.used + 1];
+ char parameter_file_path_string[parameter_file_path.used + 1];
+
+ parameter_linker.string = parameter_linker_string;
+ parameter_file_path.string = parameter_file_path_string;
- memcpy(parameter_linker, fake_build_parameter_library_shared_prefix_s.string, fake_build_parameter_library_shared_prefix_s.used);
- memcpy(parameter_file_path, 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);
+ memcpy(parameter_file_path_string, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
if (data_build.setting.version_file == fake_build_version_type_major_e) {
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name_major, parameter_file_name_major_length);
+ memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_major_string, parameter_file_name_major.used);
}
else if (data_build.setting.version_file == fake_build_version_type_minor_e) {
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name_minor, parameter_file_name_minor_length);
+ memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_minor_string, parameter_file_name_minor.used);
}
else if (data_build.setting.version_file == fake_build_version_type_micro_e) {
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name_micro, parameter_file_name_micro_length);
+ memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_micro_string, parameter_file_name_micro.used);
}
else if (data_build.setting.version_file == fake_build_version_type_nano_e) {
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name_nano, parameter_file_name_nano_length);
+ memcpy(parameter_file_path_string + main->path_build_libraries_shared.used, parameter_file_name_nano_string, parameter_file_name_nano.used);
}
if (data_build.setting.version_target == fake_build_version_type_major_e) {
- memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_major, parameter_file_name_major_length);
+ memcpy(parameter_linker_string + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_major_string, parameter_file_name_major.used);
}
else if (data_build.setting.version_target == fake_build_version_type_minor_e) {
- memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_minor, parameter_file_name_minor_length);
+ memcpy(parameter_linker_string + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_minor_string, parameter_file_name_minor.used);
}
else if (data_build.setting.version_target == fake_build_version_type_micro_e) {
- memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_micro, parameter_file_name_micro_length);
+ memcpy(parameter_linker_string + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_micro_string, parameter_file_name_micro.used);
}
else if (data_build.setting.version_target == fake_build_version_type_nano_e) {
- memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_nano, parameter_file_name_nano_length);
+ memcpy(parameter_linker_string + fake_build_parameter_library_shared_prefix_s.used, parameter_file_name_nano_string, parameter_file_name_nano.used);
}
- parameter_linker[parameter_linker_length] = 0;
- parameter_file_path[parameter_file_path_length] = 0;
+ 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,
- macro_f_string_static_t_initialize(parameter_linker, 0, parameter_linker_length),
+ parameter_linker,
fake_build_parameter_library_output_s,
- macro_f_string_static_t_initialize(parameter_file_path, 0, parameter_file_path_length),
+ parameter_file_path,
};
for (uint8_t i = 0; i < 4; ++i) {
if (*status == F_child) return result;
}
- if (parameter_file_name_major_length) {
- f_array_length_t parameter_file_path_length = main->path_build_libraries_shared.used + parameter_file_name_length;
+ if (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.used;
- char parameter_file_path[parameter_file_path_length + 1];
+ char parameter_file_path_string[parameter_file_path.used + 1];
+ parameter_file_path.string = parameter_file_path_string;
- memcpy(parameter_file_path, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name, parameter_file_name_length);
+ 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[parameter_file_path_length] = 0;
+ parameter_file_path_string[parameter_file_path.used] = 0;
*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) {
- fll_print_format("Linked file '%S' to '%S'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_major, f_string_eol_s);
+ fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_major, 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, "link", fll_error_file_type_file_e);
+ 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_major, "link", 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_major, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
}
- if (data_build.setting.version_file != fake_build_version_type_major_e && parameter_file_name_major_length) {
+ 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;
- f_array_length_t parameter_file_path_length = main->path_build_libraries_shared.used + parameter_file_name_major_length;
+ char parameter_file_path_string[parameter_file_path.used + 1];
- char parameter_file_path[parameter_file_path_length + 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);
- memcpy(parameter_file_path, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name_major, parameter_file_name_major_length);
-
- parameter_file_path[parameter_file_path_length] = 0;
+ parameter_file_path_string[parameter_file_path.used] = 0;
+ parameter_file_path.string = parameter_file_path_string;
*status = f_file_link(parameter_file_name_minor, parameter_file_path);
if (F_status_is_error_not(*status) && main->error.verbosity == f_console_verbosity_verbose_e) {
- fll_print_format("Linked file '%S' to '%S'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_minor, f_string_eol_s);
+ 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, "link", fll_error_file_type_file_e);
+ 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_minor, "link", 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;
}
- if (data_build.setting.version_file != fake_build_version_type_minor_e && parameter_file_name_minor_length) {
-
- f_array_length_t parameter_file_path_length = main->path_build_libraries_shared.used + parameter_file_name_minor_length;
+ 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;
- char parameter_file_path[parameter_file_path_length + 1];
+ char parameter_file_path_string[parameter_file_path.used + 1];
+ parameter_file_path.string = parameter_file_path_string;
- memcpy(parameter_file_path, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name_minor, parameter_file_name_minor_length);
+ 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[parameter_file_path_length] = 0;
+ parameter_file_path_string[parameter_file_path.used] = 0;
*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 '%S' to '%S'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_micro, f_string_eol_s);
+ 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, "link", fll_error_file_type_file_e);
+ 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, "link", 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_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_length) {
-
- f_array_length_t parameter_file_path_length = main->path_build_libraries_shared.used + parameter_file_name_micro_length;
+ 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[parameter_file_path_length + 1];
+ char parameter_file_path_string[parameter_file_path.used + 1];
+ parameter_file_path.string = parameter_file_path_string;
- memcpy(parameter_file_path, main->path_build_libraries_shared.string, main->path_build_libraries_shared.used);
- memcpy(parameter_file_path + main->path_build_libraries_shared.used, parameter_file_name_micro, parameter_file_name_micro_length);
+ 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[parameter_file_path_length] = 0;
+ 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) {
- fll_print_format("Linked file '%S' to '%S'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_nano, f_string_eol_s);
+ fll_print_format("Linked file '%Q' to '%Q'.%r", main->output.to.stream, parameter_file_path, parameter_file_name_nano, 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, "link", fll_error_file_type_file_e);
+ 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_nano, "link", 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_nano, f_file_operation_link_s, fll_error_file_type_file_e);
return 0;
}
#ifndef _di_fake_build_library_static_
int fake_build_library_static(fake_main_t * const main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
if (!data_build.setting.build_sources_library.used) return 0;
if (main->output.verbosity != f_console_verbosity_quiet_e) {
break;
}
- *status = f_file_name_directory(sources[i]->array[j].string, sources[i]->array[j].used, &source_path);
+ *status = f_file_name_directory(sources[i]->array[j], &source_path);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
}
if (F_status_is_error(*status)) {
- fake_print_error_fss(main, F_status_set_fine(*status), "fll_fss_extended_read", main->file_data_build_settings.string, range, F_true);
+ fake_print_error_fss(main, F_status_set_fine(*status), "fll_fss_extended_read", main->file_data_build_settings, range, F_true);
}
else {
*status = fl_fss_apply_delimit(delimits, &buffer);
settings_mode_names[j].used = 0;
- *status = f_string_dynamic_increase_by(settings_length[j] + f_string_ascii_minus_s.used + modes->array[i].used, &settings_mode_names[j]);
+ *status = f_string_dynamic_increase_by(settings_value[j]->used + f_string_ascii_minus_s.used + modes->array[i].used, &settings_mode_names[j]);
if (F_status_is_error(*status)) {
function = "f_string_dynamic_increase_by";
break;
}
- memcpy(settings_mode_names[j].string, settings_name[j], settings_length[j]);
- settings_mode_names[j].used = settings_length[j];
+ memcpy(settings_mode_names[j].string, settings_name[j].string, settings_value[j]->used);
+ settings_mode_names[j].used = settings_value[j]->used;
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;
- memcpy(settings_mode_names[j].string + settings_mode_namesf[j].used, modes->array[i].string, modes->array[i].used);
+ 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;
} // for
0, // search_exclusive
0, // search_shared
0, // search_static
- fake_build_version_type_micro_e, // version_file
+ fake_build_version_type_micro_e, // version_file
0, // version_major
0, // version_major_prefix
0, // version_micro
0, // version_minor_prefix
0, // version_nano
0, // version_nano_prefix
- fake_build_version_type_major_e, // version_target
+ fake_build_version_type_major_e, // version_target
};
- const char *settings_single_version_default_name[] = {
- 0, // build_compiler
- 0, // build_indexer
- 0, // build_language
- 0, // build_script
- 0, // build_shared
- 0, // build_static
- 0, // path_headers
- 0, // path_headers_preserve
- 0, // path_language
- 0, // path_library_script
- 0, // path_library_shared
- 0, // path_library_static
- 0, // path_program_script
- 0, // path_program_shared
- 0, // path_program_static
- 0, // path_sources
- 0, // path_standard
- 0, // process_post
- 0, // process_pre
- 0, // project_name
- 0, // search_exclusive
- 0, // search_shared
- 0, // search_static
+ const f_string_static_t settings_single_version_default_name[] = {
+ f_string_empty_s, // build_compiler
+ f_string_empty_s, // build_indexer
+ f_string_empty_s, // build_language
+ f_string_empty_s, // build_script
+ f_string_empty_s, // build_shared
+ f_string_empty_s, // build_static
+ f_string_empty_s, // path_headers
+ f_string_empty_s, // path_headers_preserve
+ f_string_empty_s, // path_language
+ f_string_empty_s, // path_library_script
+ f_string_empty_s, // path_library_shared
+ f_string_empty_s, // path_library_static
+ f_string_empty_s, // path_program_script
+ f_string_empty_s, // path_program_shared
+ f_string_empty_s, // path_program_static
+ f_string_empty_s, // path_sources
+ f_string_empty_s, // path_standard
+ f_string_empty_s, // process_post
+ f_string_empty_s, // process_pre
+ f_string_empty_s, // project_name
+ f_string_empty_s, // search_exclusive
+ f_string_empty_s, // search_shared
+ f_string_empty_s, // search_static
fake_build_version_micro_s, // version_file
- 0, // version_major
- 0, // version_major_prefix
- 0, // version_micro
- 0, // version_micro_prefix
- 0, // version_minor
- 0, // version_minor_prefix
- 0, // version_nano
- 0, // version_nano_prefix
+ f_string_empty_s, // version_major
+ f_string_empty_s, // version_major_prefix
+ f_string_empty_s, // version_micro
+ f_string_empty_s, // version_micro_prefix
+ f_string_empty_s, // version_minor
+ f_string_empty_s, // version_minor_prefix
+ f_string_empty_s, // version_nano
+ f_string_empty_s, // version_nano_prefix
fake_build_version_major_s, // version_target
};
}
if (settings_single_type[i] == 1) {
- if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_common_setting_bool_yes_s, settings_single_source[i]->array[0].used, fake_common_setting_bool_yes_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_common_setting_bool_yes_s) == F_equal_to) {
*settings_single_bool[i] = F_true;
}
- else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_common_setting_bool_no_s, settings_single_source[i]->array[0].used, fake_common_setting_bool_no_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_common_setting_bool_no_s) == F_equal_to) {
*settings_single_bool[i] = F_false;
}
else {
}
}
else if (settings_single_type[i] == 4) {
- if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_language_bash_s, settings_single_source[i]->array[0].used, fake_build_language_bash_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_build_language_bash_s) == F_equal_to) {
*settings_single_language[i] = fake_build_language_type_bash_e;
}
- else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_language_c_s, settings_single_source[i]->array[0].used, fake_build_language_c_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_build_language_c_s) == F_equal_to) {
*settings_single_language[i] = fake_build_language_type_c_e;
}
- else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_language_cpp_s, settings_single_source[i]->array[0].used, fake_build_language_cpp_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_build_language_cpp_s) == F_equal_to) {
*settings_single_language[i] = fake_build_language_type_cpp_e;
}
else {
}
}
else if (settings_single_type[i] == 5) {
- if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_version_major_s, settings_single_source[i]->array[0].used, fake_build_version_major_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_build_version_major_s) == F_equal_to) {
*settings_single_version[i] = fake_build_version_type_major_e;
}
- else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_version_minor_s, settings_single_source[i]->array[0].used, fake_build_version_minor_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_build_version_minor_s) == F_equal_to) {
*settings_single_version[i] = fake_build_version_type_minor_e;
}
- else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_version_micro_s, settings_single_source[i]->array[0].used, fake_build_version_micro_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_build_version_micro_s) == F_equal_to) {
*settings_single_version[i] = fake_build_version_type_micro_e;
}
- else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_version_nano_s, settings_single_source[i]->array[0].used, fake_build_version_nano_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare_trim(settings_single_source[i]->array[0], fake_build_version_nano_s) == F_equal_to) {
*settings_single_version[i] = fake_build_version_type_nano_e;
}
else {
return;
}
- const f_string_t names[] = {
+ const f_string_static_t names[] = {
fake_build_stage_libraries_script_s,
fake_build_stage_libraries_shared_s,
fake_build_stage_libraries_static_s,
f_string_dynamic_t settings_file_base = f_string_dynamic_t_initialize;
if (settings_file.used) {
- *status = f_file_name_base(settings_file.string, settings_file.used, &settings_file_base);
+ *status = f_file_name_base(settings_file, &settings_file_base);
}
else {
- *status = f_file_name_base(main->file_data_build_settings.string, main->file_data_build_settings.used, &settings_file_base);
+ *status = f_file_name_base(main->file_data_build_settings, &settings_file_base);
}
if (F_status_is_error(*status)) {
#ifndef _di_fake_build_objects_static_
int fake_build_objects_static(fake_main_t * const main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
if (!data_build.setting.build_sources_library.used) return 0;
if (main->output.verbosity != f_console_verbosity_quiet_e) {
f_string_dynamic_t file_name = f_string_dynamic_t_initialize;
f_string_dynamic_t destination_path = f_string_dynamic_t_initialize;
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
- f_array_length_t source_length = 0;
- f_array_length_t destination_length = 0;
+ f_string_static_t destination = f_string_static_t_initialize;
+ f_string_static_t source = f_string_static_t_initialize;
const f_string_static_t *path_sources = &main->path_sources;
file_name.used = 0;
destination_path.used = 0;
+ source.used = path_sources->used + sources[i]->array[j].used;
- source_length = path_sources->used + sources[i]->array[j].used;
+ char source_string[source.used + 1];
- char source[source_length + 1];
-
- memcpy(source, path_sources->string, path_sources->used);
- memcpy(source + path_sources->used, sources[i]->array[j].string, sources[i]->array[j].used);
- source[source_length] = 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);
break;
}
- *status = f_file_name_directory(sources[i]->array[j].string, sources[i]->array[j].used, &destination_path);
+ *status = f_file_name_directory(sources[i]->array[j], &destination_path);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_assure", F_true);
+
break;
}
break;
}
- *status = f_directory_exists(destination_path.string);
+ *status = f_directory_exists(destination_path);
if (*status == F_false) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
break;
}
- else if (*status == F_file_found_not) {
- *status = f_directory_create(destination_path.string, mode.directory);
+
+ if (*status == F_file_found_not) {
+ *status = f_directory_create(destination_path, mode.directory);
if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found_not) {
fll_print_format("Directory '%Q' created.%r", main->output.to.stream, destination_path, f_string_eol_s);
}
}
- else if (F_status_is_error(*status)) {
+
+ if (F_status_is_error(*status)) {
fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_exists", F_true, destination_path, f_file_operation_create_s, fll_error_file_type_directory_e);
break;
}
- destination_length = destination_path.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
+ destination.used = destination_path.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
else {
- destination_length = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
+ destination.used = main->path_build_objects.used + file_name.used + fake_build_parameter_object_name_suffix_s.used;
}
- char destination[destination_length + 1];
+ char destination_string[destination.used + 1];
+ destination.string = destination_string;
if (destination_path.used) {
- memcpy(destination, destination_path.string, destination_path.used);
- memcpy(destination + destination_path.used, file_name.string, file_name.used);
- memcpy(destination + destination_path.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s.used);
+ memcpy(destination_string, destination_path.string, destination_path.used);
+ memcpy(destination_string + destination_path.used, file_name.string, file_name.used);
+ memcpy(destination_string + destination_path.used + file_name.used, fake_build_parameter_object_name_suffix_s.string, fake_build_parameter_object_name_suffix_s.used);
}
else {
- memcpy(destination, main->path_build_objects.string, main->path_build_objects.used);
- memcpy(destination + main->path_build_objects.used, file_name.string, file_name.used);
- memcpy(destination + main->path_build_objects.used + file_name.used, fake_build_parameter_object_name_suffix_s, fake_build_parameter_object_name_suffix_s.used);
+ memcpy(destination_string, main->path_build_objects.string, main->path_build_objects.used);
+ memcpy(destination_string + main->path_build_objects.used, file_name.string, file_name.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[destination_length] = 0;
+ destination_string[destination.used] = 0;
const f_string_static_t values[] = {
- macro_f_string_static_t_initialize(source, 0, source_length),
+ source,
fake_build_parameter_object_compile_s,
fake_build_parameter_object_static_s,
fake_build_parameter_object_output_s,
- macro_f_string_static_t_initialize(destination, 0, destination_length),
+ destination,
};
for (uint8_t k = 0; k < 5; ++k) {
- if (!lengths[k]) continue;
+ if (!values[k].used) continue;
*status = fll_execute_arguments_add(values[k], &arguments);
if (F_status_is_error(*status)) break;
#ifndef _di_fake_build_program_script_
int fake_build_program_script(fake_main_t * const main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
fake_build_touch(main, file_stage, status);
#ifndef _di_fake_build_program_shared_
int fake_build_program_shared(fake_main_t * const main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
if (!data_build.setting.build_sources_program.used) return 0;
if (main->output.verbosity != f_console_verbosity_quiet_e) {
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_not(*status)) {
- f_array_length_t parameter_file_name_path_length = main->path_build_programs_shared.used + data_build.setting.project_name.used;
+ f_string_static_t parameter_file_name_path = f_string_static_t_initialize;
+ parameter_file_name_path.used = main->path_build_programs_shared.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;
- char parameter_file_name_path[parameter_file_name_path_length + 1];
+ 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);
- memcpy(parameter_file_name_path, main->path_build_programs_shared.string, main->path_build_programs_shared.used);
- memcpy(parameter_file_name_path + main->path_build_programs_shared.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
- parameter_file_name_path[parameter_file_name_path_length] = 0;
+ parameter_file_name_path_string[parameter_file_name_path.used] = 0;
const f_string_static_t values[] = {
fake_build_parameter_library_output_s,
- macro_f_string_static_t_initialize(parameter_file_name_path, 0, parameter_file_name_path_length),
+ parameter_file_name_path,
};
for (uint8_t i = 0; i < 2; ++i) {
// 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_length + data_build.setting.project_name.used;
+ 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;
- memcpy(link_project_library, fake_build_parameter_library_link_file_s.string, fake_build_parameter_library_link_file_s.used);
- memcpy(link_project_library + fake_build_parameter_library_link_file_s.string, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ 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);
fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
macro_f_string_dynamics_t_delete_simple(arguments);
+
return 0;
}
#ifndef _di_fake_build_program_static_
int fake_build_program_static(fake_main_t * const main, const fake_build_data_t data_build, const f_mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
if (!data_build.setting.build_sources_program.used) return 0;
if (main->output.verbosity != f_console_verbosity_quiet_e) {
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_not(*status)) {
- f_array_length_t source_library_length = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s_length + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_static_s_length;
-
- char source_library[source_library_length + 1];
+ f_string_static_t source_library = f_string_static_t_initialize;
+ source_library.used = main->path_build_libraries_static.used + fake_build_parameter_library_name_prefix_s.used + data_build.setting.project_name.used + fake_build_parameter_library_name_suffix_static_s.used;
- source_library_length = 0;
+ char source_library_string[source_library.used + 1];
+ source_library.string = source_library_string;
+ source_library.used = 0;
- // only include the library if there are sources that would result in it being built.
+ // Only include the library if there are sources that would result in it being built.
if (data_build.setting.build_sources_library.used) {
- memcpy(source_library, main->path_build_libraries_static.string, main->path_build_libraries_static.used);
- source_library_length += main->path_build_libraries_static.used;
+ memcpy(source_library_string, main->path_build_libraries_static.string, main->path_build_libraries_static.used);
+ source_library.used += main->path_build_libraries_static.used;
- memcpy(source_library + source_library_length, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
- source_library_length += fake_build_parameter_library_name_prefix_s.used;
+ memcpy(source_library_string + source_library.used, fake_build_parameter_library_name_prefix_s.string, fake_build_parameter_library_name_prefix_s.used);
+ source_library.used += fake_build_parameter_library_name_prefix_s.used;
- memcpy(source_library + source_library_length, data_build.setting.project_name.string, data_build.setting.project_name.used);
- source_library_length += data_build.setting.project_name.used;
+ memcpy(source_library_string + source_library.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
+ source_library.used += data_build.setting.project_name.used;
- memcpy(source_library + source_library_length, fake_build_parameter_library_name_suffix_static_s.string, fake_build_parameter_library_name_suffix_static_s.used);
- source_library_length += fake_build_parameter_library_name_suffix_static_s.used;
+ memcpy(source_library_string + source_library.used, fake_build_parameter_library_name_suffix_static_s.string, fake_build_parameter_library_name_suffix_static_s.used);
+ source_library.used += fake_build_parameter_library_name_suffix_static_s.used;
}
- source_library.string[source_library_length] = 0;
+ source_library_string[source_library.used] = 0;
- f_array_length_t parameter_file_name_path_length = main->path_build_programs_static.used + data_build.setting.project_name.used;
+ 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[parameter_file_name_path_length + 1];
+ char parameter_file_name_path_string[parameter_file_name_path.used + 1];
- memcpy(parameter_file_name_path, main->path_build_programs_static.string, main->path_build_programs_static.used);
- memcpy(parameter_file_name_path + main->path_build_programs_static.used, data_build.setting.project_name.string, data_build.setting.project_name.used);
- parameter_file_name_path[parameter_file_name_path_length] = 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[] = {
- macro_f_string_static_t_initialize(source_library, 0, source_library_length),
+ source_library,
fake_build_parameter_library_static_s,
fake_build_parameter_library_output_s,
- macro_f_string_static_t_initialize(parameter_file_name_path, 0, parameter_file_name_path_length),
+ parameter_file_name_path,
};
for (uint8_t i = 0; i < 4; ++i) {
fll_error_print(main->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
macro_f_string_dynamics_t_delete_simple(arguments);
+
return 0;
}
#ifndef _di_fake_build_skeleton_
void fake_build_skeleton(fake_main_t * const main, const fake_build_data_t data_build, const mode_t mode, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return;
f_string_static_t path_headers = f_string_static_t_initialize;
f_array_length_t directory_headers_length = main->path_build_includes.used + data_build.setting.path_headers.used;
directorys[i]->string[j] = 0;
- *status = f_directory_exists(directorys[i]->string);
+ *status = f_directory_exists(*directorys[i]);
if (F_status_is_error(*status) || *status == F_false) {
directorys[i]->string[j] = f_path_separator_s.string[0];
}
if (*status == F_file_found_not) {
- *status = f_directory_create(directorys[i]->string, mode);
+ *status = f_directory_create(*directorys[i], mode);
}
directorys[i]->string[j] = f_path_separator_s.string[0];
} // for
if (F_status_is_fine(*status)) {
- *status = f_directory_create(directorys[i]->string, mode);
+ *status = f_directory_create(*directorys[i], mode);
}
if (F_status_is_error(*status)) {
continue;
}
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_create", F_true, directorys[i]->string, "create", fll_error_file_type_directory_e);
+ fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_create", F_true, *directorys[i], f_file_operation_create_s, fll_error_file_type_directory_e);
return;
}
extern "C" {
#endif
+#ifndef _di_fake_build_strings_
+ const f_string_static_t fake_build_header_files_s = macro_f_string_static_t_initialize(FAKE_build_header_files_s, 0, FAKE_build_header_files_s_length);
+ const f_string_static_t fake_build_header_files_shared_s = macro_f_string_static_t_initialize(FAKE_build_header_files_shared_s, 0, FAKE_build_header_files_shared_s_length);
+ const f_string_static_t fake_build_header_files_static_s = macro_f_string_static_t_initialize(FAKE_build_header_files_static_s, 0, FAKE_build_header_files_static_s_length);
+ const f_string_static_t fake_build_scripts_s = macro_f_string_static_t_initialize(FAKE_build_scripts_s, 0, FAKE_build_scripts_s_length);
+ const f_string_static_t fake_build_setting_files_s = macro_f_string_static_t_initialize(FAKE_build_setting_files_s, 0, FAKE_build_setting_files_s_length);
+#endif // _di_fake_build_strings_
+
#ifndef _di_fake_build_arguments_standard_add_
void fake_build_arguments_standard_add(fake_main_t * const main, const fake_build_data_t data_build, const bool is_shared, const bool is_library, f_string_dynamics_t *arguments, f_status_t *status) {
#endif // _di_fake_build_arguments_standard_add_
#ifndef _di_fake_build_copy_
- void fake_build_copy(fake_main_t * const main, const f_mode_t mode, const f_string_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t preserve, f_status_t *status) {
+ void fake_build_copy(fake_main_t * const main, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t preserve, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return;
if (fake_signal_received(main)) {
*status = F_status_set_error(F_interrupt);
f_string_dynamic_t path_source = f_string_dynamic_t_initialize;
f_string_dynamic_t destination_file = f_string_dynamic_t_initialize;
f_string_dynamic_t destination_directory = f_string_dynamic_t_initialize;
+ f_string_static_t buffer = f_string_static_t_initialize;
if (main->output.verbosity != f_console_verbosity_quiet_e) {
- fll_print_format("%r%[Copying %S.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, label, main->context.set.important, f_string_eol_s);
+ fll_print_format("%r%[Copying %Q.%]%r", main->output.to.stream, f_string_eol_s, main->context.set.important, label, main->context.set.important, f_string_eol_s);
}
macro_f_string_dynamic_t_resize(*status, path_source, source.used);
if (!(i % fake_signal_check_short_d) && fake_signal_received(main)) {
*status = F_status_set_error(F_interrupt);
+
break;
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+
break;
}
if (F_status_is_error(*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.string);
+ *status = f_directory_is(path_source);
if (*status == F_true) {
destination_directory.used = 0;
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append", F_true);
+
break;
}
- *status = f_file_name_base(path_source.string, path_source.used, &destination_directory);
+ *status = f_file_name_base(path_source, &destination_directory);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
+
break;
}
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.string, destination_directory.string, path_source.used, destination_directory.used, mode, recurse);
+ *status = fl_directory_copy(path_source, destination_directory, mode, recurse);
if (F_status_is_error(*status)) {
if (main->error.verbosity == f_console_verbosity_verbose_e) {
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+
break;
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_dynamic_append_nulless", F_true);
+
break;
}
- *status = f_file_name_directory(path_source.string + preserve, path_source.used - preserve, &destination_directory);
+ buffer.string = path_source.string + preserve;
+ buffer.used = path_source.used - preserve;
+
+ *status = f_file_name_directory(buffer, &destination_directory);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
+
break;
}
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.string, destination_directory.used, F_file_mode_all_rwx_d);
+ *status = fl_directory_create(destination_directory, F_file_mode_all_rwx_d);
if (F_status_is_error(*status)) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "fl_directory_create", F_true, destination_directory.string, "create", fll_error_file_type_directory_e);
+ fll_error_file_print(main->error, F_status_set_fine(*status), "fl_directory_create", F_true, destination_directory, f_file_operation_create_s, fll_error_file_type_directory_e);
+
break;
}
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_string_append", F_true);
+
break;
}
}
else {
- *status = f_file_name_base(path_source.string, path_source.used, &destination_file);
+ *status = f_file_name_base(path_source, &destination_file);
if (F_status_is_error(*status)) {
fll_error_print(main->error, F_status_set_fine(*status), "f_file_name_base", F_true);
+
break;
}
}
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.string, destination_file.string, mode, F_file_default_read_size_d, F_false);
+ *status = f_file_copy(path_source, destination_file, mode, F_file_default_read_size_d, F_false);
if (F_status_is_error(*status)) {
- fake_print_error_build_operation_file(main, F_status_set_fine(*status), "f_file_copy", F_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true);
+ fake_print_error_build_operation_file(main, F_status_set_fine(*status), "f_file_copy", f_file_operation_copy_s, f_file_operation_to_s, path_source, destination_file, F_true);
+
break;
}
}
else if (F_status_is_error(*status)) {
fll_error_file_print(main->error, F_status_set_fine(*status), "f_directory_is", F_true, path_source, f_file_operation_create_s, fll_error_file_type_file_e);
+
break;
}
#ifndef _di_fake_build_execute_process_script_
int fake_build_execute_process_script(fake_main_t * const main, const fake_build_data_t data_build, const f_string_static_t process_script, const f_string_static_t file_stage, f_status_t *status) {
- if (F_status_is_error(*status) || f_file_exists(file_stage.string) == F_true || *status == F_child) return main->child;
+ if (F_status_is_error(*status) || f_file_exists(file_stage) == F_true || *status == F_child) return main->child;
if (!process_script.used) return 0;
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
if (!path.used) return F_none;
- f_status_t status = f_file_name_base(path.string, path.used, name);
+ f_status_t status = f_file_name_base(path, name);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_file_name_base", F_true);
if (name->string[i] == f_path_extension_separator_s.string[0]) {
name->used = i;
+
break;
}
} // for
main->child = fake_build_execute_process_script(main, data_build, data_build.setting.process_pre, stage.file_process_pre, &status);
- fake_build_copy(main, mode, "setting files", main->path_data_settings, main->path_build_settings, data_build.setting.build_sources_setting, stage.file_sources_settings, 0, &status);
+ fake_build_copy(main, mode, fake_build_setting_files_s, main->path_data_settings, main->path_build_settings, data_build.setting.build_sources_setting, stage.file_sources_settings, 0, &status);
if (data_build.setting.build_language == fake_build_language_type_bash_e) {
fake_build_library_script(main, data_build, mode, stage.file_libraries_script, &status);
fake_build_program_script(main, data_build, mode, stage.file_programs_script, &status);
if (data_build.setting.build_script) {
- fake_build_copy(main, mode, "scripts", main->path_sources_script, main->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
+ fake_build_copy(main, mode, fake_build_scripts_s, main->path_sources_script, main->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
}
}
else {
path_headers.used = directory_headers_length;
path_headers.size = directory_headers_length + 1;
- fake_build_copy(main, mode, "header files", path_sources, path_headers, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.path_headers_preserve ? path_sources_base_length : 0, &status);
+ fake_build_copy(main, mode, fake_build_header_files_s, path_sources, path_headers, data_build.setting.build_sources_headers, stage.file_sources_headers, data_build.setting.path_headers_preserve ? path_sources_base_length : 0, &status);
if (data_build.setting.build_shared) {
- fake_build_copy(main, mode, "shared header files", path_sources, path_headers, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.path_headers_preserve ? path_sources_base_length : 0, &status);
+ fake_build_copy(main, mode, fake_build_header_files_shared_s, path_sources, path_headers, data_build.setting.build_sources_headers_shared, stage.file_sources_headers, data_build.setting.path_headers_preserve ? path_sources_base_length : 0, &status);
}
if (data_build.setting.build_static) {
- fake_build_copy(main, mode, "static header files", path_sources, path_headers, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.path_headers_preserve ? path_sources_base_length : 0, &status);
+ fake_build_copy(main, mode, fake_build_header_files_static_s, path_sources, path_headers, data_build.setting.build_sources_headers_static, stage.file_sources_headers, data_build.setting.path_headers_preserve ? path_sources_base_length : 0, &status);
}
}
}
if (data_build.setting.build_script) {
- fake_build_copy(main, mode, "scripts", main->path_sources_script, main->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
+ fake_build_copy(main, mode, fake_build_scripts_s, main->path_sources_script, main->path_build_programs_script, data_build.setting.build_sources_script, stage.file_sources_script, 0, &status);
}
}
if (fake_signal_received(main)) {
*status = F_status_set_error(F_interrupt);
+
return;
}
macro_f_mode_t_set_default_umask(mode, main->umask);
- *status = f_file_touch(file.string, mode.regular, F_false);
+ *status = f_file_touch(file, mode.regular, F_false);
if (F_status_is_error(*status)) {
- fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_touch", F_true, file.string, "touch", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(*status), "f_file_touch", F_true, file, f_file_operation_touch_s, fll_error_file_type_file_e);
}
}
#endif // _di_fake_build_touch_
extern "C" {
#endif
+#ifndef _di_fake_build_strings_
+ #define FAKE_build_header_files_s "header files"
+ #define FAKE_build_header_files_shared_s "shared header files"
+ #define FAKE_build_header_files_static_s "static header files"
+ #define FAKE_build_scripts_s "scripts"
+ #define FAKE_build_setting_files_s "setting files"
+
+ #define FAKE_build_header_files_s_length 12
+ #define FAKE_build_header_files_shared_s_length 19
+ #define FAKE_build_header_files_static_s_length 19
+ #define FAKE_build_scripts_s_length 7
+ #define FAKE_build_setting_files_s_length 13
+
+ extern const f_string_static_t fake_build_header_files_s;
+ extern const f_string_static_t fake_build_header_files_shared_s;
+ extern const f_string_static_t fake_build_header_files_static_s;
+ extern const f_string_static_t fake_build_scripts_s;
+ extern const f_string_static_t fake_build_setting_files_s;
+#endif // _di_fake_build_strings_
+
/**
* Add the standard arguments for building a library/program.
*
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_build_copy_
- extern void fake_build_copy(fake_main_t * const main, const f_mode_t mode, const f_string_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t preserve, f_status_t *status) F_attribute_visibility_internal_d;
+ extern void fake_build_copy(fake_main_t * const main, const f_mode_t mode, const f_string_static_t label, const f_string_static_t source, const f_string_static_t destination, const f_string_statics_t files, const f_string_static_t file_stage, const f_array_length_t preserve, f_status_t *status) F_attribute_visibility_internal_d;
#endif // _di_fake_build_copy_
/**
}
if (main->error.verbosity == f_console_verbosity_verbose_e) {
- status = f_directory_remove_custom(main->path_build.string, F_directory_descriptors_max_d, F_true, fake_clean_remove_recursively_verbosely);
+ status = f_directory_remove_custom(main->path_build, F_directory_descriptors_max_d, F_true, fake_clean_remove_recursively_verbosely);
}
else {
- status = f_directory_remove(main->path_build.string, F_directory_descriptors_max_d, F_true);
+ status = f_directory_remove(main->path_build, F_directory_descriptors_max_d, F_true);
}
if (F_status_set_fine(status) == F_file_found_not) {
}
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_remove", F_true, main->path_build.string, "remove", fll_error_file_type_directory_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_directory_remove", F_true, main->path_build, f_file_operation_delete_s, fll_error_file_type_directory_e);
return status;
}
#define FAKE_build_setting_name_build_sources_script_s_length 20
#define FAKE_build_setting_name_build_sources_settings_s_length 22
#define FAKE_build_setting_name_build_static_s_length 12
- #define FAKE_build_setting_name_environment_length_s 11
+ #define FAKE_build_setting_name_environment_s_length 11
#define FAKE_build_setting_name_defines_s_length 7
#define FAKE_build_setting_name_defines_library_s_length 15
#define FAKE_build_setting_name_defines_library_shared_s_length 22
#define FAKE_make_parameter_variable_option_fakefile_s FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_option_s
#define FAKE_make_parameter_variable_option_mode_s FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_option_s
#define FAKE_make_parameter_variable_option_process_s FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_option_s
+ #define FAKE_make_parameter_variable_option_return_s FAKE_make_parameter_variable_return_s FAKE_make_parameter_iki_option_s
#define FAKE_make_parameter_variable_option_settings_s FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_option_s
#define FAKE_make_parameter_variable_option_sources_s FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_option_s
#define FAKE_make_parameter_variable_option_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_option_s
#define FAKE_make_parameter_variable_value_fakefile_s FAKE_make_parameter_variable_fakefile_s FAKE_make_parameter_iki_value_s
#define FAKE_make_parameter_variable_value_mode_s FAKE_make_parameter_variable_mode_s FAKE_make_parameter_iki_value_s
#define FAKE_make_parameter_variable_value_process_s FAKE_make_parameter_variable_process_s FAKE_make_parameter_iki_value_s
+ #define FAKE_make_parameter_variable_value_return_s FAKE_make_parameter_variable_return_s FAKE_make_parameter_iki_value_s
#define FAKE_make_parameter_variable_value_settings_s FAKE_make_parameter_variable_settings_s FAKE_make_parameter_iki_value_s
#define FAKE_make_parameter_variable_value_sources_s FAKE_make_parameter_variable_sources_s FAKE_make_parameter_iki_value_s
#define FAKE_make_parameter_variable_value_verbosity_s FAKE_make_parameter_variable_verbosity_s FAKE_make_parameter_iki_value_s
#define FAKE_make_parameter_variable_option_fakefile_s_length FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_option_s_length
#define FAKE_make_parameter_variable_option_mode_s_length FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_option_s_length
#define FAKE_make_parameter_variable_option_process_s_length FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_option_s_length
+ #define FAKE_make_parameter_variable_option_return_s_length FAKE_make_parameter_variable_return_s_length + FAKE_make_parameter_iki_option_s_length
#define FAKE_make_parameter_variable_option_settings_s_length FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_option_s_length
#define FAKE_make_parameter_variable_option_sources_s_length FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_option_s_length
#define FAKE_make_parameter_variable_option_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_option_s_length
#define FAKE_make_parameter_variable_value_fakefile_s_length FAKE_make_parameter_variable_fakefile_s_length + FAKE_make_parameter_iki_value_s_length
#define FAKE_make_parameter_variable_value_mode_s_length FAKE_make_parameter_variable_mode_s_length + FAKE_make_parameter_iki_value_s_length
#define FAKE_make_parameter_variable_value_process_s_length FAKE_make_parameter_variable_process_s_length + FAKE_make_parameter_iki_value_s_length
+ #define FAKE_make_parameter_variable_value_return_s_length FAKE_make_parameter_variable_return_s_length + FAKE_make_parameter_iki_value_s_length
#define FAKE_make_parameter_variable_value_settings_s_length FAKE_make_parameter_variable_settings_s_length + FAKE_make_parameter_iki_value_s_length
#define FAKE_make_parameter_variable_value_sources_s_length FAKE_make_parameter_variable_sources_s_length + FAKE_make_parameter_iki_value_s_length
#define FAKE_make_parameter_variable_value_verbosity_s_length FAKE_make_parameter_variable_verbosity_s_length + FAKE_make_parameter_iki_value_s_length
const uint8_t parameters_size[] = {
3,
3,
- 4,
+ 6,
1,
};
&main->file_data_build_defines,
&main->file_data_build_dependencies,
&main->file_data_build_fakefile,
+ &main->file_data_build_process_post_s,
+ &main->file_data_build_process_pre_s,
&main->file_data_build_settings,
};
fake_path_part_static_s,
fake_file_defines_s,
fake_file_dependencies_s,
+ fake_file_process_post_s,
+ fake_file_process_pre_s,
main->fakefile,
main->settings,
fake_file_readme_s,
&main->path_build_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 < 11; ++i) {
+ for (i = 0; i < 13; ++i) {
status = f_string_dynamic_append_nulless(parameters_source[i], parameters_value[i]);
return F_status_set_error(F_interrupt);
}
- status = f_file_exists(path_file.string);
+ status = f_file_exists(path_file);
if (status == F_true) {
{
f_array_length_t size_file = 0;
name_function = "f_file_size";
- status = f_file_size(path_file.string, F_true, &size_file);
+ status = f_file_size(path_file, F_true, &size_file);
if (F_status_is_error_not(status)) {
if (size_file > fake_common_initial_buffer_max_d) {
macro_f_string_dynamic_t_resize((status), (*buffer), size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, "allocate buffer size for", fll_error_file_type_file_e);
+ const f_string_static_t message = macro_f_string_static_t_initialize("allocate buffer size for", 0, 24);
+ fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, message, fll_error_file_type_file_e);
f_string_dynamic_resize(0, buffer);
}
name_function = "f_file_open";
- status = f_file_stream_open(path_file, 0, &file);
+ status = f_file_stream_open(path_file, f_string_empty_s, &file);
if (F_status_is_error_not(status)) {
name_function = "f_file_read";
}
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), name_function, F_true, path_file, f_file_operation_read_s, fll_error_file_type_file_e);
f_string_dynamic_resize(0, buffer);
}
if (parameters_value[i]->used) {
memset(&directory_stat, 0, sizeof(struct stat));
- status = f_file_stat(parameters_value[i]->string, F_true, &directory_stat);
+ status = f_file_stat(*parameters_value[i], F_true, &directory_stat);
if (status == F_status_set_error(F_file_found_not)) status = F_status_set_error(F_directory_found_not);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) != F_directory_found_not || parameters_required[i]) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stat", F_true, parameters_value[i]->string, "access", fll_error_file_type_directory_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stat", F_true, *parameters_value[i], f_file_operation_access_s, fll_error_file_type_directory_e);
return status;
}
#endif // _di_fake_validate_parameter_directories_
#ifndef _di_fake_verbose_print_clone_
- void fake_verbose_print_clone(const f_file_t output, const f_string_t source, const f_string_t destination) {
+ void fake_verbose_print_clone(const f_file_t output, const f_string_static_t source, const f_string_static_t destination) {
fll_print_format("Cloned '%S' to '%S'.%r", output.stream, source, destination, f_string_eol_s);
}
#endif // _di_fake_verbose_print_clone_
#ifndef _di_fake_verbose_print_copy_
- void fake_verbose_print_copy(const f_file_t output, const f_string_t source, const f_string_t destination) {
+ void fake_verbose_print_copy(const f_file_t output, const f_string_static_t source, const f_string_static_t destination) {
fll_print_format("Copied '%S' to '%S'.%r", output.stream, source, destination, f_string_eol_s);
}
#endif // _di_fake_verbose_print_copy_
#ifndef _di_fake_verbose_print_move_
- void fake_verbose_print_move(const f_file_t output, const f_string_t source, const f_string_t destination) {
+ void fake_verbose_print_move(const f_file_t output, const f_string_static_t source, const f_string_static_t destination) {
fll_print_format("Moved '%S' to '%S'.%r", output.stream, source, destination, f_string_eol_s);
}
#endif // _di_fake_verbose_print_move_
* The destination string.
*/
#ifndef _di_fake_verbose_print_clone_
- extern void fake_verbose_print_clone(const f_file_t output, const f_string_t source, const f_string_t destination) F_attribute_visibility_internal_d;
+ extern void fake_verbose_print_clone(const f_file_t output, const f_string_static_t source, const f_string_static_t destination) F_attribute_visibility_internal_d;
#endif // _di_fake_verbose_print_clone_
/**
* The destination string.
*/
#ifndef _di_fake_verbose_print_copy_
- extern void fake_verbose_print_copy(const f_file_t output, const f_string_t source, const f_string_t destination) F_attribute_visibility_internal_d;
+ extern void fake_verbose_print_copy(const f_file_t output, const f_string_static_t source, const f_string_static_t destination) F_attribute_visibility_internal_d;
#endif // _di_fake_verbose_print_copy_
/**
* The destination string.
*/
#ifndef _di_fake_verbose_print_move_
- extern void fake_verbose_print_move(const f_file_t output, const f_string_t source, const f_string_t destination) F_attribute_visibility_internal_d;
+ extern void fake_verbose_print_move(const f_file_t output, const f_string_static_t source, const f_string_static_t destination) F_attribute_visibility_internal_d;
#endif // _di_fake_verbose_print_move_
#ifdef __cplusplus
data_make->fakefile.used = 0;
- *status = fake_file_buffer(data_make->main, data_make->main->file_data_build_fakefile.string, &data_make->buffer);
+ *status = fake_file_buffer(data_make->main, data_make->main->file_data_build_fakefile, &data_make->buffer);
if (F_status_is_error(*status)) return;
if (!data_make->buffer.used) {
}
if (F_status_is_error(*status)) {
- fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_basic_list_read", data_make->main->file_data_build_fakefile.string, range, F_true);
+ fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_basic_list_read", data_make->main->file_data_build_fakefile, range, F_true);
}
else {
*status = fl_fss_apply_delimit(delimits, &data_make->buffer);
*status = fll_fss_extended_read(data_make->buffer, state, &content_range, &settings.objects, &settings.contents, 0, 0, &delimits, 0);
if (F_status_is_error(*status)) {
- fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_extended_read", data_make->main->file_data_build_fakefile.string, content_range, F_true);
+ fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_extended_read", data_make->main->file_data_build_fakefile, content_range, F_true);
break;
}
*status = fll_fss_extended_read(data_make->buffer, state, &content_range, &data_make->fakefile.array[data_make->fakefile.used].objects, &data_make->fakefile.array[data_make->fakefile.used].contents, 0, &data_make->fakefile.array[data_make->fakefile.used].quotess, &delimits, 0);
if (F_status_is_error(*status)) {
- fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_extended_read", data_make->main->file_data_build_fakefile.string, content_range, F_true);
+ fake_print_error_fss(data_make->main, F_status_set_fine(*status), "fll_fss_extended_read", data_make->main->file_data_build_fakefile, content_range, F_true);
break;
}
f_string_map_multis_t define = f_string_map_multis_t_initialize;
// Load the fakefile "settings" as if they are build "settings".
- fake_build_load_setting_process(main, F_false, main->file_data_build_fakefile.string, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build, &status);
+ fake_build_load_setting_process(main, F_false, main->file_data_build_fakefile, data_make->buffer, settings->objects, settings->contents, &data_make->setting_build, &status);
if (F_status_is_error_not(status) && settings->objects.used) {
const f_string_static_t settings_name[] = {
break;
}
- status = f_environment_set(define.array[i].name.string, combined.string, F_true);
+ status = f_environment_set(define.array[i].name, combined, F_true);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_environment_set", F_true);
return status;
}
- status = f_directory_open(data_make.path.stack.array[0].string, F_false, &data_make.path.top.id);
+ status = f_directory_open(data_make.path.stack.array[0], F_false, &data_make.path.top.id);
if (F_status_is_error(status)) {
fll_error_print(main->error, F_status_set_fine(status), "f_directory_open", F_true);
status = f_string_dynamic_partial_append_nulless(data_make->buffer, range_name, &name);
if (F_status_is_error(status)) return status;
- status = f_environment_get(name.string, &value);
+ status = f_environment_get(name, &value);
f_string_dynamic_resize(0, &name);
}
}
if (state_process->operation == fake_make_operation_type_link_e) {
- *status = f_file_link(arguments.array[0].string, arguments.array[1].string);
+ *status = f_file_link(arguments.array[0], arguments.array[1]);
if (F_status_is_error(*status)) {
- fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_link", F_true, arguments.array[1].string, "create link", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_link", F_true, arguments.array[1], f_file_operation_link_s, fll_error_file_type_file_e);
}
else if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->output.to.stream);
f_status_t status_file = F_none;
const f_array_length_t total = arguments.used - 1;
- f_array_length_t destination_length = 0;
+ f_string_static_t destination = f_string_static_t_initialize;
fl_directory_recurse_t recurse = fl_directory_recurse_t_initialize;
f_mode_t mode = f_mode_t_initialize;
// In this case, the destination could be a file, so confirm this.
if (arguments.used == 2) {
- status = f_directory_is(arguments.array[1].string);
+ status = f_directory_is(arguments.array[1]);
if (F_status_is_error(status)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_is", F_true, arguments.array[1].string, "identify", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_is", F_true, arguments.array[1], f_file_operation_identify_s, fll_error_file_type_directory_e);
return F_status_set_error(F_failure);
}
for (f_array_length_t i = 0; i < total; ++i) {
- destination_length = arguments.array[total].used;
+ destination.used = arguments.array[total].used;
if (existing) {
- destination_length += arguments.array[i].used + 1;
+ destination.used += arguments.array[i].used + 1;
}
- char destination[destination_length + 1];
+ char destination_string[destination.used + 1];
+ destination.string = destination_string;
- memcpy(destination, arguments.array[total].string, arguments.array[total].used);
+ memcpy(destination_string, arguments.array[total].string, arguments.array[total].used);
if (existing) {
- memcpy(destination + arguments.array[total].used + 1, arguments.array[i].string, arguments.array[i].used);
- destination[arguments.array[total].used] = f_path_separator_s.string[0];
+ memcpy(destination_string + arguments.array[total].used + 1, arguments.array[i].string, arguments.array[i].used);
+ destination_string[arguments.array[total].used] = f_path_separator_s.string[0];
}
- destination[destination_length] = 0;
+ destination_string[destination.used] = 0;
- status_file = f_directory_is(arguments.array[i].string);
+ status_file = f_directory_is(arguments.array[i]);
if (status_file == F_true) {
if (clone) {
- status_file = fl_directory_clone(arguments.array[i].string, destination, arguments.array[i].used, destination_length, F_true, recurse);
+ status_file = fl_directory_clone(arguments.array[i], destination, F_true, recurse);
}
else {
- status_file = fl_directory_copy(arguments.array[i].string, destination, arguments.array[i].used, destination_length, mode, recurse);
+ status_file = fl_directory_copy(arguments.array[i], destination, mode, recurse);
}
if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status_file), clone ? "fl_directory_clone" : "fl_directory_copy", F_true, arguments.array[i].string, clone ? "clone" : "copy", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status_file), clone ? "fl_directory_clone" : "fl_directory_copy", F_true, arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_directory_e);
status = F_status_set_error(F_failure);
}
}
else if (status_file == F_false) {
if (clone) {
- status_file = f_file_clone(arguments.array[i].string, destination, F_true, recurse.size_block, recurse.exclusive);
+ status_file = f_file_clone(arguments.array[i], destination, F_true, recurse.size_block, recurse.exclusive);
}
else {
- status_file = f_file_copy(arguments.array[i].string, destination, mode, recurse.size_block, recurse.exclusive);
+ status_file = f_file_copy(arguments.array[i], destination, mode, recurse.size_block, recurse.exclusive);
}
if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status_file), clone ? "f_file_clone" : "f_file_copy", F_true, arguments.array[i].string, clone ? "clone" : "copy", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status_file), clone ? "f_file_clone" : "f_file_copy", F_true, arguments.array[i], clone ? f_file_operation_clone_s : f_file_operation_copy_s, fll_error_file_type_file_e);
status = F_status_set_error(F_failure);
}
else if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->output.to.stream);
- fl_print_format("%r%r '%[%Q%]' to '", data_make->main->output.to.stream, f_string_eol_s, clone ? "Cloned" : "Copied", data_make->main->context.set.notable, arguments.array[i], data_make->main->context.set.notable);
- fl_print_format("%[%S%]'.%r", data_make->main->output.to.stream, f_string_eol_s, data_make->main->context.set.notable, destination, data_make->main->context.set.notable, f_string_eol_s);
+ fl_print_format("%r%s '%[%Q%]' to '", data_make->main->output.to.stream, f_string_eol_s, clone ? "Cloned" : "Copied", data_make->main->context.set.notable, arguments.array[i], data_make->main->context.set.notable);
+ fl_print_format("%[%Q%]'.%r", data_make->main->output.to.stream, data_make->main->context.set.notable, destination, data_make->main->context.set.notable, f_string_eol_s);
funlockfile(data_make->main->output.to.stream);
}
}
else if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[i].string, "identify", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[i], f_file_operation_identify_s, fll_error_file_type_directory_e);
return F_status_set_error(F_failure);
}
memset(&file_stat, 0, sizeof(struct stat));
- status = f_file_stat(arguments.array[i].string, F_false, &file_stat);
+ status = f_file_stat(arguments.array[i], F_false, &file_stat);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
status = F_none;
}
else {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_stat", F_true, arguments.array[i].string, "delete", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_stat", F_true, arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e);
return status;
}
}
else if (macro_f_file_type_is_directory(file_stat.st_mode)) {
if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
- status = f_directory_remove_custom(arguments.array[i].string, recursion_max, F_false, fake_clean_remove_recursively_verbosely);
+ status = f_directory_remove_custom(arguments.array[i], recursion_max, F_false, fake_clean_remove_recursively_verbosely);
}
else {
- status = f_directory_remove(arguments.array[i].string, recursion_max, F_false);
+ status = f_directory_remove(arguments.array[i], recursion_max, F_false);
}
if (F_status_set_fine(status) == F_file_found_not) {
}
if (F_status_is_error(status)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_remove", F_true, arguments.array[i].string, "delete", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_remove", F_true, arguments.array[i], f_file_operation_delete_s, fll_error_file_type_directory_e);
return status;
}
}
}
else {
- status = f_file_remove(arguments.array[i].string);
+ status = f_file_remove(arguments.array[i]);
if (F_status_set_fine(status) == F_file_found_not) {
if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
}
if (F_status_is_error(status)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_remove", F_true, arguments.array[i].string, "delete", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_remove", F_true, arguments.array[i], f_file_operation_delete_s, fll_error_file_type_file_e);
return status;
}
}
if (all) {
- status_file = fll_file_role_change_all(arguments.array[i].string, -1, id, F_false, fake_make_operation_recursion_depth_max_d);
+ status_file = fll_file_role_change_all(arguments.array[i], -1, id, F_false, fake_make_operation_recursion_depth_max_d);
}
else {
- status_file = f_file_role_change(arguments.array[i].string, -1, id, F_false);
+ status_file = f_file_role_change(arguments.array[i], -1, id, F_false);
}
if (F_status_is_error(status_file)) {
status = status_file;
- fll_error_file_print(data_make->error, F_status_set_fine(status), all ? "fll_file_role_change_all" : "f_file_role_change", F_true, arguments.array[i].string, "change group of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), all ? "fll_file_role_change_all" : "f_file_role_change", F_true, arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
}
else if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
flockfile(data_make->main->output.to.stream);
else {
for (f_array_length_t i = 2; i < arguments.used; ++i) {
- if (f_environment_exists(arguments.array[i].) != F_true) {
+ if (f_environment_exists(arguments.array[i]) != F_true) {
state_process->condition_result = fake_condition_result_false_e;
break;
for (f_array_length_t i = if_not ? 2 : 1; i < arguments.used; ++i) {
- status = f_file_exists(arguments.array[i].string);
+ status = f_file_exists(arguments.array[i]);
if (F_status_is_error(status)) {
state_process->condition_result = fake_condition_result_error_e;
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_exists", F_true, arguments.array[i].string, f_file_operation_find_s, fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_exists", F_true, arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
break;
}
for (; i < arguments.used; ++i, mode_file = 0) {
- status = f_file_mode_read(arguments.array[i].string, &mode_file);
+ status = f_file_mode_read(arguments.array[i], &mode_file);
if (F_status_is_error(status)) {
state_process->condition_result = fake_condition_result_error_e;
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i].string, "get type of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i], f_file_operation_get_type_s, fll_error_file_type_file_e);
break;
}
for (f_array_length_t i = if_not ? 3 : 2; i < arguments.used; ++i, id_file = 0) {
- status = f_file_group_read(arguments.array[i].string, &id_file);
+ status = f_file_group_read(arguments.array[i], &id_file);
if (F_status_is_error(status)) {
state_process->condition_result = fake_condition_result_error_e;
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_group_read", F_true, arguments.array[i].string, "get group of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_group_read", F_true, arguments.array[i], f_file_operation_get_group_s, fll_error_file_type_file_e);
break;
}
for (f_array_length_t i = if_not ? 4 : 3; i < arguments.used; ++i, mode_file = 0) {
- status = f_file_mode_read(arguments.array[i].string, &mode_file);
+ status = f_file_mode_read(arguments.array[i], &mode_file);
if (F_status_is_error(status)) {
state_process->condition_result = fake_condition_result_error_e;
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i].string, "get mode of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i], f_file_operation_get_mode_s, fll_error_file_type_file_e);
break;
}
for (f_array_length_t i = if_not ? 3 : 2; i < arguments.used; ++i, id_file = 0) {
- status = f_file_owner_read(arguments.array[i].string, &id_file);
+ status = f_file_owner_read(arguments.array[i], &id_file);
if (F_status_is_error(status)) {
state_process->condition_result = fake_condition_result_error_e;
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_owner_read", F_true, arguments.array[i].string, "get owner of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_owner_read", F_true, arguments.array[i], f_file_operation_get_owner_s, fll_error_file_type_file_e);
break;
}
for (f_array_length_t i = 1; i < arguments.used; ++i, mode = 0) {
- status = f_file_mode_read(arguments.array[i].string, &mode_file);
+ status = f_file_mode_read(arguments.array[i], &mode_file);
if (F_status_is_error(status)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i].string, "change mode of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_read", F_true, arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
break;
}
status = f_file_mode_determine(mode_file, mode_rule, replace, macro_f_file_type_is_directory(mode_file), &mode);
if (F_status_is_error(status)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_determine", F_true, arguments.array[i].string, "change mode of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_mode_determine", F_true, arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
break;
}
if (all) {
- status = fll_file_mode_set_all(arguments.array[i].string, mode, fake_make_operation_recursion_depth_max_d);
+ status = fll_file_mode_set_all(arguments.array[i], mode, fake_make_operation_recursion_depth_max_d);
}
else {
- status = f_file_mode_set(arguments.array[i].string, mode);
+ status = f_file_mode_set(arguments.array[i], mode);
}
if (F_status_is_error(status)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), all ? "fll_file_mode_set_all" : "f_file_mode_set", F_true, arguments.array[i].string, "change mode of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), all ? "fll_file_mode_set_all" : "f_file_mode_set", F_true, arguments.array[i], f_file_operation_change_group_s, fll_error_file_type_file_e);
break;
}
fl_directory_recurse_t recurse = fl_directory_recurse_t_initialize;
- f_array_length_t destination_length = 0;
+ f_string_static_t destination = f_string_static_t_initialize;
if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
recurse.output = data_make->main->output.to;
// In this case, the destination could be a file, so confirm this.
if (arguments.used == 2) {
- status_file = f_directory_is(arguments.array[1].string);
+ status_file = f_directory_is(arguments.array[1]);
if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_is", F_true, arguments.array[1].string, "identify", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_is", F_true, arguments.array[1], f_file_operation_identify_s, fll_error_file_type_directory_e);
return F_status_set_error(F_failure);
}
for (f_array_length_t i = 0; i < total; ++i) {
- destination_length = arguments.array[total].used;
+ destination.used = arguments.array[total].used;
if (existing) {
- destination_length += arguments.array[i].used + 1;
+ destination.used += arguments.array[i].used + 1;
}
- char destination[destination_length + 1];
+ char destination_string[destination.used + 1];
+ destination.string = destination_string;
- memcpy(destination, arguments.array[total].string, arguments.array[total].used);
+ memcpy(destination_string, arguments.array[total].string, arguments.array[total].used);
if (existing) {
- memcpy(destination + arguments.array[total].used + 1, arguments.array[i].string, arguments.array[i].used);
- destination[arguments.array[total].used] = f_path_separator_s.string[0];
+ memcpy(destination_string + arguments.array[total].used + 1, arguments.array[i].string, arguments.array[i].used);
+ destination_string[arguments.array[total].used] = f_path_separator_s.string[0];
}
- destination[destination_length] = 0;
+ destination_string[destination.used] = 0;
- status_file = fll_file_move(arguments.array[i].string, destination, arguments.array[i].used, destination_length, recurse);
+ status_file = fll_file_move(arguments.array[i], destination, recurse);
if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "fll_file_move", F_true, arguments.array[i].string, "move", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "fll_file_move", F_true, arguments.array[i], f_file_operation_move_s, fll_error_file_type_directory_e);
status = F_status_set_error(F_failure);
}
}
if (all) {
- status_file = fll_file_role_change_all(arguments.array[i].string, id, -1, F_false, fake_make_operation_recursion_depth_max_d);
+ status_file = fll_file_role_change_all(arguments.array[i], id, -1, F_false, fake_make_operation_recursion_depth_max_d);
}
else {
- status_file = f_file_role_change(arguments.array[i].string, id, -1, F_false);
+ status_file = f_file_role_change(arguments.array[i], id, -1, F_false);
}
if (F_status_is_error(status_file)) {
status = status_file;
- fll_error_file_print(data_make->error, F_status_set_fine(status), all ? "fll_file_role_change_all" : "f_file_role_change", F_true, arguments.array[i].string, "change owner of", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), all ? "fll_file_role_change_all" : "f_file_role_change", F_true, arguments.array[i], f_file_operation_change_owner_s, fll_error_file_type_file_e);
}
else if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
fll_print_format("%s owner of '%Q' to %u.%r", data_make->main->output.to.stream, all ? "Recursively changed" : "Changed", arguments.array[i], id, f_string_eol_s);
f_status_t status = F_none;
- f_string_dynamic_resize(0, &data_make->path.stack.array[data_make->path.stack.used - 1]);
+ f_string_dynamic_t *argument = &data_make->path.stack.array[data_make->path.stack.used - 1];
+
+ f_string_dynamic_resize(0, argument);
--data_make->path.stack.used;
- status = f_path_change(data_make->path.stack.array[data_make->path.stack.used - 1].string);
+ status = f_path_change(argument->string);
if (F_status_is_error(status)) {
- fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", data_make->path.stack.array[data_make->path.stack.used - 1]);
+ fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_status_set_fine(status), "f_path_change", *argument);
return 0;
}
if (data_make->main->error.verbosity == f_console_verbosity_verbose_e) {
- status = fake_make_path_relative(data_make, data_make->path.stack.array[data_make->path.stack.used - 1]);
+ status = fake_make_path_relative(data_make, *argument);
// The created relative path is for verbosity purposes and as such its failure to be processed should not be treated as a failure of the function.
if (F_status_is_error(status)) {
fll_error_print(data_make->error, F_status_set_fine(status), "fake_make_path_relative", F_true);
- fll_print_format("Changed to project path '%[%Q%]'.%r", data_make->main->output.to.stream, data_make->main->context.set.notable, data_make->path.stack.array[data_make->path.stack.used - 1], data_make->main->context.set.notable, f_string_eol_s);
+ fll_print_format("Changed to project path '%[%Q%]'.%r", data_make->main->output.to.stream, data_make->main->context.set.notable, argument, data_make->main->context.set.notable, f_string_eol_s);
}
else {
fll_print_format("Changed to project path '%[%Q%]'.%r", data_make->main->output.to.stream, data_make->main->context.set.notable, data_make->path_cache, data_make->main->context.set.notable, f_string_eol_s);
else {
status = f_string_dynamics_increase_by(F_memory_default_allocation_small_d, &data_make->path.stack);
- if (F_status_set_fine(status) == F_array_too_large) {
- fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", fake_common_file_path_stack_s_length);
+ if (F_status_is_error(status)) {
+ if (F_status_set_fine(status) == F_array_too_large) {
+ fake_print_message_section_operation_path_stack_max(data_make->main, data_make->error, F_array_too_large, "f_string_dynamics_increase_by", fake_common_file_path_stack_s);
- return status;
- }
+ return status;
+ }
- if (F_status_is_error(status)) {
- fll_error_print(data_make->error, F_status_set_fine(status), "macro_f_string_dynamics_t_resize", F_true);
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamics_increase_by", F_true);
return status;
}
status = f_string_dynamic_append(data_make->path_cache, &data_make->path.stack.array[data_make->path.stack.used]);
if (F_status_is_error(status)) {
- fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_append_nulless", F_true);
+ fll_error_print(data_make->error, F_status_set_fine(status), "f_string_dynamic_append", F_true);
return status;
}
for (f_array_length_t i = 1; i < arguments.used; ++i) {
if (fl_string_dynamic_compare(fake_make_operation_argument_file_s, arguments.array[0]) == F_equal_to) {
- status = f_file_touch(arguments.array[i].string, mode.regular, F_false);
+ status = f_file_touch(arguments.array[i], mode.regular, F_false);
if (F_status_is_error(status)) {
- if (F_status_is_error_not(fll_path_canonical(arguments.array[i].string, &data_make->path_cache))) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_touch", F_true, data_make->path_cache.string, "touch", fll_error_file_type_file_e);
+ if (F_status_is_error_not(fll_path_canonical(arguments.array[i], &data_make->path_cache))) {
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_touch", F_true, data_make->path_cache, f_file_operation_touch_s, fll_error_file_type_file_e);
}
else {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_touch", F_true, arguments.array[i].string, "touch", fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_file_touch", F_true, arguments.array[i], f_file_operation_touch_s, fll_error_file_type_file_e);
}
break;
}
}
else if (fl_string_dynamic_compare(fake_make_operation_argument_directory_s, arguments.array[0]) == F_equal_to) {
- status = f_directory_touch(arguments.array[i].string, mode.directory);
+ status = f_directory_touch(arguments.array[i], mode.directory);
if (F_status_is_error(status)) {
- if (F_status_is_error_not(fll_path_canonical(arguments.array[i].string, &data_make->path_cache))) {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_touch", F_true, data_make->path_cache.string, "touch", fll_error_file_type_directory_e);
+ if (F_status_is_error_not(fll_path_canonical(arguments.array[i], &data_make->path_cache))) {
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_touch", F_true, data_make->path_cache, f_file_operation_touch_s, fll_error_file_type_directory_e);
}
else {
- fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_touch", F_true, arguments.array[i].string, "touch", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status), "f_directory_touch", F_true, arguments.array[i], f_file_operation_touch_s, fll_error_file_type_directory_e);
}
break;
}
else if (arguments.used) {
if (arguments.array[0].used) {
- char path_file[data_make->main->path_data_build.used + arguments.array[0].used + 1];
+ f_string_static_t path_file = f_string_static_t_initialize;
+ path_file.used = data_make->main->path_data_build.used + arguments.array[0].used;
- memcpy(path_file, data_make->main->path_data_build.string, data_make->main->path_data_build.used);
- memcpy(path_file + data_make->main->path_data_build.used, arguments.array[0].string, arguments.array[0].used);
+ char path_file_string[path_file.used + 1];
+ path_file.string = path_file_string;
- path_file[data_make->main->path_data_build.used + arguments.array[0].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);
flockfile(data_make->error.to.stream);
fl_print_format("%r%[%QFailed to find file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%S%]", data_make->error.to.stream, data_make->error.notable, path_file, data_make->error.notable);
+ fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, path_file, data_make->error.notable);
fl_print_format("%['.%]%r", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
flockfile(data_make->error.to.stream);
fl_print_format("%r%[%QThe file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%S%]", data_make->error.to.stream, data_make->error.notable, path_file, data_make->error.notable);
+ fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, path_file, data_make->error.notable);
fl_print_format("%[' must be a regular file.%]%r", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
for (f_array_length_t i = 0; i < arguments.used - 1; ++i) {
- if (f_file_exists(arguments.array[i].string) != F_true) {
+ if (f_file_exists(arguments.array[i]) != F_true) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
if (arguments.used > 2) {
// The last file must be a directory.
- f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1].string);
+ f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1]);
if (status_file == F_false || status_file == F_file_found_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
*status = F_status_set_error(F_failure);
}
else if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1].string, f_file_operation_find_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1], f_file_operation_find_s, fll_error_file_type_directory_e);
*status = F_status_set_error(F_failure);
}
}
else {
// When the first file is a directory, then the second, if it exists, must also be a directory.
- f_status_t status_file = f_directory_is(arguments.array[0].string);
+ f_status_t status_file = f_directory_is(arguments.array[0]);
if (status_file == F_true) {
- status_file = f_directory_is(arguments.array[1].string);
+ status_file = f_directory_is(arguments.array[1]);
if (status_file == F_false) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%r%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%r%[%QThe second file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%r", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
for (f_array_length_t i = 0; i < arguments.used - 1; ++i) {
- if (f_file_exists(arguments.array[i].string) != F_true) {
+ if (f_file_exists(arguments.array[i]) != F_true) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
if (arguments.used > 2) {
// The last file must be a directory.
- f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1].string);
+ f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1]);
if (status_file == F_false || status_file == F_file_found_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
*status = F_status_set_error(F_failure);
}
else if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1].string, "identify", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e);
*status = F_status_set_error(F_failure);
}
}
else {
// When the first file is a directory, then the second, if it exists, must also be a directory.
- f_status_t status_file = f_directory_is(arguments.array[0].string);
+ f_status_t status_file = f_directory_is(arguments.array[0]);
if (status_file == F_true) {
- status_file = f_directory_is(arguments.array[1].string);
+ status_file = f_directory_is(arguments.array[1]);
if (status_file == F_false) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%r%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%r%[%QThe second file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%r", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
for (f_array_length_t i = 1; i < arguments.used; ++i) {
- status_file = f_file_is(arguments.array[i].string, F_file_type_regular_d, F_false);
+ status_file = f_file_is(arguments.array[i], F_file_type_regular_d, F_false);
if (status_file == F_file_found_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
}
else if (F_status_is_error(status_file)) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, arguments.array[i].string, f_file_operation_find_s, fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, arguments.array[i], f_file_operation_find_s, fll_error_file_type_directory_e);
}
*status = status_file;
else if (state_process->condition != fake_make_operation_if_type_if_exists_e && state_process->condition != fake_make_operation_if_type_if_is_e) {
// The existence tests do not need to happen here for *_if_exists and *_if_is as those two types will handle performing them during the process stage.
- status_file = f_file_exists(arguments.array[i].string);
+ status_file = f_file_exists(arguments.array[i]);
if (status_file == F_false) {
status_file = F_status_set_error(F_file_found_not);
}
if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_file_exists", F_true, arguments.array[i].string, f_file_operation_find_s, fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_file_exists", F_true, arguments.array[i], f_file_operation_find_s, fll_error_file_type_file_e);
if (F_status_is_error_not(*status)) {
*status = F_status_set_error(status_file);
for (f_array_length_t i = 0; i < arguments.used - 1; ++i) {
- if (f_file_exists(arguments.array[i].string) != F_true) {
+ if (f_file_exists(arguments.array[i]) != F_true) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
if (arguments.used > 2) {
// The last file must be a directory.
- f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1].string);
+ f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1]);
if (status_file == F_false || status_file == F_file_found_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
*status = F_status_set_error(F_failure);
}
else if (F_status_is_error(status_file)) {
- fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1].string, "identify", fll_error_file_type_directory_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(status_file), "f_directory_is", F_true, arguments.array[arguments.used - 1], f_file_operation_identify_s, fll_error_file_type_directory_e);
*status = F_status_set_error(F_failure);
}
}
else {
// When the first file is a directory, then the second, if it exists, must also be a directory.
- f_status_t status_file = f_directory_is(arguments.array[0].string);
+ f_status_t status_file = f_directory_is(arguments.array[0]);
if (status_file == F_true) {
- status_file = f_directory_is(arguments.array[1].string);
+ status_file = f_directory_is(arguments.array[1]);
if (status_file == F_false) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
flockfile(data_make->error.to.stream);
- fl_print_format("%r%[%QThe last file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
- fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[arguments.used - 1], data_make->error.notable);
+ fl_print_format("%r%[%QThe second file '%]", data_make->error.to.stream, f_string_eol_s, data_make->error.context, data_make->error.prefix, data_make->error.context);
+ fl_print_format("%[%Q%]", data_make->error.to.stream, data_make->error.notable, arguments.array[1], data_make->error.notable);
fl_print_format("%[' must be a valid directory.%]%r", data_make->error.to.stream, data_make->error.context, data_make->error.context, f_string_eol_s);
funlockfile(data_make->error.to.stream);
}
else if (arguments.used) {
if (arguments.array[0].used) {
- f_status_t status_file = f_file_is(arguments.array[0].string, F_file_type_directory_d, F_false);
+ f_status_t status_file = f_file_is(arguments.array[0], F_file_type_directory_d, F_false);
if (status_file == F_file_found_not) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
}
else if (F_status_is_error(status_file)) {
if (data_make->error.verbosity != f_console_verbosity_quiet_e && data_make->error.to.stream) {
- fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, data_make->main->file_data_build_fakefile.string, f_file_operation_find_s, fll_error_file_type_file_e);
+ fll_error_file_print(data_make->error, F_status_set_fine(*status), "f_file_is", F_true, data_make->main->file_data_build_fakefile, f_file_operation_find_s, fll_error_file_type_file_e);
}
*status = status_file;
data_make->path_cache.used = 0;
- f_status_t status = fll_path_canonical(path.string, &data_make->path_cache);
+ f_status_t status = fll_path_canonical(path, &data_make->path_cache);
if (F_status_is_error(status)) return status;
if (data_make->path_cache.used < data_make->path.stack.array[0].used) {
return F_status_set_error(F_parameter);
}
- const f_status_t status = f_file_mode_from_string(buffer.string, main->umask, mode, replace);
+ const f_status_t status = f_file_mode_from_string(buffer, main->umask, mode, replace);
if (F_status_is_error(status)) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
#endif // #ifndef _di_fake_print_error_build_operation_file_message_
#ifndef _di_fake_print_error_fss
- bool fake_print_error_fss(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_t path_file, const f_string_range_t range, const bool fallback) {
+ bool fake_print_error_fss(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) {
if (status == F_file_found_not) {
if (main->error.verbosity != f_console_verbosity_quiet_e) {
* @see fl_print_format()
*/
#ifndef _di_fake_print_error_fss_
- extern bool fake_print_error_fss(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_t path_file, const f_string_range_t range, const bool fallback) F_attribute_visibility_internal_d;
+ extern bool fake_print_error_fss(fake_main_t * const main, const f_status_t status, const f_string_t function, const f_string_static_t path_file, const f_string_range_t range, const bool fallback) F_attribute_visibility_internal_d;
#endif // _di_fake_print_error_fss_
/**
} // for
}
- f_string_dynamic_t file_data_build_process_post = f_string_dynamic_t_initialize;
- f_string_dynamic_t file_data_build_process_pre = f_string_dynamic_t_initialize;
-
if (F_status_is_error_not(status)) {
status = fake_skeleton_operate_file_create(main, main->file_data_build_defines, F_false, fake_make_skeleton_content_defines_s);
}
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, fake_file_data_build_process_post_s, F_true, fake_make_skeleton_content_process_post_s);
+ status = fake_skeleton_operate_file_create(main, main->file_data_build_process_post_s, F_true, fake_make_skeleton_content_process_post_s);
}
if (F_status_is_error_not(status)) {
- status = fake_skeleton_operate_file_create(main, fake_file_data_build_process_pre_s, F_true, fake_make_skeleton_content_process_pre_s);
+ status = fake_skeleton_operate_file_create(main, main->file_data_build_process_pre_s, F_true, fake_make_skeleton_content_process_pre_s);
}
if (F_status_is_error_not(status)) {
if (!path.used) return F_none;
- status = f_directory_exists(path.string);
+ status = f_directory_exists(path);
if (status == F_true) {
if (main->error.verbosity == f_console_verbosity_verbose_e) {
return F_status_set_warning(F_failure);
}
else if (status == F_file_found_not) {
- status = f_directory_create(path.string, F_file_mode_all_rwx_d);
+ status = f_directory_create(path, F_file_mode_all_rwx_d);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
if (!path.used) return F_none;
- status = f_file_is(path.string, F_file_type_regular_d, F_false);
+ status = f_file_is(path, F_file_type_regular_d, F_false);
if (status == F_true) {
if (main->error.verbosity == f_console_verbosity_verbose_e) {
// symbolic links might also be fine.
if (status == F_false) {
- status = f_file_is(path.string, F_file_type_link_d, F_false);
+ status = f_file_is(path, F_file_type_link_d, F_false);
if (status == F_true) {
if (main->error.verbosity == f_console_verbosity_verbose_e) {
mode = F_file_mode_all_rwx_d;
}
- status = f_file_create(path.string, mode, F_true);
+ status = f_file_create(path, mode, F_true);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
file.flag = F_file_flag_append_wo_d;
file.size_write = content.used;
- status = f_file_open(path.string, 0, &file);
+ status = f_file_open(path, 0, &file);
if (F_status_is_error(status)) {
fll_error_file_print(main->error, F_status_set_fine(status), "f_file_open", F_true, path, fake_common_file_populate_pre_s, fll_error_file_type_file_e);
#define firewall_chain_postrouting_s "POSTROUTING"
#define firewall_chain_prerouting_s "PREROUTING"
- #define firewall_chain_length_s 5
+ #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
f_string_dynamic_resize(0, &ip_list);
// process chain rule
- if (length >= firewall_chain_length_s && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string_t) firewall_chain_s, length, firewall_chain_length_s) == F_equal_to) {
+ if (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.
arguments.array[1].string[arguments.array[1].used] = 0;
main->chains.array[main->chains.used].string[main->chains.array[main->chains.used].used] = 0;
- if (fl_string_compare(arguments.array[1].string, firewall_chain_forward_s, arguments.array[1].used, firewall_chain_forward_s_length) == F_equal_to) {
+ if (fl_string_dynamic_compare(arguments.array[1], firewall_chain_forward_s) == F_equal_to) {
create_chain = F_false;
}
- else if (fl_string_compare(arguments.array[1].string, firewall_chain_input_s, arguments.array[1].used, firewall_chain_input_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(arguments.array[1], firewall_chain_input_s) == F_equal_to) {
create_chain = F_false;
}
- else if (fl_string_compare(arguments.array[1].string, firewall_chain_output_s, arguments.array[1].used, firewall_chain_output_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(arguments.array[1], firewall_chain_output_s) == F_equal_to) {
create_chain = F_false;
}
- else if (fl_string_compare(arguments.array[1].string, firewall_chain_postrouting_s, arguments.array[1].used, firewall_chain_postrouting_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(arguments.array[1], firewall_chain_postrouting_s) == F_equal_to) {
create_chain = F_false;
}
- else if (fl_string_compare(arguments.array[1].string, firewall_chain_prerouting_s, arguments.array[1].used, firewall_chain_prerouting_s_length) == F_equal_to) {
+ else if (fl_string_dynamic_compare(arguments.array[1], firewall_chain_prerouting_s) == F_equal_to) {
create_chain = F_false;
}
firewall_print_debug_tool(main->warning, firewall_tool_iptables_s, arguments);
tool = firewall_program_iptables_e;
- status = fll_execute_program((f_string_t) firewall_tool_iptables_s, arguments, 0, 0, (void *) &return_code);
+ 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_dynamic_t argument[1] = f_string_dynamic_t_initialize;
int return_code = 0;
- argument[0].string = (f_string_t) "-F";
+ argument[0].string = "-F";
argument[0].size = 2;
argument[0].used = 2;
arguments.used = 3;
arguments.size = arguments.used;
- arguments.array[0].string = (f_string_t) firewall_action_policy_command_s;
- arguments.array[1].string = (f_string_t) chains[i];
- arguments.array[2].string = (f_string_t) "DROP";
+ arguments.array[0].string = firewall_action_policy_command_s;
+ arguments.array[1].string = chains[i];
+ arguments.array[2].string = "DROP";
arguments.array[0].used = firewall_action_append_command_s_length;
arguments.array[1].used = lengths[i];
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else if (data.buffer.used) {
data.files.array[0].range.stop = data.buffer.used - 1;
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
else {
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else if (data.buffer.used) {
data.files.array[0].range.stop = data.buffer.used - 1;
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
else {
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
}
status = f_file_read(file, &main->buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else {
- status = fss_embedded_list_read_main_process_file(main, arguments, "-", depths, &objects_delimits, &contents_delimits, &comments);
+ status = fss_embedded_list_read_main_process_file(main, arguments, f_string_ascii_minus_s, depths, &objects_delimits, &contents_delimits, &comments);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
if (!main->quantity.total) {
status = f_file_size_by_id(file.id, &main->quantity.total);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
f_file_stream_close(F_true, &file);
f_file_stream_close(F_true, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_until", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = fss_embedded_list_read_main_process_file(main, arguments, arguments->argv[main->remaining.array[i]], depths, &objects_delimits, &contents_delimits, &comments);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fss_embedded_list_read_main_process_file", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else if (data.buffer.used) {
data.files.array[0].range.stop = data.buffer.used - 1;
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_minus_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
else {
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else if (data.buffer.used) {
data.files.array[0].range.stop = data.buffer.used - 1;
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
else {
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
}
#endif
#ifndef _di_fss_identify_load_line_
- f_status_t fss_identify_load_line(fss_identify_main_t * const main, const f_file_t file, const f_string_t name, f_string_static_t *buffer, f_string_range_t *range) {
+ f_status_t fss_identify_load_line(fss_identify_main_t * const main, const f_file_t file, const f_string_static_t name, f_string_static_t *buffer, f_string_range_t *range) {
f_status_t status = F_none;
uint16_t signal_check = 0;
status = f_string_dynamic_resize(buffer->size + file.size_read, buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, name ? name : "-", "read", name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
return status;
}
status = f_file_stream_read_block(file, buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read_block", F_true, name ? name : "-", "read", name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read_block", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
return status;
}
status = fll_fss_identify(buffer.string, range, &ids);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_identify", F_true, name ? name : "-", "read", name ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "fll_fss_identify", F_true, name.used ? name : f_string_ascii_s, f_file_operation_read_s, name.used ? fll_error_file_type_file_e : fll_error_file_type_pipe_e);
f_type_fll_ids_resize(0, &ids);
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
else if (data.buffer.used) {
data.files.array[0].range.stop = data.buffer.used - 1;
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
else {
status = f_file_size_by_id(file.id, &size_file);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_size_by_id", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_dynamic_resize(data.buffer.size + size_file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_dynamic_resize", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status = f_string_append_assure(f_string_eol_s, 1, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_string_append_assure", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
}
}
status = f_file_stream_read(file, &data.buffer);
if (F_status_is_error(status)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], "read", fll_error_file_type_file_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_stream_read", F_true, arguments->argv[main->remaining.array[i]], f_file_operation_read_s, fll_error_file_type_file_e);
break;
}
status_pipe = f_file_read(pipe, &buffer);
if (F_status_is_error(status_pipe)) {
- fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_to", F_true, "-", "read", fll_error_file_type_pipe_e);
+ fll_error_file_print(main->error, F_status_set_fine(status), "f_file_read_to", F_true, f_string_ascii_s, f_file_operation_read_s, fll_error_file_type_pipe_e);
status = F_status_set_error(F_pipe);
#endif // _di_utf8_print_error_no_from_
#ifndef _di_utf8_print_error_no_value_
- void utf8_print_error_no_value(utf8_data_t * const data, const f_string_t parameter) {
+ void utf8_print_error_no_value(utf8_data_t * const data, const f_string_static_t parameter) {
if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
#endif // _di_utf8_print_error_parameter_file_name_empty_
#ifndef _di_utf8_print_error_parameter_file_not_found_
- void utf8_print_error_parameter_file_not_found(utf8_data_t * const data, const bool from, const f_string_t name) {
+ void utf8_print_error_parameter_file_not_found(utf8_data_t * const data, const bool from, const f_string_static_t name) {
if (data->main->error.verbosity == f_console_verbosity_quiet_e) return;
flockfile(data->main->error.to.stream);
fl_print_format("%r%[%QFailed to find the %s file '%]", data->main->error.to.stream, f_string_eol_s, data->main->context.set.error, data->main->error.prefix, from ? utf8_string_from_s : utf8_string_to_s, data->main->context.set.error);
- fl_print_format("%[%S%]", data->main->error.to.stream, data->main->context.set.notable, name, data->main->context.set.notable);
+ fl_print_format("%[%Q%]", data->main->error.to.stream, data->main->context.set.notable, name, data->main->context.set.notable);
fl_print_format("%['.%]%r", data->main->error.to.stream, data->main->context.set.error, data->main->context.set.error, f_string_eol_s);
funlockfile(data->main->error.to.stream);
* The long parameter name.
*/
#ifndef _di_utf8_print_error_no_value_
- extern void utf8_print_error_no_value(utf8_data_t * const data, const f_string_t parameter) F_attribute_visibility_internal_d;
+ extern void utf8_print_error_no_value(utf8_data_t * const data, const f_string_static_t parameter) F_attribute_visibility_internal_d;
#endif // _di_utf8_print_error_no_value_
/**
* The file path name.
*/
#ifndef _di_utf8_print_error_parameter_file_not_found_
- extern void utf8_print_error_parameter_file_not_found(utf8_data_t * const data, const bool from, const f_string_t name) F_attribute_visibility_internal_d;
+ extern void utf8_print_error_parameter_file_not_found(utf8_data_t * const data, const bool from, const f_string_static_t name) F_attribute_visibility_internal_d;
#endif // _di_utf8_print_error_parameter_file_not_found_
/**
index = main->parameters.array[utf8_parameter_from_file_e].values.array[i];
if (arguments->argv[index][0]) {
- if (!f_file_exists(arguments->argv[index])) {
- utf8_print_error_parameter_file_not_found(&data, F_true, arguments->argv[index]);
+ if (!f_file_exists(data.argv[index])) {
+ utf8_print_error_parameter_file_not_found(&data, F_true, data.argv[index]);
if (F_status_is_error_not(status)) {
status = F_status_set_error(F_file_found_not);