After getting byte_dump switched to file descriptors and testing it, I discovered that the unbuffered write has massive performance issues over the buffer writer that is a file stream.
Do some back pedalling and then go down a different route.
Add functions for managing file streams.
Make it possible to have both the descriptor and the stream to give more control at the higher level on when to decide which to use.
There is still much more cleanup, back-pedalling, as well as redesigning the code to (now) use fprintf() over printf() and similar.
/**
* Commonly used file related properties.
*
+ * stream: File stream.
* id: File descriptor, with a value of -1 represents a closed file.
* flag: Flags used for opening the file.
* size_read: The default number of 1-byte characters to read at a time and is often used for the read buffer size.
*/
#ifndef _di_f_file_t_
typedef struct {
+ FILE *stream;
int id;
int flag;
size_t size_read;
size_t size_write;
} f_file_t;
- #define f_file_t_initialize { -1, f_file_flag_read_only, f_file_default_read_size, f_file_default_write_size }
+ #define f_file_t_initialize { 0, -1, f_file_flag_read_only, f_file_default_read_size, f_file_default_write_size }
+
+ #define f_macro_file_t_initialize(stream, id, flag) { stream, id, flag, f_file_default_read_size, f_file_default_write_size }
#define f_macro_file_t_clear(file) \
+ file.stream = 0; \
file.id = -1; \
file.flag = 0; \
file.size_read = 0; \
file.size_write = 0;
#define f_macro_file_t_reset(file) \
+ file.stream = 0; \
file.id = -1; \
file.flag = f_file_flag_read_only; \
file.size_read = f_file_default_read_size; \
}
#endif // _di_f_file_create_node_at_
+#ifndef _di_f_file_descriptor_
+ f_return_status f_file_descriptor(f_file_t *file) {
+ file->id = fileno(file->stream);
+
+ if (file->id == -1) {
+ return F_status_set_error(F_file);
+ }
+
+ return F_none;
+ }
+#endif // _di_f_file_descriptor_
+
#ifndef _di_f_file_exists_
f_return_status f_file_exists(const f_string_t path) {
#ifndef _di_level_0_parameter_checking_
}
#endif // _di_f_file_stat_by_id_
+#ifndef _di_f_file_stream_close_
+ f_return_status f_file_stream_close(const bool complete, f_file_t *file) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!file) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!fclose(file->stream)) {
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EAGAIN) return F_status_set_error(F_prohibited);
+ if (errno == EBADF) return F_status_set_error(F_file_descriptor);
+ if (errno == EDEADLK) return F_status_set_error(F_deadlock);
+ if (errno == EFAULT) return F_status_set_error(F_buffer);
+ if (errno == EINTR) return F_status_set_error(F_interrupted);
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max);
+ if (errno == ENOLCK) return F_status_set_error(F_lock);
+ if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+
+ return F_status_set_error(F_failure);
+ }
+
+ file->stream = 0;
+
+ if (complete) {
+ return private_f_file_close(&file->id);
+ }
+
+ return F_none;
+ }
+#endif // _di_f_file_stream_close_
+
+#ifndef _di_f_file_stream_descriptor_
+ f_return_status f_file_stream_descriptor(const int id, const f_string_t mode, FILE *stream) {
+ #ifndef _di_level_0_parameter_checking_
+ if (id == -1) return F_status_set_error(F_parameter);
+ if (!mode) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ stream = fdopen(id, mode);
+
+ if (!stream) {
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EAGAIN) return F_status_set_error(F_prohibited);
+ if (errno == EBADF) return F_status_set_error(F_file_descriptor);
+ if (errno == EDEADLK) return F_status_set_error(F_deadlock);
+ if (errno == EFAULT) return F_status_set_error(F_buffer);
+ if (errno == EINTR) return F_status_set_error(F_interrupted);
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max);
+ if (errno == ENOLCK) return F_status_set_error(F_lock);
+ if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+
+ return F_status_set_error(F_failure);
+ }
+
+ return F_none;
+ }
+#endif // _di_f_file_stream_descriptor_
+
+
+#ifndef _di_f_file_stream_open_
+ f_return_status f_file_stream_open(const f_string_t path, const f_string_t mode, f_file_t *file) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!path) return F_status_set_error(F_parameter);
+ if (!mode) return F_status_set_error(F_parameter);
+ if (!file) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ file->stream = fopen(path, mode);
+
+ if (!file->stream) {
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EDQUOT) return F_status_set_error(F_filesystem_quota_block);
+ if (errno == EEXIST) return F_status_set_error(F_file_found);
+ if (errno == ENAMETOOLONG) return F_status_set_error(F_name);
+ if (errno == EFAULT) return F_status_set_error(F_buffer);
+ if (errno == EFBIG || errno == EOVERFLOW) return F_status_set_error(F_number_overflow);
+ if (errno == EINTR) return F_status_set_error(F_interrupted);
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == ELOOP) return F_status_set_error(F_loop);
+ if (errno == ENFILE) return F_status_set_error(F_file_open_max);
+ if (errno == ENOENT) return F_status_set_error(F_file_found_not);
+ if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory);
+ if (errno == ENOMEM) return F_status_set_error(F_memory_out);
+ if (errno == ENOSPC) return F_status_set_error(F_space_not);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+ if (errno == EROFS) return F_status_set_error(F_read_only);
+ if (errno == ETXTBSY) return F_status_set_error(F_busy);
+ if (errno == EISDIR) return F_status_set_error(F_directory);
+ if (errno == EOPNOTSUPP) return F_status_set_error(F_unsupported);
+
+ return F_status_set_error(F_failure);
+ }
+
+ file->id = fileno(file->stream);
+
+ if (file->id == -1) {
+ return F_status_set_error(F_file_descriptor);
+ }
+
+ return F_none;
+ }
+#endif // _di_f_file_stream_open_
+
+#ifndef _di_f_file_stream_reopen_
+ f_return_status f_file_stream_reopen(const f_string_t path, const f_string_t mode, f_file_t *file) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!path) return F_status_set_error(F_parameter);
+ if (!mode) return F_status_set_error(F_parameter);
+ if (!file) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
+ if (!freopen(path, mode, file->stream)) {
+ if (errno == EACCES) return F_status_set_error(F_access_denied);
+ if (errno == EAGAIN) return F_status_set_error(F_prohibited);
+ if (errno == EBADF) return F_status_set_error(F_file_descriptor);
+ if (errno == EDEADLK) return F_status_set_error(F_deadlock);
+ if (errno == EFAULT) return F_status_set_error(F_buffer);
+ if (errno == EINTR) return F_status_set_error(F_interrupted);
+ if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == EMFILE) return F_status_set_error(F_file_descriptor_max);
+ if (errno == ENOLCK) return F_status_set_error(F_lock);
+ if (errno == ENOTDIR) return F_status_set_error(F_file_type_not_directory);
+ if (errno == EPERM) return F_status_set_error(F_prohibited);
+
+ return F_status_set_error(F_failure);
+ }
+
+ file->id = fileno(file->stream);
+
+ if (file->id == -1) {
+ return F_status_set_error(F_file_descriptor);
+ }
+
+ return F_none;
+ }
+#endif // _di_f_file_stream_reopen_
+
#ifndef _di_f_file_touch_
f_return_status f_file_touch(const f_string_t path, const mode_t mode, const bool dereference) {
#ifndef _di_level_0_parameter_checking_
#endif // _di_f_file_create_node_at_
/**
+ * Identify the file descriptor of a valid file stream.
+ *
+ * @param file
+ * The file stream to get descriptor of.
+ *
+ * @return
+ * F_none is returned on success.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_file (with error bit) if file is not a valid stream.
+ *
+ * @see fileno()
+ */
+#ifndef _di_f_file_descriptor_
+ extern f_return_status f_file_descriptor(f_file_t *file);
+#endif // _di_f_file_descriptor_
+
+/**
* Identify whether or not a file exists at the given path.
*
* This does not require access on the file itself.
/**
* Open a particular file and save its stream.
*
- * This will open the file and obtain the file descriptor.
+ * This will open the file as a file descriptor.
+ * This does not open a file stream.
*
* @param path
* The path file name.
* This will be updated with the file descriptor.
*
* @return
- * F_none on success.
- * F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid).
+ * F_none is returned on success.
+ * F_access_denied (with error bit) on access denied.
+ * F_buffer (with error bit) if the buffer is invalid.
+ * F_busy (with error bit) if filesystem is too busy to perform write.
* F_file_found_not (with error bit) if the file was not found.
- * F_file_open (with error bit) if the file is already open.
+ * F_file_open_max (with error bit) when system-wide max open files is reached.
+ * F_file_type_not_directory (with error bit) if F_NOTIFY was specified and file.id is not a directory.
+ * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted.
+ * F_interrupted (with error bit) when program received an interrupt signal, halting operation.
+ * F_loop (with error bit) on loop error.
+ * F_memory_out (with error bit) if out of memory.
+ * F_name (with error bit) on path name is too long.
+ * F_number_overflow (with error bit) on overflow error.
* F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if filesystem does not allow for making changes.
+ * F_read_only (with error bit) if file is read-only.
+ * F_unsupported (with error bit) fo unsupported file types.
+ * F_failure (with error bit) for any other error.
*
* @see open()
*/
/**
* Open a particular file and save its stream.
*
- * This will open the file and obtain the file descriptor.
+ * This will open the file as a file descriptor.
+ * This does not open a file stream.
*
* @param at_id
* The parent directory, as an open directory file descriptor, in which path is relative to.
#endif // _di_f_file_stat_by_id_
/**
+ * Close an open file stream.
+ *
+ * @param complete
+ * When TRUE, will close the file descriptor as well, setting file.id is reset to -1, on success.
+ * When FALSE, will do nothing in regards to the file descriptor.
+ * @param file
+ * The file information.
+ * The file.stream is set to 0, on success.
+ *
+ * @return
+ * F_none is returned on success.
+ * F_access_denied (with error bit) on access denied.
+ * F_buffer (with error bit) if the buffer is invalid.
+ * F_deadlock (with error bit) if operation would cause a deadlock.
+ * F_file_close (with error bit) if fclose() failed for any other reason.
+ * F_file_descriptor (with error bit) if file descriptor is invalid.
+ * F_file_descriptor_max (with error bit) if max file descriptors was reached.
+ * F_file_synchronize (with error bit) on flush failure.
+ * F_file_type_not_directory (with error bit) if F_NOTIFY was specified and file.id is not a directory.
+ * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted.
+ * F_input_output (with error bit) on I/O error.
+ * F_interrupted (with error bit) when program received an interrupt signal, halting operation.
+ * F_lock (with error bit) if failed to lock, such as lock table is full or too many open segments.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if filesystem does not allow for making changes.
+ * F_space_not (with error bit) if filesystem is out of space (or filesystem quota is reached).
+ *
+ * @see close()
+ * @see fclose()
+ */
+#ifndef _di_f_file_stream_close_
+ extern f_return_status f_file_stream_close(const bool complete, f_file_t *file);
+#endif // _di_f_file_stream_close_
+
+/**
+ * Open a file stream from a file descriptor.
+ *
+ * @param id
+ * The file descriptor.
+ * @param mode
+ * The file modes do use when opening.
+ * This should match the modes used to open the file descriptor as it relates to the stream modes.
+ * @param stream
+ * The file stream.
+ * Updated on success, but may be set to NULL on error.
+ *
+ * @return
+ * F_none is returned on success.
+ * F_access_denied (with error bit) on access denied.
+ * F_buffer (with error bit) if the buffer is invalid.
+ * F_deadlock (with error bit) if operation would cause a deadlock.
+ * F_file_descriptor (with error bit) if file descriptor is invalid.
+ * F_file_descriptor_max (with error bit) if max file descriptors was reached.
+ * F_file_type_not_directory (with error bit) if F_NOTIFY was specified and file.id is not a directory.
+ * F_interrupted (with error bit) when program received an interrupt signal, halting operation.
+ * F_lock (with error bit) if failed to lock, such as lock table is full or too many open segments.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if filesystem does not allow for making changes.
+ *
+ * @see fdopen()
+ */
+#ifndef _di_f_file_stream_descriptor_
+ extern f_return_status f_file_stream_descriptor(const int id, const f_string_t mode, FILE *stream);
+#endif // _di_f_file_stream_descriptor_
+
+/**
+ * Open a file stream.
+ *
+ * The file descriptor is retrieved on success, if necessary and able.
+ *
+ * @param path
+ * The file path
+ * @param mode
+ * The file modes do use when opening.
+ * @param file
+ * The file information.
+ * The file.stream is updated if necessary.
+ * The file.id is updated with the file descriptor, if necessary and able.
+ *
+ * @return
+ * F_none is returned on success.
+ * F_access_denied (with error bit) on access denied.
+ * F_buffer (with error bit) if the buffer is invalid.
+ * F_busy (with error bit) if filesystem is too busy to perform write.
+ * F_file_descriptor (with error bit) if unable to load the file descriptor.
+ * F_file_found_not (with error bit) if the file was not found.
+ * F_file_open_max (with error bit) when system-wide max open files is reached.
+ * F_file_type_not_directory (with error bit) if F_NOTIFY was specified and file.id is not a directory.
+ * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted.
+ * F_interrupted (with error bit) when program received an interrupt signal, halting operation.
+ * F_loop (with error bit) on loop error.
+ * F_memory_out (with error bit) if out of memory.
+ * F_name (with error bit) on path name is too long.
+ * F_number_overflow (with error bit) on overflow error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if filesystem does not allow for making changes.
+ * F_read_only (with error bit) if file is read-only.
+ * F_unsupported (with error bit) fo unsupported file types.
+ * F_failure (with error bit) for any other error.
+ *
+ * @see fileno()
+ * @see fopen()
+ */
+#ifndef _di_f_file_stream_open_
+ extern f_return_status f_file_stream_open(const f_string_t path, const f_string_t mode, f_file_t *file);
+#endif // _di_f_file_stream_open_
+
+/**
+ * Re-open a file stream.
+ *
+ * This allows for re-using an existing file stream and possibly file-descriptor.
+ *
+ * The file descriptor is retrieved on success, if necessary and able.
+ *
+ * @param path
+ * The file path
+ * @param mode
+ * The file modes do use when opening.
+ * @param file
+ * The file information.
+ * The file.stream is updated, if necessary.
+ * The file.id is updated with the file descriptor, if necessary and able.
+ *
+ * @return
+ * F_none is returned on success.
+ * F_access_denied (with error bit) on access denied.
+ * F_buffer (with error bit) if the buffer is invalid.
+ * F_busy (with error bit) if filesystem is too busy to perform write.
+ * F_file_descriptor (with error bit) if unable to load the file descriptor.
+ * F_file_found_not (with error bit) if the file was not found.
+ * F_file_open_max (with error bit) when system-wide max open files is reached.
+ * F_file_type_not_directory (with error bit) if F_NOTIFY was specified and file.id is not a directory.
+ * F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted.
+ * F_interrupted (with error bit) when program received an interrupt signal, halting operation.
+ * F_loop (with error bit) on loop error.
+ * F_memory_out (with error bit) if out of memory.
+ * F_name (with error bit) on path name is too long.
+ * F_number_overflow (with error bit) on overflow error.
+ * F_parameter (with error bit) if a parameter is invalid.
+ * F_prohibited (with error bit) if filesystem does not allow for making changes.
+ * F_read_only (with error bit) if file is read-only.
+ * F_unsupported (with error bit) fo unsupported file types.
+ * F_failure (with error bit) for any other error.
+ *
+ * @see fileno()
+ * @see freopen()
+ */
+#ifndef _di_f_file_stream_reopen_
+ extern f_return_status f_file_stream_reopen(const f_string_t path, const f_string_t mode, f_file_t *file);
+#endif // _di_f_file_stream_reopen_
+
+/**
* Update the files access and modification timestamp, creating the file if it does not already exist.
*
* When the file is created, it is created as a regular file.
extern "C" {
#endif
-#if !defined(_di_f_file_close_) || !defined(_di_f_file_copy_)
+#if !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_stream_close_)
f_return_status private_f_file_close(int *id) {
if (*id == -1) return F_none;
*id = -1;
return F_none;
}
-#endif // !defined(_di_f_file_close_) || !defined(_di_f_file_copy_)
+#endif // !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_stream_close_)
#if !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_)
f_return_status private_f_file_copy_content(const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) {
*
* @see f_file_close()
* @see f_file_copy()
+ * @see f_file_stream_close()
*/
-#if !defined(_di_f_file_close_) || !defined(_di_f_file_copy_)
+#if !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_stream_close_)
extern f_return_status private_f_file_close(int *id) f_gcc_attribute_visibility_internal;
-#endif // !defined(_di_f_file_close_) || !defined(_di_f_file_copy_)
+#endif // !defined(_di_f_file_close_) || !defined(_di_f_file_copy_) || !defined(_di_f_file_stream_close_)
/**
* Copy a file.
F_connected,
F_connected_not,
F_critical,
+ F_deadlock,
F_descriptor,
F_device,
F_dummy,
F_invalid,
F_output,
F_link,
+ F_lock,
+ F_lock_not,
F_loop,
F_maybe,
F_memory_out,
#endif
#ifndef _di_fl_color_set_
- f_return_status fl_color_set(FILE *file, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) {
+ f_return_status fl_color_set(FILE *stream, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5) {
#ifndef _di_level_1_parameter_checking_
- if (!file) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
if (!color1) return F_status_set_error(F_parameter);
// make sure all data is in the proper order
if (!color4 && color5 != 0) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!color2) fprintf(file, "%s%s%s", format.begin, color1, format.end);
- else if (!color3) fprintf(file, "%s%s%s%s%s", format.begin, color1, format.medium, color2, format.end);
- else if (!color4) fprintf(file, "%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.end);
- else if (!color5) fprintf(file, "%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.end);
- else fprintf(file, "%s%s%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.medium, color5, format.end);
+ if (!color2) fprintf(stream, "%s%s%s", format.begin, color1, format.end);
+ else if (!color3) fprintf(stream, "%s%s%s%s%s", format.begin, color1, format.medium, color2, format.end);
+ else if (!color4) fprintf(stream, "%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.end);
+ else if (!color5) fprintf(stream, "%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.end);
+ else fprintf(stream, "%s%s%s%s%s%s%s%s%s%s%s", format.begin, color1, format.medium, color2, format.medium, color3, format.medium, color4, format.medium, color5, format.end);
return F_none;
}
#endif // _di_fl_color_save_
#ifndef _di_fl_color_print_
- f_return_status fl_color_print(FILE *file, const f_color_set_t set, const f_string_t string, ...) {
+ f_return_status fl_color_print(FILE *stream, const f_color_set_t set, const f_string_t string, ...) {
#ifndef _di_level_1_parameter_checking_
- if (!file) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
if (!string) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (set.before) {
- fprintf(file, "%s", set.before->string);
+ fprintf(stream, "%s", set.before->string);
}
va_list ap;
va_start(ap, string);
- vfprintf(file, string, ap);
+ vfprintf(stream, string, ap);
va_end(ap);
if (set.after) {
- fprintf(file, "%s", set.after->string);
+ fprintf(stream, "%s", set.after->string);
}
return F_none;
#endif // _di_fl_color_print_
#ifndef _di_fl_color_print2_
- f_return_status fl_color_print2(FILE *file, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...) {
+ f_return_status fl_color_print2(FILE *stream, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...) {
#ifndef _di_level_1_parameter_checking_
- if (!file) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
if (!string) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
f_status_t status = F_none;
if (set.before) {
- fprintf(file, "%s", set.before->string);
+ fprintf(stream, "%s", set.before->string);
}
if (extra.before) {
- fprintf(file, "%s", extra.before->string);
+ fprintf(stream, "%s", extra.before->string);
}
va_list ap;
va_start(ap, string);
- vfprintf(file, string, ap);
+ vfprintf(stream, string, ap);
va_end(ap);
if (set.after) {
- fprintf(file, "%s", set.after->string);
+ fprintf(stream, "%s", set.after->string);
}
if (extra.after) {
- fprintf(file, "%s", extra.after->string);
+ fprintf(stream, "%s", extra.after->string);
}
return F_none;
#endif // _di_fl_color_print2_
#ifndef _di_fl_color_print_code_
- f_return_status fl_color_print_code(FILE *file, const f_string_static_t color) {
+ f_return_status fl_color_print_code(FILE *stream, const f_string_static_t color) {
#ifndef _di_level_1_parameter_checking_
- if (!file) return F_status_set_error(F_parameter);
+ if (!stream) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
if (color.used) {
- fprintf(file, "%s", color.string);
+ fprintf(stream, "%s", color.string);
}
return F_none;
*
* Up to 5 colors may be associted with a single color format block.
*
- * @param file
- * The file or standard io.
+ * @param stream
+ * The file stream or standard output.
* @param format
* The color format parts.
* @param color1
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_color_set_
- extern f_return_status fl_color_set(FILE *file, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5);
+ extern f_return_status fl_color_set(FILE *stream, const f_color_format_t format, const int8_t *color1, const int8_t *color2, const int8_t *color3, const int8_t *color4, const int8_t *color5);
- #define fl_macro_color_set_1(file, format, color1) fl_color_set(file, format, color1, 0, 0, 0, 0)
- #define fl_macro_color_set_2(file, format, color1, color2) fl_color_set(file, format, color1, color2, 0, 0, 0)
- #define fl_macro_color_set_3(file, format, color1, color2, color3) fl_color_set(file, format, color1, color2, color3, 0, 0)
- #define fl_macro_color_set_4(file, format, color1, color2, color3, color4) fl_color_set(file, format, color1, color2, color3, color4, 0)
- #define fl_macro_color_set_5(file, format, color1, color2, color3, color4, color5) fl_color_set(file, format, color1, color2, color3, color4, color5)
+ #define fl_macro_color_set_1(stream, format, color1) fl_color_set(stream, format, color1, 0, 0, 0, 0)
+ #define fl_macro_color_set_2(stream, format, color1, color2) fl_color_set(stream, format, color1, color2, 0, 0, 0)
+ #define fl_macro_color_set_3(stream, format, color1, color2, color3) fl_color_set(stream, format, color1, color2, color3, 0, 0)
+ #define fl_macro_color_set_4(stream, format, color1, color2, color3, color4) fl_color_set(stream, format, color1, color2, color3, color4, 0)
+ #define fl_macro_color_set_5(stream, format, color1, color2, color3, color4, color5) fl_color_set(stream, format, color1, color2, color3, color4, color5)
#endif // _di_fl_color_set_
/**
*
* If the colors strings have nothing used in them, then this will only print the string.
*
- * @param file
- * The file or standard io.
+ * @param stream
+ * The file stream or standard output.
* @param set
* The color set used for printing.
* @param string
- * The string to print to the file or standard io.
+ * The string to print.
* @param ...
* Variable arguments, processed in the same way fprintf() processes them.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_print_dynamic().
*/
#ifndef _di_fl_color_print_
- extern f_return_status fl_color_print(FILE *file, const f_color_set_t set, const f_string_t string, ...);
+ extern f_return_status fl_color_print(FILE *stream, const f_color_set_t set, const f_string_t string, ...);
#endif // _di_fl_color_print_
/**
* It is common for colors to be bolded.
* This is intended to simplify printing bold colors.
*
- * @param file
- * The file or standard io.
+ * @param stream
+ * The file stream or standard output.
* @param set
* The color set used for printing.
* @param extra
* The a second color set used for printing, which gets appended after set.before and set.after, respectively.
* @param string
- * The string to print to the file or standard io.
+ * The string to print.
* @param ...
* Variable arguments, processed in the same way fprintf() processes them.
*
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
- *
- * Errors (with error bit) from: f_print_dynamic().
*/
#ifndef _di_fl_color_print2_
- extern f_return_status fl_color_print2(FILE *file, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...);
+ extern f_return_status fl_color_print2(FILE *stream, const f_color_set_t set, const f_color_set_t extra, const f_string_t string, ...);
#endif // _di_fl_color_print2_
/**
*
* Be sure to forget to print the color reset when done.
*
- * @param file
- * The file or standard io.
+ * @param stream
+ * The file stream or standard output.
* @param start_color
* The color code to print.
*
* Errors (with error bit) from: f_print_dynamic().
*/
#ifndef _di_fl_color_print_code_
- extern f_return_status fl_color_print_code(FILE *file, const f_string_static_t color);
+ extern f_return_status fl_color_print_code(FILE *stream, const f_string_static_t color);
#endif // _di_fl_color_print_code_
/**
* @param set
* The color set used for printing.
* @param string
- * The string to print to the file or standard io.
+ * The string to print.
* @param ...
* Variable arguments, processed in the same way fprintf() processes them.
*
* @param extra
* The a second color set used for printing, which gets appended after set.before and set.after, respectively.
* @param string
- * The string to print to the file or standard io.
+ * The string to print.
* @param ...
* Variable arguments, processed in the same way fprintf() processes them.
*
status = private_fl_directory_clone(static_source, static_destination, role, recurse, 1);
}
- if (status == F_none && recurse.output && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source, destination);
}
status = private_fl_directory_clone(static_source, static_destination, role, recurse, 1);
- if (status == F_none && recurse.output != -1 && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source, destination);
}
status = private_fl_directory_copy(static_source, static_destination, mode, recurse, 1);
}
- if (status == F_none && recurse.output != -1 && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source, destination);
}
status = private_fl_directory_copy(static_source, static_destination, mode, recurse, 1);
}
- if (status == F_none && recurse.output != -1 && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source, destination);
}
* verbose:
* Set to 0 to not print on successful operation.
* Set to address of a function to be called for printing such that:
- * - The first parameter represents the file pointer from the output variable.
+ * - The first parameter represents the output file type.
* - The second parameter represents the source string.
* - The third parameter represents the destination string.
* failures:
f_number_unsigned_t depth_max;
f_number_unsigned_t size_block;
bool exclusive;
- int output;
- void (*verbose)(const int, const f_string_t, const f_string_t);
+ f_file_t output;
+ void (*verbose)(const f_file_t, const f_string_t, const f_string_t);
f_directory_statuss_t *failures;
} fl_directory_recurse_t;
- #define fl_directory_recurse_t_initialize { fl_directory_recurse_depth_max, f_file_default_read_size, F_false, -1, 0, 0 }
+ #define fl_directory_recurse_t_initialize { fl_directory_recurse_depth_max, f_file_default_read_size, F_false, f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), 0, 0 }
#endif // _di_fl_directory_recurse_t_
/**
if (depth < recurse.depth_max) {
status = private_fl_directory_clone(source_sub, destination_sub, role, recurse, depth + 1);
- if (status == F_none && recurse.output != -1 && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source_sub.string, destination_sub.string);
}
}
return F_failure;
}
- if (recurse.output != -1 && recurse.verbose) {
+ if ((!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, path_source, path_destination);
}
if (depth < recurse.depth_max) {
status = private_fl_directory_copy(source_sub, destination_sub, mode, recurse, depth + 1);
- if (status == F_none && recurse.output != -1 && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source_sub.string, destination_sub.string);
}
}
return F_failure;
}
- if (recurse.output != -1 && recurse.verbose) {
+ if ((!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, path_source, path_destination);
}
case F_critical:
*string = FL_status_string_critical;
break;
+ case F_deadlock:
+ *string = FL_status_string_deadlock;
+ break;
case F_descriptor:
*string = FL_status_string_descriptor;
break;
case F_link:
*string = FL_status_string_link;
break;
+ case F_lock:
+ *string = FL_status_string_lock;
+ break;
+ case F_lock_not:
+ *string = FL_status_string_lock_not;
+ break;
case F_loop:
*string = FL_status_string_loop;
break;
#define FL_status_string_connected "F_connected"
#define FL_status_string_connected_not "F_connected_not"
#define FL_status_string_critical "F_critical"
+ #define FL_status_string_deadlock "F_deadlock"
#define FL_status_string_descriptor "F_descriptor"
#define FL_status_string_device "F_device"
#define FL_status_string_dummy "F_dummy"
#define FL_status_string_invalid "F_invalid"
#define FL_status_string_output "F_output"
#define FL_status_string_link "F_link"
+ #define FL_status_string_lock "F_lock"
+ #define FL_status_string_lock_not "F_lock_not"
#define FL_status_string_loop "F_loop"
#define FL_status_string_maybe "F_maybe"
#define FL_status_string_memory_out "F_memory_out"
#define FL_status_string_connected_length 11
#define FL_status_string_connected_not_length 15
#define FL_status_string_critical_length 10
+ #define FL_status_string_deadlock_length 10
#define FL_status_string_descriptor_length 12
#define FL_status_string_device_length 8
#define FL_status_string_dummy_length 7
#define FL_status_string_invalid_length 9
#define FL_status_string_output_length 8
#define FL_status_string_link_length 6
+ #define FL_status_string_lock_length 6
+ #define FL_status_string_lock_not_length 10
#define FL_status_string_loop_length 6
#define FL_status_string_maybe_length 7
#define FL_status_string_memory_out_length 12
/**
* Structure for facilitating the error printing.
*
- * to: The file descriptor to print to.
+ * to: The file to print to.
* verbosity: The verbosity mode.
* prefix: A prefix string to display before the error.
* context: The color codes for the entire error message.
#define fll_error_print_warning_length 9
typedef struct {
- int to;
+ f_file_t to;
uint8_t verbosity;
const char *prefix;
} fll_error_print_t;
#define fll_error_print_t_initialize { \
- f_type_descriptor_error, \
+ f_macro_file_t_initialize(f_type_error, f_type_descriptor_error, f_file_flag_write_only), \
f_console_verbosity_normal, \
fll_error_print_error, \
f_color_set_t_initialize, \
#endif
#ifndef _di_fll_error_print_
- f_return_status fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback) {
- return private_fll_error_print(print, status, function, fallback);
+ f_return_status fll_error_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback) {
+ return private_fll_error_print(error, status, function, fallback);
}
#endif // _di_fll_error_print_
#ifndef _di_fll_error_file_print_
- f_return_status fll_error_file_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type) {
+ f_return_status fll_error_file_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type) {
const char *type_name = fll_error_file_type_string_file;
if (type == fll_error_file_type_directory) {
}
if (status == F_access_denied) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sAccess denied while trying to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sAccess denied while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_access_group) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sCurrrent user is not allowed to use the given group while trying to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given group while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_access_owner) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sCurrrent user is not allowed to use the given owner while trying to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sCurrrent user is not allowed to use the given owner while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_directory) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sInvalid directory while trying to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sInvalid directory while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_directory_empty_not) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sThe %s '", print.context.before->string, print.prefix ? print.prefix : "", type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "' is not empty.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "' is not empty.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_file_closed) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sThe %s '", print.context.before->string, print.prefix ? print.prefix : "", type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "' is not open.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "' is not open.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_file_found) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sThe %s '", print.context.before->string, print.prefix ? print.prefix : "", type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "' already exists.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sThe %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "' already exists.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_file_found_not) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sFailed to find %s '", print.context.before->string, print.prefix ? print.prefix : "", type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sFailed to find %s '", error.context.before->string, error.prefix ? error.prefix : "", type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_file_read) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sA read error occurred while accessing the file '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sA read error occurred while accessing the file '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_file_seek) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sA seek error occurred while accessing the file '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sA seek error occurred while accessing the file '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_loop) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sLoop while trying to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sLoop while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_name) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sInvalid %s name '", print.context.before->string, print.prefix ? print.prefix : "", type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sInvalid %s name '", error.context.before->string, error.prefix ? error.prefix : "", type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_number_overflow) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sOverflow while trying to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sOverflow while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_parameter) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sInvalid parameter", print.context.before->string, print.prefix ? print.prefix : "");
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : "");
- private_fll_error_print_function(print, function);
+ private_fll_error_print_function(error, function);
- dprintf(print.to, " for the %s '", type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ fprintf(error.to.stream, " for the %s '", type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_prohibited) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sProhibited by system while trying to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "'.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sProhibited by system while trying to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "'.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
if (type == fll_error_file_type_file) {
if (status == F_directory_found_not) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sFailed to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "' due to an invalid directory in the path.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "' due to an invalid directory in the path.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
else if (type == fll_error_file_type_directory) {
if (status == F_directory_found_not) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sFailed to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
- dprintf(print.to, "' due to an invalid directory in the path.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
+ fprintf(error.to.stream, "' due to an invalid directory in the path.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_failure) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sFailed to %s %s '", print.context.before->string, print.prefix ? print.prefix : "", operation, type_name);
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, name, print.notable.after->string);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sFailed to %s %s '", error.context.before->string, error.prefix ? error.prefix : "", operation, type_name);
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, name, error.notable.after->string);
}
return F_false;
}
}
- return private_fll_error_print(print, status, function, fallback);
+ return private_fll_error_print(error, status, function, fallback);
}
#endif // _di_fll_error_file_print_
-#ifndef _di_fll_error_parameter_print_
- f_return_status fll_error_parameter_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback) {
-
- if (status == F_data_not) {
- if (print.verbosity != f_console_verbosity_quiet) {
- // @todo there is a way to identify which parameter is incorrect
- // to do this, one must look for any "has_additional" and then see if the "additional" location is set to 0
- // nothing can be 0 as that represents the program name, unless argv[] is improperly created
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sOne of the parameters passed requires an additional argument that was not passed.%s%c", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "' must not be an empty string.%s%c", print.context.after->string, f_string_eol[0]);
- }
-
- return F_false;
- }
-
- if (status == F_utf) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sInvalid UTF-8 character in a parameter when calling ", print.context.before->string, print.prefix ? print.prefix : "");
-
- private_fll_error_print_function(print, function);
-
- dprintf(print.to, ".%s%c", print.context.after->string, f_string_eol[0]);
- }
-
- return F_false;
- }
-
- return private_fll_error_print(print, status, function, fallback);
- }
-#endif // _di_fll_error_parameter_print_
-
#ifndef _di_fll_error_parameter_integer_print_
- f_return_status fll_error_parameter_integer_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument) {
+ f_return_status fll_error_parameter_integer_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument) {
if (status == F_data_not) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sThe argument for the parameter '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, parameter, print.notable.after->string);
- dprintf(print.to, "' must not be an empty string.%s%c", print.context.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sThe argument for the parameter '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string);
+ fprintf(error.to.stream, "' must not be an empty string.%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_number) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", argument[0]);
- dprintf(print.to, "%s%sThe argument '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "' is not a valid number for the parameter '");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "%s%s%s%s%c", print.context.after->string, print.notable.before->string, parameter, print.notable.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", argument[0]);
+ fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "' is not a valid number for the parameter '");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "%s%s%s%s%c", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_number_negative) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", argument[0]);
- dprintf(print.to, "%s%sThe argument '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "' is negative, which is not allowed for the parameter '");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "%s%s%s%s%c", print.context.after->string, print.notable.before->string, parameter, print.notable.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", argument[0]);
+ fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "' is negative, which is not allowed for the parameter '");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "%s%s%s%s%c", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_number_overflow) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", argument[0]);
- dprintf(print.to, "%s%sThe argument '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "' is too large for the parameter '");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "%s%s%s%s%c", print.context.after->string, print.notable.before->string, parameter, print.notable.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", argument[0]);
+ fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "' is too large for the parameter '");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "%s%s%s%s%c", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_number_positive) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", argument[0]);
- dprintf(print.to, "%s%sThe argument '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "' is positive, which is not allowed for the parameter '");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "%s%s%s%s%c", print.context.after->string, print.notable.before->string, parameter, print.notable.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", argument[0]);
+ fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "' is positive, which is not allowed for the parameter '");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "%s%s%s%s%c", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_number_underflow) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", argument[0]);
- dprintf(print.to, "%s%sThe argument '", print.context.before->string, print.prefix ? print.prefix : "");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "' is too small for the parameter '");
- dprintf(print.to, "%s%s%s%s", print.context.after->string, print.notable.before->string, argument, print.notable.after->string);
- dprintf(print.to, "%s%s%s%s%c", print.context.after->string, print.notable.before->string, parameter, print.notable.after->string, f_string_eol[0]);
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", argument[0]);
+ fprintf(error.to.stream, "%s%sThe argument '", error.context.before->string, error.prefix ? error.prefix : "");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "' is too small for the parameter '");
+ fprintf(error.to.stream, "%s%s%s%s", error.context.after->string, error.notable.before->string, argument, error.notable.after->string);
+ fprintf(error.to.stream, "%s%s%s%s%c", error.context.after->string, error.notable.before->string, parameter, error.notable.after->string, f_string_eol[0]);
}
return F_false;
}
- return private_fll_error_print(print, status, function, fallback);
+ return private_fll_error_print(error, status, function, fallback);
}
#endif // _di_fll_error_parameter_integer_print_
* F_true is returned if the status code is unknown.
*/
#ifndef _di_fll_error_print_
- extern f_return_status fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback);
+ extern f_return_status fll_error_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback);
#endif // _di_fll_error_print_
/**
* F_false is returned on successful print of known errors.
*/
#ifndef _di_fll_error_file_print_
- extern f_return_status fll_error_file_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type);
+ extern f_return_status fll_error_file_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t name, const f_string_t operation, const uint8_t type);
#endif // _di_fll_error_file_print_
/**
- * Print parameter related error or warning messages.
- *
- * @param print
- * Designates how printing is to be performed.
- * @param status
- * The status code to process.
- * Make sure this has F_status_set_fine() called if the status code has any error or warning bits.
- * @param function
- * The name of the function where the error happened.
- * Set to 0 to disable.
- * @param fallback
- * Set to F_true to print the fallback error message for unknown errors.
- *
- * @return
- * F_false is returned on successful print of known errors.
- * F_true is returned if the status code is unknown.
- */
-#ifndef _di_fll_error_parameter_print_
- extern f_return_status fll_error_parameter_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback);
-#endif // _di_fll_error_parameter_print_
-
-/**
* Print integer related error or warning messages.
*
* @param print
* F_false is returned on successful print of known errors.
*/
#ifndef _di_fll_error_parameter_integer_print_
- extern f_return_status fll_error_parameter_integer_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument);
+ extern f_return_status fll_error_parameter_integer_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback, const f_string_t parameter, const f_string_t argument);
#endif // _di_fll_error_parameter_integer_print_
#ifdef __cplusplus
#endif
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
- f_return_status private_fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback) {
+ f_return_status private_fll_error_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback) {
if (status == F_buffer_too_large) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sMaximum buffer length reached while processing ", print.context.before->string, print.prefix ? print.prefix : "");
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sMaximum buffer length reached while processing ", error.context.before->string, error.prefix ? error.prefix : "");
- private_fll_error_print_function(print, function);
+ private_fll_error_print_function(error, function);
- dprintf(print.to, ".%s%c", print.context.after->string, f_string_eol[0]);
+ fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_memory_allocation || status == F_memory_reallocation || status == F_memory_out) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sUnable to allocate memory in function ", print.context.before->string, print.prefix ? print.prefix : "");
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sUnable to allocate memory in function ", error.context.before->string, error.prefix ? error.prefix : "");
- private_fll_error_print_function(print, function);
+ private_fll_error_print_function(error, function);
- dprintf(print.to, ".%s%c", print.context.after->string, f_string_eol[0]);
+ fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_parameter) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sInvalid parameter", print.context.before->string, print.prefix ? print.prefix : "");
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sInvalid parameter", error.context.before->string, error.prefix ? error.prefix : "");
- private_fll_error_print_function(print, function);
+ private_fll_error_print_function(error, function);
- dprintf(print.to, ".%s%c", print.context.after->string, f_string_eol[0]);
+ fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_string_too_large) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sMaximum string length reached while processing ", print.context.before->string, print.prefix ? print.prefix : "");
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sMaximum string length reached while processing ", error.context.before->string, error.prefix ? error.prefix : "");
- private_fll_error_print_function(print, function);
+ private_fll_error_print_function(error, function);
- dprintf(print.to, ".%s%c", print.context.after->string, f_string_eol[0]);
+ fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
if (status == F_utf) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%sInvalid UTF-8 character while calling ", print.context.before->string, print.prefix ? print.prefix : "");
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%sInvalid UTF-8 character while calling ", error.context.before->string, error.prefix ? error.prefix : "");
- private_fll_error_print_function(print, function);
+ private_fll_error_print_function(error, function);
- dprintf(print.to, ".%s%c", print.context.after->string, f_string_eol[0]);
+ fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]);
}
return F_false;
}
- if (fallback && print.verbosity != f_console_verbosity_quiet) {
- if (print.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- dprintf(print.to, "%s%s(%llu)", print.context.before->string, print.prefix ? print.prefix : "", status);
+ if (fallback && error.verbosity != f_console_verbosity_quiet) {
+ if (error.verbosity != f_console_verbosity_quiet) {
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%s%s(%llu)", error.context.before->string, error.prefix ? error.prefix : "", status);
- private_fll_error_print_function(print, function);
+ private_fll_error_print_function(error, function);
- dprintf(print.to, ".%s%c", print.context.after->string, f_string_eol[0]);
+ fprintf(error.to.stream, ".%s%c", error.context.after->string, f_string_eol[0]);
}
}
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
- void private_fll_error_print_function(const fll_error_print_t print, const f_string_t function) {
+ void private_fll_error_print_function(const fll_error_print_t error, const f_string_t function) {
if (function) {
- dprintf(print.to, " when calling function %s", print.context.after->string);
- dprintf(print.to, "%s%s%s", print.notable.before->string, function, print.notable.after->string);
- dprintf(print.to, "%s()", print.context.before->string);
+ fprintf(error.to.stream, " when calling function %s", error.context.after->string);
+ fprintf(error.to.stream, "%s%s%s", error.notable.before->string, function, error.notable.after->string);
+ fprintf(error.to.stream, "%s()", error.context.before->string);
}
}
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
* @see fll_error_file_print()
*/
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
- extern f_return_status private_fll_error_print(const fll_error_print_t print, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal;
+ extern f_return_status private_fll_error_print(const fll_error_print_t error, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal;
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
/**
* @see fll_error_file_print()
*/
#if !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
- void private_fll_error_print_function(const fll_error_print_t print, const f_string_t function) f_gcc_attribute_visibility_internal;
+ void private_fll_error_print_function(const fll_error_print_t error, const f_string_t function) f_gcc_attribute_visibility_internal;
#endif // !defined(_di_fll_error_print_) || !defined(_di_fll_error_file_print_) || !defined(_di_fll_error_number_print_)
#ifdef __cplusplus
#endif
#ifndef _di_fll_file_error_print_
- f_return_status fll_file_error_print(FILE *file, const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) {
+ f_return_status fll_file_error_print(FILE *stream, const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) {
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print(file, context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_file_closed) {
- fl_color_print(file, context.set.error, "INTERNAL ERROR: The file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "' is no longer open.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "INTERNAL ERROR: The file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "' is no longer open.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_file_seek) {
- fl_color_print(file, context.set.error, "ERROR: A seek error occurred while accessing the file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "'.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "ERROR: A seek error occurred while accessing the file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "'.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_file_read) {
- fl_color_print(file, context.set.error, "ERROR: A read error occurred while accessing the file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "'.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "ERROR: A read error occurred while accessing the file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "'.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print(file, context.set.error, "ERROR: Unable to find the file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "'.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "ERROR: Unable to find the file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "'.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print(file, context.set.error, "ERROR: Unable to open the file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "'.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "ERROR: Unable to open the file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "'.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print(file, context.set.error, "ERROR: File descriptor error while trying to open the file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "'.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "ERROR: File descriptor error while trying to open the file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "'.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_parameter) {
- fl_color_print(file, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(file, context.set.notable, "%s()", function_name);
- fl_color_print(file, context.set.error, ".");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(stream, context.set.notable, "%s()", function_name);
+ fl_color_print(stream, context.set.error, ".");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print(file, context.set.error, "ERROR: Integer overflow while trying to buffer the file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "'.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "ERROR: Integer overflow while trying to buffer the file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "'.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else if (status == F_number_underflow) {
- fl_color_print(file, context.set.error, "ERROR: Integer underflow while trying to buffer the file '");
- fl_color_print(file, context.set.notable, "%s", file_name);
- fl_color_print(file, context.set.error, "'.");
- fprintf(file, "%c", f_string_eol[0]);
+ fl_color_print(stream, context.set.error, "ERROR: Integer underflow while trying to buffer the file '");
+ fl_color_print(stream, context.set.notable, "%s", file_name);
+ fl_color_print(stream, context.set.error, "'.");
+ fprintf(stream, "%c", f_string_eol[0]);
}
else {
return F_false;
f_status_t status = f_file_rename(source, destination);
if (F_status_set_fine(status) != F_mount) {
- if (status == F_none && recurse.output && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source, destination);
}
status = f_directory_remove(source, recurse.depth_max, F_false);
- if (status == F_none && recurse.output && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source, destination);
}
}
status = f_file_remove(source);
- if (status == F_none && recurse.output && recurse.verbose) {
+ if (status == F_none && (!recurse.output.stream || recurse.output.id != -1) && recurse.verbose) {
recurse.verbose(recurse.output, source, destination);
}
}
/**
* Print file error messages.
*
- * @param file
- * The file to write to, such as f_type_output or f_type_error.
+ * @param stream
+ * The file stream to write to, such as f_type_output or f_type_error.
* @param context
* The color context information to use when printing.
* @param function_name
* F_false if no error message was printed.
*/
#ifndef _di_fll_file_error_print_
- extern f_return_status fll_file_error_print(FILE *file, const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status);
+ extern f_return_status fll_file_error_print(FILE *stream, const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status);
#endif // _di_fll_file_error_print_
/**
#endif
#ifndef _di_fll_program_print_help_header_
- f_return_status fll_program_print_help_header(const int id, const f_color_context_t context, const f_string_t name, const f_string_t version) {
+ f_return_status fll_program_print_help_header(const f_file_t file, const f_color_context_t context, const f_string_t name, const f_string_t version) {
- dprintf(id, "%c", f_string_eol[0]);
- fl_color_print_to(id, context.set.title, " %s", name);
+ fprintf(file.stream, "%c", f_string_eol[0]);
+ fl_color_print(file.stream, context.set.title, " %s", name);
- dprintf(id, "%c", f_string_eol[0]);
- fl_color_print_to(id, context.set.notable, " Version %s", version);
+ fprintf(file.stream, "%c", f_string_eol[0]);
+ fl_color_print(file.stream, context.set.notable, " Version %s", version);
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
- fl_color_print_to(id, context.set.important, " Available Options: ");
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fl_color_print(file.stream, context.set.important, " Available Options: ");
return F_none;
}
#endif // _di_fll_program_print_help_header_
#ifndef _di_fll_program_print_help_option_
- f_return_status fll_program_print_help_option(const int id, const f_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description) {
+ f_return_status fll_program_print_help_option(const f_file_t file, const f_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description) {
- dprintf(id, "%c %s", f_string_eol[0], symbol_short);
- fl_color_print_to(id, context.set.standout, option_short);
+ fprintf(file.stream, "%c %s", f_string_eol[0], symbol_short);
+ fl_color_print(file.stream, context.set.standout, option_short);
- dprintf(id, ", %s", symbol_long);
- fl_color_print_to(id, context.set.standout, option_long);
+ fprintf(file.stream, ", %s", symbol_long);
+ fl_color_print(file.stream, context.set.standout, option_long);
- dprintf(id, " %s", description);
+ fprintf(file.stream, " %s", description);
return F_none;
}
#endif // _di_fll_program_print_help_option_
#ifndef _di_fll_program_print_help_option_long_
- f_return_status fll_program_print_help_option_long(const int id, const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description) {
+ f_return_status fll_program_print_help_option_long(const f_file_t file, const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description) {
- dprintf(id, "%c %s", f_string_eol[0], symbol_long);
- fl_color_print_to(id, context.set.standout, option_long);
+ fprintf(file.stream, "%c %s", f_string_eol[0], symbol_long);
+ fl_color_print(file.stream, context.set.standout, option_long);
- dprintf(id, " %s", description);
+ fprintf(file.stream, " %s", description);
return F_none;
}
#endif // _di_fll_program_print_help_option_long_
#ifndef _di_fll_program_print_help_option_other_
- f_return_status fll_program_print_help_option_other(const int id, const f_color_context_t context, const f_string_t option_other, const f_string_t description) {
+ f_return_status fll_program_print_help_option_other(const f_file_t file, const f_color_context_t context, const f_string_t option_other, const f_string_t description) {
- dprintf(id, "%c ", f_string_eol[0]);
- fl_color_print_to(id, context.set.standout, option_other);
+ fprintf(file.stream, "%c ", f_string_eol[0]);
+ fl_color_print(file.stream, context.set.standout, option_other);
- dprintf(id, " %s", description);
+ fprintf(file.stream, " %s", description);
return F_none;
}
#endif // _di_fll_program_print_help_option_other_
#ifndef _di_fll_program_print_help_usage_
- f_return_status fll_program_print_help_usage(const int id, const f_color_context_t context, const f_string_t name, const f_string_t parameters) {
+ f_return_status fll_program_print_help_usage(const f_file_t file, const f_color_context_t context, const f_string_t name, const f_string_t parameters) {
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
- fl_color_print_to(id, context.set.important, " Usage:");
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fl_color_print(file.stream, context.set.important, " Usage:");
- dprintf(id, "%c ", f_string_eol[0]);
- fl_color_print_to(id, context.set.standout, name);
+ fprintf(file.stream, "%c ", f_string_eol[0]);
+ fl_color_print(file.stream, context.set.standout, name);
- dprintf(id, " ");
- fl_color_print_to(id, context.set.notable, "[");
+ fprintf(file.stream, " ");
+ fl_color_print(file.stream, context.set.notable, "[");
- dprintf(id, " options ");
- fl_color_print_to(id, context.set.notable, "]");
+ fprintf(file.stream, " options ");
+ fl_color_print(file.stream, context.set.notable, "]");
if (parameters[0] != '\0') {
- dprintf(id, " ");
- fl_color_print_to(id, context.set.notable, "[");
+ fprintf(file.stream, " ");
+ fl_color_print(file.stream, context.set.notable, "[");
- dprintf(id, " %s ", parameters);
- fl_color_print_to(id, context.set.notable, "]");
+ fprintf(file.stream, " %s ", parameters);
+ fl_color_print(file.stream, context.set.notable, "]");
}
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
return F_none;
}
#endif // _di_fll_program_print_help_usage_
#ifndef _di_fll_program_print_version_
- f_return_status fll_program_print_version(const int id, const f_string_t version) {
+ f_return_status fll_program_print_version(const f_file_t file, const f_string_t version) {
- dprintf(id, "%s%c", version, f_string_eol[0]);
+ fprintf(file.stream, "%s%c", version, f_string_eol[0]);
return F_none;
}
/**
* Print standard help header.
*
- * @param id
- * The file descriptor to output to.
+ * @param file
+ * The file to output to.
* @param context
* The color context.
* @param name
* @param fl_color_print()
*/
#ifndef _di_fll_program_print_help_header_
- extern f_return_status fll_program_print_help_header(const int id, const f_color_context_t context, const f_string_t name, const f_string_t version);
+ extern f_return_status fll_program_print_help_header(const f_file_t file, const f_color_context_t context, const f_string_t name, const f_string_t version);
#endif // _di_fll_program_print_help_header_
/**
* Print standard help option.
*
- * @param id
- * The file descriptor to output to.
+ * @param file
+ * The file to output to.
* @param context
* The color context.
* @param option_short
* @param fl_color_print()
*/
#ifndef _di_fll_program_print_help_option_
- extern f_return_status fll_program_print_help_option(const int id, const f_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description);
+ extern f_return_status fll_program_print_help_option(const f_file_t file, const f_color_context_t context, const f_string_t option_short, const f_string_t option_long, const f_string_t symbol_short, const f_string_t symbol_long, const f_string_t description);
#endif // _di_fll_program_print_help_option_
/**
* Print standard help option (long option only).
*
- * @param id
- * The file descriptor to output to.
+ * @param file
+ * The file to output to.
* @param context
* The color context.
* @param option_long
* @param fl_color_print()
*/
#ifndef _di_fll_program_print_help_option_long_
- extern f_return_status fll_program_print_help_option_long(const int id, const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description);
+ extern f_return_status fll_program_print_help_option_long(const f_file_t file, const f_color_context_t context, const f_string_t option_long, const f_string_t symbol_long, const f_string_t description);
#endif // _di_fll_program_print_help_option_long_
/**
* Print standard help option (other option only).
*
- * @param id
- * The file descriptor to output to.
+ * @param file
+ * The file to output to.
* @param context
* The color context.
* @param option_other
* @param fl_color_print()
*/
#ifndef _di_fll_program_print_help_option_other_
- extern f_return_status fll_program_print_help_option_other(const int id, const f_color_context_t context, const f_string_t option_other, const f_string_t description);
+ extern f_return_status fll_program_print_help_option_other(const f_file_t file, const f_color_context_t context, const f_string_t option_other, const f_string_t description);
#endif // _di_fll_program_print_help_option_other_
/**
* Print standard help usage.
*
- * @param id
- * The file descriptor to output to.
+ * @param file
+ * The file to output to.
* @param context
* The color context.
* @param name
* @param fl_color_print()
*/
#ifndef _di_fll_program_print_help_usage_
- extern f_return_status fll_program_print_help_usage(const int id, const f_color_context_t context, const f_string_t name, const f_string_t parameters);
+ extern f_return_status fll_program_print_help_usage(const f_file_t file, const f_color_context_t context, const f_string_t name, const f_string_t parameters);
#endif // _di_fll_program_print_help_usage_
/**
* Print the program version.
*
- * @param id
- * The file descriptor to output to.
+ * @param file
+ * The file to output to.
* @param version
* The version number of the program.
*
* F_none on success.
*/
#ifndef _di_fll_program_print_version_
- extern f_return_status fll_program_print_version(const int id, const f_string_t version);
+ extern f_return_status fll_program_print_version(const f_file_t file, const f_string_t version);
#endif // _di_fll_program_print_version_
/**
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_deadlock, length, FL_status_string_deadlock_length) == F_equal_to) {
+ *code = F_deadlock;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_descriptor, length, FL_status_string_descriptor_length) == F_equal_to) {
*code = F_descriptor;
return F_none;
return F_none;
}
+ if (fl_string_compare(string, FL_status_string_lock, length, FL_status_string_lock_length) == F_equal_to) {
+ *code = F_lock;
+ return F_none;
+ }
+
+ if (fl_string_compare(string, FL_status_string_lock_not, length, FL_status_string_lock_not_length) == F_equal_to) {
+ *code = F_lock_not;
+ return F_none;
+ }
+
if (fl_string_compare(string, FL_status_string_loop, length, FL_status_string_loop_length) == F_equal_to) {
*code = F_loop;
return F_none;
#endif
#ifndef _di_byte_dump_print_help_
- f_return_status byte_dump_print_help(const int id, const f_color_context_t context) {
+ f_return_status byte_dump_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, byte_dump_name_long, byte_dump_version);
+ fll_program_print_help_header(file, context, byte_dump_name_long, byte_dump_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
- dprintf(id, "%c", f_string_eol[0]);
+ fprintf(file.stream, "%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display binary representation.");
- fll_program_print_help_option(id, context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display decimal representation.");
- fll_program_print_help_option(id, context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display duodecimal representation.");
- fll_program_print_help_option(id, context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Display hexadecimal representation.");
- fll_program_print_help_option(id, context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display octal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_binary, byte_dump_long_binary, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display binary representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_decimal, byte_dump_long_decimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display decimal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_duodecimal, byte_dump_long_duodecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display duodecimal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_hexidecimal, byte_dump_long_hexidecimal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Display hexadecimal representation.");
+ fll_program_print_help_option(file, context, byte_dump_short_octal, byte_dump_long_octal, f_console_symbol_short_enable, f_console_symbol_long_enable, " Display octal representation.");
- dprintf(id, "%c", f_string_eol[0]);
+ fprintf(file.stream, "%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable, f_console_symbol_long_enable, " Start reading at this byte offset.");
- fll_program_print_help_option(id, context, byte_dump_short_last, byte_dump_long_last, f_console_symbol_short_enable, f_console_symbol_long_enable, " Stop reading at this (inclusive) byte offset.");
- fll_program_print_help_option(id, context, byte_dump_short_width, byte_dump_long_width, f_console_symbol_short_enable, f_console_symbol_long_enable, " Set number of columns of Bytes to display.");
+ fll_program_print_help_option(file, context, byte_dump_short_first, byte_dump_long_first, f_console_symbol_short_enable, f_console_symbol_long_enable, " Start reading at this byte offset.");
+ fll_program_print_help_option(file, context, byte_dump_short_last, byte_dump_long_last, f_console_symbol_short_enable, f_console_symbol_long_enable, " Stop reading at this (inclusive) byte offset.");
+ fll_program_print_help_option(file, context, byte_dump_short_width, byte_dump_long_width, f_console_symbol_short_enable, f_console_symbol_long_enable, " Set number of columns of Bytes to display.");
- dprintf(id, "%c", f_string_eol[0]);
+ fprintf(file.stream, "%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include a column of text when displaying the bytes.");
- fll_program_print_help_option(id, context, byte_dump_short_placeholder, byte_dump_long_placeholder, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use a placeholder character instead of a space for placeholders.");
+ fll_program_print_help_option(file, context, byte_dump_short_text, byte_dump_long_text, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include a column of text when displaying the bytes.");
+ fll_program_print_help_option(file, context, byte_dump_short_placeholder, byte_dump_long_placeholder, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use a placeholder character instead of a space for placeholders.");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
- fl_color_print_to(id, context.set.important, " Special Options: ");
+ fl_color_print(file.stream, context.set.important, " Special Options: ");
- fll_program_print_help_option_long(id, context, byte_dump_long_normal, f_console_symbol_long_enable, " Display UTF-8 symbols for ASCII control codes.");
- fll_program_print_help_option_long(id, context, byte_dump_long_simple, f_console_symbol_long_enable, " Display spaces for ASCII control codes.");
- fll_program_print_help_option_long(id, context, byte_dump_long_classic, f_console_symbol_long_enable, "Display periods for ASCII control codes.");
+ fll_program_print_help_option_long(file, context, byte_dump_long_normal, f_console_symbol_long_enable, " Display UTF-8 symbols for ASCII control codes.");
+ fll_program_print_help_option_long(file, context, byte_dump_long_simple, f_console_symbol_long_enable, " Display spaces for ASCII control codes.");
+ fll_program_print_help_option_long(file, context, byte_dump_long_classic, f_console_symbol_long_enable, "Display periods for ASCII control codes.");
- fll_program_print_help_usage(id, context, byte_dump_name, "filename(s)");
+ fll_program_print_help_usage(file, context, byte_dump_name, "filename(s)");
- dprintf(id, " When using the ");
- fl_color_print_to(id, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_text);
- dprintf(id, " option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.");
+ fprintf(file.stream, " When using the ");
+ fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_text);
+ fprintf(file.stream, " option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
- dprintf(id, " Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the ");
- fl_color_print_to(id, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder);
- dprintf(id, " option is used).");
+ fprintf(file.stream, " Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the ");
+ fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder);
+ fprintf(file.stream, " option is used).");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
- dprintf(id, " UTF-8 \"Combining\" characters might have a space appended to allow a proper display but this may cause copy and paste issues.");
+ fprintf(file.stream, " UTF-8 \"Combining\" characters might have a space appended to allow a proper display but this may cause copy and paste issues.");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
- dprintf(id, " When ");
- fl_color_print_to(id, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
- dprintf(id, " is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range.");
+ fprintf(file.stream, " When ");
+ fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fprintf(file.stream, " is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range.");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
return F_none;
}
status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context);
if (F_status_is_error(status)) {
- fll_error_parameter_print(data->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
byte_dump_delete_data(data);
return F_status_set_error(status);
status = f_console_parameter_prioritize_right(parameters, choices, &choice);
if (F_status_is_error(status)) {
+ fll_error_print(data->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
+
byte_dump_delete_data(data);
return status;
}
status = f_console_parameter_prioritize_right(parameters, choices, &choice);
if (F_status_is_error(status)) {
+ fll_error_print(data->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
+
byte_dump_delete_data(data);
return F_status_set_error(status);
}
if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[byte_dump_parameter_width].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
- fl_color_print_to(data->error.to, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
byte_dump_delete_data(data);
return F_status_set_error(status);
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
if (F_status_is_error(status) || number < 1 || number >= 0xfb) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
- fl_color_print_to(data->error.to, data->context.set.error, "' value can only be a number between ");
- fl_color_print_to(data->error.to, data->context.set.notable, "0");
- fl_color_print_to(data->error.to, data->context.set.error, " and ");
- fl_color_print_to(data->error.to, data->context.set.notable, "251");
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' value can only be a number between ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "0");
+ fl_color_print(data->error.to.stream, data->context.set.error, " and ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "251");
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
byte_dump_delete_data(data);
return F_status_set_error(status);
}
if (data->parameters[byte_dump_parameter_first].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
- fl_color_print_to(data->error.to, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
byte_dump_delete_data(data);
return F_status_set_error(status);
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
if (F_status_is_error(status) || number > f_number_t_size_unsigned) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
- fl_color_print_to(data->error.to, data->context.set.error, "' value can only be a number (inclusively) between ");
- fl_color_print_to(data->error.to, data->context.set.notable, "0");
- fl_color_print_to(data->error.to, data->context.set.error, " and ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%llu", f_number_t_size_unsigned);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' value can only be a number (inclusively) between ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "0");
+ fl_color_print(data->error.to.stream, data->context.set.error, " and ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%llu", f_number_t_size_unsigned);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
byte_dump_delete_data(data);
return F_status_set_error(status);
}
if (data->parameters[byte_dump_parameter_last].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
- fl_color_print_to(data->error.to, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
byte_dump_delete_data(data);
return F_status_set_error(status);
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
if (F_status_is_error(status) || number < 0 || number > f_number_t_size_unsigned) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
- fl_color_print_to(data->error.to, data->context.set.error, "' value can only be a number (inclusively) between ");
- fl_color_print_to(data->error.to, data->context.set.notable, "0");
- fl_color_print_to(data->error.to, data->context.set.error, " and ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%llu", f_number_t_size_unsigned);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' value can only be a number (inclusively) between ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "0");
+ fl_color_print(data->error.to.stream, data->context.set.error, " and ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%llu", f_number_t_size_unsigned);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
byte_dump_delete_data(data);
return F_status_set_error(status);
if (data->parameters[byte_dump_parameter_first].result == f_console_result_additional && data->parameters[byte_dump_parameter_last].result == f_console_result_additional) {
if (data->first > data->last) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
- fl_color_print_to(data->error.to, data->context.set.error, "' value cannot be greater than the parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
- fl_color_print_to(data->error.to, data->context.set.error, "' value.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' value cannot be greater than the parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' value.%c", f_string_eol[0]);
byte_dump_delete_data(data);
return F_status_set_error(status);
file.id = f_type_descriptor_input;
printf("%c", f_string_eol[0]);
- fl_color_print_to(data->output, data->context.set.title, "Piped Byte Dump: (in ");
+ fl_color_print(data->output.stream, data->context.set.title, "Piped Byte Dump: (in ");
if (data->mode == byte_dump_mode_hexidecimal) {
- fl_color_print_to(data->output, data->context.set.title, "Hexidecimal");
+ fl_color_print(data->output.stream, data->context.set.title, "Hexidecimal");
}
else if (data->mode == byte_dump_mode_duodecimal) {
- fl_color_print_to(data->output, data->context.set.title, "Duodecimal");
+ fl_color_print(data->output.stream, data->context.set.title, "Duodecimal");
}
else if (data->mode == byte_dump_mode_octal) {
- fl_color_print_to(data->output, data->context.set.title, "Octal");
+ fl_color_print(data->output.stream, data->context.set.title, "Octal");
}
else if (data->mode == byte_dump_mode_binary) {
- fl_color_print_to(data->output, data->context.set.title, "Binary");
+ fl_color_print(data->output.stream, data->context.set.title, "Binary");
}
else if (data->mode == byte_dump_mode_decimal) {
- fl_color_print_to(data->output, data->context.set.title, "Decimal");
+ fl_color_print(data->output.stream, data->context.set.title, "Decimal");
}
- fl_color_print_to(data->output, data->context.set.title, ")%c", f_string_eol[0]);
+ fl_color_print(data->output.stream, data->context.set.title, ")%c", f_string_eol[0]);
status = byte_dump_file(*data, "-", file);
if (F_status_is_error(status)) {
+ fll_error_print(data->error, F_status_set_fine(status), "byte_dump_file", F_true);
+
byte_dump_delete_data(data);
return status;
}
missing_files = status;
}
- fll_error_file_print(data->error, F_status_set_fine(status), "f_file_exists", F_true, arguments.argv[data->remaining.array[counter]], "find", fll_error_file_type_file);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_file_exists", F_true, arguments.argv[data->remaining.array[counter]], "find", fll_error_file_type_file);
}
} // for
}
}
- for (f_array_length_t counter = 0; counter < data->remaining.used; counter++) {
- f_file_t file = f_file_t_initialize;
+ f_file_t file = f_file_t_initialize;
+ for (f_array_length_t counter = 0; counter < data->remaining.used; counter++) {
status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file);
if (F_status_is_error(status)) {
- fll_error_file_print(data->error, F_status_set_fine(status), "f_file_open", F_true, arguments.argv[data->remaining.array[counter]], "open", fll_error_file_type_file);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_file_open", F_true, arguments.argv[data->remaining.array[counter]], "open", fll_error_file_type_file);
byte_dump_delete_data(data);
return status;
}
printf("%c", f_string_eol[0]);
- fl_color_print_to(data->output, data->context.set.title, "Byte Dump of: ");
- fl_color_print_to(data->output, data->context.set.notable, "%s", arguments.argv[data->remaining.array[counter]]);
- fl_color_print_to(data->output, data->context.set.title, " (in ");
+ fl_color_print(data->output.stream, data->context.set.title, "Byte Dump of: ");
+ fl_color_print(data->output.stream, data->context.set.notable, "%s", arguments.argv[data->remaining.array[counter]]);
+ fl_color_print(data->output.stream, data->context.set.title, " (in ");
if (data->mode == byte_dump_mode_hexidecimal) {
- fl_color_print_to(data->output, data->context.set.title, "Hexidecimal");
+ fl_color_print(data->output.stream, data->context.set.title, "Hexidecimal");
}
else if (data->mode == byte_dump_mode_duodecimal) {
- fl_color_print_to(data->output, data->context.set.title, "Duodecimal");
+ fl_color_print(data->output.stream, data->context.set.title, "Duodecimal");
}
else if (data->mode == byte_dump_mode_octal) {
- fl_color_print_to(data->output, data->context.set.title, "Octal");
+ fl_color_print(data->output.stream, data->context.set.title, "Octal");
}
else if (data->mode == byte_dump_mode_binary) {
- fl_color_print_to(data->output, data->context.set.title, "Binary");
+ fl_color_print(data->output.stream, data->context.set.title, "Binary");
}
else if (data->mode == byte_dump_mode_decimal) {
- fl_color_print_to(data->output, data->context.set.title, "Decimal");
+ fl_color_print(data->output.stream, data->context.set.title, "Decimal");
}
- fl_color_print_to(data->output, data->context.set.title, ")%c", f_string_eol[0]);
+ fl_color_print(data->output.stream, data->context.set.title, ")%c", f_string_eol[0]);
status = byte_dump_file(*data, arguments.argv[data->remaining.array[counter]], file);
f_file_close(&file.id);
if (F_status_is_error(status)) {
+ fll_error_file_print(data.error, F_status_set_fine(status), "byte_dump_file", F_true, arguments.argv[data->remaining.array[counter]], "open", fll_error_file_type_file);
+
byte_dump_delete_data(data);
return status;
}
}
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify one or more filenames.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify one or more filenames.%c", f_string_eol[0]);
status = F_status_set_error(F_parameter);
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
uint64_t first;
byte_dump_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
0, \
0, \
#endif // _di_byte_dump_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
- * @param id
- * The file descriptor to print to.
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_byte_dump_print_help_
- extern f_return_status byte_dump_print_help(const int id, const f_color_context_t context);
+ extern f_return_status byte_dump_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_byte_dump_print_help_
/**
data.process_pipe = F_true;
}
- f_status_t status = byte_dump_main(arguments, &data);
-
- if (F_status_is_error(status)) {
+ if (F_status_is_error(byte_dump_main(arguments, &data))) {
return 1;
}
while (cell.column < data.width) {
if (data.mode == byte_dump_mode_hexidecimal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_duodecimal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_octal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_binary) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_decimal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
cell.column++;
if (cell.column < data.width) {
if (data.mode == byte_dump_mode_hexidecimal && cell.column % 8 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_duodecimal && cell.column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_octal && cell.column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_binary && cell.column % 4 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_decimal && cell.column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
}
} // while
byte_dump_print_text(data, characters, invalid, &previous, &offset);
}
else {
- printf("%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
}
}
- printf("%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
// make sure to flush standard out to help prevent standard error from causing poblems.
fflush(f_type_output);
if (found_invalid_utf) {
- fl_color_print_to(data.error.to, data.context.set.error, "Invalid UTF-8 codes were detected for file '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", file_name);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
- printf("%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "Invalid UTF-8 codes were detected for file '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", file_name);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.");
+ fprintf(data.error.to.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
}
if (size < 0) {
// @todo: determine what the error from read() is and display it.
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: read() failed for '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", file_name);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
- printf("%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: read() failed for '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", file_name);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.");
+ fprintf(data.error.to.stream, "%c%x", f_string_eol[0], f_string_eol[0]);
+
status = F_status_set_error(F_failure);
}
}
if (!cell->column) {
- fl_color_print(f_type_output, data.context.set.notable, "%016X ", (uint64_t) cell->row);
+ fl_color_print(data.output.stream, data.context.set.notable, "%016X ", (uint64_t) cell->row);
if (*offset > 0) {
uint8_t offset_to_print = *offset;
// Pad the buffer with spaces to hide any skipped bytes (skipped via --first).
while (offset_to_print > 0 && cell->column < data.width) {
if (data.mode == byte_dump_mode_hexidecimal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_duodecimal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_octal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_binary) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_decimal) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
offset_to_print--;
if (cell->column < data.width) {
if (data.mode == byte_dump_mode_hexidecimal && cell->column % 8 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_duodecimal && cell->column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_octal && cell->column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_binary && cell->column % 4 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_decimal && cell->column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
}
}
if (cell->column < data.width) {
if (data.mode == byte_dump_mode_hexidecimal) {
if (invalid[character_current]) {
- fl_color_print(f_type_output, data.context.set.error, " %02x", (uint8_t) byte);
+ fl_color_print(data.output.stream, data.context.set.error, " %02x", (uint8_t) byte);
}
else {
- printf(" %02x", (uint8_t) byte);
+ fprintf(data.output.stream, " %02x", (uint8_t) byte);
}
}
else if (data.mode == byte_dump_mode_duodecimal) {
if (invalid[character_current]) {
- f_print_dynamic(f_type_output, data.context.error);
+ fprintf(data.output.stream, "%s", data.context.error);
}
- printf(" %01d", byte / 144);
+ fprintf(data.output.stream, " %01d", byte / 144);
uint8_t current = (byte % 144) / 12;
if (current == 11) {
- printf("b");
+ fprintf(data.output.stream, "b");
}
else if (current == 10) {
- printf("a");
+ fprintf(data.output.stream, "a");
}
else {
- printf("%01d", current);
+ fprintf(data.output.stream, "%01d", current);
}
current = (byte % 144) % 12;
if (current == 11) {
- printf("b");
+ fprintf(data.output.stream, "b");
}
else if (current == 10) {
- printf("a");
+ fprintf(data.output.stream, "a");
}
else {
- printf("%01d", current);
+ fprintf(data.output.stream, "%01d", current);
}
if (invalid[character_current]) {
- f_print_dynamic(f_type_output, data.context.reset);
+ fprintf(data.output.stream, "%s", data.context.reset);
}
}
else if (data.mode == byte_dump_mode_octal) {
if (invalid[character_current]) {
- fl_color_print(f_type_output, data.context.set.error, " %03o", (uint8_t) byte);
+ fl_color_print(data.output.stream, data.context.set.error, " %03o", (uint8_t) byte);
}
else {
- printf(" %03o", (uint8_t) byte);
+ fprintf(data.output.stream, " %03o", (uint8_t) byte);
}
}
else if (data.mode == byte_dump_mode_binary) {
binary_string[7] = (byte & 0x01) ? '1' : '0';
if (invalid[character_current]) {
- fl_color_print(f_type_output, data.context.set.error, " %s", binary_string);
+ fl_color_print(data.output.stream, data.context.set.error, " %s", binary_string);
}
else {
- printf(" %s", binary_string);
+ fprintf(data.output.stream, " %s", binary_string);
}
}
else if (data.mode == byte_dump_mode_decimal) {
if (invalid[character_current]) {
- fl_color_print(f_type_output, data.context.set.error, " %3d", (uint8_t) byte);
+ fl_color_print(data.output.stream, data.context.set.error, " %3d", (uint8_t) byte);
}
else {
- printf(" %3d", (uint8_t) byte);
+ fprintf(data.output.stream, " %3d", (uint8_t) byte);
}
}
byte_dump_print_text(data, characters, invalid, previous, offset);
}
else {
- printf("%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
}
cell->column = 0;
}
}
else if (data.mode == byte_dump_mode_hexidecimal && cell->column % 8 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_duodecimal && cell->column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_octal && cell->column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_binary && cell->column % 4 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.mode == byte_dump_mode_decimal && cell->column % 6 == 0) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
return reset;
uint8_t width_utf = 0;
bool printed = F_false;
- fl_color_print(f_type_output, data.context.set.notable, " %s ", byte_dump_character_wall);
+ fl_color_print(data.output.stream, data.context.set.notable, " %s ", byte_dump_character_wall);
if (*offset > 0) {
if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
while (*offset > 0 && j < data.width) {
- printf(".");
+ fprintf(data.output.stream, ".");
(*offset)--;
j++;
} // while
}
else {
- f_string_t placeholder = " ";
+ const char *placeholder = " ";
if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
placeholder = byte_dump_character_placeholder;
}
while (*offset > 0 && j < data.width) {
- fl_color_print(f_type_output, data.context.set.warning, "%s", placeholder);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", placeholder);
(*offset)--;
j++;
} // while
for (; j < previous->bytes && j < data.width; j++) {
if (previous->invalid) {
- fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.error, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
else {
- fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", byte_dump_character_placeholder);
}
} // for
}
else {
for (; j < previous->bytes && j < data.width; j++) {
- printf(" ");
+ fprintf(data.output.stream, " ");
} // for
}
}
width_utf = f_macro_utf_byte_width_is(output);
if (invalid[i]) {
- fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_incomplete);
+ fl_color_print(data.output.stream, data.context.set.error, "%s", byte_dump_character_incomplete);
}
else if (output >= 0 && output <= 32 || output == 127) {
if (data.presentation == byte_dump_presentation_normal) {
if (!output) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_null);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_null);
}
else if (output == 1) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_start_of_header);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_start_of_header);
}
else if (output == 2) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_start_of_text);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_start_of_text);
}
else if (output == 3) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_text);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_text);
}
else if (output == 4) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_transmission);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_transmission);
}
else if (output == 5) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_enquiry);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_enquiry);
}
else if (output == 6) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_acknowledge);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_acknowledge);
}
else if (output == 7) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_bell);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_bell);
}
else if (output == 8) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_backspace);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_backspace);
}
else if (output == 9) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_tab);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_tab);
}
else if (output == 10) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_new_line);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_new_line);
}
else if (output == 11) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_tab_vertical);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_tab_vertical);
}
else if (output == 12) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_form_feed);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_form_feed);
}
else if (output == 13) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_carriage_return);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_carriage_return);
}
else if (output == 14) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_shift_out);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_shift_out);
}
else if (output == 15) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_shift_in);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_shift_in);
}
else if (output == 16) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_data_link_escape);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_data_link_escape);
}
else if (output == 17) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_1);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_1);
}
else if (output == 18) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_2);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_2);
}
else if (output == 19) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_3);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_3);
}
else if (output == 20) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_4);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_device_control_4);
}
else if (output == 21) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_negative_acknowledge);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_negative_acknowledge);
}
else if (output == 22) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_synchronous_idle);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_synchronous_idle);
}
else if (output == 23) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_transmission_block);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_transmission_block);
}
else if (output == 24) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_cancel);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_cancel);
}
else if (output == 25) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_medium);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_end_of_medium);
}
else if (output == 26) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_substitute);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_substitute);
}
else if (output == 27) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_escape);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_escape);
}
else if (output == 28) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_file_separator);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_file_separator);
}
else if (output == 29) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_group_separator);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_group_separator);
}
else if (output == 30) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_record_separator);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_record_separator);
}
else if (output == 31) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_unit_separator);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_unit_separator);
}
else if (output == 32) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_space);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_space);
}
else if (output == 127) {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_delete);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_delete);
}
}
else if (data.presentation == byte_dump_presentation_simple) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (data.presentation == byte_dump_presentation_classic) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
}
else if (f_utf_character_is_whitespace(characters.string[i]) == F_true) {
if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
else {
- fl_color_print2(f_type_output, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_space);
+ fl_color_print2(data.output.stream, data.context.set.notable, data.context.set.warning, "%s", byte_dump_sequence_space);
}
}
else if (f_utf_character_is_zero_width(characters.string[i]) == F_true) {
if (data.presentation == byte_dump_presentation_classic) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
else if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
- fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", byte_dump_character_placeholder);
}
else {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
}
else if (f_utf_character_is_control(characters.string[i]) == F_true) {
// print a space (or '.') for control characters.
if (data.presentation == byte_dump_presentation_classic) {
- fl_color_print(f_type_output, data.context.set.warning, ".");
+ fl_color_print(data.output.stream, data.context.set.warning, ".");
}
else {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
}
else if (width_utf == 2 && characters.string[i] == 0xd89d0000) {
// U+061C
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 3 && characters.string[i] >= 0xefbfb000 && characters.string[i] <= 0xefbfbc00) {
// Use space to represent Specials codes.
// 0xefbfbd00 is excluded because it is printable (and is the "Replacement Character" code).
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 3 && characters.string[i] >= 0xe290a700 && characters.string[i] <= 0xe290bf00) {
// Use space to represent Control Pictues codes that are not currently defined but are reserved.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 3 && characters.string[i] >= 0xee808000 && characters.string[i] <= 0xefa3bf00) {
// Use space to represent Private Use Area codes.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 4 && characters.string[i] >= 0xf09c80a0 && characters.string[i] <= 0xf09c80bd) {
// Use space to represent Vaiation Selectors Supplement codes.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 4 && characters.string[i] >= 0xf3b08080 && characters.string[i] <= 0xf3bfbfbf) {
// Use space to represent Supplemental Private Use Area-A codes.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 4 && characters.string[i] >= 0xf4808080 && characters.string[i] <= 0xf48fbfbf) {
// Use space to represent Supplemental Private Use Area-B codes.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 1) {
// print invalid placeholder for invalid UTF-8 widths.
if (invalid[i]) {
- fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_incomplete);
+ fl_color_print(data.output.stream, data.context.set.error, "%s", byte_dump_character_incomplete);
}
else {
- fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_incomplete);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", byte_dump_character_incomplete);
}
}
else if (width_utf > 0) {
- printf("%c", (uint8_t) output);
+ fprintf(data.output.stream, "%c", (uint8_t) output);
if (width_utf > 1) {
output = f_macro_utf_character_t_to_char_2(characters.string[i]);
- printf("%c", (uint8_t) output);
+ fprintf(data.output.stream, "%c", (uint8_t) output);
if (width_utf > 2) {
output = f_macro_utf_character_t_to_char_3(characters.string[i]);
- printf("%c", (uint8_t) output);
+ fprintf(data.output.stream, "%c", (uint8_t) output);
if (width_utf > 3) {
output = f_macro_utf_character_t_to_char_4(characters.string[i]);
- printf("%c", (uint8_t) output);
+ fprintf(data.output.stream, "%c", (uint8_t) output);
}
}
}
// print a space for combining characters to combine into, thereby allowing it to be safely and readably displayed.
if (width_utf == 2 && characters.string[i] >= 0xdea60000 && characters.string[i] <= 0xdeb00000) {
// Thana combining codes: U+07A6 to U+07B0.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 2 && characters.string[i] >= 0xcc800000 && characters.string[i] <= 0xcdaf0000) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 3 && characters.string[i] >= 0xe1aab000 && characters.string[i] <= 0xe1abbf00) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 3 && characters.string[i] >= 0xe1b78000 && characters.string[i] <= 0xe1b7bf00) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 3 && characters.string[i] >= 0xe2839000 && characters.string[i] <= 0xe283bf00) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 2 && characters.string[i] >= 0xd8900000 && characters.string[i] <= 0xd89a0000) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 2 && characters.string[i] >= 0xd98b0000 && characters.string[i] <= 0xd99f0000) {
// Arabic, U+064B to U+065F.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 2 && characters.string[i] >= 0xdb960000 && characters.string[i] <= 0xdb9c0000) {
// Arabic, U+06D6 to U+06DC.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
else if (width_utf == 2 && characters.string[i] >= 0xd6910000 && characters.string[i] <= 0xd6bd0000) {
// Hebrew, U+0591 to U+05BD.
- printf(" ");
+ fprintf(data.output.stream, " ");
}
}
else {
- printf("%c", output);
+ fprintf(data.output.stream, "%c", output);
}
// When using UTF-8 characters, the character columns will not line up, so print placeholders to simulate the bytes that are not printed, if necessary for alignment.
if (width_utf > 1 && j + 1 < data.width) {
if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
if (invalid[i]) {
- fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.error, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
else {
- fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", byte_dump_character_placeholder);
}
}
else {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
j++;
if (width_utf > 2 && j + 1 < data.width) {
if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
if (invalid[i]) {
- fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.error, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
else {
- fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", byte_dump_character_placeholder);
}
}
else {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
j++;
if (width_utf > 3 && j + 1 < data.width) {
if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
if (invalid[i]) {
- fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.error, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
else {
- fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", byte_dump_character_placeholder);
}
}
else {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
j++;
// Print placeholder for the remaining parts of the line.
if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
for (; j < data.width; j++) {
+
if (invalid[j]) {
- fl_color_print(f_type_output, data.context.set.error, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.error, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
- printf(".");
+ fprintf(data.output.stream, ".");
}
else {
- fl_color_print(f_type_output, data.context.set.warning, "%s", byte_dump_character_placeholder);
+ fl_color_print(data.output.stream, data.context.set.warning, "%s", byte_dump_character_placeholder);
}
} // for
}
else {
for (; j < data.width; j++) {
- printf(" ");
+ fprintf(data.output.stream, " ");
} // for
}
- fl_color_print(f_type_output, data.context.set.notable, " |");
- printf("%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.notable, " |");
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
}
#endif // _di_byte_dump_file_
#endif
#ifndef _di_fake_print_help_
- f_return_status fake_print_help(const int id, const f_color_context_t context) {
+ f_return_status fake_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fake_name_long, fake_version);
+ fll_program_print_help_header(file, context, fake_name_long, fake_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
- dprintf(id, "%c", f_string_eol[0]);
+ fprintf(file.stream, "%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fake_short_define, fake_long_define, f_console_symbol_short_enable, f_console_symbol_long_enable, " Override defines from settings file with this define.");
- fll_program_print_help_option(id, context, fake_short_fakefile, fake_long_fakefile, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this fakefile.");
- fll_program_print_help_option(id, context, fake_short_mode, fake_long_mode, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use this mode when processing the build settings.");
- fll_program_print_help_option(id, context, fake_short_process, fake_long_process, f_console_symbol_short_enable, f_console_symbol_long_enable, " Process name for storing build states.");
- fll_program_print_help_option(id, context, fake_short_settings, fake_long_settings, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this settings file.");
+ fll_program_print_help_option(file, context, fake_short_define, fake_long_define, f_console_symbol_short_enable, f_console_symbol_long_enable, " Override defines from settings file with this define.");
+ fll_program_print_help_option(file, context, fake_short_fakefile, fake_long_fakefile, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this fakefile.");
+ fll_program_print_help_option(file, context, fake_short_mode, fake_long_mode, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use this mode when processing the build settings.");
+ fll_program_print_help_option(file, context, fake_short_process, fake_long_process, f_console_symbol_short_enable, f_console_symbol_long_enable, " Process name for storing build states.");
+ fll_program_print_help_option(file, context, fake_short_settings, fake_long_settings, f_console_symbol_short_enable, f_console_symbol_long_enable, "Use this settings file.");
- dprintf(id, "%c", f_string_eol[0]);
+ fprintf(file.stream, "%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fake_short_path_build, fake_long_path_build, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom build directory.");
- fll_program_print_help_option(id, context, fake_short_path_data, fake_long_path_data, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom path to the data files.");
- fll_program_print_help_option(id, context, fake_short_path_sources, fake_long_path_sources, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom path to the source files.");
- fll_program_print_help_option(id, context, fake_short_path_work, fake_long_path_work, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use includes/libraries/programs from this directory instead of system.");
+ fll_program_print_help_option(file, context, fake_short_path_build, fake_long_path_build, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom build directory.");
+ fll_program_print_help_option(file, context, fake_short_path_data, fake_long_path_data, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom path to the data files.");
+ fll_program_print_help_option(file, context, fake_short_path_sources, fake_long_path_sources, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom path to the source files.");
+ fll_program_print_help_option(file, context, fake_short_path_work, fake_long_path_work, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use includes/libraries/programs from this directory instead of system.");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
- fl_color_print_to(id, context.set.important, " Special Options: ");
+ fl_color_print(file.stream, context.set.important, " Special Options: ");
- fll_program_print_help_option_long(id, context, fake_long_documents_disabled, f_console_symbol_long_enable, " Forcibly do not build documents files.");
- fll_program_print_help_option_long(id, context, fake_long_documents_enabled, f_console_symbol_long_enable, " Forcibly do build documents files.");
- fll_program_print_help_option_long(id, context, fake_long_shared_disabled, f_console_symbol_long_enable, "Forcibly do not build shared files.");
- fll_program_print_help_option_long(id, context, fake_long_shared_enabled, f_console_symbol_long_enable, " Forcibly do build shared files.");
- fll_program_print_help_option_long(id, context, fake_long_static_disabled, f_console_symbol_long_enable, "Forcibly do not build static files.");
- fll_program_print_help_option_long(id, context, fake_long_static_enabled, f_console_symbol_long_enable, " Forcibly do build static files.");
+ fll_program_print_help_option_long(file, context, fake_long_documents_disabled, f_console_symbol_long_enable, " Forcibly do not build documents files.");
+ fll_program_print_help_option_long(file, context, fake_long_documents_enabled, f_console_symbol_long_enable, " Forcibly do build documents files.");
+ fll_program_print_help_option_long(file, context, fake_long_shared_disabled, f_console_symbol_long_enable, "Forcibly do not build shared files.");
+ fll_program_print_help_option_long(file, context, fake_long_shared_enabled, f_console_symbol_long_enable, " Forcibly do build shared files.");
+ fll_program_print_help_option_long(file, context, fake_long_static_disabled, f_console_symbol_long_enable, "Forcibly do not build static files.");
+ fll_program_print_help_option_long(file, context, fake_long_static_enabled, f_console_symbol_long_enable, " Forcibly do build static files.");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
- fl_color_print_to(id, context.set.important, " Operations: ");
+ fl_color_print(file.stream, context.set.important, " Operations: ");
- fll_program_print_help_option_other(id, context, fake_other_operation_build, " Build or compile the code based on build settings file.");
- fll_program_print_help_option_other(id, context, fake_other_operation_clean, " Delete all build files.");
- fll_program_print_help_option_other(id, context, fake_other_operation_make, " Build or compile the code based on fakefile.");
- fll_program_print_help_option_other(id, context, fake_other_operation_skeleton, "Build a skeleton directory structure.");
+ fll_program_print_help_option_other(file, context, fake_other_operation_build, " Build or compile the code based on build settings file.");
+ fll_program_print_help_option_other(file, context, fake_other_operation_clean, " Delete all build files.");
+ fll_program_print_help_option_other(file, context, fake_other_operation_make, " Build or compile the code based on fakefile.");
+ fll_program_print_help_option_other(file, context, fake_other_operation_skeleton, "Build a skeleton directory structure.");
- fll_program_print_help_usage(id, context, fake_name, "operation");
+ fll_program_print_help_usage(file, context, fake_name, "operation");
- dprintf(id, " When performing the ");
- fl_color_print_to(id, context.set.notable, "%s", fake_other_operation_build);
- dprintf(id, " operation, the ");
- fl_color_print_to(id, context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
- dprintf(id, " parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.");
- dprintf(id, "%c", f_string_eol[0]);
+ fprintf(file.stream, " When performing the ");
+ fl_color_print(file.stream, context.set.notable, "%s", fake_other_operation_build);
+ fprintf(file.stream, " operation, the ");
+ fl_color_print(file.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fprintf(file.stream, " parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.");
+ fprintf(file.stream, "%c", f_string_eol[0]);
- dprintf(id, " For example, when a ");
- fl_color_print_to(id, context.set.notable, "%s", fake_long_mode);
- dprintf(id, " of 'fll_monolithic' is specified, build libaries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level').");
+ fprintf(file.stream, " For example, when a ");
+ fl_color_print(file.stream, context.set.notable, "%s", fake_long_mode);
+ fprintf(file.stream, " of 'fll_monolithic' is specified, build libaries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level').");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
- dprintf(id, " When specifying the ");
- fl_color_print_to(id, context.set.notable, "%s", fake_long_fakefile);
- dprintf(id, " or the ");
- fl_color_print_to(id, context.set.notable, "%s", fake_long_settings);
- dprintf(id, " parameters, the filenames are relative to the data build directory, unless a path is used.");
- dprintf(id, "%c", f_string_eol[0]);
+ fprintf(file.stream, " When specifying the ");
+ fl_color_print(file.stream, context.set.notable, "%s", fake_long_fakefile);
+ fprintf(file.stream, " or the ");
+ fl_color_print(file.stream, context.set.notable, "%s", fake_long_settings);
+ fprintf(file.stream, " parameters, the filenames are relative to the data build directory, unless a path is used.");
+ fprintf(file.stream, "%c", f_string_eol[0]);
- dprintf(id, " For example, with '");
- fl_color_print_to(id, context.set.notable, "%s%s my_fakefile", f_console_symbol_long_enable, fake_long_fakefile);
- dprintf(id, "' the fakefile at '");
- fl_color_print_to(id, context.set.notable, "./%s%smy_fakefile", fake_default_path_data, fake_default_path_build);
- dprintf(id, " would be used, however with '");
- fl_color_print_to(id, context.set.notable, "%s%s ./my_fakefile", f_console_symbol_long_enable, fake_long_fakefile);
- dprintf(id, "' the fakefile at '");
- fl_color_print_to(id, context.set.notable, "./my_fakefile", fake_default_path_data, fake_default_path_build);
- dprintf(id, " would be used.");
+ fprintf(file.stream, " For example, with '");
+ fl_color_print(file.stream, context.set.notable, "%s%s my_fakefile", f_console_symbol_long_enable, fake_long_fakefile);
+ fprintf(file.stream, "' the fakefile at '");
+ fl_color_print(file.stream, context.set.notable, "./%s%smy_fakefile", fake_default_path_data, fake_default_path_build);
+ fprintf(file.stream, " would be used, however with '");
+ fl_color_print(file.stream, context.set.notable, "%s%s ./my_fakefile", f_console_symbol_long_enable, fake_long_fakefile);
+ fprintf(file.stream, "' the fakefile at '");
+ fl_color_print(file.stream, context.set.notable, "./my_fakefile", fake_default_path_data, fake_default_path_build);
+ fprintf(file.stream, " would be used.");
- dprintf(id, "%c%c", f_string_eol[0], f_string_eol[0]);
+ fprintf(file.stream, "%c%c", f_string_eol[0], f_string_eol[0]);
return F_none;
}
status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context);
if (F_status_is_error(status)) {
- fake_print_error(*data, F_status_set_fine(status), "fll_program_parameter_process", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "fll_program_parameter_process", F_true);
+
fake_delete_data(data);
return status;
}
status = f_console_parameter_prioritize_right(parameters, choices, &choice);
if (F_status_is_error(status)) {
- fake_print_error(*data, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "f_console_parameter_prioritize_right", F_true);
+
fake_delete_data(data);
return status;
}
}
else if (F_status_is_error(status)) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The operation '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", operations_name);
- fl_color_print_to(data->error.to, data->context.set.error, "' failed.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The operation '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", operations_name);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' failed.%c", f_string_eol[0]);
}
break;
// ensure a newline is always put at the end of the program execution, unless in quiet mode.
if (data->error.verbosity != f_console_verbosity_quiet) {
if (F_status_is_error(status) || status == F_signal) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
}
else {
- dprintf(data->output, "%cAll operations complete.%c%c", f_string_eol[0], f_string_eol[0], f_string_eol[0]);
+ fprintf(data->output.stream, "%cAll operations complete.%c%c", f_string_eol[0], f_string_eol[0], f_string_eol[0]);
}
}
}
else {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify an operation.%c", f_string_eol[0]);
- dprintf(data->error.to, "%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify an operation.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
uint8_t operation;
fake_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
0, \
0, \
#endif // _di_fake_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fake_print_help_
- extern f_return_status fake_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fake_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fake_print_help_
/**
f_string_dynamic_t destination_file = f_string_dynamic_t_initialize;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Copying %s.%c", label, f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Copying %s.%c", label, f_string_eol[0]);
}
f_macro_string_dynamic_t_new(*status, path_source, source.used);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamic_t_new", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "f_macro_string_dynamic_t_new", F_true);
f_macro_string_dynamic_t_delete_simple(path_source);
return;
*status = fl_string_dynamic_append_nulless(files.array[i], &path_source);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(&path_source);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
} // for
if (F_status_set_fine(*status) != F_failure) {
- fake_print_error(data, F_status_set_fine(*status), "fl_directory_copy_content", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_directory_copy_content", F_true);
}
break;
*status = fl_string_dynamic_append_nulless(destination, &destination_file);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
*status = f_file_name_base(path_source.string, path_source.used, &destination_file);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_file_name_base", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "f_file_name_base", F_true);
break;
}
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Copied file '%s' to '%s'.%c", path_source.string, destination_file.string, f_string_eol[0]);
+ fprintf(data.output.stream, "Copied file '%s' to '%s'.%c", path_source.string, destination_file.string, f_string_eol[0]);
}
}
else if (F_status_is_error(*status)) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_directory_is", path_source.string, "create", F_false, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_directory_is", F_true, path_source.string, "create", fll_error_file_type_file);
break;
}
};
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Creating base build directories.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Creating base build directories.%c", f_string_eol[0]);
}
for (uint8_t i = 0; i < 15; i++) {
continue;
}
- fake_print_error_file(data, F_status_set_fine(*status), "f_directory_create", directorys[i]->string, "create", F_false, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_directory_create", F_true, directorys[i]->string, "create", fll_error_file_type_directory);
return;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Created directory '%s'.%c", directorys[i]->string, f_string_eol[0]);
+ fprintf(data.output.stream, "Created directory '%s'.%c", directorys[i]->string, f_string_eol[0]);
}
} // for
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_macro_string_dynamics_t_delete_simple(arguments);
return;
} // for
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_mash", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_mash", F_true);
f_macro_string_dynamic_t_delete_simple(defines);
f_macro_string_dynamics_t_delete_simple(arguments);
*status = fl_string_dynamic_terminate_after(&defines);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
f_macro_string_dynamic_t_delete_simple(defines);
f_macro_string_dynamics_t_delete_simple(arguments);
f_macro_string_dynamic_t_delete_simple(defines);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add_parameter_set", F_true);
f_macro_string_dynamics_t_delete_simple(arguments);
return;
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), function, F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), function, F_true);
f_macro_string_dynamic_t_delete_simple(path);
f_macro_string_dynamics_t_delete_simple(arguments);
if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_failure) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to execute script: ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path.string);
- fl_color_print_to(data.error.to, data.context.set.error, ".%c", f_string_eol[0]);
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: Failed to execute script: ");
+ fl_color_print(data.error, data.context.set.notable, "%s", path.string);
+ fl_color_print(data.error, data.context.set.error, ".%c", f_string_eol[0]);
}
}
else {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_path_environment", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_path_environment", F_true);
}
}
else {
f_status_t status = f_file_name_base(path.string, path.used, name);
if (F_status_is_error(status)) {
- fake_print_error(data, F_status_set_fine(status), "f_file_name_base", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "f_file_name_base", F_true);
return status;
}
status = fl_string_dynamic_terminate_after(name);
if (F_status_is_error(status)) {
- fake_print_error(data, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true);
return status;
}
if (!data_build.setting.build_sources_library.used) return;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Compiling shared library.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Compiling shared library.%c", f_string_eol[0]);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
} // for
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_macro_string_dynamics_t_delete_simple(arguments);
return;
fake_build_arguments_standard_add(data, data_build, F_true, F_true, &arguments, status);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_macro_string_dynamics_t_delete_simple(arguments);
return;
*status = f_file_link(parameter_file_name_micro, parameter_file_path);
if (F_status_is_error_not(*status) && data.error.verbosity == f_console_verbosity_verbose) {
- printf("Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_micro, f_string_eol[0]);
+ fprintf(data.output.stream, "Linked file '%s' to '%s'.%c", parameter_file_path, parameter_file_name_micro, f_string_eol[0]);
}
else if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_file_link", parameter_file_path, "link", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, "link", fll_error_file_type_file);
return;
}
- fake_print_error_file(data, F_status_set_fine(*status), "f_file_link", parameter_file_name_micro, "link", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, "link", fll_error_file_type_file);
return;
}
}
}
if (F_status_is_error_not(*status) && data.error.verbosity == f_console_verbosity_verbose) {
- printf("Linked file '%s' to '", parameter_file_path);
+ fprintf(data.output.stream, "Linked file '%s' to '", parameter_file_path);
if (data_build.setting.version_target == fake_build_version_type_major) {
- printf("%s", parameter_file_name_major);
+ fprintf(data.output.stream, "%s", parameter_file_name_major);
}
else if (data_build.setting.version_target == fake_build_version_type_minor) {
- printf("%s", parameter_file_name_minor);
+ fprintf(data.output.stream, "%s", parameter_file_name_minor);
}
else if (data_build.setting.version_target == fake_build_version_type_micro) {
- printf("%s", parameter_file_name_micro);
+ fprintf(data.output.stream, "%s", parameter_file_name_micro);
}
- printf("'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "'.%c", f_string_eol[0]);
}
else if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_file_link", parameter_file_path, "link", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_path, "link", fll_error_file_type_file);
return;
}
if (data_build.setting.version_target == fake_build_version_type_major) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_file_link", parameter_file_name_major, "link", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_major, "link", fll_error_file_type_file);
}
else if (data_build.setting.version_target == fake_build_version_type_minor) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_file_link", parameter_file_name_minor, "link", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_minor, "link", fll_error_file_type_file);
}
else if (data_build.setting.version_target == fake_build_version_type_micro) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_file_link", parameter_file_name_micro, "link", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_file_link", F_true, parameter_file_name_micro, "link", fll_error_file_type_file);
}
return;
if (!data_build.setting.build_sources_library.used) return;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Compiling static library.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Compiling static library.%c", f_string_eol[0]);
}
f_string_dynamic_t file_name = f_string_dynamic_t_initialize;
*status = fake_build_get_file_name_without_extension(data, data_build.setting.build_sources_library.array[i], &file_name);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
break;
}
*status = f_file_name_directory(data_build.setting.build_sources_library.array[i].string, data_build.setting.build_sources_library.array[i].used, &source_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_file_name_directory", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
break;
}
*status = fl_string_dynamic_prepend(data.path_build_objects, &source_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true);
break;
}
*status = fl_string_append_assure(f_path_separator, f_path_separator_length, &source_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append_assure", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append_assure", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(&source_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
*status = fll_execute_arguments_add(source, source_length, &arguments);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
break;
}
} // for
f_macro_string_dynamics_new(*status, names, 2);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamics_new", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "f_macro_string_dynamics_new", F_true);
f_macro_string_dynamics_t_delete_simple(names);
return;
if (names.used + data_build.setting.environment.used > names.size) {
if (names.used + data_build.setting.environment.used > f_array_length_t_size) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The values for the setting '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", fake_build_setting_name_environment);
- fl_color_print_to(data.error.to, data.context.set.error, "' of setting file '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", data.file_data_build_settings.string);
- fl_color_print_to(data.error.to, data.context.set.error, "' is too large.%c", f_string_eol[0]);
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: The values for the setting '");
+ fl_color_print(data.error, data.context.set.notable, "%s", fake_build_setting_name_environment);
+ fl_color_print(data.error, data.context.set.error, "' of setting file '");
+ fl_color_print(data.error, data.context.set.notable, "%s", data.file_data_build_settings.string);
+ fl_color_print(data.error, data.context.set.error, "' is too large.%c", f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(part);
f_macro_string_dynamics_resize(*status, names, names.used + data_build.setting.environment.used);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamics_resize", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "f_macro_string_dynamics_resize", F_true);
f_macro_string_dynamic_t_delete_simple(part);
f_macro_string_dynamics_t_delete_simple(names);
f_macro_string_dynamic_t_delete_simple(part);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append", F_true);
f_macro_string_dynamics_t_delete_simple(names);
return;
f_macro_string_dynamic_t_delete_simple(variable_value);
if (F_status_is_error(*status) && F_status_set_fine(*status) != F_signal) {
- fake_print_error(data, *status, function, F_true);
+ fll_error_print(data->error, *status, function, F_true);
}
}
#endif // _di_fake_build_load_environment_
for (uint8_t i = 0; i < 1; i++) {
if (!settings[i]->used) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The setting '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", names[i]);
- fl_color_print_to(data.error.to, data.context.set.error, "' is required but is not specified in the settings file '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", setting_file.used ? path_file : data.file_data_build_settings.string);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: The setting '");
+ fl_color_print(data.error, data.context.set.notable, "%s", names[i]);
+ fl_color_print(data.error, data.context.set.error, "' is required but is not specified in the settings file '");
+ fl_color_print(data.error, data.context.set.notable, "%s", setting_file.used ? path_file : data.file_data_build_settings.string);
+ fl_color_print(data.error, data.context.set.error, "'.%c", f_string_eol[0]);
failed = F_true;
}
if (found == F_false) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The specified mode '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", modes->array[i].string);
- fl_color_print_to(data.error.to, data.context.set.error, "' is not a valid mode, according to '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: The specified mode '");
+ fl_color_print(data.error, data.context.set.notable, "%s", modes->array[i].string);
+ fl_color_print(data.error, data.context.set.error, "' is not a valid mode, according to '");
+ fl_color_print(data.error, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.error, data.context.set.error, "'.%c", f_string_eol[0]);
}
error_printed = F_true;
if (*status == F_status_set_error(F_string_too_large)) {
if (data.error.verbosity != f_console_verbosity_quiet) {
// @todo update FSS functions to return which setting index the problem happened on.
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: A setting in the build setting file '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.error.to, data.context.set.error, "' is too long.%c", f_string_eol[0]);
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: A setting in the build setting file '");
+ fl_color_print(data.error, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.error, data.context.set.error, "' is too long.%c", f_string_eol[0]);
}
}
else if (!error_printed) {
- fake_print_error(data, F_status_set_fine(*status), function, F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), function, F_true);
}
}
else if (!fake_signal_received(data)) {
if (settings_single_source[i]->used > 1) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: the setting '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", settings_single_name[i]);
- fl_color_print_to(data.output, data.context.set.warning, "' in the file '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.output, data.context.set.warning, "' may only have a single property, only using the first: '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", settings_single_source[i]->array[0].string);
- fl_color_print_to(data.output, data.context.set.warning, "'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: the setting '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]);
+ fl_color_print(data.output.stream, data.context.set.warning, "' in the file '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.output.stream, data.context.set.warning, "' may only have a single property, only using the first: '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_source[i]->array[0].string);
+ fl_color_print(data.output.stream, data.context.set.warning, "'.%c", f_string_eol[0]);
}
}
*settings_single_bool[i] = F_true;
if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: the setting '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", settings_single_name[i]);
- fl_color_print_to(data.output, data.context.set.warning, "' in the file '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.output, data.context.set.warning, "' may be either '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_common_setting_bool_yes);
- fl_color_print_to(data.output, data.context.set.warning, "' or '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_common_setting_bool_no);
- fl_color_print_to(data.output, data.context.set.warning, "', defaulting to '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_common_setting_bool_yes);
- fl_color_print_to(data.output, data.context.set.warning, "'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: the setting '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]);
+ fl_color_print(data.output.stream, data.context.set.warning, "' in the file '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.output.stream, data.context.set.warning, "' may be either '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_common_setting_bool_yes);
+ fl_color_print(data.output.stream, data.context.set.warning, "' or '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_common_setting_bool_no);
+ fl_color_print(data.output.stream, data.context.set.warning, "', defaulting to '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_common_setting_bool_yes);
+ fl_color_print(data.output.stream, data.context.set.warning, "'.%c", f_string_eol[0]);
}
}
}
*settings_single_language[i] = fake_build_language_type_c;
if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: the setting '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", settings_single_name[i]);
- fl_color_print_to(data.output, data.context.set.warning, "' in the file '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.output, data.context.set.warning, "' may only be one of '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_language_bash);
- fl_color_print_to(data.output, data.context.set.warning, "', '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_language_c);
- fl_color_print_to(data.output, data.context.set.warning, "', or '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_language_cpp);
- fl_color_print_to(data.output, data.context.set.warning, "', defaulting to '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_language_c);
- fl_color_print_to(data.output, data.context.set.warning, "'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: the setting '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]);
+ fl_color_print(data.output.stream, data.context.set.warning, "' in the file '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.output.stream, data.context.set.warning, "' may only be one of '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_language_bash);
+ fl_color_print(data.output.stream, data.context.set.warning, "', '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_language_c);
+ fl_color_print(data.output.stream, data.context.set.warning, "', or '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_language_cpp);
+ fl_color_print(data.output.stream, data.context.set.warning, "', defaulting to '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_language_c);
+ fl_color_print(data.output.stream, data.context.set.warning, "'.%c", f_string_eol[0]);
}
}
}
*settings_single_version[i] = fake_build_version_type_major;
if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: the setting '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", settings_single_name[i]);
- fl_color_print_to(data.output, data.context.set.warning, "' in the file '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.output, data.context.set.warning, "' may only be one of '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_version_major);
- fl_color_print_to(data.output, data.context.set.warning, "', '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_version_minor);
- fl_color_print_to(data.output, data.context.set.warning, "', or '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_version_micro);
- fl_color_print_to(data.output, data.context.set.warning, "', defaulting to '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", fake_build_version_major);
- fl_color_print_to(data.output, data.context.set.warning, "'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: the setting '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_single_name[i]);
+ fl_color_print(data.output.stream, data.context.set.warning, "' in the file '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.output.stream, data.context.set.warning, "' may only be one of '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_version_major);
+ fl_color_print(data.output.stream, data.context.set.warning, "', '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_version_minor);
+ fl_color_print(data.output.stream, data.context.set.warning, "', or '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_version_micro);
+ fl_color_print(data.output.stream, data.context.set.warning, "', defaulting to '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", fake_build_version_major);
+ fl_color_print(data.output.stream, data.context.set.warning, "'.%c", f_string_eol[0]);
}
}
}
*status = fl_string_dynamic_append_nulless(settings_single_source[i]->array[0], settings_single_destination[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
if (settings_single_type[i] == 2) {
*status = fl_string_append_assure(f_path_separator, f_path_separator_length, settings_single_destination[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append_assure", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append_assure", F_true);
break;
}
}
*status = fl_string_dynamic_terminate_after(settings_single_destination[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
}
*status = fl_string_append_assure(sources[i], lengths[i], destinations[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append_assure", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append_assure", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(destinations[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
} // for
fl_color_print_TO(data.output, data.context.set.error, "' contradict, defaulting to '");
if (setting->build_shared) {
- fl_color_print_to(data.output, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_enabled);
+ fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_enabled);
}
else {
- fl_color_print_to(data.output, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_disabled);
+ fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_shared_disabled);
}
- fl_color_print_to(data.output, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
}
else {
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.error, "WARNING: the parameters '");
- fl_color_print_to(data.output, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled);
- fl_color_print_to(data.output, data.context.set.error, "' and '");
- fl_color_print_to(data.output, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled);
- fl_color_print_to(data.output, data.context.set.error, "' contradict, defaulting to '");
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.error, "WARNING: the parameters '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled);
+ fl_color_print(data.output.stream, data.context.set.error, "' and '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled);
+ fl_color_print(data.output.stream, data.context.set.error, "' contradict, defaulting to '");
if (setting->build_static) {
- fl_color_print_to(data.output, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled);
+ fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_enabled);
}
else {
- fl_color_print_to(data.output, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled);
+ fl_color_print(data.output.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_static_disabled);
}
- fl_color_print_to(data.output, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
}
else {
if (setting->build_language == fake_build_language_type_c || setting->build_language == fake_build_language_type_cpp) {
if (setting->build_shared == F_false && setting->build_static == F_false) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The build settings '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", fake_build_setting_name_build_shared);
- fl_color_print_to(data.error.to, data.context.set.error, "' and '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", fake_build_setting_name_build_static);
- fl_color_print_to(data.error.to, data.context.set.error, "' cannot both be false when using the language '");
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: The build settings '");
+ fl_color_print(data.error, data.context.set.notable, "%s", fake_build_setting_name_build_shared);
+ fl_color_print(data.error, data.context.set.error, "' and '");
+ fl_color_print(data.error, data.context.set.notable, "%s", fake_build_setting_name_build_static);
+ fl_color_print(data.error, data.context.set.error, "' cannot both be false when using the language '");
if (setting->build_language == fake_build_language_type_c) {
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", fake_build_language_c);
+ fl_color_print(data.error, data.context.set.notable, "%s", fake_build_language_c);
}
else {
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", fake_build_language_cpp);
+ fl_color_print(data.error, data.context.set.notable, "%s", fake_build_language_cpp);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_file_name_base", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "f_file_name_base", F_true);
return;
}
*status = fl_string_dynamic_append_nulless(data.path_build_stage, values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
*status = fl_string_append(data.process.string, data.process.used, values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
*status = fl_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
}
*status = fl_string_append_nulless(names[i], lengths[i], values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
*status = fl_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
*status = fl_string_dynamic_append(settings_file_base, values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
break;
}
*status = fl_string_append(fake_build_stage_built, fake_build_stage_built_length, values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(values[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
} // for
if (!data_build.setting.build_sources_library.used) return;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Compiling static objects.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Compiling static objects.%c", f_string_eol[0]);
}
f_string_dynamic_t file_name = f_string_dynamic_t_initialize;
*status = fake_build_get_file_name_without_extension(data, data_build.setting.build_sources_library.array[i], &file_name);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
break;
}
*status = f_file_name_directory(data_build.setting.build_sources_library.array[i].string, data_build.setting.build_sources_library.array[i].used, &destination_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_file_name_directory", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "f_file_name_directory", F_true);
break;
}
*status = fl_string_dynamic_prepend(data.path_build_objects, &destination_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true);
break;
}
*status = fl_string_append_assure(f_path_separator, f_path_separator_length, &destination_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append_assure", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_append_assure", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(&destination_path);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
if (*status == F_false) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The path '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination_path.string);
- fl_color_print_to(data.error.to, data.context.set.error, "' exists but is not a directory.%c", f_string_eol[0]);
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: The path '");
+ fl_color_print(data.error, data.context.set.notable, "%s", destination_path.string);
+ fl_color_print(data.error, data.context.set.error, "' exists but is not a directory.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found_not) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The path '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination_path.string);
- fl_color_print_to(data.error.to, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]);
+ fprintf(data.error.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error, data.context.set.error, "ERROR: The path '");
+ fl_color_print(data.error, data.context.set.notable, "%s", destination_path.string);
+ fl_color_print(data.error, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]);
}
else {
- fake_print_error_file(data, F_status_set_fine(*status), "f_directory_create", destination_path.string, "create", F_false, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_directory_create", F_true, destination_path.string, "create", fll_error_file_type_directory);
}
break;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Directory '%s' created.%c", destination_path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "Directory '%s' created.%c", destination_path.string, f_string_eol[0]);
}
}
else if (F_status_is_error(*status)) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_directory_exists", destination_path.string, "create", F_false, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_directory_exists", F_true, destination_path.string, "create", fll_error_file_type_directory);
break;
}
fake_build_arguments_standard_add(data, data_build, F_false, F_true, &arguments, status);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
break;
}
if (F_status_is_fine(status)) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Building project%c", data_build.setting.project_name.used ? ' ' : 0);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Building project%c", data_build.setting.project_name.used ? ' ' : 0);
if (data_build.setting.project_name.used) {
fl_color_print_code(f_type_output, data.context.notable);
fl_color_print_code(f_type_output, data.context.reset);
}
- fl_color_print(f_type_output, data.context.set.important, ".%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, ".%c", f_string_eol[0]);
}
}
if (!data_build.setting.build_sources_program.used) return;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Compiling shared program.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Compiling shared program.%c", f_string_eol[0]);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_arguments_standard_add(data, data_build, F_true, F_false, &arguments, status);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_macro_string_dynamics_t_delete_simple(arguments);
return;
if (!data_build.setting.build_sources_program.used) return;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Compiling static program.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Compiling static program.%c", f_string_eol[0]);
}
f_string_dynamics_t arguments = f_string_dynamics_t_initialize;
fake_build_arguments_standard_add(data, data_build, F_false, F_false, &arguments, status);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
+ fll_error_print(data->error, F_status_set_fine(*status), "fll_execute_arguments_add", F_true);
f_macro_string_dynamics_t_delete_simple(arguments);
return;
*status = f_file_touch(file.string, mode.regular, F_false);
if (F_status_is_error(*status)) {
- fake_print_error_file(data, F_status_set_fine(*status), "f_file_touch", file.string, "touch", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(*status), "f_file_touch", F_true, file.string, "touch", fll_error_file_type_file);
}
}
#endif // _di_fake_build_touch_
f_status_t status = F_none;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Deleting all files within build directory '");
- fl_color_print(f_type_output, data.context.set.notable, "%s", data.path_build.string);
- fl_color_print(f_type_output, data.context.set.important, "'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Deleting all files within build directory '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", data.path_build.string);
+ fl_color_print(data.output.stream, data.context.set.important, "'.%c", f_string_eol[0]);
}
if (fake_signal_received(data)) {
if (F_status_set_fine(status) == F_file_found_not) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("The build directory '%s' does not exist.%c", data.path_build.string, f_string_eol[0]);
+ fprintf(data.output.stream, "The build directory '%s' does not exist.%c", data.path_build.string, f_string_eol[0]);
}
status = F_none;
}
if (F_status_is_error(status)) {
- fake_print_error(data, F_status_set_fine(status), "f_directory_remove", F_true);
+ fll_error_print(data.error, F_status_set_fine(status), "f_directory_remove", F_true);
return status;
}
const int result = remove(path);
if (!result) {
+ // @todo in order to get this working, the recursive function that calls this needs to be rewritten with more flexibility or provide a higher-level equivalent function.
printf("Removed '%s'.%c", path, f_string_eol[0]);
}
if (F_status_is_error(*status)) return 1;
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("%s", program.string);
+ fprintf(data.output.stream, "%s", program.string);
for (f_array_length_t i = 0; i < arguments.used; i++) {
if (!arguments.array[i].used) continue;
- printf(" %s", arguments.array[i].string);
+ fprintf(data.output.stream, " %s", arguments.array[i].string);
} // for
- printf("%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
// flush to stdout before executing command.
fflush(f_type_output);
if (F_status_set_fine(*status) == F_file_found_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to find program '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", program.used ? program.string : "");
- fl_color_print_to(data.error.to, data.context.set.error, "' for executing.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to find program '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", program.used ? program.string : "");
+ fl_color_print(data.error.to.stream, data.context.set.error, "' for executing.%c", f_string_eol[0]);
}
}
else {
- fake_print_error(data, F_status_set_fine(*status), "fll_execute_program_environment", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fll_execute_program_environment", F_true);
}
}
f_macro_string_dynamic_t_new((status), (*buffer), size_file);
if (F_status_is_error(status)) {
- fake_print_error_file(data, F_status_set_fine(status), name_function, path_file, "allocate buffer size for", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), name_function, F_true, path_file, "allocate buffer size for", fll_error_file_type_file);
f_macro_string_dynamic_t_delete_simple((*buffer));
return status;
}
if (F_status_is_error(status)) {
- fake_print_error_file(data, F_status_set_fine(status), name_function, path_file, "read", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), name_function, F_true, path_file, "read", fll_error_file_type_file);
f_macro_string_dynamic_t_delete_simple((*buffer));
}
if (F_status_is_error(status)) {
if (fake_print_error(*data, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_unknown && data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to process the parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to process the parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return status;
if (status == F_false) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameters value '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", arguments.argv[location]);
- fl_color_print_to(data->error.to, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_process);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameters value '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", arguments.argv[location]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol[0]);
}
return F_status_set_error(F_parameter);
if (F_status_is_error(status)) {
if (status == F_status_set_error(F_string_too_large)) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_to(data->error.to, data->context.set.error, "' is too long.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' is too long.%c", f_string_eol[0]);
}
}
else {
if (length == 0 || status == F_data_not) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_to(data->error.to, data->context.set.error, "' must not be empty and must not contain only whitespace.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' must not be empty and must not contain only whitespace.%c", f_string_eol[0]);
}
}
}
if (F_status_is_error(status)) {
if (fake_print_error(*data, F_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", F_false) == F_unknown && data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to process parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to process parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return status;
if (F_status_is_error(status)) {
if (fake_print_error(*data, F_status_set_fine(status), "f_macro_string_dynamic_t_new", F_false) == F_unknown && data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to load default for the parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to load default for the parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return status;
if (F_status_is_error(status)) {
if (fake_print_error(*data, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_unknown && data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to process the parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to process the parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return status;
if (F_status_is_error(status)) {
if (fake_print_error(*data, F_status_set_fine(status), "f_utf_is_word", F_false) == F_unknown && data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to process the parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to process the parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return status;
if (status == F_false) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameters value '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", data->define.array[i].string);
- fl_color_print_to(data->error.to, data->context.set.error, "' contains non-word characters.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_define);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameters value '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", data->define.array[i].string);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word characters.%c", f_string_eol[0]);
}
return F_status_set_error(F_parameter);
if (F_status_is_error(status)) {
if (fake_print_error(*data, F_status_set_fine(status), "fll_program_parameter_additional_rip", F_false) == F_unknown && data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to process the parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to process the parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return status;
if (F_status_is_error(status)) {
if (fake_print_error(*data, F_status_set_fine(status), "f_utf_is_word_dash_plus", F_false) == F_unknown && data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to process the parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to process the parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return status;
if (status == F_false) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameters value '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", data->mode.array[i].string);
- fl_color_print_to(data->error.to, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameters value '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", data->mode.array[i].string);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' contains non-word, non-dash, and non-plus characters.%c", f_string_eol[0]);
}
return F_status_set_error(F_parameter);
case F_signal_termination:
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ALERT: An appropriate exit signal has been received, now aborting.%c", f_string_eol[0]);
}
return F_true;
if (F_status_is_error(status)) {
if (F_status_set_fine(status) != F_directory_found_not || parameters_required[i]) {
- fake_print_error_file(data, F_status_set_fine(status), "f_file_stat", parameters_value[i]->string, "access", F_false, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_file_stat", F_true, parameters_value[i]->string, "access", fll_error_file_type_directory);
+
return status;
}
}
}
else if (parameters_required[i]) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: No valid path for the (required) directory parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_to(data.error.to, data.context.set.error, "' was found.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: No valid path for the (required) directory parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' was found.%c", f_string_eol[0]);
return F_status_set_error(F_directory_found_not);
}
#endif // _di_fake_validate_parameter_directories_
#ifndef _di_fake_verbose_print_clone_
- void fake_verbose_print_clone(const int output, const f_string_t source, const f_string_t destination) {
- dprintf(output, "Cloned '%s' to '%s'.%c", source, destination, f_string_eol[0]);
+ void fake_verbose_print_clone(const f_file_t output, const f_string_t source, const f_string_t destination) {
+ fprintf(output.stream, "Cloned '%s' to '%s'.%c", source, destination, f_string_eol[0]);
}
#endif // _di_fake_verbose_print_clone_
#ifndef _di_fake_verbose_print_copy_
- void fake_verbose_print_copy(const int output, const f_string_t source, const f_string_t destination) {
- dprintf(output, "Copied '%s' to '%s'.%c", source, destination, f_string_eol[0]);
+ void fake_verbose_print_copy(const f_file_t output, const f_string_t source, const f_string_t destination) {
+ fprintf(output.stream, "Copied '%s' to '%s'.%c", source, destination, f_string_eol[0]);
}
#endif // _di_fake_verbose_print_copy_
#ifndef _di_fake_verbose_print_move_
- void fake_verbose_print_move(const int output, const f_string_t source, const f_string_t destination) {
- dprintf(output, "Moved '%s' to '%s'.%c", source, destination, f_string_eol[0]);
+ void fake_verbose_print_move(const f_file_t output, const f_string_t source, const f_string_t destination) {
+ fprintf(output.stream, "Moved '%s' to '%s'.%c", source, destination, f_string_eol[0]);
}
#endif // _di_fake_verbose_print_move_
* Helper function for performing a verbose print for a file clone operation.
*
* @param output
- * A file descriptor to print to, such as f_type_desciptor_output.
+ * A file to print to.
* @param source
* The source string.
* @param destination
* The destination string.
*/
#ifndef _di_fake_verbose_print_clone_
- extern void fake_verbose_print_clone(const int output, const f_string_t source, const f_string_t destination) f_gcc_attribute_visibility_internal;
+ extern void fake_verbose_print_clone(const f_file_t output, const f_string_t source, const f_string_t destination) f_gcc_attribute_visibility_internal;
#endif // _di_fake_verbose_print_clone_
/**
* Helper function for performing a verbose print for a file copy operation.
*
* @param output
- * A file descriptor to print to, such as f_type_desciptor_output.
+ * A file to print to.
* @param source
* The source string.
* @param destination
* The destination string.
*/
#ifndef _di_fake_verbose_print_copy_
- extern void fake_verbose_print_copy(const int output, const f_string_t source, const f_string_t destination) f_gcc_attribute_visibility_internal;
+ extern void fake_verbose_print_copy(const f_file_t output, const f_string_t source, const f_string_t destination) f_gcc_attribute_visibility_internal;
#endif // _di_fake_verbose_print_copy_
/**
* Helper function for performing a verbose print for a file move operation.
*
* @param output
- * A file descriptor to print to, such as f_type_desciptor_output.
+ * A file to print to.
* @param source
* The source string.
* @param destination
* The destination string.
*/
#ifndef _di_fake_verbose_print_move_
- extern void fake_verbose_print_move(const int output, const f_string_t source, const f_string_t destination) f_gcc_attribute_visibility_internal;
+ extern void fake_verbose_print_move(const f_file_t output, const f_string_t source, const f_string_t destination) f_gcc_attribute_visibility_internal;
#endif // _di_fake_verbose_print_move_
#ifdef __cplusplus
#endif // _di_fake_make_assure_inside_project_
#ifndef _di_fake_make_get_id_group_
- f_return_status fake_make_get_id_group(const fake_data_t data, const f_string_static_t buffer, gid_t *id) {
+ f_return_status fake_make_get_id_group(const fake_data_t data, const fll_error_print_t error, const f_string_static_t buffer, gid_t *id) {
const f_string_range_t range = f_macro_string_range_t_initialize(buffer.used);
f_number_unsigned_t number = 0;
status = f_account_id_group_by_name(buffer.string, id);
if (F_status_is_error(status)) {
- fake_print_message(data, status, "f_account_id_group_by_name", F_true, print);
+ fake_print_message(data, status, "f_account_id_group_by_name", F_true);
return F_status_set_error(status);
}
else if (status == F_exist_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print_to(print.to, print.context, "%s: The group name '", print.prefix);
- fl_color_print_to(print.to, data.context.set.notable, "%s", buffer.string);
- fl_color_print_to(print.to, print.context, "' was not found.%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, print.context, "%s: The group name '", data.error.prefix);
+ fl_color_print(error.to.stream, data.context.set.notable, "%s", buffer.string);
+ fl_color_print(error.to.stream, print.context, "' was not found.%c", f_string_eol[0]);
}
return F_status_set_error(F_failure);
return F_none;
}
- fake_print_message(data, status, "fl_conversion_string_to_number_unsigned", F_true, print);
+ fake_print_message(data, status, "fl_conversion_string_to_number_unsigned", F_true);
return F_status_set_error(status);
}
else if (number > f_type_size_32_unsigned) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print_to(print.to, print.context, "%s: The number '", print.prefix);
- fl_color_print_to(print.to, data.context.set.notable, "%llu", number);
- fl_color_print_to(print.to, print.context, "' is too large.%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, print.context, "%s: The number '", data.error.prefix);
+ fl_color_print(error.to.stream, data.context.set.notable, "%llu", number);
+ fl_color_print(error.to.stream, print.context, "' is too large.%c", f_string_eol[0]);
}
}
#endif // _di_fake_make_get_id_group_
#ifndef _di_fake_make_get_id_mode_
- f_return_status fake_make_get_id_mode(const fake_data_t data, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) {
+ f_return_status fake_make_get_id_mode(const fake_data_t data, const fll_error_print_t error, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) {
if (!buffer.used) {
- fake_print_message(data, F_parameter, "fake_make_get_id_mode", F_true, print);
+ fake_print_message(data, F_parameter, "fake_make_get_id_mode", F_true);
return F_status_set_error(F_parameter);
}
if (F_status_is_error(status)) {
if (data.error.verbosity != f_console_verbosity_quiet) {
if (F_status_set_fine(status) == F_syntax) {
- dprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print_to(print.to, print.context, "%s: The mode '", print.prefix);
- fl_color_print_to(print.to, data.context.set.notable, "%s", buffer.string);
- fl_color_print_to(print.to, print.context, "' is invalid.%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, print.context, "%s: The mode '", data.error.prefix);
+ fl_color_print(error.to.stream, data.context.set.notable, "%s", buffer.string);
+ fl_color_print(error.to.stream, print.context, "' is invalid.%c", f_string_eol[0]);
}
else {
- fake_print_message(data, status, "f_file_mode_from_string", F_true, print);
+ fake_print_message(data, status, "f_file_mode_from_string", F_true);
}
}
status = f_account_id_user_by_name(buffer.string, id);
if (F_status_is_error(status)) {
- fake_print_message(data, status, "f_account_id_user_by_name", F_true, print);
+ fake_print_message(data, status, "f_account_id_user_by_name", F_true);
return F_status_set_error(status);
}
else if (status == F_exist_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print_to(print.to, print.context, "%s: The user name '", print.prefix);
- fl_color_print_to(print.to, data.context.set.notable, "%s", buffer.string);
- fl_color_print_to(print.to, print.context, "' was not found.%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, print.context, "%s: The user name '", data.error.prefix);
+ fl_color_print(error.to.stream, data.context.set.notable, "%s", buffer.string);
+ fl_color_print(error.to.stream, print.context, "' was not found.%c", f_string_eol[0]);
}
return F_status_set_error(F_failure);
return F_none;
}
- fake_print_message(data, status, "fl_conversion_string_to_number_unsigned", F_true, print);
+ fake_print_message(data, status, "fl_conversion_string_to_number_unsigned", F_true);
return F_status_set_error(status);
}
else if (number > f_type_size_32_unsigned) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print_to(print.to, print.context, "%s: The number '", print.prefix);
- fl_color_print_to(print.to, data.context.set.notable, "%llu", number);
- fl_color_print_to(print.to, print.context, "' is too large.%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, print.context, "%s: The number '", data.error.prefix);
+ fl_color_print(error.to.stream, data.context.set.notable, "%llu", number);
+ fl_color_print(error.to.stream, print.context, "' is too large.%c", f_string_eol[0]);
}
}
if (!data_make->buffer.used) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: the fakefile '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", data.file_data_build_fakefile.string);
- fl_color_print_to(data.output, data.context.set.warning, "' is empty.");
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: the fakefile '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", data.file_data_build_fakefile.string);
+ fl_color_print(data.output.stream, data.context.set.warning, "' is empty.");
}
return;
f_macro_fss_nameds_t_new((*status), data_make->fakefile, list_objects.used);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_macro_fss_nameds_t_new", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "f_macro_fss_nameds_t_new", F_true);
f_macro_fss_set_t_delete_simple(settings);
f_macro_fss_objects_t_delete_simple(list_objects);
if (missing_main) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The fakefile '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", data.file_data_build_fakefile.string);
- fl_color_print_to(data.error.to, data.context.set.error, "' is missing the required '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", fake_make_section_main);
- fl_color_print_to(data.error.to, data.context.set.error, "' object.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The fakefile '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", data.file_data_build_fakefile.string);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' is missing the required '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", fake_make_section_main);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' object.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), function_name, F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), function_name, F_true);
f_macro_fss_set_t_delete_simple(settings);
return;
*status = fl_string_dynamic_partial_append_nulless(data_make->buffer, settings.contents.array[i].array[j], &name_define);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(&name_define);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, &data_make->setting_build.environment);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_lengths_size_increase", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_lengths_size_increase", F_true);
break;
}
}
*status = fl_string_dynamic_append(name_define, &data_make->setting_build.environment.array[data_make->setting_build.environment.used]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
break;
}
data_make->setting_build.environment.used++;
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: The environment name '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", name_define.string);
- fl_color_print_to(data.output, data.context.set.warning, "' is already added.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: The environment name '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", name_define.string);
+ fl_color_print(data.output.stream, data.context.set.warning, "' is already added.%c", f_string_eol[0]);
}
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: The environment name '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", name_define.string);
- fl_color_print_to(data.output, data.context.set.warning, "' is invalid, ignoring.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: The environment name '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", name_define.string);
+ fl_color_print(data.output.stream, data.context.set.warning, "' is invalid, ignoring.%c", f_string_eol[0]);
}
name_define.used = 0;
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), function_name, F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), function_name, F_true);
break;
}
} // for
fake_build_load_setting(data, stub, &data_make->setting_build, status);
if (F_status_is_error(*status) && *status != F_status_set_error(F_signal)) {
- fake_print_error(data, F_status_set_fine(*status), "fake_build_load_setting", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fake_build_load_setting", F_true);
}
}
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_partial_append", F_true);
f_macro_fss_set_t_delete_simple(settings);
return;
*status = fll_fss_snatch_map_apart(data_make->buffer, settings.objects, settings.contents, settings_name, settings_length, 2, settings_value, 0);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fll_fss_snatch_map_apart", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fll_fss_snatch_map_apart", F_true);
f_macro_string_map_multis_t_delete_simple(define);
f_macro_fss_set_t_delete_simple(settings);
*status = fl_string_dynamic_mash(" ", 1, define.array[i].value.array[j], &combined);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_mash_nulless", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_mash_nulless", F_true);
break;
}
} // for
*status = fl_string_dynamic_terminate_after(&combined);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
}
*status = f_environment_set(define.array[i].name.string, combined.string, F_true);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "f_environment_set", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "f_environment_set", F_true);
break;
}
}
else {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Invalid characters in the define setting name '");
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Invalid characters in the define setting name '");
- fl_color_print_code(f_type_error, data.context.notable);
- f_print_dynamic(f_type_error, define.array[i].name);
- fl_color_print_code(f_type_error, data.context.reset);
+ fl_color_print_code(data.error.to.stream, data.context.notable);
+ f_print_dynamic(data.error.to.stream, define.array[i].name);
+ fl_color_print_code(data.error.to.stream, data.context.reset);
- fl_color_print_to(data.error.to, data.context.set.error, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is %c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is %c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, &data_make->parameter.color);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
return;
}
}
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true);
return;
}
else {
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, &data_make->parameter.verbosity);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
return;
}
}
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true);
return;
}
else {
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, destination[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
return;
}
}
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true);
return;
}
else {
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, destination[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
return;
}
}
*status = fl_string_dynamic_append(source[i]->array[j], &destination[i]->array[destination[i]->used]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
return;
}
else {
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, destination[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
return;
}
}
}
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_append", F_true);
return;
}
else {
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, destination[i]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true);
return;
}
}
*status = fl_string_dynamic_append(*source[i], &destination[i]->array[destination[i]->used]);
if (F_status_is_error(*status)) {
- fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
+ fll_error_print(data.error, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
return;
}
else {
#ifndef _di_fake_make_operate_
f_return_status fake_make_operate(const fake_data_t data) {
- if (fake_signal_received(data)) {
+ if (fake_signal_received(*data)) {
return F_signal;
}
- if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Making project.%c", f_string_eol[0]);
+ if (data->error.verbosity != f_console_verbosity_quiet) {
+ fprintf(data->output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->output.stream, data->context.set.important, "Making project.%c", f_string_eol[0]);
}
f_status_t status = F_none;
f_macro_string_dynamics_new(status, data_make.path.stack, f_memory_default_allocation_step);
if (F_status_is_error(status)) {
- fake_print_error(data, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true);
return status;
}
- if (fake_signal_received(data)) {
+ if (fake_signal_received(*data)) {
fake_macro_make_data_t_delete_simple(data_make);
return F_signal;
}
status = f_path_current(F_true, &data_make.path.stack.array[0]);
if (F_status_is_error(status)) {
- fake_print_error(data, F_status_set_fine(status), "f_path_current", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "f_path_current", F_true);
fake_macro_make_data_t_delete_simple(data_make);
return status;
status = f_directory_open(data_make.path.stack.array[0].string, F_false, &data_make.path.top);
if (F_status_is_error(status)) {
- fake_print_error(data, F_status_set_fine(status), "f_directory_open", F_true);
+ fll_error_print(data->error, F_status_set_fine(status), "f_directory_open", F_true);
fake_macro_make_data_t_delete_simple(data_make);
return status;
data_make.path.stack.used = 1;
- f_macro_mode_t_set_default_umask(mode, data.umask);
+ f_macro_mode_t_set_default_umask(mode, data->umask);
- fake_make_load_parameters(data, &data_make, &status);
+ fake_make_load_parameters(*data, &data_make, &status);
- fake_make_load_fakefile(data, &data_make, &status);
+ fake_make_load_fakefile(*data, &data_make, &status);
if (F_status_is_error(status)) {
fake_macro_make_data_t_delete_simple(data_make);
}
if (data_make.setting_make.fail == fake_make_operation_fail_type_exit) {
- data_make.print.prefix = fake_make_print_error;
- data_make.print.context = data.context.set.error;
- data_make.print.to = f_type_error;
+ data_make.error.prefix = fake_make_print_error;
+ data_make.error.context = data_make.context.set.error;
+ data_make.error.to.stream = f_type_error;
+ data_make.error.to.id = f_type_descriptor_error;
}
else if (data_make.setting_make.fail == fake_make_operation_fail_type_warn) {
- data_make.print.prefix = fake_make_print_warning;
- data_make.print.context = data.context.set.warning;
- data_make.print.to = f_type_warning;
+ data_make.error.prefix = fake_make_print_warning;
+ data_make.error.context = data_make.context.set.warning;
+ data_make.error.to.stream = f_type_warning;
+ data_make.error.to.id = f_type_descriptor_warning;
}
else {
- data_make.print.to = 0;
+ data_make.error.to.stream = 0;
+ data_make.error.to.id = -1;
}
- fake_make_operate_section(data, data_make.main, &data_make, §ion_stack, &status);
+ fake_make_operate_section(*data, data_make.main, &data_make, §ion_stack, &status);
if (data_make.path.current > 0) {
f_file_close(&data_make.path.current);
{
f_status_t status_path = f_path_change_at(data_make.path.top);
- if (F_status_is_error(status_path) && data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: Failed change back to orignal path '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", data_make.path.stack.array[0].string);
- fl_color_print_to(data.output, data.context.set.warning, "', status code = ");
- fl_color_print_to(data.output, data.context.set.notable, "%llu", F_status_set_fine(status_path));
- fl_color_print_to(data.output, data.context.set.warning, ".%c", f_string_eol[0]);
+ if (F_status_is_error(status_path) && data->error.verbosity == f_console_verbosity_verbose) {
+ fprintf(data->output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->output.stream, data->context.set.warning, "WARNING: Failed change back to orignal path '");
+ fl_color_print(data->output.stream, data->context.set.notable, "%s", data_make.path.stack.array[0].string);
+ fl_color_print(data->output.stream, data->context.set.warning, "', status code = ");
+ fl_color_print(data->output.stream, data->context.set.notable, "%llu", F_status_set_fine(status_path));
+ fl_color_print(data->output.stream, data->context.set.warning, ".%c", f_string_eol[0]);
}
}
*status = fl_string_dynamics_size_increase(content.used, arguments);
if (F_status_is_error(*status) || *status == F_string_too_large) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true, data_make->error);
return;
}
}
*status = fl_iki_read(&data_make->buffer, &range, &iki_variable, &iki_vocabulary, &iki_content);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_iki_read", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_iki_read", F_true, data_make->error);
break;
}
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, arguments);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_lengths_size_increase", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_lengths_size_increase", F_true, data_make->error);
return;
}
}
*status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true, data_make->error);
break;
}
}
*status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true, data_make->error);
break;
}
}
}
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_compare", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_compare", F_true, data_make->error);
break;
}
*status = fl_string_dynamic_append(data_make->setting_make.parameter.array[0].value.array[0], &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true, data_make->error);
break;
}
}
*status = fl_string_append("0", 1, &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->error);
break;
}
}
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, arguments);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true, data_make->error);
return;
}
}
*status = fl_string_append(" ", 1, &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->error);
break;
}
}
*status = fl_string_dynamic_append(reserved_value[k]->array[l], &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true, data_make->error);
break;
}
} // for
*status = fl_string_append(" ", 1, &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->error);
break;
}
}
*status = fl_string_dynamic_append_nulless(parameter->array[k].value.array[l], &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true, data_make->error);
break;
}
} // for
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, arguments);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamics_size_increase", F_true, data_make->error);
break;
}
}
*status = fl_string_dynamic_append_nulless(parameter->array[k].value.array[l], &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true, data_make->error);
break;
}
*status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_terminate_after", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_terminate_after", F_true, data_make->error);
break;
}
break;
}
else if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_compare", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_compare", F_true, data_make->error);
break;
}
} // for
*status = fake_make_operate_expand_build(data, quoteds.array[i], iki_content.array[j], data_make, arguments);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fake_make_operate_expand_build", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fake_make_operate_expand_build", F_true, data_make->error);
break;
}
}
*status = fake_make_operate_expand_environment(data, quoteds.array[i], iki_content.array[j], data_make, arguments);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fake_make_operate_expand_environment", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fake_make_operate_expand_environment", F_true, data_make->error);
break;
}
}
if (F_status_is_error_not(*status)) {
*status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used - 1]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_terminate_after", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_terminate_after", F_true, data_make->error);
break;
}
}
}
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true, data_make->error);
break;
}
}
*status = fl_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_append_nulless", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_append_nulless", F_true, data_make->error);
break;
}
}
*status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_terminate_after", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_terminate_after", F_true, data_make->error);
break;
}
if (id_section > data_make->fakefile.used) {
*status = F_status_set_error(F_parameter);
- fake_print_message(data, F_parameter, "fake_make_operate_section", F_true, data_make->print);
+ fake_print_message(data, F_parameter, "fake_make_operate_section", F_true, data_make->error);
return;
}
*status = fl_string_lengths_size_increase(f_memory_default_allocation_step, section_stack);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_lengths_size_increase", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_lengths_size_increase", F_true, data_make->error);
return;
}
}
const f_fss_named_t *section = &data_make->fakefile.array[id_section];
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Processing Section '");
+ fl_color_print(data.output.stream, data.context.set.important, "Processing Section '");
fl_color_print_code(f_type_output, data.context.notable);
f_print_dynamic_partial(f_type_output, data_make->buffer, section->name);
fl_color_print_code(f_type_output, data.context.reset);
- fl_color_print(f_type_output, data.context.set.important, "'.%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "'.%c", f_string_eol[0]);
}
if (!section->objects.used) {
} // for
if (!operation) {
- fake_print_message_section_operation_unknown(data, data_make->buffer, section->name, section->objects.array[i], data_make->print);
+ fake_print_message_section_operation_unknown(data, data_make->buffer, section->name, section->objects.array[i], data_make->error);
*status = F_status_set_error(F_invalid);
}
else if (operation == fake_make_operation_type_operate) {
if (section_stack->used == fake_make_section_stack_max) {
- fake_print_message_section_operation_stack_max(data, data_make->buffer, section->name, section->objects.array[i], fake_make_section_stack_max, data_make->print);
+ fake_print_message_section_operation_stack_max(data, data_make->buffer, section->name, section->objects.array[i], fake_make_section_stack_max, data_make->error);
*status = F_status_set_error(F_recurse);
}
// break acts identical to fail when at the top of the stack.
if (F_status_set_fine(*status) == F_signal_abort && !section_stack->used) {
data_make->setting_make.fail = fake_make_operation_fail_type_exit;
- data_make->print.prefix = fake_make_print_error;
- data_make->print.context = data.context.set.error;
- data_make->print.to = f_type_error;
+ data_make->error.prefix = fake_make_print_error;
+ data_make->error.context = data.context.set.error;
+ data_make->error.to = f_type_error;
}
- fake_print_message_section_operation_failed(data, data_make->buffer, section->name, section->objects.array[i], data_make->print);
+ fake_print_message_section_operation_failed(data, data_make->buffer, section->name, section->objects.array[i], data_make->error);
// F_signal_abort is used by the break section operation.
if (F_status_set_fine(*status) == F_signal_abort) {
if (i == section->objects.used && (operation_if == fake_make_operation_if_type_true_next || operation_if == fake_make_operation_if_type_false_next || operation_if == fake_make_operation_if_type_else_true || operation_if == fake_make_operation_if_type_else_false)) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
const char *type_name = 0;
if (operation_if == fake_make_operation_if_type_true_next || operation_if == fake_make_operation_if_type_false_next) {
type_name = fake_make_operation_else;
}
- fprintf(data_make->print.to, "%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Incomplete '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", type_name);
- fl_color_print(data_make->print.to, data_make->print.context, "' at end of section.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Incomplete '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", type_name);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' at end of section.%c", f_string_eol[0]);
}
- fake_print_message_section_operation_failed(data, data_make->buffer, section->name, section->objects.array[section->objects.used - 1], data_make->print);
+ fake_print_message_section_operation_failed(data, data_make->buffer, section->name, section->objects.array[section->objects.used - 1], data_make->error);
*status = F_status_set_error(F_failure);
}
int return_code = fake_execute(data, data_make->environment, data_make->setting_build.build_indexer, arguments, status);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fake_execute", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fake_execute", F_true, data_make->error);
}
fake_make_operate_process_return(data, return_code, data_make, status);
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Breaking as '%s'.", arguments.used ? arguments.array[0].string : fake_make_operation_argument_success);
+ fprintf(data.output.stream, "Breaking as '%s'.", arguments.used ? arguments.array[0].string : fake_make_operation_argument_success);
}
return;
status_file = f_directory_is(arguments.array[total].string);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[1].string, "identify", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[1].string, "identify", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
return;
}
status_file = fl_directory_clone(arguments.array[i].string, destination, arguments.array[i].used, destination_length, F_true, recurse);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "fl_directory_clone", arguments.array[i].string, "clone", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "fl_directory_clone", arguments.array[i].string, "clone", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
}
status_file = f_file_clone(arguments.array[i].string, destination, F_true, recurse.size_block, recurse.exclusive);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_file_clone", arguments.array[i].string, "clone", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_file_clone", arguments.array[i].string, "clone", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Cloned '%s' to '%s'.%c", arguments.array[i].string, destination, f_string_eol[0]);
+ fprintf(data.output.stream, "Cloned '%s' to '%s'.%c", arguments.array[i].string, destination, f_string_eol[0]);
}
}
else if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[i].string, "identify", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[i].string, "identify", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
break;
}
int return_code = fake_execute(data, data_make->environment, data_make->setting_build.build_compiler, arguments, status);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fake_execute", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fake_execute", F_true, data_make->error);
}
fake_make_operate_process_return(data, return_code, data_make, status);
status_file = f_directory_is(arguments.array[total].string);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[1].string, "identify", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[1].string, "identify", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
return;
}
status_file = fl_directory_copy(arguments.array[i].string, destination, arguments.array[i].used, destination_length, mode, recurse);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "fl_directory_copy", arguments.array[i].string, "copy", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "fl_directory_copy", arguments.array[i].string, "copy", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
}
status_file = f_file_copy(arguments.array[i].string, destination, mode, recurse.size_block, recurse.exclusive);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_file_copy", arguments.array[i].string, "copy", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_file_copy", arguments.array[i].string, "copy", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Copied '%s' to '%s'.%c", arguments.array[i].string, destination, f_string_eol[0]);
+ fprintf(data.output.stream, "Copied '%s' to '%s'.%c", arguments.array[i].string, destination, f_string_eol[0]);
}
}
else if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[i].string, "identify", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[i].string, "identify", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
break;
}
}
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "f_environment_set", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "f_environment_set", F_true, data_make->error);
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Defined environment variable '%s'.%c", arguments.array[0].string, f_string_eol[0]);
+ fprintf(data.output.stream, "Defined environment variable '%s'.%c", arguments.array[0].string, f_string_eol[0]);
}
return;
if (F_status_is_error(*status)) {
if (F_status_set_fine(*status) == F_file_found_not) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- dprintf(data.output, "%c", f_string_eol[0]);
- fl_color_print_to(data.output, data.context.set.warning, "WARNING: the file '");
- fl_color_print_to(data.output, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print_to(data.output, data.context.set.warning, "' was not found.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: the file '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.output.stream, data.context.set.warning, "' was not found.%c", f_string_eol[0]);
}
*status = F_none;
}
else {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_stat", arguments.array[i].string, "delete", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_stat", arguments.array[i].string, "delete", F_true, F_true, data_make->error);
return;
}
}
if (F_status_set_fine(*status) == F_file_found_not) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("The directory '%s' does not exist.%c", arguments.array[i].string, f_string_eol[0]);
+ fprintf(data.output.stream, "The directory '%s' does not exist.%c", arguments.array[i].string, f_string_eol[0]);
}
*status = F_none;
}
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_directory_remove", arguments.array[i].string, "delete", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_directory_remove", arguments.array[i].string, "delete", F_false, F_true, data_make->error);
return;
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Removed '%s'.%c", arguments.array[i].string, f_string_eol[0]);
+ fprintf(data.output.stream, "Removed '%s'.%c", arguments.array[i].string, f_string_eol[0]);
}
}
else {
*status = f_file_remove(arguments.array[i].string);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_remove", arguments.array[i].string, "delete", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_remove", arguments.array[i].string, "delete", F_true, F_true, data_make->error);
return;
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Removed '%s'.%c", arguments.array[i].string, f_string_eol[0]);
+ fprintf(data.output.stream, "Removed '%s'.%c", arguments.array[i].string, f_string_eol[0]);
}
}
} // for
// forcing exit forces fail mode.
data_make->setting_make.fail = fake_make_operation_fail_type_exit;
- data_make->print.prefix = fake_make_print_error;
- data_make->print.context = data.context.set.error;
- data_make->print.to = f_type_error;
+ data_make->error.prefix = fake_make_print_error;
+ data_make->error.context = data.context.set.error;
+ data_make->error.to = f_type_error;
}
else {
return;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Exiting as '%s'.", arguments.used ? arguments.array[0].string : fake_make_operation_argument_success);
+ fprintf(data.output.stream, "Exiting as '%s'.", arguments.used ? arguments.array[0].string : fake_make_operation_argument_success);
}
return;
if (fl_string_dynamic_compare_string(fake_make_operation_argument_exit, arguments.array[0], fake_make_operation_argument_exit_length) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_exit;
- data_make->print.prefix = fake_make_print_error;
- data_make->print.context = data.context.set.error;
- data_make->print.to = f_type_error;
+ data_make->error.prefix = fake_make_print_error;
+ data_make->error.context = data.context.set.error;
+ data_make->error.to = f_type_error;
}
else if (fl_string_dynamic_compare_string(fake_make_operation_argument_warn, arguments.array[0], fake_make_operation_argument_warn_length) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_warn;
- data_make->print.prefix = fake_make_print_warning;
- data_make->print.context = data.context.set.warning;
- data_make->print.to = f_type_warning;
+ data_make->error.prefix = fake_make_print_warning;
+ data_make->error.context = data.context.set.warning;
+ data_make->error.to = f_type_warning;
}
else if (fl_string_dynamic_compare_string(fake_make_operation_argument_ignore, arguments.array[0], fake_make_operation_argument_ignore_length) == F_equal_to) {
data_make->setting_make.fail = fake_make_operation_fail_type_ignore;
- data_make->print.to = 0;
+ data_make->error.to = 0;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Set failure state to '");
+ fprintf(data.output.stream, "Set failure state to '");
if (data_make->setting_make.fail == fake_make_operation_fail_type_exit) {
printf(fake_make_operation_argument_exit);
printf(fake_make_operation_argument_ignore);
}
- printf("'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "'.%c", f_string_eol[0]);
}
return;
if (operation == fake_make_operation_type_group) {
gid_t id = 0;
- *status = fake_make_get_id_group(data, data_make->print, arguments.array[0], &id);
+ *status = fake_make_get_id_group(data, data_make->error, arguments.array[0], &id);
if (F_status_is_error(*status)) return;
f_status_t status_file = F_none;
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
continue;
}
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_file(data, *status, "f_file_role_change", arguments.array[i].string, "change group of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, *status, "f_file_role_change", arguments.array[i].string, "change group of", F_true, F_true, data_make->error);
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Changed group of '%s' to %llu.%c", arguments.array[i].string, id, f_string_eol[0]);
+ fprintf(data.output.stream, "Changed group of '%s' to %llu.%c", arguments.array[i].string, id, f_string_eol[0]);
}
} // for
if (operation == fake_make_operation_type_groups) {
gid_t id = 0;
- *status = fake_make_get_id_group(data, data_make->print, arguments.array[0], &id);
+ *status = fake_make_get_id_group(data, data_make->error, arguments.array[0], &id);
if (F_status_is_error(*status)) return;
f_status_t status_file = F_none;
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
continue;
}
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_file(data, F_status_set_fine(*status), "fll_file_role_change_all", arguments.array[i].string, "change group of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "fll_file_role_change_all", arguments.array[i].string, "change group of", F_true, F_true, data_make->error);
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Changed group of '%s' to %llu.%c", arguments.array[i].string, id, f_string_eol[0]);
+ fprintf(data.output.stream, "Changed group of '%s' to %llu.%c", arguments.array[i].string, id, f_string_eol[0]);
}
} // for
if (*operation_if == fake_make_operation_if_type_if_group) {
uid_t id = 0;
- *status = fake_make_get_id_group(data, data_make->print, arguments.array[1], &id);
+ *status = fake_make_get_id_group(data, data_make->error, arguments.array[1], &id);
if (F_status_is_error(*status)) return;
uid_t id_file = 0;
*status = f_file_group_read(arguments.array[i].string, &id_file);
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_group_read", arguments.array[i].string, "get group of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_group_read", arguments.array[i].string, "get group of", F_true, F_true, data_make->error);
break;
}
{
uint8_t mode_replace = 0;
- *status = fake_make_get_id_mode(data, data_make->print, arguments.array[2], &mode_rule, &mode_replace);
+ *status = fake_make_get_id_mode(data, data_make->error, arguments.array[2], &mode_rule, &mode_replace);
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
- fake_print_message(data, F_status_set_fine(*status), "f_file_mode_to_mode", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "f_file_mode_to_mode", F_true, data_make->error);
return;
}
}
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "get mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "get mode of", F_true, F_true, data_make->error);
break;
}
if (*operation_if == fake_make_operation_if_type_if_owner) {
uid_t id = 0;
- *status = fake_make_get_id_owner(data, data_make->print, arguments.array[1], &id);
+ *status = fake_make_get_id_owner(data, data_make->error, arguments.array[1], &id);
if (F_status_is_error(*status)) return;
uid_t id_file = 0;
*status = f_file_owner_read(arguments.array[i].string, &id_file);
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_owner_read", arguments.array[i].string, "get owner of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_owner_read", arguments.array[i].string, "get owner of", F_true, F_true, data_make->error);
break;
}
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "get mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "get mode of", F_true, F_true, data_make->error);
break;
}
*status = f_file_exists(arguments.array[i].string);
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_exists", arguments.array[i].string, "find", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_exists", arguments.array[i].string, "find", F_true, F_true, data_make->error);
break;
}
*status = F_status_set_error(F_failure);
*operation_if = fake_make_operation_if_type_false_always_next;
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
if ((i == 1 && number_left > f_number_t_size_unsigned) || (i > 1 && number_right > f_number_t_size_unsigned)) {
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The number '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%c%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The number '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%c%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol[0]);
}
else {
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Invalid or unsupported number provided '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Invalid or unsupported number provided '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
}
}
*status = f_file_link(arguments.array[0].string, arguments.array[1].string);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, *status, "f_file_link", arguments.array[1].string, "create link", F_true, F_true, data_make->print);
+ fake_print_message_file(data, *status, "f_file_link", arguments.array[1].string, "create link", F_true, F_true, data_make->error);
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Created symbolic link from '%s' to '%s'.%c", arguments.array[1].string, arguments.array[0].string, f_string_eol[0]);
+ fprintf(data.output.stream, "Created symbolic link from '%s' to '%s'.%c", arguments.array[1].string, arguments.array[0].string, f_string_eol[0]);
}
return;
f_file_mode_t mode_rule = 0;
uint8_t replace = 0;
- *status = fake_make_get_id_mode(data, data_make->print, arguments.array[0], &mode_rule, &replace);
+ *status = fake_make_get_id_mode(data, data_make->error, arguments.array[0], &mode_rule, &replace);
if (F_status_is_error(*status)) return;
mode_t mode = 0;
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "change mode of", F_true, F_true, data_make->error);
break;
}
*status = f_file_mode_determine(mode_file, mode_rule, replace, f_macro_file_type_is_directory(mode_file), &mode);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_determine", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_determine", arguments.array[i].string, "change mode of", F_true, F_true, data_make->error);
break;
}
*status = f_file_mode_set(arguments.array[i].string, mode);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_set", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_set", arguments.array[i].string, "change mode of", F_true, F_true, data_make->error);
break;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Changed mode of '%s' to %#o.%c", arguments.array[i].string, mode, f_string_eol[0]);
+ fprintf(data.output.stream, "Changed mode of '%s' to %#o.%c", arguments.array[i].string, mode, f_string_eol[0]);
}
} // for
f_file_mode_t mode_rule = 0;
uint8_t replace = 0;
- *status = fake_make_get_id_mode(data, data_make->print, arguments.array[0], &mode_rule, &replace);
+ *status = fake_make_get_id_mode(data, data_make->error, arguments.array[0], &mode_rule, &replace);
if (F_status_is_error(*status)) return;
mode_t mode = 0;
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "change mode of", F_true, F_true, data_make->error);
break;
}
*status = f_file_mode_determine(mode_file, mode_rule, replace, f_macro_file_type_is_directory(mode_file), &mode);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_determine", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_determine", arguments.array[i].string, "change mode of", F_true, F_true, data_make->error);
break;
}
*status = fll_file_mode_set_all(arguments.array[i].string, mode, fake_make_operation_recursion_depth_max);
if (F_status_is_error(*status)) {
- fake_print_message_file(data, F_status_set_fine(*status), "fll_file_mode_set_all", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "fll_file_mode_set_all", arguments.array[i].string, "change mode of", F_true, F_true, data_make->error);
break;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Changed mode of '%s' to %#o.%c", arguments.array[i].string, mode, f_string_eol[0]);
+ fprintf(data.output.stream, "Changed mode of '%s' to %#o.%c", arguments.array[i].string, mode, f_string_eol[0]);
}
} // for
status_file = f_directory_is(arguments.array[total].string);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[1].string, "identify", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[1].string, "identify", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
return;
}
status_file = fll_file_move(arguments.array[i].string, destination, arguments.array[i].used, destination_length, recurse);
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "fll_file_move", arguments.array[i].string, "move", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "fll_file_move", arguments.array[i].string, "move", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
} // for
if (operation == fake_make_operation_type_owner) {
uid_t id = 0;
- *status = fake_make_get_id_owner(data, data_make->print, arguments.array[0], &id);
+ *status = fake_make_get_id_owner(data, data_make->error, arguments.array[0], &id);
if (F_status_is_error(*status)) return;
f_status_t status_file = F_none;
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
continue;
}
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_role_change", arguments.array[i].string, "change owner of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_role_change", arguments.array[i].string, "change owner of", F_true, F_true, data_make->error);
break;
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Changed owner of '%s' to %d.%c", arguments.array[i].string, id, f_string_eol[0]);
+ fprintf(data.output.stream, "Changed owner of '%s' to %d.%c", arguments.array[i].string, id, f_string_eol[0]);
}
} // for
if (operation == fake_make_operation_type_owners) {
uid_t id = 0;
- *status = fake_make_get_id_owner(data, data_make->print, arguments.array[0], &id);
+ *status = fake_make_get_id_owner(data, data_make->error, arguments.array[0], &id);
if (F_status_is_error(*status)) return;
f_status_t status_file = F_none;
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
continue;
}
if (F_status_is_error(status_file)) {
*status = status_file;
- fake_print_message_file(data, F_status_set_fine(*status), "fll_file_role_change_all", arguments.array[i].string, "change owner of", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "fll_file_role_change_all", arguments.array[i].string, "change owner of", F_true, F_true, data_make->error);
}
else if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Changed owner of '%s' to %o.%c", arguments.array[i].string, id, f_string_eol[0]);
+ fprintf(data.output.stream, "Changed owner of '%s' to %o.%c", arguments.array[i].string, id, f_string_eol[0]);
}
} // for
*status = f_path_change(data_make->path.stack.array[data_make->path.stack.used - 1].string);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", data_make->path.stack.array[data_make->path.stack.used - 1].string, data_make->print);
+ fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", data_make->path.stack.array[data_make->path.stack.used - 1].string, data_make->error);
return;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
*status = fake_make_path_relative(data, data_make->path.stack.array[data_make->path.stack.used - 1], data_make);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fake_make_path_relative", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fake_make_path_relative", F_true, data_make->error);
return;
}
- printf("Changed to project path '");
+ fprintf(data.output.stream, "Changed to project path '");
f_print_dynamic(f_type_output, data_make->path_cache);
- printf("'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "'.%c", f_string_eol[0]);
}
return;
f_print_dynamic(f_type_output, arguments.array[i]);
if (i + 1 < arguments.used) {
- printf(" ");
+ fprintf(data.output.stream, " ");
}
} // for
- printf("%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
return;
}
*status = fake_make_assure_inside_project(data, arguments.array[0], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[0].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[0].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
*status = f_path_change(arguments.array[0].string);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", arguments.array[0].string, data_make->print);
+ fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", arguments.array[0].string, data_make->error);
}
else {
if (data_make->path.stack.used == data_make->path.stack.size) {
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, &data_make->path.stack);
if (F_status_set_fine(*status) == F_buffer_too_large) {
- fake_print_message_section_operation_path_stack_max(data, F_buffer_too_large, "fl_string_lengths_size_increase", "path stack", data_make->print);
+ fake_print_message_section_operation_path_stack_max(data, F_buffer_too_large, "fl_string_lengths_size_increase", "path stack", data_make->error);
return;
}
else if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "f_macro_string_dynamics_resize", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "f_macro_string_dynamics_resize", F_true, data_make->error);
return;
}
}
fl_string_dynamic_append(data_make->path_cache, &data_make->path.stack.array[data_make->path.stack.used]);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true, data_make->error);
return;
}
*status = fake_make_path_relative(data, data_make->path.stack.array[data_make->path.stack.used], data_make);
if (F_status_is_error(*status)) {
- fake_print_message(data, F_status_set_fine(*status), "fake_make_path_relative", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fake_make_path_relative", F_true, data_make->error);
return;
}
- printf("Changed to project path '");
+ fprintf(data.output.stream, "Changed to project path '");
f_print_dynamic(f_type_output, data_make->path_cache);
- printf("'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "'.%c", f_string_eol[0]);
}
data_make->path.stack.used++;
*status = f_path_change_at(data_make->path.top);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", arguments.array[0].string, data_make->print);
+ fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", arguments.array[0].string, data_make->error);
return;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Changed to project path ''.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "Changed to project path ''.%c", f_string_eol[0]);
}
// clear stack, except for the project root.
if (F_status_is_error(*status)) {
if (F_status_is_error_not(fll_path_canonical(arguments.array[i].string, &data_make->path_cache))) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_touch", data_make->path_cache.string, "touch", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_touch", data_make->path_cache.string, "touch", F_true, F_true, data_make->error);
}
else {
- fake_print_message_file(data, F_status_set_fine(*status), "f_file_touch", arguments.array[i].string, "touch", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_file_touch", arguments.array[i].string, "touch", F_true, F_true, data_make->error);
}
break;
if (F_status_is_error(*status)) {
if (F_status_is_error_not(fll_path_canonical(arguments.array[i].string, &data_make->path_cache))) {
- fake_print_message_file(data, F_status_set_fine(*status), "f_directory_touch", data_make->path_cache.string, "touch", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_directory_touch", data_make->path_cache.string, "touch", F_false, F_true, data_make->error);
}
else {
- fake_print_message_file(data, F_status_set_fine(*status), "f_directory_touch", arguments.array[i].string, "touch", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(*status), "f_directory_touch", arguments.array[i].string, "touch", F_false, F_true, data_make->error);
}
break;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Touched %s '", arguments.array[0].string);
+ fprintf(data.output.stream, "Touched %s '", arguments.array[0].string);
f_print_dynamic(f_type_output, arguments.array[i]);
- printf("'.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "'.%c", f_string_eol[0]);
}
} // for
}
if (F_status_is_error(status)) {
- fake_print_message(data, F_status_set_fine(status), "f_macro_string_dynamics_resize", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(status), "f_macro_string_dynamics_resize", F_true, data_make->error);
return status;
}
}
status = f_environment_get(data_make->setting_build.environment.array[i].string, &data_make->environment.values.array[data_make->environment.values.used]);
if (F_status_is_error(status)) {
- fake_print_message(data, F_status_set_fine(status), "f_environment_get", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(status), "f_environment_get", F_true, data_make->error);
return status;
}
fl_string_dynamic_append(data_make->setting_build.environment.array[i], &data_make->environment.names.array[data_make->environment.names.used]);
if (F_status_is_error(status)) {
- fake_print_message(data, F_status_set_fine(status), "f_environment_get", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(status), "f_environment_get", F_true, data_make->error);
return status;
}
} // for
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("%s", program.string);
+ fprintf(data.output.stream, "%s", program.string);
for (f_array_length_t i = 0; i < arguments.used; i++) {
if (!arguments.array[i].used) continue;
- printf(" %s", arguments.array[i].string);
+ fprintf(data.output.stream, " %s", arguments.array[i].string);
} // for
- printf("%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
// flush to stdout before executing command.
fflush(f_type_output);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- fprintf(data_make->print.to, "%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find program '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", program.string);
- fl_color_print(data_make->print.to, data_make->print.context, "' for executing.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed to find program '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", program.string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' for executing.%c", f_string_eol[0]);
}
}
else if (F_status_set_fine(status) != F_failure) {
- fake_print_message(data, F_status_set_fine(status), "fll_execute_program_environment", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(status), "fll_execute_program_environment", F_true, data_make->error);
}
}
if (F_status_is_error(status2)) {
*status = status2;
- fake_print_message(data, F_status_set_fine(*status), "f_conversion_number_signed_to_string", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "f_conversion_number_signed_to_string", F_true, data_make->error);
f_macro_string_dynamic_t_delete_simple(number);
return;
if (F_status_is_error(status2)) {
*status = status2;
- fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_append", F_true, data_make->error);
return;
}
if (F_status_is_error(status2)) {
*status = status2;
- fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true, data_make->error);
return;
}
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- fprintf(data_make->print.to, "%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed with return code '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", data_make->setting_make.parameter.array[0].value.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed with return code '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", data_make->setting_make.parameter.array[0].value.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
if (data_make->setting_make.fail == fake_make_operation_fail_type_exit) {
f_macro_string_dynamics_new(status, args, arguments.used - 1);
if (F_status_is_error(status)) {
- fake_print_message(data, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(status), "f_macro_string_dynamics_new", F_true, data_make->error);
return status;
}
status = fl_string_dynamic_append(arguments.array[i + 1], &args.array[i]);
if (F_status_is_error(status)) {
- fake_print_message(data, F_status_set_fine(status), "fl_string_dynamic_append", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(status), "fl_string_dynamic_append", F_true, data_make->error);
f_macro_string_dynamics_t_delete_simple(args);
return status;
status = fl_string_dynamic_terminate(&args.array[i]);
if (F_status_is_error(status)) {
- fake_print_message(data, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true, data_make->print);
+ fake_print_message(data, F_status_set_fine(status), "fl_string_dynamic_terminate", F_true, data_make->error);
f_macro_string_dynamics_t_delete_simple(args);
return status;
if (operation == fake_make_operation_type_index || operation == fake_make_operation_type_run || operation == fake_make_operation_type_shell) {
if (!arguments.used) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
else if (operation == fake_make_operation_type_index) {
if (!data_make->setting_build.build_indexer.used) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- fprintf(data_make->print.to, "%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: No indexer has been specified, cannot perform '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, fake_make_operation_index);
- fl_color_print(data_make->print.to, data_make->print.context, "' section operation.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: No indexer has been specified, cannot perform '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, fake_make_operation_index);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_break) {
if (arguments.used > 1) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (fl_string_dynamic_compare_string(fake_make_operation_argument_success, arguments.array[0], fake_make_operation_argument_success_length) == F_equal_to_not) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure, arguments.array[0], fake_make_operation_argument_failure_length) == F_equal_to_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported break type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported break type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_build) {
if (arguments.used > 1) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
f_status_t status_file = f_file_is(path_file, f_file_type_regular, F_false);
if (status_file == F_file_found_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", path_file);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed to find file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(status_file);
}
else if (F_status_is_error(status_file)) {
- fake_print_message_file(data, *status, "f_file_is", path_file, "find", F_true, F_true, data_make->print);
+ fake_print_message_file(data, *status, "f_file_is", path_file, "find", F_true, F_true, data_make->error);
*status = status_file;
}
else if (!status_file) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", path_file);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a regular file.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a regular file.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Filename argument must not be an empty string.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Filename argument must not be an empty string.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_clean || operation == fake_make_operation_type_pop || operation == fake_make_operation_type_top || operation == fake_make_operation_type_skeleton) {
if (arguments.used) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
else if (operation == fake_make_operation_type_pop) {
if (data_make->path.stack.used == 1) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Must not attempt to pop project root off of path stack.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Must not attempt to pop project root off of path stack.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
if (f_file_exists(arguments.array[i].string) != F_true) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed to find file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1].string);
if (status_file == F_false || status_file == F_file_found_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a valid directory.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The last file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
else if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[arguments.used - 1].string, "find", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[arguments.used - 1].string, "find", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
}
status_file = f_directory_is(arguments.array[1].string);
if (status_file == F_false) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a valid directory.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The last file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_compile) {
if (!arguments.used) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
else if (data_make->setting_build.build_compiler.used) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- fprintf(data_make->print.to, "%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: No compiler has been specified, cannot perform '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, fake_make_operation_compile);
- fl_color_print(data_make->print.to, data_make->print.context, "' section operation.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: No compiler has been specified, cannot perform '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, fake_make_operation_compile);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
if (f_file_exists(arguments.array[i].string) != F_true) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed to find file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1].string);
if (status_file == F_false || status_file == F_file_found_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a valid directory.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The last file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
else if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[arguments.used - 1].string, "find", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[arguments.used - 1].string, "find", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
}
status_file = f_directory_is(arguments.array[1].string);
if (status_file == F_false) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a valid directory.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The last file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
} // for
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fake_make_operate_validate_define_name(arguments.array[0]);
if (*status == F_none) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Define name must not be an empty string.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Define name must not be an empty string.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
else if (*status == F_false) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- fprintf(data_make->print.to, "%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Invalid characters in the define setting name '", data_make->print.prefix);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Invalid characters in the define setting name '", data_make->error.prefix);
- fl_color_print_code(data_make->print.to, data.context.notable);
- f_print_dynamic(data_make->print.to, arguments.array[0]);
- fl_color_print_code(data_make->print.to, data.context.reset);
+ fl_color_print_code(data.error.to.stream, data.context.notable);
+ f_print_dynamic(data.error.to.stream, arguments.array[0]);
+ fl_color_print_code(data.error.to.stream, data.context.reset);
- fl_color_print(data_make->print.to, data_make->print.context, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "', only alpha-numeric ASCII characters and underscore (without a leading digit) is allowed.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_else) {
if (*operation_if == fake_make_operation_if_type_else_true || *operation_if == fake_make_operation_if_type_else_false) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Must not be used after another '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "else");
- fl_color_print(data_make->print.to, data_make->print.context, "' section operation.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Must not be used after another '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "else");
+ fl_color_print(data.error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
if (*operation_if == fake_make_operation_if_type_true || *operation_if == fake_make_operation_if_type_false || *operation_if == fake_make_operation_if_type_false_always) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Must not be used inside an ", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "if");
- fl_color_print(data_make->print.to, data_make->print.context, "' section operation.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Must not be used inside an ", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "if");
+ fl_color_print(data.error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
if (*operation_if != fake_make_operation_if_type_else_true_next && *operation_if != fake_make_operation_if_type_else_false_next && *operation_if != fake_make_operation_if_type_else_false_next_always) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has no preceding if condition.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has no preceding if condition.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
if (arguments.used) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_exit) {
if (arguments.used > 1) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (fl_string_dynamic_compare_string(fake_make_operation_argument_success, arguments.array[0], fake_make_operation_argument_success_length) == F_equal_to_not) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_failure, arguments.array[0], fake_make_operation_argument_failure_length) == F_equal_to_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported exit type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported exit type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (fl_string_dynamic_compare_string(fake_make_operation_argument_warn, arguments.array[0], fake_make_operation_argument_warn_length) == F_equal_to_not) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_ignore, arguments.array[0], fake_make_operation_argument_ignore_length) == F_equal_to_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported fail type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported fail type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
status_file = f_file_is(arguments.array[i].string, f_file_type_regular, F_false);
if (status_file == F_file_found_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed to find file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(status_file);
}
else if (F_status_is_error(status_file)) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- fake_print_message_file(data, *status, "f_file_is", arguments.array[i].string, "find", F_true, F_true, data_make->print);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fake_print_message_file(data, *status, "f_file_is", arguments.array[i].string, "find", F_true, F_true, data_make->error);
}
*status = status_file;
return;
}
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_if) {
if (*operation_if == fake_make_operation_if_type_true || *operation_if == fake_make_operation_if_type_false || *operation_if == fake_make_operation_if_type_false_always) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Must not be used after another '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "if");
- fl_color_print(data_make->print.to, data_make->print.context, "' section operation.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Must not be used after another '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "if");
+ fl_color_print(data.error.to.stream, data_make->error.context, "' section operation.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
} // for
if (i == 14) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported if type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported if type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (arguments.used >= if_type_minimum[i]) {
if (*operation_if == fake_make_operation_if_type_if_success || *operation_if == fake_make_operation_if_type_if_failure) {
if (arguments.used > if_type_minimum[i]) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (*operation_if == fake_make_operation_if_type_if_mode) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_is, arguments.array[1], fake_make_operation_argument_is_length) == F_equal_to_not) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_has, arguments.array[1], fake_make_operation_argument_has_length) == F_equal_to_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported mode type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported mode type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
f_file_mode_t mode_rule = 0;
uint8_t replace = 0;
- *status = fake_make_get_id_mode(data, data_make->print, arguments.array[2], &mode_rule, &replace);
+ *status = fake_make_get_id_mode(data, data_make->error, arguments.array[2], &mode_rule, &replace);
if (F_status_is_error(*status)) return;
i = 3;
if (*operation_if == fake_make_operation_if_type_if_owner) {
uid_t id = 0;
- *status = fake_make_get_id_owner(data, data_make->print, arguments.array[1], &id);
+ *status = fake_make_get_id_owner(data, data_make->error, arguments.array[1], &id);
if (F_status_is_error(*status)) return;
i = 2;
if (*operation_if == fake_make_operation_if_type_if_group) {
gid_t id = 0;
- *status = fake_make_get_id_group(data, data_make->print, arguments.array[1], &id);
+ *status = fake_make_get_id_group(data, data_make->error, arguments.array[1], &id);
if (F_status_is_error(*status)) return;
i = 2;
type_file |= 0x40;
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported file type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported file type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
type_file |= 0x80;
status_file = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(status_file)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(status_file), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(status_file), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
*operation_if = fake_make_operation_if_type_false_always_next;
}
if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_file_exists", arguments.array[i].string, "find", F_true, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_file_exists", arguments.array[i].string, "find", F_true, F_true, data_make->error);
*operation_if = fake_make_operation_if_type_false_always_next;
if (fl_string_dynamic_compare_string(fake_make_operation_argument_environment, arguments.array[1], fake_make_operation_argument_environment_length) == F_equal_to_not) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_parameter, arguments.array[1], fake_make_operation_argument_parameter_length) == F_equal_to_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported define type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported define type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (*operation_if == fake_make_operation_if_type_if_equal || *operation_if == fake_make_operation_if_type_if_equal_not) {
if (arguments.used < 3) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (*operation_if == fake_make_operation_if_type_if_greater || *operation_if == fake_make_operation_if_type_if_greater_equal || *operation_if == fake_make_operation_if_type_if_less || *operation_if == fake_make_operation_if_type_if_less_equal) {
if (arguments.used < 3) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (F_status_is_error(status_number)) {
*status = F_status_set_error(F_failure);
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
if (number > f_number_t_size_unsigned) {
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The number '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%c%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The number '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%c%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' may only be between the ranges -%llu to %llu.%c", f_number_t_size_unsigned, f_number_t_size_unsigned, f_string_eol[0]);
}
else {
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Invalid or unsupported number provided '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Invalid or unsupported number provided '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
}
}
}
}
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_link) {
if (arguments.used > 2) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data, arguments.array[0], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[0].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[0].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data, arguments.array[1], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[1].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[1].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
if (f_file_exists(arguments.array[i].string) != F_true) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[i].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed to find file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[i].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
f_status_t status_file = f_directory_is(arguments.array[arguments.used - 1].string);
if (status_file == F_false || status_file == F_file_found_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a valid directory.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The last file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
else if (F_status_is_error(status_file)) {
- fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[arguments.used - 1].string, "find", F_false, F_true, data_make->print);
+ fake_print_message_file(data, F_status_set_fine(status_file), "f_directory_is", arguments.array[arguments.used - 1].string, "find", F_false, F_true, data_make->error);
*status = F_status_set_error(F_failure);
}
}
status_file = f_directory_is(arguments.array[1].string);
if (status_file == F_false) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The last file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a valid directory.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The last file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[arguments.used - 1].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a valid directory.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_operate) {
if (arguments.used > 1) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
} // for
if (id_section == data_make->fakefile.used) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: No operation section named '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' was found.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: No operation section named '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' was found.%c", f_string_eol[0]);
}
else {
for (f_array_length_t i = 0; i < section_stack->used; i++) {
if (section_stack->array[i] == id_section) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The section operation '", data_make->print.prefix);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The section operation '", data_make->error.prefix);
- fl_color_print_code(data_make->print.to, data.context.notable);
- f_print_dynamic_partial(data_make->print.to, data_make->buffer, data_make->fakefile.array[id_section].name);
- fl_color_print_code(data_make->print.to, data.context.reset);
+ fl_color_print_code(data.error.to.stream, data.context.notable);
+ f_print_dynamic_partial(data.error.to.stream, data_make->buffer, data_make->fakefile.array[id_section].name);
+ fl_color_print_code(data.error.to.stream, data.context.reset);
- fl_color_print(data_make->print.to, data_make->print.context, "' is already in the operation stack, recursion is not allowed.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' is already in the operation stack, recursion is not allowed.%c", f_string_eol[0]);
*status = F_status_set_error(F_failure);
break;
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (operation == fake_make_operation_type_to) {
if (arguments.used > 1) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Has too many arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Has too many arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
f_status_t status_file = f_file_is(arguments.array[0].string, f_file_type_directory, F_false);
if (status_file == F_file_found_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Failed to find file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Failed to find file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(status_file);
}
else if (F_status_is_error(status_file)) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- fake_print_message_file(data, *status, "f_file_is", data.file_data_build_fakefile.string, "find", F_true, F_true, data_make->print);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fake_print_message_file(data, *status, "f_file_is", data.file_data_build_fakefile.string, "find", F_true, F_true, data_make->error);
}
*status = status_file;
}
else if (!status_file) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: The file '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "' must be a directory file.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: The file '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "' must be a directory file.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Filename argument must not be an empty string.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Filename argument must not be an empty string.%c", data_make->error.prefix, f_string_eol[0]);
}
}
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
if (fl_string_dynamic_compare_string(fake_make_operation_argument_file, arguments.array[0], fake_make_operation_argument_file_length) == F_equal_to_not) {
if (fl_string_dynamic_compare_string(fake_make_operation_argument_directory, arguments.array[0], fake_make_operation_argument_directory_length) == F_equal_to_not) {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Unsupported file type '", data_make->print.prefix);
- fl_color_print(data_make->print.to, data.context.set.notable, "%s", arguments.array[0].string);
- fl_color_print(data_make->print.to, data_make->print.context, "'.%c", f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Unsupported file type '", data_make->error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", arguments.array[0].string);
+ fl_color_print(data.error.to.stream, data_make->error.context, "'.%c", f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
- fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->print);
+ fake_print_message_section_operation_path_outside(data, F_status_set_fine(*status), "fake_make_assure_inside_project", data_make->path_cache.used ? data_make->path_cache.string : arguments.array[i].string, data_make->error);
if (F_status_set_fine(*status) == F_false) {
*status = F_status_set_error(F_failure);
} // for
}
else {
- if (data.error.verbosity != f_console_verbosity_quiet && data_make->print.to) {
- printf("%c", f_string_eol[0]);
- fl_color_print(data_make->print.to, data_make->print.context, "%s: Requires more arguments.%c", data_make->print.prefix, f_string_eol[0]);
+ if (data.error.verbosity != f_console_verbosity_quiet && data_make->error.to.stream) {
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data_make->error.context, "%s: Requires more arguments.%c", data_make->error.prefix, f_string_eol[0]);
}
*status = F_status_set_error(F_failure);
fake_make_parameter_t parameter;
fake_make_path_t path;
+ fll_error_print_t error;
+
f_fss_nameds_t fakefile;
f_string_dynamic_t buffer;
fake_environment_t_initialize, \
fake_make_parameter_t_initialize, \
fake_make_path_t_initialize, \
+ fll_error_print_t_initialize, \
f_fss_nameds_t_initialize, \
f_string_dynamic_t_initialize, \
f_string_dynamic_t_initialize, \
*
* @param data
* The program data.
+ * @param error
+ * The error/warning print data.
* @param buffer
* The string containing the name or number.
* @param id
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_make_get_id_group_
- f_return_status fake_make_get_id_group(const fake_data_t data, const f_string_static_t buffer, gid_t *id) f_gcc_attribute_visibility_internal;
+ f_return_status fake_make_get_id_group(const fake_data_t data, const fll_error_print_t error, const f_string_static_t buffer, gid_t *id) f_gcc_attribute_visibility_internal;
#endif // _di_fake_make_get_id_group_
/**
*
* @param data
* The program data.
+ * @param error
+ * The error/warning print data.
* @param buffer
* The string containing the name or number.
* @param mode
* Status codes (with error bit) are returned on any problem.
*/
#ifndef _di_fake_make_get_id_mode_
- f_return_status fake_make_get_id_mode(const fake_data_t data, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) f_gcc_attribute_visibility_internal;
+ f_return_status fake_make_get_id_mode(const fake_data_t data, const fll_error_print_t error, const f_string_static_t buffer, f_file_mode_t *mode, uint8_t *replace) f_gcc_attribute_visibility_internal;
#endif // _di_fake_make_get_id_mode_
/**
extern "C" {
#endif
-#ifndef _di_fake_print_error_
- f_return_status fake_print_error(const fake_data_t data, const f_status_t status, const f_string_t function, const bool fallback) {
- const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.set.error, f_type_error);
-
- return fake_print_message(data, status, function, fallback);
- }
-#endif // _di_fake_print_error_
-
#ifndef _di_fake_print_error_build_operation_file_
bool fake_print_error_build_operation_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t operation, const f_string_t how, const f_string_t source, const f_string_t destination, const bool fallback) {
if (status == F_file_found_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to find '");
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to find '");
if (f_file_exists(source) == F_true) {
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
else {
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
}
- fl_color_print_to(data.error.to, data.context.set.error, "' while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_parameter) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, data.context.set.error, "() to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, data.context.set.error, "() to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_name) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Invalid name for '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Invalid name for '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' or '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' or '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_memory_out) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_number_overflow) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Overflow while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Overflow while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_directory) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Invalid directory while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Invalid directory while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_access_denied) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Access denied while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Access denied while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_loop) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Loop while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Loop while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_prohibited) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Prohibited by system while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Prohibited by system while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_directory_found_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
}
return F_false;
if (status == F_failure) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
}
- if (fake_print_error(data, status, function, F_false) == F_unknown && fallback && data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "UNKNOWN ERROR: (");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, data.context.set.error, ") occurred while trying to %s '", operation);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", source);
+ if (fll_error_print(data.error, status, function, F_false) == F_unknown && fallback && data.error.verbosity != f_console_verbosity_quiet) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "UNKNOWN ERROR: (");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, data.context.set.error, ") occurred while trying to %s '", operation);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", source);
if (destination) {
- fl_color_print_to(data.error.to, data.context.set.error, "' %s '", how);
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", destination);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' %s '", how);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", destination);
}
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
}
return F_true;
}
#endif // _di_fake_print_error_build_operation_file_
-#ifndef _di_fake_print_error_file_
- bool fake_print_error_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) {
- const fake_make_print_t print = fake_macro_make_print_t_initialize(fake_make_print_error, data.context.set.error, f_type_error);
-
- return fake_print_message_file(data, status, function, name, operation, is_file, fallback, print);
- }
-#endif // _di_fake_print_error_file_
-
#ifndef _di_fake_print_error_fss
bool fake_print_error_fss(const fake_data_t data, 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) {
if (status == F_file_found_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%d", range.start);
- fl_color_print_to(data.error.to, data.context.set.error, " of setting file '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.error.to, data.context.set.error, "').%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%d", range.start);
+ fl_color_print(data.error.to.stream, data.context.set.error, " of setting file '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.error.to.stream, data.context.set.error, "').%c", f_string_eol[0]);
}
return F_false;
if (status == F_status_set_error(F_incomplete_utf_stop)) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%d", range.start);
- fl_color_print_to(data.error.to, data.context.set.error, " of setting file '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path_file);
- fl_color_print_to(data.error.to, data.context.set.error, "').%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%d", range.start);
+ fl_color_print(data.error.to.stream, data.context.set.error, " of setting file '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.error.to.stream, data.context.set.error, "').%c", f_string_eol[0]);
}
return F_false;
}
- if (fake_print_error(data, status, function, F_false) == F_unknown && fallback && data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "UNKNOWN ERROR: (");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, data.context.set.error, ") in function ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, data.context.set.error, "().%c", f_string_eol[0]);
+ if (fll_error_print(data.error, status, function, F_false) == F_unknown && fallback && data.error.verbosity != f_console_verbosity_quiet) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "UNKNOWN ERROR: (");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, data.context.set.error, ") in function ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, data.context.set.error, "().%c", f_string_eol[0]);
}
return F_true;
void fake_print_error_parameter_missing_value(const fake_data_t data, const f_string_t parameter) {
if (data.error.verbosity == f_console_verbosity_quiet) return;
- dprintf(data.error.to, "%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
}
#endif // _di_fake_print_error_parameter_missing_value_
void fake_print_error_parameter_too_many(const fake_data_t data, const f_string_t parameter) {
if (data.error.verbosity == f_console_verbosity_quiet) return;
- dprintf(data.error.to, "%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, data.context.set.error, "' specified too many times.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' specified too many times.%c", f_string_eol[0]);
}
#endif // _di_fake_print_error_parameter_too_many_
if (status == F_parameter) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Invalid parameter", print.prefix);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Invalid parameter", data.error.prefix);
if (function) {
- fl_color_print(print.to, print.context, " when calling function ");
- fl_color_print(print.to, data.context.set.notable, "%s", function);
- fl_color_print(print.to, print.context, "().%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, " when calling function ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, data.error.context, "().%c", f_string_eol[0]);
}
else {
- fl_color_print(print.to, print.context, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, ".%c", f_string_eol[0]);
}
}
if (status == F_memory_allocation || status == F_memory_reallocation) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Unable to allocate memory", print.prefix);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Unable to allocate memory", data.error.prefix);
if (function) {
- fl_color_print(print.to, print.context, " in function ");
- fl_color_print(print.to, data.context.set.notable, "%s", function);
- fl_color_print(print.to, print.context, "().%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, " in function ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, data.error.context, "().%c", f_string_eol[0]);
}
else {
- fl_color_print(print.to, print.context, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, ".%c", f_string_eol[0]);
}
}
}
if (fallback && data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "UNKNOWN %s: (", print.prefix);
- fl_color_print(print.to, data.context.set.notable, "%llu", status);
- fl_color_print(print.to, print.context, ")");
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "UNKNOWN %s: (", data.error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, data.error.context, ")");
if (function) {
- fl_color_print(print.to, print.context, " in function ");
- fl_color_print(print.to, data.context.set.notable, "%s", function);
- fl_color_print(print.to, print.context, "().%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, " in function ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, data.error.context, "().%c", f_string_eol[0]);
}
else {
- fl_color_print(print.to, print.context, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, ".%c", f_string_eol[0]);
}
}
if (status == F_file_found_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Failed to find %s '", print.prefix, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Failed to find %s '", data.error.prefix, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_file_found) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: The %s '", print.prefix, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "' already exists.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: The %s '", data.error.prefix, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "' already exists.%c", f_string_eol[0]);
}
return F_false;
if (status == F_directory_empty_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: The %s '", print.prefix, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "' is not empty.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: The %s '", data.error.prefix, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "' is not empty.%c", f_string_eol[0]);
}
return F_false;
if (status == F_parameter) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "INTERNAL %s: Invalid parameter when calling ", print.prefix);
- fl_color_print(print.to, data.context.set.notable, "%s", function);
- fl_color_print(print.to, print.context, "() for the %s '", file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "INTERNAL %s: Invalid parameter when calling ", data.error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, data.error.context, "() for the %s '", file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_name) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Invalid %s name '", print.prefix, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Invalid %s name '", data.error.prefix, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_memory_out) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "CRITICAL %s: Unable to allocate memory, while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "CRITICAL %s: Unable to allocate memory, while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_number_overflow) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Overflow while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Overflow while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_directory) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Invalid directory while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Invalid directory while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_access_denied) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Access denied while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Access denied while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_loop) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Loop while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Loop while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_prohibited) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Prohibited by system while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Prohibited by system while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_access_owner) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Currrent user is not allowed to use the given owner while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Currrent user is not allowed to use the given owner while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_access_group) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Currrent user is not allowed to use the given group while trying to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Currrent user is not allowed to use the given group while trying to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
if (is_file) {
if (status == F_directory_found_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "' due to an invalid directory in the path.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Failed to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "' due to an invalid directory in the path.%c", f_string_eol[0]);
}
return F_false;
else {
if (status == F_directory_found_not) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "' due to an invalid directory in the path.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Failed to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "' due to an invalid directory in the path.%c", f_string_eol[0]);
}
return F_false;
if (status == F_failure) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Failed to %s %s '", print.prefix, operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "%s: Failed to %s %s '", data.error.prefix, operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_false;
}
}
- if (fake_print_error(data, status, function, F_false) == F_unknown && fallback && data.error.verbosity != f_console_verbosity_quiet) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "UNKNOWN %s: (", print.prefix);
- fl_color_print(print.to, data.context.set.notable, "%llu", status);
- fl_color_print(print.to, print.context, ") occurred while trying to %s %s '", operation, file_or_directory);
- fl_color_print(print.to, data.context.set.notable, "%s", name);
- fl_color_print(print.to, print.context, "'.%c", f_string_eol[0]);
+ if (fll_error_print(data.error, status, function, F_false) == F_unknown && fallback && data.error.verbosity != f_console_verbosity_quiet) {
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.error.context, "UNKNOWN %s: (", data.error.prefix);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, data.error.context, ") occurred while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, data.error.context, "'.%c", f_string_eol[0]);
}
return F_true;
#endif // _di_fake_print_message_file_
#ifndef _di_fake_print_message_section_operation_failed_
- void fake_print_message_section_operation_failed(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) {
- if (data.error.verbosity == f_console_verbosity_quiet || !print.to) return;
+ void fake_print_message_section_operation_failed(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, fll_error_print_t error) {
+ if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
f_string_length_t line = 1;
f_fss_count_lines(buffer, operation_name.start, &line);
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: The section operation '", print.prefix);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "%s: The section operation '", data.error.prefix);
- fl_color_print_code(print.to, data.context.notable);
- f_print_dynamic_partial(print.to, buffer, operation_name);
- fl_color_print_code(print.to, data.context.reset);
+ fl_color_print_code(error.to.stream, data.context.notable);
+ f_print_dynamic_partial(error.to.stream, buffer, operation_name);
+ fl_color_print_code(error.to.stream, data.context.reset);
- fl_color_print(print.to, print.context, "' from section '");
+ fl_color_print(error.to.stream, data.error.context, "' from section '");
- fl_color_print_code(print.to, data.context.notable);
- f_print_dynamic_partial(print.to, buffer, section_name);
- fl_color_print_code(print.to, data.context.reset);
+ fl_color_print_code(error.to.stream, data.context.notable);
+ f_print_dynamic_partial(error.to.stream, buffer, section_name);
+ fl_color_print_code(error.to.stream, data.context.reset);
- fl_color_print(print.to, print.context, "' on line ");
- fl_color_print(print.to, data.context.set.notable, "%llu", line);
- fl_color_print(print.to, print.context, " failed.%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "' on line ");
+ fl_color_print(error.to.stream, data.context.set.notable, "%llu", line);
+ fl_color_print(error.to.stream, data.error.context, " failed.%c", f_string_eol[0]);
}
#endif // _di_fake_print_message_section_operation_failed_
#ifndef _di_fake_print_message_section_operation_path_outside_
- void fake_print_message_section_operation_path_outside(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) {
- if (data.error.verbosity == f_console_verbosity_quiet || !print.to) return;
+ void fake_print_message_section_operation_path_outside(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, fll_error_print_t error) {
+ if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
if (F_status_set_fine(status) == F_false) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: The path '", print.prefix);
- fl_color_print(print.to, data.context.set.notable, "%s", path);
- fl_color_print(print.to, print.context, "' is outside the project root.%c", f_string_eol[0]);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "%s: The path '", data.error.prefix);
+ fl_color_print(error.to.stream, data.context.set.notable, "%s", path);
+ fl_color_print(error.to.stream, data.error.context, "' is outside the project root.%c", f_string_eol[0]);
}
else {
- fake_print_error_file(data, status, function, path, "determine real path of", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), function, F_true, path, "determine real path of", fll_error_file_type_file);
}
}
#endif // _di_fake_print_message_section_operation_path_outside_
#ifndef _di_fake_print_message_section_operation_path_stack_max_
- void fake_print_message_section_operation_path_stack_max(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) {
- if (data.error.verbosity == f_console_verbosity_quiet || !print.to) return;
+ void fake_print_message_section_operation_path_stack_max(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, fll_error_print_t error) {
+ if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
if (status == F_buffer_too_large) {
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: Maximum stack size reached while processing path '", print.prefix);
- fl_color_print(print.to, data.context.set.notable, "%s", path);
- fl_color_print(print.to, print.context, "'");
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "%s: Maximum stack size reached while processing path '", data.error.prefix);
+ fl_color_print(error.to.stream, data.context.set.notable, "%s", path);
+ fl_color_print(error.to.stream, data.error.context, "'");
if (function) {
- fl_color_print(print.to, print.context, " while calling ");
- fl_color_print(print.to, data.context.set.notable, "%s", function);
- fl_color_print(print.to, print.context, "()");
+ fl_color_print(error.to.stream, data.error.context, " while calling ");
+ fl_color_print(error.to.stream, data.context.set.notable, "%s", function);
+ fl_color_print(error.to.stream, data.error.context, "()");
}
- fl_color_print(print.to, print.context, ".%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, ".%c", f_string_eol[0]);
}
else {
- fake_print_message_file(data, status, function, path, "change path to", F_false, F_true, print);
+ fll_error_file_print(error, status, function, F_true, path, "change path to", fll_error_file_type_directory);
}
}
#endif // _di_fake_print_message_section_operation_path_stack_max_
#ifndef _di_fake_print_message_section_operation_stack_max_
- void fake_print_message_section_operation_stack_max(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max, const fake_make_print_t print) {
- if (data.error.verbosity == f_console_verbosity_quiet || !print.to) return;
+ void fake_print_message_section_operation_stack_max(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max, fll_error_print_t error) {
+ if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
f_string_length_t line = 1;
f_fss_count_lines(buffer, operation_name.start, &line);
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: The section operation '", print.prefix);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "%s: The section operation '", data.error.prefix);
- fl_color_print_code(print.to, data.context.notable);
- f_print_dynamic_partial(print.to, buffer, operation_name);
- fl_color_print_code(print.to, data.context.reset);
+ fl_color_print_code(error.to.stream, data.context.notable);
+ f_print_dynamic_partial(error.to.stream, buffer, operation_name);
+ fl_color_print_code(error.to.stream, data.context.reset);
- fl_color_print(print.to, print.context, "' from section '");
+ fl_color_print(error.to.stream, data.error.context, "' from section '");
- fl_color_print_code(print.to, data.context.notable);
- f_print_dynamic_partial(print.to, buffer, section_name);
- fl_color_print_code(print.to, data.context.reset);
+ fl_color_print_code(error.to.stream, data.context.notable);
+ f_print_dynamic_partial(error.to.stream, buffer, section_name);
+ fl_color_print_code(error.to.stream, data.context.reset);
- fl_color_print(print.to, print.context, "' on line ");
- fl_color_print(print.to, data.context.set.notable, "%llu", line);
- fl_color_print(print.to, print.context, " cannot be processed because the max stack depth of ");
- fl_color_print(print.to, data.context.set.notable, "%llu", stack_max);
- fl_color_print(print.to, print.context, " has been reached.%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "' on line ");
+ fl_color_print(error.to.stream, data.context.set.notable, "%llu", line);
+ fl_color_print(error.to.stream, data.error.context, " cannot be processed because the max stack depth of ");
+ fl_color_print(error.to.stream, data.context.set.notable, "%llu", stack_max);
+ fl_color_print(error.to.stream, data.error.context, " has been reached.%c", f_string_eol[0]);
}
#endif // _di_fake_print_message_section_operation_stack_max_
#ifndef _di_fake_print_message_section_operation_unknown_
- void fake_print_message_section_operation_unknown(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) {
- if (data.error.verbosity == f_console_verbosity_quiet || !print.to) return;
+ void fake_print_message_section_operation_unknown(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, fll_error_print_t error) {
+ if (data.error.verbosity == f_console_verbosity_quiet || !error.to.stream) return;
f_string_length_t line = 1;
f_fss_count_lines(buffer, operation_name.start, &line);
- fprintf(print.to, "%c", f_string_eol[0]);
- fl_color_print(print.to, print.context, "%s: The section operation '", print.prefix);
+ fprintf(error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "%s: The section operation '", data.error.prefix);
- fl_color_print_code(print.to, data.context.notable);
- f_print_dynamic_partial(print.to, buffer, operation_name);
- fl_color_print_code(print.to, data.context.reset);
+ fl_color_print_code(error.to.stream, data.context.notable);
+ f_print_dynamic_partial(error.to.stream, buffer, operation_name);
+ fl_color_print_code(error.to.stream, data.context.reset);
- fl_color_print(print.to, print.context, "' from section '");
+ fl_color_print(error.to.stream, data.error.context, "' from section '");
- fl_color_print_code(print.to, data.context.notable);
- f_print_dynamic_partial(print.to, buffer, section_name);
- fl_color_print_code(print.to, data.context.reset);
+ fl_color_print_code(error.to.stream, data.context.notable);
+ f_print_dynamic_partial(error.to.stream, buffer, section_name);
+ fl_color_print_code(error.to.stream, data.context.reset);
- fl_color_print(print.to, print.context, "' on line ");
- fl_color_print(print.to, data.context.set.notable, "%llu", line);
- fl_color_print(print.to, print.context, " is not a known operation name.%c", f_string_eol[0]);
+ fl_color_print(error.to.stream, data.error.context, "' on line ");
+ fl_color_print(error.to.stream, data.context.set.notable, "%llu", line);
+ fl_color_print(error.to.stream, data.error.context, " is not a known operation name.%c", f_string_eol[0]);
}
#endif // _di_fake_print_message_section_operation_unknown_
void fake_print_warning_settings_content_empty(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_t settings_name) {
if (data.error.verbosity == f_console_verbosity_quiet) return;
- dprintf(data.error.to, "%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the fakefile '");
fl_color_print(f_type_warning, data.context.set.notable, "%s", path_file);
void fake_print_warning_settings_content_invalid(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_t settings_name) {
if (data.error.verbosity == f_console_verbosity_quiet) return;
- dprintf(data.error.to, "%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
- fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the fakefile '");
- fl_color_print(f_type_warning, data.context.set.notable, "%s", path_file);
- fl_color_print(f_type_warning, data.context.set.warning, "' has an invalid content '");
+ fl_color_print(data.output.stream, data.context.set.warning, "WARNING: the fakefile '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", path_file);
+ fl_color_print(data.output.stream, data.context.set.warning, "' has an invalid content '");
- fl_color_print_code(f_type_warning, data.context.notable);
- f_print_dynamic_partial(f_type_warning, buffer, range_content);
- fl_color_print_code(f_type_warning, data.context.reset);
+ fl_color_print_code(data.output.stream, data.context.notable);
+ f_print_dynamic_partial(data.output.stream, buffer, range_content);
+ fl_color_print_code(data.output.stream, data.context.reset);
- fl_color_print(f_type_warning, data.context.set.warning, "' for the '");
- fl_color_print(f_type_warning, data.context.set.notable, "%s", settings_name);
- fl_color_print(f_type_warning, data.context.set.warning, "' object '");
+ fl_color_print(data.output.stream, data.context.set.warning, "' for the '");
+ fl_color_print(data.output.stream, data.context.set.notable, "%s", settings_name);
+ fl_color_print(data.output.stream, data.context.set.warning, "' object '");
- fl_color_print_code(f_type_warning, data.context.notable);
- f_print_dynamic_partial(f_type_warning, buffer, range_object);
- fl_color_print_code(f_type_warning, data.context.reset);
+ fl_color_print_code(data.output.stream, data.context.notable);
+ f_print_dynamic_partial(data.output.stream, buffer, range_object);
+ fl_color_print_code(data.output.stream, data.context.reset);
- fl_color_print(f_type_warning, data.context.set.warning, "'.%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.warning, "'.%c", f_string_eol[0]);
}
#endif // _di_fake_print_warning_settings_content_invalid_
void fake_print_warning_settings_content_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t name_object) {
if (data.error.verbosity != f_console_verbosity_verbose) return;
- dprintf(data.error.to, "%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the setting '");
fl_color_print(f_type_warning, data.context.set.notable, "%s", name_object);
void fake_print_warning_settings_object_multiple(const fake_data_t data, const f_string_t path_file, const f_string_t label, const f_string_t name_object) {
if (data.error.verbosity != f_console_verbosity_verbose) return;
- dprintf(data.error.to, "%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
fl_color_print(f_type_warning, data.context.set.warning, "WARNING: the %s object '", label);
fl_color_print(f_type_warning, data.context.set.notable, "%s", name_object);
#endif
/**
- * Print generic error messages.
- *
- * @param data
- * The program data.
- * @param status
- * The status code representing an error.
- * @param function
- * The name of the function where the error happened.
- * Set to 0 to disable.
- * @param fallback
- * Set to F_true to print the fallback error message for unknown errors.
- *
- * @return
- * F_none is returned on successful print of known errors.
- * F_unknown is returned if the status code has no print message.
- */
-#ifndef _di_fake_print_error_
- extern f_return_status fake_print_error(const fake_data_t data, const f_status_t status, const f_string_t function, const bool fallback) f_gcc_attribute_visibility_internal;
-#endif // _di_fake_print_error_
-
-/**
* Print build operation file error messages.
*
* @param data
#endif // _di_fake_print_error_operation_file_
/**
- * Print file/directory error messages.
- *
- * @todo the fll_file_error_print() needs to be reviewed and possibly changed.
- *
- * @param data
- * The program data.
- * @param status
- * The error status code to report on.
- * @param function
- * The function call that returned the error.
- * @param name
- * The name of the file or directory.
- * @param operation
- * The operation that fails, such as 'create' or 'access'.
- * @param is_file
- * Set to TRUE if this is a file and FALSE if this is a directory.
- * @param fallback
- * Set to F_true to print the fallback error message for unknown errors.
- *
- * @return
- * F_true is returned if the status code has no print message.
- * F_false is returned on successful print of known errors.
- */
-#ifndef _di_fake_print_error_file_
- extern bool fake_print_error_file(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t name, const f_string_t operation, const bool is_file, const bool fallback) f_gcc_attribute_visibility_internal;
-#endif // _di_fake_print_error_file_
-
-/**
* Print FSS error messages.
*
* @param data
* Set to TRUE if this is a file and FALSE if this is a directory.
* @param fallback
* Set to F_true to print the fallback error message for unknown errors.
- * @param print
- * Designates how the section error/warning should be printed.
*
* @return
* F_true is returned if the status code has no print message.
* The range within the buffer representing the section name.
* @param operation_name
* The range within the buffer representing the operation name within the section.
- * @param print
+ * @param error
* Designates how the section error/warning should be printed.
*/
#ifndef _di_fake_print_message_section_operation_failed_
- extern void fake_print_message_section_operation_failed(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) f_gcc_attribute_visibility_internal;
+ extern void fake_print_message_section_operation_failed(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, fll_error_print_t error) f_gcc_attribute_visibility_internal;
#endif // _di_fake_print_message_section_operation_failed_
/**
* The name of the function where the error happened.
* @param path
* The path that is outside of the project path.
- * @param print
+ * @param error
* Designates how the section error/warning should be printed.
*/
#ifndef _di_fake_print_message_section_operation_path_outside_
- extern void fake_print_message_section_operation_path_outside(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) f_gcc_attribute_visibility_internal;
+ extern void fake_print_message_section_operation_path_outside(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, fll_error_print_t error) f_gcc_attribute_visibility_internal;
#endif // _fake_print_message_section_operation_path_outside_
/**
* Set to 0 to disable.
* @param path
* The path to the directory.
- * @param print
+ * @param error
* Designates how the section error/warning should be printed.
*/
#ifndef _di_fake_print_message_section_operation_path_stack_max_
- extern void fake_print_message_section_operation_path_stack_max(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, const fake_make_print_t print) f_gcc_attribute_visibility_internal;
+ extern void fake_print_message_section_operation_path_stack_max(const fake_data_t data, const f_status_t status, const f_string_t function, const f_string_t path, fll_error_print_t error) f_gcc_attribute_visibility_internal;
#endif // _di_fake_print_message_section_operation_path_stack_max_
/**
* The range within the buffer representing the operation name within the section.
* @param stack_max
* The max stack depth.
- * @param print
+ * @param error
* Designates how the section error/warning should be printed.
*/
#ifndef _di_fake_print_message_section_operation_stack_max_
- extern void fake_print_message_section_operation_stack_max(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max, const fake_make_print_t print) f_gcc_attribute_visibility_internal;
+ extern void fake_print_message_section_operation_stack_max(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const f_array_length_t stack_max, fll_error_print_t error) f_gcc_attribute_visibility_internal;
#endif // _di_fake_print_message_section_operation_stack_max_
/**
* The range within the buffer representing the section name.
* @param operation_name
* The range within the buffer representing the operation name within the section.
- * @param print
+ * @param error
* Designates how the section error/warning should be printed.
*/
#ifndef _di_fake_print_message_section_operation_unknown_
- extern void fake_print_message_section_operation_unknown(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, const fake_make_print_t print) f_gcc_attribute_visibility_internal;
+ extern void fake_print_message_section_operation_unknown(const fake_data_t data, const f_string_static_t buffer, const f_string_range_t section_name, const f_string_range_t operation_name, fll_error_print_t error) f_gcc_attribute_visibility_internal;
#endif // _di_fake_print_message_section_operation_unknown_
/**
* The range within the buffer representing the content.
* @param settings_name
* The name of the setting that has an invalid value.
- * @param print
- * Designates how the section error/warning should be printed.
*/
#ifndef _di_fake_print_warning_settings_content_invalid_
extern void fake_print_warning_settings_content_invalid(const fake_data_t data, const f_string_t path_file, const f_string_dynamic_t buffer, const f_string_range_t range_object, const f_string_range_t range_content, const f_string_t settings_name) f_gcc_attribute_visibility_internal;
f_status_t status = F_none;
if (data.error.verbosity != f_console_verbosity_quiet) {
- printf("%c", f_string_eol[0]);
- fl_color_print(f_type_output, data.context.set.important, "Generating skeleton structure.%c", f_string_eol[0]);
+ fprintf(data.output.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.output.stream, data.context.set.important, "Generating skeleton structure.%c", f_string_eol[0]);
}
{
status = fake_skeleton_operate_directory_create(data, *parameters_value[i]);
if (F_status_is_error(status)) {
- fake_print_error(data, F_status_set_fine(status), "fake_skeleton_operate_directory_create", F_true);
+ fll_error_print(data.error, F_status_set_fine(status), "fake_skeleton_operate_directory_create", F_true);
return status;
}
} // for
if (status == F_true) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Directory '%s' already exists.%c", path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "Directory '%s' already exists.%c", path.string, f_string_eol[0]);
}
return F_none;
if (status == F_false) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The path '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path.string);
- fl_color_print_to(data.error.to, data.context.set.error, "' exists but is not a directory.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The path '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path.string);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' exists but is not a directory.%c", f_string_eol[0]);
}
return F_status_set_warning(F_failure);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The path '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path.string);
- fl_color_print_to(data.error.to, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The path '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path.string);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]);
}
else {
- fake_print_error_file(data, F_status_set_fine(status), "f_directory_create", path.string, "create", F_false, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_directory_create", F_true, path.string, "create", fll_error_file_type_directory);
}
return status;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("Directory '%s' created.%c", path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "Directory '%s' created.%c", path.string, f_string_eol[0]);
}
}
else if (F_status_is_error(status)) {
- fake_print_error_file(data, F_status_set_fine(status), "f_directory_exists", path.string, "create", F_false, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_directory_exists", F_true, path.string, "create", fll_error_file_type_directory);
return status;
}
if (status == F_true) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("File '%s' already exists.%c", path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "File '%s' already exists.%c", path.string, f_string_eol[0]);
}
return F_none;
if (status == F_true) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("File '%s' already exists (as a symbolic link).%c", path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "File '%s' already exists (as a symbolic link).%c", path.string, f_string_eol[0]);
}
return F_none;
if (status == F_false) {
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("File '%s' already exists but is not a regular file (or symbolic link).%c", path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "File '%s' already exists but is not a regular file (or symbolic link).%c", path.string, f_string_eol[0]);
}
return F_status_set_warning(F_none);
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_file_found_not) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The file '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s", path.string);
- fl_color_print_to(data.error.to, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The file '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s", path.string);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' could not be created, a parent directory does not exist.%c", f_string_eol[0]);
}
else {
- fake_print_error_file(data, F_status_set_fine(status), "f_file_create", path.string, "create", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_file_create", F_true, path.string, "create", fll_error_file_type_file);
}
return status;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("File '%s' created.%c", path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "File '%s' created.%c", path.string, f_string_eol[0]);
}
if (content.used) {
status = f_file_open(path.string, 0, &file);
if (F_status_is_error(status)) {
- fake_print_error_file(data, F_status_set_fine(status), "f_file_open", path.string, "pre-populate", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_file_open", F_true, path.string, "pre-populate", fll_error_file_type_file);
return status;
}
status = f_file_write(file, content, 0);
if (F_status_is_error(status)) {
- fake_print_error_file(data, F_status_set_fine(status), "f_file_write", path.string, "pre-populate", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_file_write", F_true, path.string, "pre-populate", fll_error_file_type_file);
f_file_close(&file.id);
return status;
}
if (data.error.verbosity == f_console_verbosity_verbose) {
- printf("File '%s' pre-populated.%c", path.string, f_string_eol[0]);
+ fprintf(data.output.stream, "File '%s' pre-populated.%c", path.string, f_string_eol[0]);
}
f_file_close(&file.id);
}
}
else if (F_status_is_error(status)) {
- fake_print_error_file(data, F_status_set_fine(status), "f_file_is", path.string, "create", F_true, F_true);
+ fll_error_file_print(data.error, F_status_set_fine(status), "f_file_is", F_true, path.string, "create", fll_error_file_type_file);
+
return status;
}
#endif
#ifndef _di_firewall_print_help_
- f_return_status firewall_print_help(const int id, const f_color_context_t context) {
+ f_return_status firewall_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, firewall_name_long, firewall_version);
+ fll_program_print_help_header(file, context, firewall_name_long, firewall_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
#ifdef _en_firewall_debug_
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
#endif // _en_firewall_debug_
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
#ifdef _en_firewall_debug_
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging.");
#endif // _en_firewall_debug_
printf("%c%c", f_string_eol[0], f_string_eol[0]);
fl_color_print(f_type_output, context.set.standout, firewall_command_show);
printf(" Show active firewall settings");
- fll_program_print_help_usage(id, context, firewall_name, "command");
+ fll_program_print_help_usage(file, context, firewall_name, "command");
return F_none;
}
f_macro_string_dynamics_resize(status, parameters, 7);
if (F_status_is_error(status)) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
firewall_delete_local_data(&local);
firewall_delete_data(data);
return status;
status = F_status_set_fine(status);
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to perform requested %s operation:%c", firewall_tool_iptables, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to perform requested %s operation:%c", firewall_tool_iptables, f_string_eol[0]);
fprintf(f_type_error, " ");
f_string_length_t i = 0;
status = F_status_set_fine(status);
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status == F_data_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Could not find any network devices%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Could not find any network devices%c", f_string_eol[0]);
}
else if (status == F_failure) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to read the device directory '%s'%c", network_devices, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to read the device directory '%s'%c", network_devices, f_string_eol[0]);
}
firewall_delete_local_data(&local);
return status;
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to perform lock request because the lock instructions are missing from: %s.%c", network_path firewall_file_other, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to perform lock request because the lock instructions are missing from: %s.%c", network_path firewall_file_other, f_string_eol[0]);
firewall_delete_local_data(&local);
firewall_delete_data(data);
}
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to perform stop request because the lock instructions are missing from: %s.", network_path firewall_file_other, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to perform stop request because the lock instructions are missing from: %s.", network_path firewall_file_other, f_string_eol[0]);
firewall_delete_local_data(&local);
firewall_delete_data(data);
f_macro_string_dynamic_t_resize(status, file_path, network_path_length + data->devices.array[i].used + firewall_file_suffix_length + 1);
if (F_status_is_error(status)) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
firewall_delete_local_data(&local);
firewall_delete_data(data);
return status;
firewall_delete_local_data(&local);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You did not pass a command%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You did not pass a command%c", f_string_eol[0]);
status = F_status_set_error(F_parameter);
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_string_dynamics_t chains;
firewall_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_string_dynamics_t_initialize, \
f_string_dynamics_t_initialize, \
#endif // _di_firewall_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_firewall_print_help_
- extern f_return_status firewall_print_help(const int id, const f_color_context_t context);
+ extern f_return_status firewall_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_firewall_print_help_
/**
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
// the file does not have to exist
status = F_none;
}
else if (status == F_file_open) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Unable to open the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Unable to open the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: File descriptor error while trying to open the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: File descriptor error while trying to open the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
}
if (status != F_file_found_not) {
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read()%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read()%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Integer overflow while trying to buffer the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Integer overflow while trying to buffer the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
}
else if (status == F_file_closed) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: The file '%.*s' is no longer open%c", file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: The file '%.*s' is no longer open%c", file_path.used, file_path.string, f_string_eol[0]);
}
else if (status == F_file_seek) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: A seek error occurred while accessing the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: A seek error occurred while accessing the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
}
else if (status == F_file_read) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: A read error occurred while accessing the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: A read error occurred while accessing the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read()%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read()%c", status, f_string_eol[0]);
}
status = F_status_set_error(status);
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_read() for the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_read() for the file '%.*s'%c", file_path.used, file_path.string, f_string_eol[0]);
}
else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
// empty files are to be silently ignored
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'%c", status, file_path.used, file_path.string, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'%c", status, file_path.used, file_path.string, f_string_eol[0]);
}
status = F_status_set_error(status);
}
if (F_status_is_error(status)) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
f_macro_string_dynamic_t_delete_simple(ip_list_action);
}
f_macro_string_dynamic_t_new(status, ip_argument, ip_length);
if (F_status_is_error(status)) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
break;
}
status = fll_execute_program((f_string_t) current_tool, arguments, 0, &return_code);
if (status == F_failure) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", current_tool, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", current_tool, f_string_eol[0]);
fprintf(f_type_error, " ");
fl_color_print_code(f_type_error, data.context.error);
break;
}
else if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
// remove ip_argument from arguments string.
f_macro_string_dynamic_t_delete_simple(arguments.array[arguments.used]);
status = fll_execute_program(current_tool, arguments, 0, &return_code);
if (status == F_failure) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", current_tool, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", current_tool, f_string_eol[0]);
fprintf(f_type_error, " ");
fl_color_print_code(f_type_error, data.context.error);
break;
}
else if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
break;
}
}
if (status == F_failure) {
if (tool == firewall_program_iptables) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to perform requested %s operation:%c", firewall_tool_iptables, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to perform requested %s operation:%c", firewall_tool_iptables, f_string_eol[0]);
}
else if (tool == firewall_program_ip6tables) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to perform requested %s operation:%c", firewall_tool_ip6tables, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to perform requested %s operation:%c", firewall_tool_ip6tables, f_string_eol[0]);
}
fprintf(f_type_error, " ");
fprintf(f_type_error, "\n");
}
else if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
}
f_macro_string_dynamics_t_delete_simple(arguments);
status = F_status_set_fine(status);
if (status == F_failure) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", tools[i], f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", tools[i], f_string_eol[0]);
fprintf(f_type_error, " ");
fl_color_print_code(f_type_error, data.context.error);
fprintf(f_type_error, "\n");
}
else if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
}
return status;
status = F_status_set_fine(status);
if (status == F_failure) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", tools[i], f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", tools[i], f_string_eol[0]);
fprintf(f_type_error, " ");
fl_color_print_code(f_type_error, data.context.error);
fprintf(f_type_error, "\n");
}
else if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
}
return status;
status = F_status_set_fine(status);
if (status == F_failure) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", tools[j], f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Failed to perform requested %s operation:%c", tools[j], f_string_eol[0]);
fprintf(f_type_error, " ");
fl_color_print_code(f_type_error, data.context.error);
fprintf(f_type_error, "\n");
}
else if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()%c", status, f_string_eol[0]);
}
return status;
if (optional) {
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
}
else if (status != F_file_found_not && status != F_file_open && status != F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
}
} else {
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to find the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to find the file '%s'.%c", filename, f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to open the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to open the file '%s'.%c", filename, f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'.%c", filename, f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
}
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read().%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read().%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Integer overflow while trying to buffer the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Integer overflow while trying to buffer the file '%s'.%c", filename, f_string_eol[0]);
}
else if (status == F_file_closed) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: The file '%s' is no longer open.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: The file '%s' is no longer open.%c", filename, f_string_eol[0]);
}
else if (status == F_file_seek) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: A seek error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: A seek error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
}
else if (status == F_file_read) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: A read error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: A read error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read().%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read().%c", status, f_string_eol[0]);
}
return status;
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.%c", filename, f_string_eol[0]);
}
else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: No relevant data was found within the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: No relevant data was found within the file '%s'.%c", filename, f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.%c", status, filename, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.%c", status, filename, f_string_eol[0]);
}
return status;
status = F_status_set_fine(status);
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status == F_failure) {
// the error message has already been displayed.
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().%c", status, f_string_eol[0]);
}
f_macro_fss_objects_t_delete_simple(local->rule_objects);
(structure.array[index].stop - structure.array[index].start) + 1
// TODO: temporarily added, convert this to a function below.
-// TODO: also report: fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+// TODO: also report: fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
#define firewall_macro_append_argument_to_arguments(status, arguments, argument) \
if (arguments.used == arguments.size) { \
f_macro_string_dynamics_resize(status, arguments, arguments.used + firewall_default_allocation_step); \
#endif
#ifndef _di_fss_basic_list_read_print_help_
- f_return_status fss_basic_list_read_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_basic_list_read_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_basic_list_read_name_long, fss_basic_list_read_version);
+ fll_program_print_help_header(file, context, fss_basic_list_read_name_long, fss_basic_list_read_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_line, fss_basic_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_name, fss_basic_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_select, fss_basic_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_total, fss_basic_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
- fll_program_print_help_option(id, context, fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_at, fss_basic_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_depth, fss_basic_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_empty, fss_basic_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_line, fss_basic_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_name, fss_basic_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_object, fss_basic_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_select, fss_basic_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_total, fss_basic_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_basic_list_read_short_trim, fss_basic_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
- fll_program_print_help_usage(id, context, fss_basic_list_read_name, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_basic_list_read_name, "filename(s)");
fl_color_print(f_type_output, context.set.important, " Notes:");
if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[fss_basic_list_read_parameter_at].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_depth].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_name].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_basic_list_read_parameter_object].result == f_console_result_found) {
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) {
if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_basic_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
macro_fss_basic_list_read_depths_t_delete_simple(depths);
fss_basic_list_read_delete_data(data);
macro_fss_basic_list_read_depths_t_delete_simple(depths);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
status = F_status_set_error(F_parameter);
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_string_dynamic_t buffer;
fss_basic_list_read_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_string_dynamic_t_initialize, \
f_fss_objects_t_initialize, \
#endif // _di_fss_basic_list_read_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_basic_list_read_print_help_
- extern f_return_status fss_basic_list_read_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_basic_list_read_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_basic_list_read_print_help_
/**
void fss_basic_list_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) {
if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
}
#endif // _di_fss_basic_list_read_print_file_error_
void fss_basic_list_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) {
if (status == F_parameter) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
else if (status == F_number) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is not a valid number for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is not a valid number for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_underflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too small for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too small for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too large for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too large for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_negative) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is negative, which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_positive) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' contains a '");
- fl_color_print_to(data.error.to, context.set.notable, "+");
- fl_color_print_to(data.error.to, context.set.error, "', which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' contains a '");
+ fl_color_print(data.error.to.stream, context.set.notable, "+");
+ fl_color_print(data.error.to.stream, context.set.error, "', which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_data_not) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, "' for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' with the value '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' with the value '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
}
#endif // _di_fss_basic_list_read_print_number_argument_error_
macro_fss_basic_list_read_depths_t_new(status, (*depths), depth_size);
if (F_status_is_error(status)) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
return status;
}
// @todo: move error printing into common function.
if (status_code == F_memory_allocation || status_code == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status_code == f_string_length_t_size) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Unable to process '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim);
- fl_color_print_to(data.error.to, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Unable to process '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
}
else {
f_string_t function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, data.context.set.notable, "%u", status_code);
- fl_color_print_to(data.error.to, data.context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s()", function);
- fl_color_print_to(data.error.to, data.context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code);
+ fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function);
+ fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]);
}
return status;
}
if (!depths->array[i].value_name.used) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
- fl_color_print_to(data.error.to, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
for (f_array_length_t j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may only be specified once for the parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may not have the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' before the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[j].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may not have the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_basic_list_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_basic_list_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_stop) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_eos) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data->error.to, data->context.set.notable, "%u", status);
- fl_color_print_to(data->error.to, data->context.set.error, ") has occurred while calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_basic_list_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%u", status);
+ fl_color_print(data->error.to.stream, data->context.set.error, ") has occurred while calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_basic_list_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return F_status_set_error(status);
#endif
#ifndef _di_fss_basic_list_write_print_help_
- f_return_status fss_basic_list_write_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_basic_list_write_name_long, fss_basic_list_write_version);
+ fll_program_print_help_header(file, context, fss_basic_list_write_name_long, fss_basic_list_write_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_basic_list_write_short_content, fss_basic_list_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " The content to output.");
- fll_program_print_help_option(id, context, fss_basic_list_write_short_double, fss_basic_list_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
- fll_program_print_help_option(id, context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
- fll_program_print_help_option(id, context, fss_basic_list_write_short_object, fss_basic_list_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
- fll_program_print_help_option(id, context, fss_basic_list_write_short_partial, fss_basic_list_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output end of object/content character.");
- fll_program_print_help_option(id, context, fss_basic_list_write_short_single, fss_basic_list_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_content, fss_basic_list_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " The content to output.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_double, fss_basic_list_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_file, fss_basic_list_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_object, fss_basic_list_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_partial, fss_basic_list_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output end of object/content character.");
+ fll_program_print_help_option(file, context, fss_basic_list_write_short_single, fss_basic_list_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
- fll_program_print_help_usage(id, context, fss_basic_list_write_name, "");
+ fll_program_print_help_usage(file, context, fss_basic_list_write_name, "");
return F_none;
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to find the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to find the file '%s'%c", "-", f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to open the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to open the file '%s'%c", "-", f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", "-", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(buffer);
f_file_close(&output.id);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to find the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to find the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(buffer);
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()%c", f_string_eol[0]);
}
else if (status == F_file_write) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to write to the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to write to the file '%s'%c", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(buffer);
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_color_context_t context;
fss_basic_list_write_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_color_context_t_initialize, \
}
#endif // _di_fss_basic_list_write_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_basic_list_write_print_help_
- extern f_return_status fss_basic_list_write_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_basic_list_write_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_basic_list_write_print_help_
/**
#endif
#ifndef _di_fss_basic_read_print_help_
- f_return_status fss_basic_read_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_basic_read_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_basic_read_name_long, fss_basic_read_version);
+ fll_program_print_help_header(file, context, fss_basic_read_name_long, fss_basic_read_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
- fll_program_print_help_option(id, context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
- fll_program_print_help_option(id, context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
- fll_program_print_help_option(id, context, fss_basic_read_short_line, fss_basic_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
- fll_program_print_help_option(id, context, fss_basic_read_short_name, fss_basic_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
- fll_program_print_help_option(id, context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
- fll_program_print_help_option(id, context, fss_basic_read_short_select, fss_basic_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
- fll_program_print_help_option(id, context, fss_basic_read_short_total, fss_basic_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
- fll_program_print_help_option(id, context, fss_basic_read_short_trim, fss_basic_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_at, fss_basic_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_depth, fss_basic_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_empty, fss_basic_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_line, fss_basic_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_name, fss_basic_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_object, fss_basic_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_select, fss_basic_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_total, fss_basic_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_basic_read_short_trim, fss_basic_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
- fll_program_print_help_usage(id, context, fss_basic_read_name, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_basic_read_name, "filename(s)");
fl_color_print(f_type_output, context.set.important, " Notes:");
if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[fss_basic_read_parameter_at].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_read_parameter_depth].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_read_parameter_name].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_basic_read_parameter_object].result == f_console_result_found) {
if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.");
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.");
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) {
if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_basic_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
macro_fss_basic_read_depths_t_delete_simple(depths);
fss_basic_read_delete_data(data);
macro_fss_basic_read_depths_t_delete_simple(depths);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
status = F_status_set_error(F_parameter);
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_string_dynamic_t buffer;
fss_basic_read_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_string_dynamic_t_initialize, \
f_fss_objects_t_initialize, \
#endif // _di_fss_basic_read_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_basic_read_print_help_
- extern f_return_status fss_basic_read_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_basic_read_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_basic_read_print_help_
/**
void fss_basic_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) {
if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
}
#endif // _di_fss_basic_read_print_file_error_
void fss_basic_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) {
if (status == F_parameter) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
else if (status == F_number) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is not a valid number for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is not a valid number for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_underflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too small for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too small for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too large for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too large for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_negative) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is negative, which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_positive) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' contains a '");
- fl_color_print_to(data.error.to, context.set.notable, "+");
- fl_color_print_to(data.error.to, context.set.error, "', which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' contains a '");
+ fl_color_print(data.error.to.stream, context.set.notable, "+");
+ fl_color_print(data.error.to.stream, context.set.error, "', which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_data_not) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, "' for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' with the value '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' with the value '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
}
#endif // _di_fss_basic_read_print_number_argument_error_
macro_fss_basic_read_depths_t_new(status, (*depths), depth_size);
if (F_status_is_error(status)) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
return status;
}
// @todo: move error printing into common function.
if (status_code == F_memory_allocation || status_code == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status_code == f_string_length_t_size) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Unable to process '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim);
- fl_color_print_to(data.error.to, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Unable to process '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
}
else {
f_string_t function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, data.context.set.notable, "%u", status_code);
- fl_color_print_to(data.error.to, data.context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s()", function);
- fl_color_print_to(data.error.to, data.context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code);
+ fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function);
+ fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]);
}
return status;
}
if (!depths->array[i].value_name.used) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
- fl_color_print_to(data.error.to, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
for (f_array_length_t j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may only be specified once for the parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may not have the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' before the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[j].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may not have the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_basic_list_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_basic_list_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_stop) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_eos) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data->error.to, data->context.set.notable, "%u", status);
- fl_color_print_to(data->error.to, data->context.set.error, ") has occurred while calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_basic_list_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%u", status);
+ fl_color_print(data->error.to.stream, data->context.set.error, ") has occurred while calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_basic_list_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return F_status_set_error(status);
#endif
#ifndef _di_fss_basic_write_print_help_
- f_return_status fss_basic_write_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_basic_write_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_basic_write_name_long, fss_basic_write_version);
+ fll_program_print_help_header(file, context, fss_basic_write_name_long, fss_basic_write_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_basic_write_short_content, fss_basic_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " The content to output.");
- fll_program_print_help_option(id, context, fss_basic_write_short_double, fss_basic_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
- fll_program_print_help_option(id, context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
- fll_program_print_help_option(id, context, fss_basic_write_short_object, fss_basic_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
- fll_program_print_help_option(id, context, fss_basic_write_short_partial, fss_basic_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output end of object/content character.");
- fll_program_print_help_option(id, context, fss_basic_write_short_single, fss_basic_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_content, fss_basic_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " The content to output.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_double, fss_basic_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_basic_write_short_file, fss_basic_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_object, fss_basic_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_partial, fss_basic_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output end of object/content character.");
+ fll_program_print_help_option(file, context, fss_basic_write_short_single, fss_basic_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
- fll_program_print_help_usage(id, context, fss_basic_write_name, "");
+ fll_program_print_help_usage(file, context, fss_basic_write_name, "");
return F_none;
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to find the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to find the file '%s'%c", "-", f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to open the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to open the file '%s'%c", "-", f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", "-", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(input);
f_file_close(&output.id);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to find the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to find the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(buffer);
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()%c", f_string_eol[0]);
}
else if (status == F_file_write) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to write to the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to write to the file '%s'%c", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(buffer);
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_color_context_t context;
fss_basic_write_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_color_context_t_initialize, \
}
#endif // _di_fss_basic_write_data_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_basic_write_print_help_
- extern f_return_status fss_basic_write_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_basic_write_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_basic_write_print_help_
/**
#endif
#ifndef _di_fss_extended_list_read_print_help_
- f_return_status fss_extended_list_read_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_extended_list_read_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_extended_list_read_name_long, fss_extended_list_read_version);
+ fll_program_print_help_header(file, context, fss_extended_list_read_name_long, fss_extended_list_read_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_line, fss_extended_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_name, fss_extended_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_select, fss_extended_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_total, fss_extended_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
- fll_program_print_help_option(id, context, fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_at, fss_extended_list_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_depth, fss_extended_list_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_empty, fss_extended_list_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_line, fss_extended_list_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_name, fss_extended_list_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_object, fss_extended_list_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_select, fss_extended_list_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_total, fss_extended_list_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_extended_list_read_short_trim, fss_extended_list_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
- fll_program_print_help_usage(id, context, fss_extended_list_read_name, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_extended_list_read_name, "filename(s)");
fl_color_print(f_type_output, context.set.important, " Notes:");
if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[fss_extended_list_read_parameter_at].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_depth].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_name].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_extended_list_read_parameter_object].result == f_console_result_found) {
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) {
if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_extended_list_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
macro_fss_extended_list_read_depths_t_delete_simple(depths);
fss_extended_list_read_delete_data(data);
macro_fss_extended_list_read_depths_t_delete_simple(depths);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
status = F_status_set_error(F_parameter);
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_string_dynamic_t buffer;
fss_extended_list_read_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_string_dynamic_t_initialize, \
f_fss_nest_t_initialize, \
#endif // _di_fss_extended_list_read_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_extended_list_read_print_help_
- extern f_return_status fss_extended_list_read_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_extended_list_read_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_extended_list_read_print_help_
/**
void fss_extended_list_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) {
if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
}
#endif // _di_fss_extended_list_read_print_file_error_
void fss_extended_list_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) {
if (status == F_parameter) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
else if (status == F_number) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is not a valid number for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is not a valid number for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_underflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too small for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too small for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too large for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too large for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_negative) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is negative, which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_positive) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' contains a '");
- fl_color_print_to(data.error.to, context.set.notable, "+");
- fl_color_print_to(data.error.to, context.set.error, "', which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' contains a '");
+ fl_color_print(data.error.to.stream, context.set.notable, "+");
+ fl_color_print(data.error.to.stream, context.set.error, "', which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_data_not) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, "' for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' with the value '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' with the value '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
}
#endif // _di_fss_extended_list_read_print_number_argument_error_
macro_fss_extended_list_read_depths_t_new(status, (*depths), depth_size);
if (F_status_is_error(status)) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
return status;
}
// @todo: move error printing into common function.
if (status_code == F_memory_allocation || status_code == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status_code == f_string_length_t_size) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Unable to process '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim);
- fl_color_print_to(data.error.to, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Unable to process '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
}
else {
f_string_t function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, data.context.set.notable, "%u", status_code);
- fl_color_print_to(data.error.to, data.context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s()", function);
- fl_color_print_to(data.error.to, data.context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code);
+ fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function);
+ fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]);
}
return status;
}
if (!depths->array[i].value_name.used) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
- fl_color_print_to(data.error.to, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
for (f_array_length_t j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may only be specified once for the parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may not have the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' before the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[j].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may not have the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_extended_list_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_extended_list_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_stop) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_eos) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data->error.to, data->context.set.notable, "%u", status);
- fl_color_print_to(data->error.to, data->context.set.error, ") has occurred while calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_extended_list_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%u", status);
+ fl_color_print(data->error.to.stream, data->context.set.error, ") has occurred while calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_extended_list_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return F_status_set_error(status);
#endif
#ifndef _di_fss_extended_read_print_help_
- f_return_status fss_extended_read_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_extended_read_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_extended_read_name_long, fss_extended_read_version);
+ fll_program_print_help_header(file, context, fss_extended_read_name_long, fss_extended_read_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
- fll_program_print_help_option(id, context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
- fll_program_print_help_option(id, context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
- fll_program_print_help_option(id, context, fss_extended_read_short_line, fss_extended_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
- fll_program_print_help_option(id, context, fss_extended_read_short_name, fss_extended_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
- fll_program_print_help_option(id, context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
- fll_program_print_help_option(id, context, fss_extended_read_short_select, fss_extended_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
- fll_program_print_help_option(id, context, fss_extended_read_short_total, fss_extended_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
- fll_program_print_help_option(id, context, fss_extended_read_short_trim, fss_extended_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_at, fss_extended_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric index.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_depth, fss_extended_read_long_depth, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object at this numeric depth.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_empty, fss_extended_read_long_empty, f_console_symbol_short_enable, f_console_symbol_long_enable, " Include empty content when processing.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_line, fss_extended_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the content at the given line.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_name, fss_extended_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select object with this name.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_object, fss_extended_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the object instead of the content.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_select, fss_extended_read_long_select, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select sub-content at this index.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_total, fss_extended_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of lines.");
+ fll_program_print_help_option(file, context, fss_extended_read_short_trim, fss_extended_read_long_trim, f_console_symbol_short_enable, f_console_symbol_long_enable, " Trim object names on select or print.");
- fll_program_print_help_usage(id, context, fss_extended_read_name, "filename(s)");
+ fll_program_print_help_usage(file, context, fss_extended_read_name, "filename(s)");
fl_color_print(f_type_output, context.set.important, " Notes:");
if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[fss_extended_read_parameter_at].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_read_parameter_depth].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_read_parameter_name].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_extended_read_parameter_object].result == f_console_result_found) {
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_additional) {
if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
fss_extended_read_delete_data(data);
return F_status_set_error(F_parameter);
}
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter requires a positive number.%c", f_string_eol[0]);
macro_fss_extended_read_depths_t_delete_simple(depths);
fss_extended_read_delete_data(data);
macro_fss_extended_read_depths_t_delete_simple(depths);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify one or more files.%c", f_string_eol[0]);
status = F_status_set_error(F_parameter);
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_string_dynamic_t buffer;
fss_extended_read_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_string_dynamic_t_initialize, \
f_fss_objects_t_initialize, \
#endif // _di_fss_extended_read_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_extended_read_print_help_
- extern f_return_status fss_extended_read_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_extended_read_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_extended_read_print_help_
/**
void fss_extended_read_print_file_error(const f_color_context_t context, const f_string_t function_name, const f_string_t file_name, const f_status_t status) {
if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == F_false) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
}
#endif // _di_fss_extended_read_print_file_error_
void fss_extended_read_print_number_argument_error(const f_color_context_t context, const f_string_t function_name, const f_string_t parameter_name, const f_string_t argument, const f_status_t status) {
if (status == F_parameter) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
else if (status == F_number) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is not a valid number for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is not a valid number for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_underflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too small for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too small for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too large for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too large for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_negative) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is negative, which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_positive) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' contains a '");
- fl_color_print_to(data.error.to, context.set.notable, "+");
- fl_color_print_to(data.error.to, context.set.error, "', which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' contains a '");
+ fl_color_print(data.error.to.stream, context.set.notable, "+");
+ fl_color_print(data.error.to.stream, context.set.error, "', which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_data_not) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function_name);
- fl_color_print_to(data.error.to, context.set.error, "' for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_to(data.error.to, context.set.error, "' with the value '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(data.error.to.stream, context.set.error, "' with the value '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
}
#endif // _di_fss_extended_read_print_number_argument_error_
macro_fss_extended_read_depths_t_new(status, (*depths), depth_size);
if (F_status_is_error(status)) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
return status;
}
// @todo: move error printing into common function.
if (status_code == F_memory_allocation || status_code == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status_code == f_string_length_t_size) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Unable to process '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim);
- fl_color_print_to(data.error.to, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Unable to process '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' because the maximum buffer size was reached.%c", f_string_eol[0]);
}
else {
f_string_t function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data.error.to, data.context.set.notable, "%u", status_code);
- fl_color_print_to(data.error.to, data.context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s()", function);
- fl_color_print_to(data.error.to, data.context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%u", status_code);
+ fl_color_print(data.error.to.stream, data.context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s()", function);
+ fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]);
}
return status;
}
if (!depths->array[i].value_name.used) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
- fl_color_print_to(data.error.to, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
for (f_array_length_t j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may only be specified once for the parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may only be specified once for the parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' may not have the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[i].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "' before the value '");
- fl_color_print_to(data.error.to, data.context.set.notable, "%llu", depths->array[j].depth);
- fl_color_print_to(data.error.to, data.context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' may not have the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[i].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' before the value '");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "%llu", depths->array[j].depth);
+ fl_color_print(data.error.to.stream, data.context.set.error, "'.%c", f_string_eol[0]);
return F_status_set_error(F_parameter);
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_extended_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_extended_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data->error.to, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_stop) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else if (status == F_incomplete_utf_eos) {
- fl_color_print_to(data->error.to, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%d", input.start);
- fl_color_print_to(data->error.to, data->context.set.error, ").%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ENCODING ERROR: Error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%d", input.start);
+ fl_color_print(data->error.to.stream, data->context.set.error, ").%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
- fl_color_print_to(data->error.to, data->context.set.notable, "%u", status);
- fl_color_print_to(data->error.to, data->context.set.error, ") has occurred while calling ");
- fl_color_print_to(data->error.to, data->context.set.notable, "fll_fss_extended_read()");
- fl_color_print_to(data->error.to, data->context.set.error, " for the file '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s", filename);
- fl_color_print_to(data->error.to, data->context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%u", status);
+ fl_color_print(data->error.to.stream, data->context.set.error, ") has occurred while calling ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "fll_fss_extended_read()");
+ fl_color_print(data->error.to.stream, data->context.set.error, " for the file '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s", filename);
+ fl_color_print(data->error.to.stream, data->context.set.error, "'.%c", f_string_eol[0]);
}
return F_status_set_error(status);
#endif
#ifndef _di_fss_extended_write_print_help_
- f_return_status fss_extended_write_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_extended_write_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_extended_write_name_long, fss_extended_write_version);
+ fll_program_print_help_header(file, context, fss_extended_write_name_long, fss_extended_write_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_extended_write_short_content, fss_extended_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " The content to output.");
- fll_program_print_help_option(id, context, fss_extended_write_short_double, fss_extended_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
- fll_program_print_help_option(id, context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
- fll_program_print_help_option(id, context, fss_extended_write_short_object, fss_extended_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
- fll_program_print_help_option(id, context, fss_extended_write_short_partial, fss_extended_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output end of object/content character.");
- fll_program_print_help_option(id, context, fss_extended_write_short_single, fss_extended_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_content, fss_extended_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, " The content to output.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_double, fss_extended_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, fss_extended_write_short_file, fss_extended_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_object, fss_extended_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_partial, fss_extended_write_long_partial, f_console_symbol_short_enable, f_console_symbol_long_enable, "Do not output end of object/content character.");
+ fll_program_print_help_option(file, context, fss_extended_write_short_single, fss_extended_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
- fll_program_print_help_usage(id, context, fss_extended_write_name, "");
+ fll_program_print_help_usage(file, context, fss_extended_write_name, "");
return F_none;
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to find the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to find the file '%s'%c", "-", f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to open the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to open the file '%s'%c", "-", f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", "-", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", "-", f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(input);
f_file_close(&output.id);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open()%c", f_string_eol[0]);
}
else if (status == F_file_found_not) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to find the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to find the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else if (status == F_file_open) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to open the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to open the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else if (status == F_file_descriptor) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: File descriptor error while trying to open the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(buffer);
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_write()%c", f_string_eol[0]);
}
else if (status == F_file_write) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Unable to write to the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Unable to write to the file '%s'%c", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], f_string_eol[0]);
}
else {
- fl_color_print_to(data->error.to, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()%c", status, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_write()%c", status, f_string_eol[0]);
}
f_macro_string_dynamic_t_delete_simple(buffer);
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_color_context_t context;
fss_extended_write_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_color_context_t_initialize, \
}
#endif // _di_fss_extended_write_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_extended_write_print_help_
- extern f_return_status fss_extended_write_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_extended_write_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_extended_write_print_help_
/**
#endif
#ifndef _di_fss_status_code_print_help_
- f_return_status fss_status_code_print_help(const int id, const f_color_context_t context) {
+ f_return_status fss_status_code_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, fss_status_code_name_long, fss_status_code_version);
+ fll_program_print_help_header(file, context, fss_status_code_name_long, fss_status_code_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is not an error, F_false otherwise.");
- fll_program_print_help_option(id, context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print F_true if the error code is a warning, F_false otherwise.");
- fll_program_print_help_option(id, context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is an error, F_false otherwise.");
- fll_program_print_help_option(id, context, fss_status_code_short_number, fss_status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number.");
+ fll_program_print_help_option(file, context, fss_status_code_short_is_fine, fss_status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is not an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, fss_status_code_short_is_warning, fss_status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print F_true if the error code is a warning, F_false otherwise.");
+ fll_program_print_help_option(file, context, fss_status_code_short_is_error, fss_status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, fss_status_code_short_number, fss_status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number.");
- fll_program_print_help_usage(id, context, fss_status_code_name, "status code(s)");
+ fll_program_print_help_usage(file, context, fss_status_code_name, "status code(s)");
return F_none;
}
if (data->parameters[fss_status_code_parameter_is_error].result == f_console_result_found) {
if (data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
- fl_color_print_to(data->error.to, data->context.set.error, "' cannot be used with the parameter ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
fss_status_code_delete_data(data);
return F_status_set_error(status);
}
else if (data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
- fl_color_print_to(data->error.to, data->context.set.error, "' cannot be used with the parameter ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
fss_status_code_delete_data(data);
return F_status_set_error(status);
}
}
else if (data->parameters[fss_status_code_parameter_is_warning].result == f_console_result_found && data->parameters[fss_status_code_parameter_is_fine].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
- fl_color_print_to(data->error.to, data->context.set.error, "' cannot be used with the parameter ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
fss_status_code_delete_data(data);
return F_status_set_error(status);
}
if (data->remaining.used == 0 && !data->process_pipe) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify an error code.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify an error code.%c", f_string_eol[0]);
fss_status_code_delete_data(data);
return F_status_set_error(F_parameter);
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_color_context_t context;
fss_status_code_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_color_context_t_initialize, \
}
#endif // _di_fss_status_code_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_fss_status_code_print_help_
- extern f_return_status fss_status_code_print_help(const int id, const f_color_context_t context);
+ extern f_return_status fss_status_code_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_fss_status_code_print_help_
/**
#endif
#ifndef _di_iki_read_print_help_
- f_return_status iki_read_print_help(const int id, const f_color_context_t context) {
+ f_return_status iki_read_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, iki_read_name_long, iki_read_version);
+ fll_program_print_help_header(file, context, iki_read_name_long, iki_read_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, iki_read_short_at, iki_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select variable at this numeric index.");
- fll_program_print_help_option(id, context, iki_read_short_line, iki_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the variables at the given line.");
- fll_program_print_help_option(id, context, iki_read_short_name, iki_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select variables with this name.");
- fll_program_print_help_option(id, context, iki_read_short_whole, iki_read_long_whole, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print all of the data instead of just the variable data.");
+ fll_program_print_help_option(file, context, iki_read_short_at, iki_read_long_at, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select variable at this numeric index.");
+ fll_program_print_help_option(file, context, iki_read_short_line, iki_read_long_line, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print only the variables at the given line.");
+ fll_program_print_help_option(file, context, iki_read_short_name, iki_read_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Select variables with this name.");
+ fll_program_print_help_option(file, context, iki_read_short_whole, iki_read_long_whole, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print all of the data instead of just the variable data.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, iki_read_short_content, iki_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print the variable content (default).");
- fll_program_print_help_option(id, context, iki_read_short_literal, iki_read_long_literal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print the entire variable (aka: object, content, and syntax).");
- fll_program_print_help_option(id, context, iki_read_short_object, iki_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the variable name (aka: object).");
- fll_program_print_help_option(id, context, iki_read_short_total, iki_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of variables.");
+ fll_program_print_help_option(file, context, iki_read_short_content, iki_read_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print the variable content (default).");
+ fll_program_print_help_option(file, context, iki_read_short_literal, iki_read_long_literal, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print the entire variable (aka: object, content, and syntax).");
+ fll_program_print_help_option(file, context, iki_read_short_object, iki_read_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the variable name (aka: object).");
+ fll_program_print_help_option(file, context, iki_read_short_total, iki_read_long_total, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print the total number of variables.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, iki_read_short_substitute, iki_read_long_substitute, f_console_symbol_short_enable, f_console_symbol_long_enable, "Substitute the entire variable for the given name and content value with the given string.");
+ fll_program_print_help_option(file, context, iki_read_short_substitute, iki_read_long_substitute, f_console_symbol_short_enable, f_console_symbol_long_enable, "Substitute the entire variable for the given name and content value with the given string.");
- fll_program_print_help_usage(id, context, iki_read_name, "filename(s)");
+ fll_program_print_help_usage(file, context, iki_read_name, "filename(s)");
fl_color_print(f_type_output, context.set.important, " Notes:");
iki_read_print_error(data->context, data->error.verbosity, F_status_set_fine(status), "fll_program_parameter_process", F_true);
if (data->error.verbosity == f_console_verbosity_verbose) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
}
iki_read_delete_data(data);
if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[iki_read_parameter_at].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_total].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.");
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_at);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.");
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_line].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_line);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_line);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a positive number.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_name].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_name);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_name);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires a string.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_substitute].result != f_console_result_none) {
if (data->parameters[iki_read_parameter_substitute].result == f_console_result_found || data->parameters[iki_read_parameter_substitute].additional.used % 3 != 0) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute);
- fl_color_print_to(data->error.to, data->context.set.error, "' requires 3 strings.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' requires 3 strings.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_total].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_substitute);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_literal].result == f_console_result_found) {
if (data->parameters[iki_read_parameter_object].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_content].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_total].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_literal);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
else if (data->parameters[iki_read_parameter_object].result == f_console_result_found) {
if (data->parameters[iki_read_parameter_content].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_total].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (data->parameters[iki_read_parameter_whole].result == f_console_result_found) {
if (data->parameters[iki_read_parameter_total].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Cannot specify the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_whole);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter with the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameter.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Cannot specify the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_whole);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter with the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_read_long_total);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameter.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (F_status_is_error(status)) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
}
iki_read_delete_data(data);
}
else {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: you failed to specify one or more files.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: you failed to specify one or more files.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
// ensure a newline is always put at the end of the program execution, unless in quiet mode.
if (data->error.verbosity != f_console_verbosity_quiet) {
if (F_status_is_error(status) || !data->mode) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
}
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
uint8_t mode;
iki_read_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
0, \
0, \
#endif // _di_iki_read_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_iki_read_print_help_
- extern f_return_status iki_read_print_help(const int id, const f_color_context_t context);
+ extern f_return_status iki_read_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_iki_read_print_help_
/**
if (status == F_parameter) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Invalid parameter when calling function ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Invalid parameter when calling function ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
if (status == F_memory_allocation || status == F_memory_reallocation) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Unable to allocate memory in function ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Unable to allocate memory in function ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
if (status == F_buffer_too_large) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Maximum buffer limit reached while processing ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Maximum buffer limit reached while processing ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
if (status == F_string_too_large) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Maximum string limit reached while processing ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Maximum string limit reached while processing ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
}
if (fallback && verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "UNKNOWN ERROR: (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") in function ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "UNKNOWN ERROR: (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") in function ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_unknown;
if (status == F_file_found_not) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to find %s '", file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to find %s '", file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_file_found) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The %s '", file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "' already exists.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The %s '", file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "' already exists.%c", f_string_eol[0]);
}
return F_false;
if (status == F_parameter) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "() for the %s '", file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "() for the %s '", file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_name) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Invalid %s name '", file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Invalid %s name '", file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_memory_out) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_number_overflow) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_directory) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_access_denied) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_loop) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Loop while trying to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Loop while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_prohibited) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Prohibited by system while trying to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Prohibited by system while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (is_file) {
if (status == F_directory_found_not) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
}
return F_false;
else {
if (status == F_directory_found_not) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
}
return F_false;
if (status == F_failure) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
}
if (iki_read_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "UNKNOWN ERROR: (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") occurred while trying to %s %s '", operation, file_or_directory);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "UNKNOWN ERROR: (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") occurred while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_true;
void iki_read_print_error_number_argument(const f_color_context_t context, const uint8_t verbosity, const f_status_t status, const f_string_t function, const f_string_t parameter, const f_string_t argument) {
if (verbosity == f_console_verbosity_quiet) return;
- dprintf(data.error.to, "%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
if (status == F_parameter) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function);
- fl_color_print_to(data.error.to, context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function);
+ fl_color_print(data.error.to.stream, context.set.error, ".%c", f_string_eol[0]);
}
else if (status == F_number) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is not a valid number for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is not a valid number for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_underflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too small for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too small for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_overflow) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is too large for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is too large for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_negative) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' is negative, which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_number_positive) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The argument '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "' contains a '");
- fl_color_print_to(data.error.to, context.set.notable, "+");
- fl_color_print_to(data.error.to, context.set.error, "', which is not allowed for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The argument '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "' contains a '");
+ fl_color_print(data.error.to.stream, context.set.notable, "+");
+ fl_color_print(data.error.to.stream, context.set.error, "', which is not allowed for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
else if (status == F_data_not) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, context.set.error, "' must not be an empty string.%c", f_string_eol[0]);
}
else {
- fl_color_print_to(data.error.to, context.set.error, "UNKNOWN ERROR: (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") has occurred while calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s()", function);
- fl_color_print_to(data.error.to, context.set.error, "' for the parameter '");
- fl_color_print_to(data.error.to, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_to(data.error.to, context.set.error, "' with the value '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", argument);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "UNKNOWN ERROR: (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") has occurred while calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s()", function);
+ fl_color_print(data.error.to.stream, context.set.error, "' for the parameter '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print(data.error.to.stream, context.set.error, "' with the value '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", argument);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
}
#endif // _di_iki_read_print_error_number_argument_
#endif
#ifndef _di_iki_write_print_help_
- f_return_status iki_write_print_help(const int id, const f_color_context_t context) {
+ f_return_status iki_write_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, iki_write_name_long, iki_write_version);
+ fll_program_print_help_header(file, context, iki_write_name_long, iki_write_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, iki_write_short_file, iki_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
- fll_program_print_help_option(id, context, iki_write_short_content, iki_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "The content to output.");
- fll_program_print_help_option(id, context, iki_write_short_double, iki_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
- fll_program_print_help_option(id, context, iki_write_short_object, iki_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
- fll_program_print_help_option(id, context, iki_write_short_single, iki_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
+ fll_program_print_help_option(file, context, iki_write_short_file, iki_write_long_file, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a file to send output to.");
+ fll_program_print_help_option(file, context, iki_write_short_content, iki_write_long_content, f_console_symbol_short_enable, f_console_symbol_long_enable, "The content to output.");
+ fll_program_print_help_option(file, context, iki_write_short_double, iki_write_long_double, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use double quotes (default).");
+ fll_program_print_help_option(file, context, iki_write_short_object, iki_write_long_object, f_console_symbol_short_enable, f_console_symbol_long_enable, " The object to output.");
+ fll_program_print_help_option(file, context, iki_write_short_single, iki_write_long_single, f_console_symbol_short_enable, f_console_symbol_long_enable, " Use single quotes.");
- fll_program_print_help_usage(id, context, iki_write_name, "filename(s)");
+ fll_program_print_help_usage(file, context, iki_write_name, "filename(s)");
fl_color_print(f_type_output, context.set.important, " Notes:");
iki_write_print_error(data->context, data->error.verbosity, F_status_set_fine(status), "fll_program_parameter_process", F_true);
if (data->error.verbosity == f_console_verbosity_verbose) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
}
iki_write_delete_data(data);
if (data->parameters[iki_write_parameter_file].result == f_console_result_additional) {
if (data->parameters[iki_write_parameter_file].additional.used > 1) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file);
- fl_color_print_to(data->error.to, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' may only be specified once.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
}
else if (data->parameters[iki_write_parameter_file].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file);
- fl_color_print_to(data->error.to, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_file);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (F_status_is_fine(status) && data->parameters[iki_write_parameter_object].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (F_status_is_fine(status) && data->parameters[iki_write_parameter_content].result == f_console_result_found) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content);
- fl_color_print_to(data->error.to, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' was specified, but no value was given.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (F_status_is_fine(status) && !data->process_pipe) {
if (data->parameters[iki_write_parameter_object].result != f_console_result_additional && data->parameters[iki_write_parameter_content].result != f_console_result_additional) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: No data provided, either pipe the data or use the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' and the '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content);
- fl_color_print_to(data->error.to, data->context.set.error, "' parameters.%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: No data provided, either pipe the data or use the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' and the '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' parameters.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (F_status_is_fine(status)) {
if (data->parameters[iki_write_parameter_object].additional.used != data->parameters[iki_write_parameter_content].additional.used) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameters '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content);
- fl_color_print_to(data->error.to, data->context.set.error, "' and '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object);
- fl_color_print_to(data->error.to, data->context.set.error, "' must be specified the same number of times.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameters '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_content);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' and '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, iki_write_long_object);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' must be specified the same number of times.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (!buffer.used) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The pipe has no content.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The pipe has no content.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (object_ended && previous == range.start) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The pipe has incorrectly placed newlines.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The pipe has incorrectly placed newlines.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
if (F_status_is_fine(status) && object_ended) {
if (data->error.verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The pipe has an object without content.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The pipe has an object without content.%c", f_string_eol[0]);
}
status = F_status_set_error(F_parameter);
// ensure a newline is always put at the end of the program execution, unless in quiet mode.
if (data->error.verbosity != f_console_verbosity_quiet) {
if (F_status_is_error(status)) {
- dprintf(data->error.to, "%c", f_string_eol[0]);
+ fprintf(data->error.to.stream, "%c", f_string_eol[0]);
}
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_string_dynamic_t buffer;
iki_write_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_string_dynamic_t_initialize, \
f_color_context_t_initialize, \
#endif // _di_iki_write_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_iki_write_print_help_
- extern f_return_status iki_write_print_help(const int id, const f_color_context_t context);
+ extern f_return_status iki_write_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_iki_write_print_help_
/**
if (status == F_parameter) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Invalid parameter when calling function ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Invalid parameter when calling function ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
if (status == F_memory_allocation || status == F_memory_reallocation) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Unable to allocate memory in function ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Unable to allocate memory in function ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
if (status == F_buffer_too_large) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Maximum buffer limit reached while processing ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Maximum buffer limit reached while processing ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
if (status == F_string_too_large) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Maximum string limit reached while processing ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Maximum string limit reached while processing ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_none;
}
if (fallback && verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "UNKNOWN ERROR: (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") in function ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "().%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "UNKNOWN ERROR: (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") in function ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "().%c", f_string_eol[0]);
}
return F_unknown;
if (status == F_file_found_not) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to find %s '", type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to find %s '", type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_file_closed) {
if (verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: The %s '", type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "' is no longer open.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: The %s '", type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "' is no longer open.%c", f_string_eol[0]);
}
return F_false;
if (status == F_file_seek) {
if (verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: A seek error occurred while accessing the file '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: A seek error occurred while accessing the file '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_file_read) {
if (verbosity != f_console_verbosity_quiet) {
- fl_color_print_to(data.error.to, context.set.error, "ERROR: A read error occurred while accessing the file '");
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: A read error occurred while accessing the file '");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_file_found) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: The %s '", type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "' already exists.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: The %s '", type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "' already exists.%c", f_string_eol[0]);
}
return F_false;
if (status == F_parameter) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print_to(data.error.to, context.set.notable, "%s", function);
- fl_color_print_to(data.error.to, context.set.error, "() for the %s '", type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", function);
+ fl_color_print(data.error.to.stream, context.set.error, "() for the %s '", type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_name) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Invalid %s name '", type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Invalid %s name '", type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_memory_out) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_number_overflow) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Overflow while trying to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Overflow while trying to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_directory) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Invalid directory while trying to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Invalid directory while trying to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_access_denied) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Access denied while trying to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Access denied while trying to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_loop) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Loop while trying to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Loop while trying to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (status == F_prohibited) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Prohibited by system while trying to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Prohibited by system while trying to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
if (!type) {
if (status == F_directory_found_not) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
}
return F_false;
else if (type == 1) {
if (status == F_directory_found_not) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "' due to an invalid directory in the path.%c", f_string_eol[0]);
}
return F_false;
if (status == F_failure) {
if (verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "ERROR: Failed to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "ERROR: Failed to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_false;
}
if (iki_write_print_error(context, verbosity, status, function, F_false) == F_unknown && fallback && verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, context.set.error, "UNKNOWN ERROR: (");
- fl_color_print_to(data.error.to, context.set.notable, "%llu", status);
- fl_color_print_to(data.error.to, context.set.error, ") occurred while trying to %s %s '", operation, type_name);
- fl_color_print_to(data.error.to, context.set.notable, "%s", name);
- fl_color_print_to(data.error.to, context.set.error, "'.%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, context.set.error, "UNKNOWN ERROR: (");
+ fl_color_print(data.error.to.stream, context.set.notable, "%llu", status);
+ fl_color_print(data.error.to.stream, context.set.error, ") occurred while trying to %s %s '", operation, type_name);
+ fl_color_print(data.error.to.stream, context.set.notable, "%s", name);
+ fl_color_print(data.error.to.stream, context.set.error, "'.%c", f_string_eol[0]);
}
return F_true;
if (!object.used) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The object is missing, it must not have a length of ");
- fl_color_print_to(data.error.to, data.context.set.notable, "0");
- fl_color_print_to(data.error.to, data.context.set.error, ".%c", f_string_eol[0]);
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The object is missing, it must not have a length of ");
+ fl_color_print(data.error.to.stream, data.context.set.notable, "0");
+ fl_color_print(data.error.to.stream, data.context.set.error, ".%c", f_string_eol[0]);
}
return F_status_set_error(F_failure);
if (status == F_false) {
if (data.error.verbosity != f_console_verbosity_quiet) {
- dprintf(data.error.to, "%c", f_string_eol[0]);
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: The object '");
+ fprintf(data.error.to.stream, "%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: The object '");
fl_color_print_code(f_type_error, data.context.notable);
f_print_dynamic(f_type_error, object);
fl_color_print_code(f_type_error, data.context.reset);
- fl_color_print_to(data.error.to, data.context.set.error, "' is not a valid IKI object.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "' is not a valid IKI object.%c", f_string_eol[0]);
}
return F_status_set_error(F_failure);
#endif // _di_init_print_version_
#ifndef _di_init_print_help_
- f_return_status init_print_help(const int id, const f_color_context_t context) {
+ f_return_status init_print_help(const f_file_t file, const f_color_context_t context) {
- fll_program_print_help_header(id, context, init_name_long, init_version);
+ fll_program_print_help_header(file, context, init_name_long, init_version);
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Do not attempt to process kernel command line or perform any boot-time specific preparations.");
- fll_program_print_help_option(id, context, init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom run level, ignoring the kernel command line runlevel argument.");
+ fll_program_print_help_option(file, context, init_parameter_no_prepare_short_name, init_parameter_no_prepare_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Do not attempt to process kernel command line or perform any boot-time specific preparations.");
+ fll_program_print_help_option(file, context, init_parameter_runlevel_short_name, init_parameter_runlevel_long_name, f_console_symbol_short_enable, f_console_symbol_long_enable, " Specify a custom run level, ignoring the kernel command line runlevel argument.");
- fll_program_print_help_usage(id, context, init_name, "");
+ fll_program_print_help_usage(file, context, init_name, "");
return F_none;
}
pid_t pid_services = clone(init_handler_child_services, stack_memory.services + init_stack_size_small_services, init_flags_clone, stack_memory.services);
if (pid_services < 0) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to clone services process (errno = %i).%c", errno, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to clone services process (errno = %i).%c", errno, f_string_eol[0]);
}
pid_t pid_control_file = clone(init_handler_child_control_file, stack_memory.control_file + init_stack_size_control_file, init_flags_clone, stack_memory.control_file);
if (pid_control_file < 0) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Failed to clone control via file process (errno = %i).%c", errno, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Failed to clone control via file process (errno = %i).%c", errno, f_string_eol[0]);
}
*/
continue;
}
else if (errno != EINTR) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: sigwaitinfo() failed (errno = %i).%c", errno, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: sigwaitinfo() failed (errno = %i).%c", errno, f_string_eol[0]);
signal_problem_count++;
if (signal_problem_count > problem_count_max_signal_size) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: Max signal problem count has been reached, sleeping for a period of time.%c", errno, f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: Max signal problem count has been reached, sleeping for a period of time.%c", errno, f_string_eol[0]);
sleep(init_panic_signal_sleep_seconds);
signal_problem_count = 0;
}
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_color_context_t context;
init_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_color_context_t_initialize, \
}
#endif // _di_init_print_version_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_init_print_help_
- extern f_return_status init_print_help(const int id, const f_color_context_t context);
+ extern f_return_status init_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_init_print_help_
/**
if (optional) {
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
} else if (status != F_file_found_not && status != F_file_open && status != F_file_descriptor) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
}
} else {
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_open().%c", f_string_eol[0]);
} else if (status == F_file_found_not) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Unable to find the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Unable to find the file '%s'.%c", filename, f_string_eol[0]);
} else if (status == F_file_open) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Unable to open the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Unable to open the file '%s'.%c", filename, f_string_eol[0]);
} else if (status == F_file_descriptor) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: File descriptor error while trying to open the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: File descriptor error while trying to open the file '%s'.%c", filename, f_string_eol[0]);
} else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().%c", status, f_string_eol[0]);
}
}
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read_until().%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling f_file_read_until().%c", f_string_eol[0]);
} else if (status == F_number_overflow) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: Integer overflow while trying to buffer the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: Integer overflow while trying to buffer the file '%s'.%c", filename, f_string_eol[0]);
} else if (status == F_file_closed) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: The file '%s' is no longer open.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: The file '%s' is no longer open.%c", filename, f_string_eol[0]);
} else if (status == F_file_seek) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: A seek error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: A seek error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
} else if (status == F_file_read) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: A read error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: A read error occurred while accessing the file '%s'.%c", filename, f_string_eol[0]);
} else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
} else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read_until().%c", status, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read_until().%c", status, f_string_eol[0]);
}
return F_status_set_error(status);
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.%c", filename, f_string_eol[0]);
} else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: No relevant data was found within the file '%s'.%c", filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: No relevant data was found within the file '%s'.%c", filename, f_string_eol[0]);
} else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.%c", f_string_eol[0]);
} else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.%c", status, filename, f_string_eol[0]);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.%c", status, filename, f_string_eol[0]);
}
return F_status_set_error(status);
status = F_status_set_fine(status);
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
} else if (status == F_failure) {
// the error message has already been displayed.
} else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
}
f_macro_fss_objects_t_delete_simple(local->rule_objects);
status = F_status_set_fine(status);
if (status == F_parameter) {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file);
} else if (status == F_data_not_eos || status == F_data_not || status == F_data_not_stop) {
- fl_color_print_to(data.error.to, data.context.set.error, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file);
+ fl_color_print(data.error.to.stream, data.context.set.error, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file);
} else if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
} else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, init_rule_core_file);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, init_rule_core_file);
}
f_macro_string_dynamic_t_delete(buffer);
if (F_status_is_error(status_process)) {
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status);
}
// @todo: init_delete_data((*data));
status = F_status_set_fine(status);
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print(data.error.to.stream, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
} else if (status == F_failure) {
// the error message has already been displayed.
} else {
- fl_color_print_to(data.error.to, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
+ fl_color_print(data.error.to.stream, data.context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
}
f_macro_fss_objects_t_delete_simple((*rule_objects));
}
else {
if (status == F_memory_allocation || status == F_memory_reallocation) {
- fl_color_print_to(data.error.to, context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print(data.error.to.stream, context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_to(data.error.to, context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status);
+ fl_color_print(data.error.to.stream, context.set.error, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status);
}
}
#endif
#ifndef _di_status_code_print_help_
- f_return_status status_code_print_help(const int id, const f_color_context_t context) {
- fll_program_print_help_header(id, context, status_code_name_long, status_code_version);
-
- fll_program_print_help_option(id, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
- fll_program_print_help_option(id, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
- fll_program_print_help_option(id, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
- fll_program_print_help_option(id, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
- fll_program_print_help_option(id, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
+ f_return_status status_code_print_help(const f_file_t file, const f_color_context_t context) {
+ fll_program_print_help_header(file, context, status_code_name_long, status_code_version);
+
+ fll_program_print_help_option(file, context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
+ fll_program_print_help_option(file, context, f_console_standard_short_dark, f_console_standard_long_dark, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on dark backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_light, f_console_standard_long_light, f_console_symbol_short_disable, f_console_symbol_long_disable, " Output using colors that show up better on light backgrounds.");
+ fll_program_print_help_option(file, context, f_console_standard_short_no_color, f_console_standard_long_no_color, f_console_symbol_short_disable, f_console_symbol_long_disable, "Do not output in color.");
+ fll_program_print_help_option(file, context, f_console_standard_short_quiet, f_console_standard_long_quiet, f_console_symbol_short_disable, f_console_symbol_long_disable, " Decrease verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_normal, f_console_standard_long_normal, f_console_symbol_short_disable, f_console_symbol_long_disable, " Set verbosity to normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_verbose, f_console_standard_long_verbose, f_console_symbol_short_disable, f_console_symbol_long_disable, " Increase verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_debug, f_console_standard_long_debug, f_console_symbol_short_disable, f_console_symbol_long_disable, " Enable debugging, inceasing verbosity beyond normal output.");
+ fll_program_print_help_option(file, context, f_console_standard_short_version, f_console_standard_long_version, f_console_symbol_short_disable, f_console_symbol_long_disable, " Print only the version number.");
printf("%c", f_string_eol[0]);
- fll_program_print_help_option(id, context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is not an error, F_false otherwise.");
- fll_program_print_help_option(id, context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print F_true if the error code is a warning, F_false otherwise.");
- fll_program_print_help_option(id, context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is an error, F_false otherwise.");
- fll_program_print_help_option(id, context, status_code_short_number, status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number.");
+ fll_program_print_help_option(file, context, status_code_short_is_fine, status_code_long_is_fine, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is not an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, status_code_short_is_warning, status_code_long_is_warning, f_console_symbol_short_enable, f_console_symbol_long_enable, "Print F_true if the error code is a warning, F_false otherwise.");
+ fll_program_print_help_option(file, context, status_code_short_is_error, status_code_long_is_error, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print F_true if the error code is an error, F_false otherwise.");
+ fll_program_print_help_option(file, context, status_code_short_number, status_code_long_number, f_console_symbol_short_enable, f_console_symbol_long_enable, " Convert status code name to number.");
- fll_program_print_help_usage(id, context, status_code_name, "status code(s)");
+ fll_program_print_help_usage(file, context, status_code_name, "status code(s)");
return F_none;
}
if (data->parameters[status_code_parameter_is_error].result == f_console_result_found) {
if (data->parameters[status_code_parameter_is_warning].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
- fl_color_print_to(data->error.to, data->context.set.error, "' cannot be used with the parameter ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
status_code_delete_data(data);
return F_status_set_error(status);
}
else if (data->parameters[status_code_parameter_is_fine].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
- fl_color_print_to(data->error.to, data->context.set.error, "' cannot be used with the parameter ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
status_code_delete_data(data);
return F_status_set_error(status);
}
}
else if (data->parameters[status_code_parameter_is_warning].result == f_console_result_found && data->parameters[status_code_parameter_is_fine].result == f_console_result_found) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: The parameter '");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
- fl_color_print_to(data->error.to, data->context.set.error, "' cannot be used with the parameter ");
- fl_color_print_to(data->error.to, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
- fl_color_print_to(data->error.to, data->context.set.error, ".%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: The parameter '");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
+ fl_color_print(data->error.to.stream, data->context.set.error, "' cannot be used with the parameter ");
+ fl_color_print(data->error.to.stream, data->context.set.notable, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
+ fl_color_print(data->error.to.stream, data->context.set.error, ".%c", f_string_eol[0]);
status_code_delete_data(data);
return F_status_set_error(status);
}
if (data->remaining.used == 0 && !data->process_pipe) {
- fl_color_print_to(data->error.to, data->context.set.error, "ERROR: You failed to specify a status code.%c", f_string_eol[0]);
+ fl_color_print(data->error.to.stream, data->context.set.error, "ERROR: You failed to specify a status code.%c", f_string_eol[0]);
status_code_delete_data(data);
return F_status_set_error(F_parameter);
f_string_lengths_t remaining;
bool process_pipe;
- int output;
+ f_file_t output;
fll_error_print_t error;
f_color_context_t context;
status_code_console_parameter_t_initialize, \
f_string_lengths_t_initialize, \
F_false, \
- f_type_descriptor_output, \
+ f_macro_file_t_initialize(f_type_output, f_type_descriptor_output, f_file_flag_write_only), \
fll_error_print_t_initialize, \
f_color_context_t_initialize, \
}
#endif // _di_status_code_data_t_
/**
- * Print help to standard output.
+ * Print help.
*
+ * @param file
+ * The file to print to.
* @param context
* The color context settings.
*
* F_none on success.
*/
#ifndef _di_status_code_print_help_
- extern f_return_status status_code_print_help(const int id, const f_color_context_t context);
+ extern f_return_status status_code_print_help(const f_file_t file, const f_color_context_t context);
#endif // _di_status_code_print_help_
/**