This required making some fixes in the files related code.
This puts the UTF-8 file (utf_file) project notably behind an additional work is necessary to get that working correctly as well as having it be consistent with f_file.
I've decided that when written pointer is 0, then the caller is requesting to not get back the written size.
I am very likely going to do similar behavior with null pointers in other uses, which will help further simplify the design.
Other minor changes.
Of particular note is moving flags into the f_file structure.
This was effectively how the pre-file redesign worked, but it uses flags now instead of the "r", "rw", "a", etc.. string modes used by fopen.
Make sure an append flag is available.
#endif // _di_f_file_is_at_
#ifndef _di_f_file_open_
- f_return_status f_file_open(const f_string path, const int flags, const mode_t mode, f_file *file) {
+ f_return_status f_file_open(const f_string path, const mode_t mode, f_file *file) {
#ifndef _di_level_0_parameter_checking_
if (file == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_file_open(path, mode, flags, file);
+ return private_f_file_open(path, mode, file);
}
#endif // _di_f_file_open_
#ifndef _di_f_file_open_at_
- f_return_status f_file_open_at(const int at_id, const f_string path, const int flags, const mode_t mode, f_file *file) {
+ f_return_status f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file) {
#ifndef _di_level_0_parameter_checking_
if (file == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
- return private_f_file_open_at(at_id, path, flags, mode, file);
+ return private_f_file_open_at(at_id, path, mode, file);
}
#endif // _di_f_file_open_at_
f_return_status f_file_read(const f_file file, f_string_dynamic *buffer) {
#ifndef _di_level_0_parameter_checking_
if (file.size_read == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer->used >= buffer->size) return f_status_set_error(f_invalid_parameter);
+ if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
if (file.id <= 0) return f_status_set_error(f_file_not_open);
f_return_status f_file_read_block(const f_file file, f_string_dynamic *buffer) {
#ifndef _di_level_0_parameter_checking_
if (file.size_read == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer->used >= buffer->size) return f_status_set_error(f_invalid_parameter);
+ if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
if (file.id <= 0) return f_status_set_error(f_file_not_open);
f_return_status f_file_read_until(const f_file file, f_string_dynamic *buffer, const f_string_length total) {
#ifndef _di_level_0_parameter_checking_
if (file.size_read == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer->used >= buffer->size) return f_status_set_error(f_invalid_parameter);
+ if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
if (file.id <= 0) return f_status_set_error(f_file_not_open);
if (file.id <= 0) return f_status_set_error(f_file_not_open);
if (buffer.used == 0) {
- *written = 0;
+ if (written) *written = 0;
return f_no_data;
}
- f_status status = private_f_file_write_until(file, buffer.string, buffer.used, written);
- if (f_status_is_error(status)) return f_status_set_error(status);
+ f_status status = f_none;
+
+ if (written) {
+ private_f_file_write_until(file, buffer.string, buffer.used, written);
+
+ if (status == f_none && *written == buffer.used) return f_none_on_eos;
+ }
+ else {
+ f_string_length written_local = 0;
- if (status == f_none && *written == buffer.used) return f_none_on_eos;
+ private_f_file_write_until(file, buffer.string, buffer.used, &written_local);
+
+ if (status == f_none && written_local == buffer.used) return f_none_on_eos;
+ }
+
+ if (f_status_is_error(status)) return f_status_set_error(status);
return status;
}
if (file.id <= 0) return f_status_set_error(f_file_not_open);
if (buffer.used == 0) {
- *written = 0;
+ if (written) *written = 0;
return f_no_data;
}
write_max = buffer.used;
}
- f_status status = private_f_file_write_until(file, buffer.string, write_max, written);
- if (f_status_is_error(status)) return f_status_set_error(status);
+ f_status status = f_none;
+
+ if (written) {
+ private_f_file_write_until(file, buffer.string, write_max, written);
- if (status == f_none && *written == buffer.used) return f_none_on_eos;
+ if (status == f_none) {
+ if (*written == buffer.used) return f_none_on_eos;
+ if (*written == write_max) return f_none_on_stop;
+ }
+ }
+ else {
+ f_string_length written_local = 0;
+
+ private_f_file_write_until(file, buffer.string, write_max, &written_local);
+
+ if (status == f_none) {
+ if (written_local == buffer.used) return f_none_on_eos;
+ if (written_local == write_max) return f_none_on_stop;
+ }
+ }
return status;
}
if (file.id <= 0) return f_status_set_error(f_file_not_open);
if (buffer.used == 0 || total == 0) {
- *written = 0;
+ if (written) *written = 0;
return f_no_data;
}
write_max = buffer.used;
}
- f_status status = private_f_file_write_until(file, buffer.string, write_max, written);
- if (f_status_is_error(status)) return f_status_set_error(status);
+ f_status status = f_none;
+
+ if (written) {
+ private_f_file_write_until(file, buffer.string, write_max, written);
- if (status == f_none && *written == buffer.used) return f_none_on_eos;
+ if (status == f_none) {
+ if (*written == buffer.used) return f_none_on_eos;
+ if (*written == write_max) return f_none_on_stop;
+ }
+ }
+ else {
+ f_string_length written_local = 0;
+
+ private_f_file_write_until(file, buffer.string, buffer.used, &written_local);
+
+ if (status == f_none) {
+ if (written_local == buffer.used) return f_none_on_eos;
+ if (written_local == write_max) return f_none_on_stop;
+ }
+ }
return status;
}
if (file.id <= 0) return f_status_set_error(f_file_not_open);
if (buffer.used == 0) {
- *written = 0;
+ if (written) *written = 0;
return f_no_data;
}
write_max = buffer.used;
}
- f_status status = private_f_file_write_until(file, buffer.string + range.start, write_max, written);
- if (f_status_is_error(status)) return f_status_set_error(status);
+ f_status status = f_none;
+
+ if (written) {
+ private_f_file_write_until(file, buffer.string + range.start, write_max, written);
+
+ if (status == f_none) {
+ if (range.start + *written == buffer.used) return f_none_on_stop;
+ if (range.start + *written == total) return f_none_on_eos;
+ }
+ }
+ else {
+ f_string_length written_local = 0;
- if (status == f_none) {
- if (range.start + *written == total) return f_none_on_stop;
- if (range.start + *written == buffer.used) return f_none_on_eos;
+ private_f_file_write_until(file, buffer.string + range.start, write_max, &written_local);
+
+ if (status == f_none) {
+ if (range.start + written_local == buffer.used) return f_none_on_eos;
+ if (range.start + written_local == total) return f_none_on_stop;
+ }
}
return status;
* Commonly used file related properties.
*
* id: File descriptor.
- * size_block: The default number of 1-byte characters to read at a time and is often used for the read/write buffer size.
+ * flags: 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.
+ * size_write: The default number of 1-byte characters to read at a time and is often used for the write buffer size.
*/
#ifndef _di_f_file_
typedef struct {
int id;
+ int flags;
size_t size_read;
size_t size_write;
} f_file;
- #define f_file_initialize { 0, f_file_default_read_size, f_file_default_write_size }
+ #define f_file_initialize { 0, O_RDONLY, f_file_default_read_size, f_file_default_write_size }
#endif // _di_f_file_
/**
#define f_file_flag_truncate_rw (O_CREAT | O_TRUNC | O_RDRW)
#define f_file_flag_truncate_wo (O_CREAT | O_TRUNC | O_WRONLY)
+ // file open flags pre-combined will truncate any existing files to 0.
+ #define f_file_flag_append_rw (O_CREAT | O_APPEND | O_RDRW)
+ #define f_file_flag_append_wo (O_CREAT | O_APPEND | O_WRONLY)
+
// file open flags pre-combined with synchronous io.
#define f_file_flag_sync_ro (O_SYNC | O_RDONLY)
#define f_file_flag_sync_wo (O_SYNC | O_WRONLY)
#endif // _di_f_file_modes_
/**
+ * Check if a file can be accessed.
+ *
+ * @param path
+ * The path file name.
+ *
+ * @return
+ * f_true if file exists.
+ * f_false if file does not exist.
+ * f_invalid_parameter (with error bit) if a parameter is invalid.
+ * f_invalid_name (with error bit) if the filename is too long.
+ * f_out_of_memory (with error bit) if out of memory.
+ * f_number_overflow (with error bit) on overflow error.
+ * f_invalid_directory (with error bit) on invalid directory.
+ * f_access_denied (with error bit) on access denied.
+ * f_loop (with error bit) on loop error.
+ * f_false (with error bit) on unknown/unhandled errors.
+ *
+ * @see access()
+ */
+#ifndef _di_f_file_access_
+ extern f_return_status f_file_access(const f_string path);
+#endif // _di_f_file_access_
+
+/**
* Change mode of a given file at the specified path.
*
* @param path
#endif // _di_f_file_change_owner_at_
/**
- * Check if a file can be accessed.
- *
- * @param path
- * The path file name.
- *
- * @return
- * f_true if file exists.
- * f_false if file does not exist.
- * f_invalid_parameter (with error bit) if a parameter is invalid.
- * f_invalid_name (with error bit) if the filename is too long.
- * f_out_of_memory (with error bit) if out of memory.
- * f_number_overflow (with error bit) on overflow error.
- * f_invalid_directory (with error bit) on invalid directory.
- * f_access_denied (with error bit) on access denied.
- * f_loop (with error bit) on loop error.
- * f_false (with error bit) on unknown/unhandled errors.
- *
- * @see access()
- */
-#ifndef _di_f_file_access_
- extern f_return_status f_file_access(const f_string path);
-#endif // _di_f_file_access_
-
-/**
* Copy a file.
*
* The paths must not contain NULL except for the terminating NULL.
*
* @param path
* The path file name.
- * @param flags
- * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW.
* @param mode
* The file mode to open in.
* Set to 0 to not use.
* @see open()
*/
#ifndef _di_f_file_open_
- extern f_return_status f_file_open(const f_string path, const int flags, const mode_t mode, f_file *file);
+ extern f_return_status f_file_open(const f_string path, const mode_t mode, f_file *file);
#endif // _di_f_file_open_
/**
* The parent directory, as an open directory file descriptor, in which path is relative to.
* @param path
* The path file name.
- * @param flags
- * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW.
* @param mode
* The file mode to open in.
* Set to 0 to not use.
* @see openat()
*/
#ifndef _di_f_file_open_at_
- extern f_return_status f_file_open_at(const int at_id, const f_string path, const int flags, const mode_t mode, f_file *file);
+ extern f_return_status f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file);
#endif // _di_f_file_open_at_
/**
* The buffer to write to the file.
* @param written
* The total bytes written.
+ * Set pointer to 0 to not use.
*
* @return
* f_none on success.
* The buffer to write to the file.
* @param written
* The total bytes written.
+ * Set pointer to 0 to not use.
*
* @return
* f_none on success.
* The total bytes to write, unless end of buffer is reached first.
* @param written
* The total bytes written.
+ * Set pointer to 0 to not use.
*
* @return
* f_none on success.
* An inclusive start an stop range within the buffer to read.
* @param written
* The total bytes written.
+ * Set pointer to 0 to not use.
*
* @return
* f_none on success.
f_file file_source = f_file_initialize;
f_file file_destination = f_file_initialize;
- f_status status = private_f_file_open(source, f_file_flag_read_only, 0, &file_source);
+ file_source.flags = f_file_flag_read_only;
+ file_destination.flags = f_file_flag_write_only | f_file_flag_no_follow;
+
+ f_status status = private_f_file_open(source, 0, &file_source);
if (f_status_is_error(status)) return status;
- status = private_f_file_open(destination, f_file_flag_write_only | f_file_flag_no_follow, 0, &file_destination);
+ status = private_f_file_open(destination, 0, &file_destination);
if (f_status_is_error(status)) {
private_f_file_close(&file_source.id);
return status;
#if !defined(_di_f_file_create_) || !defined(_di_f_file_copy_)
f_return_status private_f_file_create(const f_string path, const mode_t mode, const bool exclusive, const bool dereference) {
- int flags = O_CLOEXEC | O_CREAT | O_WRONLY;
+ f_file file = f_file_initialize;
+
+ file.flags = O_CLOEXEC | O_CREAT | O_WRONLY;
if (exclusive) {
- flags |= O_EXCL;
+ file.flags |= O_EXCL;
}
if (!dereference) {
- flags |= O_NOFOLLOW;
+ file.flags |= O_NOFOLLOW;
}
- f_file file = f_file_initialize;
- f_status status = private_f_file_open(path, mode, flags, &file);
+ f_status status = private_f_file_open(path, mode, &file);
if (file.id > 0) {
return private_f_file_close(&file.id);
#if !defined(_di_f_file_create_at_) || !defined(_di_f_file_copy_at_)
f_return_status private_f_file_create_at(const int at_id, const f_string path, const mode_t mode, const bool exclusive, const bool dereference) {
- int flags = O_CLOEXEC | O_CREAT | O_WRONLY;
+ f_file file = f_file_initialize;
+
+ file.flags = O_CLOEXEC | O_CREAT | O_WRONLY;
if (exclusive) {
- flags |= O_EXCL;
+ file.flags |= O_EXCL;
}
if (!dereference) {
- flags |= O_NOFOLLOW;
+ file.flags |= O_NOFOLLOW;
}
- f_file file = f_file_initialize;
- f_status status = private_f_file_open_at(at_id, path, flags, mode, &file);
+ f_status status = private_f_file_open_at(at_id, path, mode, &file);
if (file.id > 0) {
return private_f_file_close(&file.id);
#endif // !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_)
#if !defined(_di_f_file_open_) || !defined(_di_f_file_copy_)
- f_return_status private_f_file_open(const f_string path, const int flags, const mode_t mode, f_file *file) {
+ f_return_status private_f_file_open(const f_string path, const mode_t mode, f_file *file) {
if (mode == 0) {
- file->id = open(path, flags);
+ file->id = open(path, file->flags);
}
else {
- file->id = open(path, flags, mode);
+ file->id = open(path, file->flags, mode);
}
if (file->id < 0) {
#endif // !defined(_di_f_file_open_) || !defined(_di_f_file_copy_)
#if !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_)
- f_return_status private_f_file_open_at(const int at_id, const f_string path, const int flags, const mode_t mode, f_file *file) {
+ f_return_status private_f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file) {
if (mode == 0) {
- file->id = openat(at_id, path, flags);
+ file->id = openat(at_id, path, file->flags);
}
else {
- file->id = openat(at_id, path, flags, mode);
+ file->id = openat(at_id, path, file->flags, mode);
}
if (file->id < 0) {
* f_failure (with error bit) for any other (mkdir()) error.
*
* @see f_file_change_mode()
+ * @see f_file_copy()
*/
#if !defined(_di_f_file_change_mode_) || !defined(_di_f_file_copy_)
extern f_return_status private_f_file_change_mode(const f_string path, const mode_t mode, const bool dereference) f_gcc_attribute_visibility_internal;
* f_failure (with error bit) for any other (mkdir()) error.
*
* @see f_file_change_mode_at()
+ * @see f_file_copy_at()
*/
#if !defined(_di_f_file_change_mode_at_) || !defined(_di_f_file_copy_at_)
extern f_return_status private_f_file_change_mode_at(const int at_id, const f_string path, const mode_t mode, const int flags) f_gcc_attribute_visibility_internal;
* f_failure (with error bit) for any other (mkdir()) error.
*
* @see f_file_change_owner()
+ * @see f_file_copy()
*/
#if !defined(_di_f_file_change_owner_) || !defined(_di_f_file_copy_)
extern f_return_status private_f_file_change_owner(const f_string path, const uid_t uid, const gid_t gid, const bool dereference) f_gcc_attribute_visibility_internal;
* f_failure (with error bit) for any other (mkdir()) error.
*
* @see f_file_change_owner_at()
+ * @see f_file_copy_at()
*/
#if !defined(_di_f_file_change_owner_at_) || !defined(_di_f_file_copy_at_)
extern f_return_status private_f_file_change_owner_at(const int at_id, const f_string path, const uid_t uid, const gid_t gid, const int flags) f_gcc_attribute_visibility_internal;
* f_file_error_close (with error bit) if fclose() failed for any other reason.
*
* @see f_file_close()
+ * @see f_file_copy()
*/
#if !defined(_di_f_file_close_) || !defined(_di_f_file_copy_)
extern f_return_status private_f_file_close(int *id) f_gcc_attribute_visibility_internal;
* The path file name.
* @param mode
* The file mode to open in.
- * @param flags
- * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW.
* @param file
* The data related to the file being opened.
* This will be updated with the file descriptor and file address.
+ * This will be updated with the create flags (ignoring and overriding existing file.flags).
+ * @param exclusive
+ * If TRUE, will fail when file already exists.
+ * If FALSE, will not fail if file already exists.
+ * @param dereference
+ * Set to TRUE to dereferenc symlinks (often is what is desired).
+ * Set to FALSE to fail if the path is a symbolic link.
+ * This does not write symbolic links. (@todo add function f_create_link() for creating symbolic links.)
*
* @return
* f_none on success.
* f_file_max_open (with error bit) when system-wide max open files is reached.
* f_busy (with error bit) if filesystem is too busy to perforrm write.
*
+ * @see f_file_copy()
* @see f_file_create()
*/
#if !defined(_di_f_file_create_) || !defined(_di_f_file_copy_)
* @param file
* The data related to the file being opened.
* This will be updated with the file descriptor and file address.
+ * This will be updated with the create flags (ignoring and overriding existing file.flags).
* @param path
* The path file name.
* @param mode
* The file mode to open in.
- * @param flags
- * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW.
+ * @param exclusive
+ * If TRUE, will fail when file already exists.
+ * If FALSE, will not fail if file already exists.
+ * @param dereference
+ * Set to TRUE to dereferenc symlinks (often is what is desired).
+ * Set to FALSE to fail if the path is a symbolic link.
+ * This does not write symbolic links. (@todo add function f_create_link() for creating symbolic links.)
*
* @return
* f_none on success.
* f_file_max_open (with error bit) when system-wide max open files is reached.
* f_busy (with error bit) if filesystem is too busy to perforrm write.
*
+ * @see f_file_copy_at()
* @see f_file_create_at()
*/
#if !defined(_di_f_file_create_at_) || !defined(_di_f_file_copy_at_)
*
* @return
*
+ * @see f_file_copy()
* @see f_file_link()
*/
#if !defined(_di_f_file_link_) || !defined(_di_f_file_copy_)
*
* @return
*
+ * @see f_file_copy_at()
* @see f_file_link_at()
*/
#if !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_)
* f_unsupported (with error bit) if the file system or file type does not support flushing.
* f_failure (with error bit) on any other failure.
*
+ * @see f_file_close()
+ * @see f_file_copy()
* @see f_file_flush()
*/
#if !defined(_di_f_file_flush_) || !defined(_di_f_file_close_) || !defined(_di_f_file_copy_)
#endif // !defined(_di_f_file_flush_) || !defined(_di_f_file_close_) || !defined(_di_f_file_copy_)
/**
+ * Create a link to a file.
+ *
+ * This will not replace existing files/links.
+ *
+ * @param target
+ * A path that the link points to.
+ * @param point
+ * A path to the link that does the pointing.
+ *
+ * @return
+ *
+ * @see f_file_link()
+ * @see f_file_copy()
+ */
+#if !defined(_di_f_file_link_) || !defined(_di_f_file_copy_)
+ extern f_return_status private_f_file_link(const f_string target, const f_string point);
+#endif // !defined(_di_f_file_link_) || !defined(_di_f_file_copy_)
+
+/**
+ * Create a link to a file.
+ *
+ * This will not replace existing files/links.
+ *
+ * @param at_id
+ * The parent directory, as an open directory file descriptor, in which path is relative to.
+ * @param target
+ * A path that the link points to.
+ * @param point
+ * A path to the link that does the pointing.
+ *
+ * @return
+ *
+ * @see f_file_link_at()
+ * @see f_file_copy_at()
+ */
+#if !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_)
+ extern f_return_status private_f_file_link_at(const int at_id, const f_string target, const f_string point);
+#endif // !defined(_di_f_file_link_at_) || !defined(_di_f_file_copy_at_)
+
+/**
* Private implementation of f_file_open().
*
* Intended to be shared to each of the different implementation variations.
*
* @param path
* The path file name.
- * @param flags
- * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW.
* @param mode
* The file mode to open in.
* Set to 0 to not use.
* f_file_error_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid).
* f_invalid_parameter (with error bit) if a parameter is invalid.
*
+ * @see f_file_copy()
* @see f_file_open()
*/
#if !defined(_di_f_file_open_) || !defined(_di_f_file_copy_)
- extern f_return_status private_f_file_open(const f_string path, const int flags, const mode_t mode, f_file *file) f_gcc_attribute_visibility_internal;
+ extern f_return_status private_f_file_open(const f_string path, const mode_t mode, f_file *file) f_gcc_attribute_visibility_internal;
#endif // !defined(_di_f_file_open_) || !defined(_di_f_file_copy_)
/**
* The parent directory, as an open directory file descriptor, in which path is relative to.
* @param path
* The path file name.
- * @param flags
- * Any valid flag, such as AT_EMPTY_PATH, AT_NO_AUTOMOUNT, or AT_SYMLINK_NO_FOLLOW.
* @param mode
* The file mode to open in.
* Set to 0 to not use.
* f_file_error_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid).
* f_invalid_parameter (with error bit) if a parameter is invalid.
*
+ * @see f_file_copy_at()
* @see f_file_open_at()
*/
#if !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_)
- extern f_return_status private_f_file_open_at(const int at_id, const f_string path, const int flags, const mode_t mode, f_file *file) f_gcc_attribute_visibility_internal;
+ extern f_return_status private_f_file_open_at(const int at_id, const f_string path, const mode_t mode, f_file *file) f_gcc_attribute_visibility_internal;
#endif // !defined(_di_f_file_open_at_) || !defined(_di_f_file_copy_at_)
/**
- * Create a link to a file.
- *
- * This will not replace existing files/links.
- *
- * @param target
- * A path that the link points to.
- * @param point
- * A path to the link that does the pointing.
- *
- * @return
- *
- * @see f_file_link()
- */
-#if !defined(_di_f_file_link_) || !defined(_di_f_file_copy_)
- extern f_return_status private_f_file_link(const f_string target, const f_string point);
-#endif // !defined(_di_f_file_link_) || !defined(_di_f_file_copy_)
-
-/**
* Private implementation of f_file_close().
*
* Intended to be shared to each of the different implementation variations.
* f_loop (with error bit) if a loop occurred.
* f_invalid_parameter (with error bit) if a parameter is invalid.
*
+ * @see f_file_copy()
* @see f_file_stat()
*/
#if !defined(_di_f_file_stat_) || !defined(_di_f_file_copy_)
* f_loop (with error bit) if a loop occurred.
* f_invalid_parameter (with error bit) if a parameter is invalid.
*
+ * @see f_file_copy_at()
* @see f_file_stat_at()
*/
#if !defined(_di_f_file_stat_at_) || !defined(_di_f_file_copy_at_)
extern "C" {
#endif
-#ifndef _di_f_pipe_exists_
- f_return_status f_pipe_exists() {
+#ifndef _di_f_pipe_input_exists_
+ f_return_status f_pipe_input_exists() {
struct stat st_info;
- if (fstat(fileno(f_pipe), &st_info) != 0) {
+ if (fstat(f_type_descriptor_input, &st_info) != 0) {
return f_status_set_error(f_file_error_stat);
}
return f_false;
}
-#endif // _di_f_pipe_exists_
+#endif // _di_f_pipe_input_exists_
#ifndef _di_f_pipe_warning_exists_
f_return_status f_pipe_warning_exists() {
struct stat st_info;
- if (fstat(fileno(f_pipe_warning), &st_info) != 0) {
+ if (fstat(f_type_descriptor_warning, &st_info) != 0) {
return f_status_set_error(f_file_error_stat);
}
f_return_status f_pipe_error_exists() {
struct stat st_info;
- if (fstat(fileno(f_pipe_error), &st_info) != 0) {
+ if (fstat(f_type_descriptor_error, &st_info) != 0) {
return f_status_set_error(f_file_error_stat);
}
f_return_status f_pipe_debug_exists() {
struct stat st_info;
- if (fstat(fileno(f_pipe_debug), &st_info) != 0) {
+ if (fstat(f_type_descriptor_debug, &st_info) != 0) {
return f_status_set_error(f_file_error_stat);
}
* Licenses: lgplv2.1
*
* Provides pipe functionality.
+ *
+ * @todo implement pipe() functionality.
*/
#ifndef _F_pipe_h
#define _F_pipe_h
#endif
/**
- * Default pipe sources.
- */
-#ifndef _di_f_pipe_
- #define f_pipe f_standard_input
- #define f_pipe_warning f_standard_warning
- #define f_pipe_error f_standard_error
- #define f_pipe_debug f_standard_debug
-#endif // _di_f_pipe_
-
-/**
- * Identify whether or not the default f_pipe source (generally standard input) contains piped data.
+ * Identify whether or not the standard input pipe source contains piped data.
*
* @return
* f_true if there is piped data.
* f_false if there is no piped data.
* f_file_error_stat (with error bit) on stat() error.
*
- * @see stat()
+ * @see fstat()
*/
-#ifndef _di_f_pipe_exists_
- extern f_return_status f_pipe_exists();
-#endif // _di_f_pipe_exists_
+#ifndef _di_f_pipe_input_exists_
+ extern f_return_status f_pipe_input_exists();
+#endif // _di_f_pipe_input_exists_
/**
- * Identify whether or not the default f_pipe_warning source (generally standard warning) contains piped data.
+ * Identify whether or not the standard warning pipe contains piped data.
*
* For most systems, standard warning does not exist and instead maps to standard output.
*
* f_false if there is no piped data.
* f_file_error_stat (with error bit) on stat() error.
*
- * @see stat()
+ * @see fstat()
*/
#ifndef _di_f_pipe_warning_exists_
extern f_return_status f_pipe_warning_exists();
#endif // _di_f_pipe_warning_exists_
/**
- * Identify whether or not the default f_pipe_error source (generally standard error) contains piped data.
+ * Identify whether or not the standard error pipe source contains piped data.
*
* @return
* f_true if there is piped data.
* f_false if there is no piped data.
* f_file_error_stat (with error bit) on stat() error.
*
- * @see stat()
+ * @see fstat()
*/
#ifndef _di_f_pipe_error_exists_
extern f_return_status f_pipe_error_exists();
#endif // _di_f_pipe_error_exists_
/**
- * Identify whether or not the default f_pipe_debug source (generally standard warning) contains piped data.
+ * Identify whether or not the standard debug pipe source contains piped data.
*
* For most systems, standard debug does not exist and instead maps to standard output.
*
* f_false if there is no piped data.
* f_file_error_stat (with error bit) on stat() error.
*
- * @see stat()
+ * @see fstat()
*/
#ifndef _di_f_pipe_debug_exists_
extern f_return_status f_pipe_debug_exists();
#ifndef _di_f_status_buffers_
f_buffer_too_small,
f_buffer_too_large,
+ f_error_on_block,
f_error_on_eof,
f_error_on_eol,
f_error_on_eos,
f_error_on_stop,
f_incomplete_utf,
+ f_incomplete_utf_on_block,
f_incomplete_utf_on_eof,
f_incomplete_utf_on_eol,
f_incomplete_utf_on_eos,
f_incomplete_utf_on_stop,
+ f_none_on_block,
f_none_on_eof,
f_none_on_eol,
f_none_on_eos,
f_none_on_stop,
+ f_no_data_on_block,
f_no_data_on_eof,
f_no_data_on_eol,
f_no_data_on_eos,
f_string_too_small,
f_string_too_large,
f_unterminated,
+ f_unterminated_on_block,
f_unterminated_on_eof,
f_unterminated_on_eol,
f_unterminated_on_eos,
f_unterminated_on_stop,
f_unterminated_group,
+ f_unterminated_group_on_block,
f_unterminated_group_on_eof,
f_unterminated_group_on_eol,
f_unterminated_group_on_eos,
f_unterminated_group_on_stop,
f_unterminated_nest,
+ f_unterminated_nest_on_block,
f_unterminated_nest_on_eof,
f_unterminated_nest_on_eol,
f_unterminated_nest_on_eos,
// libc includes
#include <stdbool.h>
#include <stdint.h>
+#include <unistd.h>
#ifdef __cplusplus
extern "C" {
* For most systems, there is no standard warning nor is there a standard debug.
* Therefore, these will map to standard output.
*/
-#ifndef _di_f_type_standard_input_output_
- #define f_standard_debug stdout
- #define f_standard_error stderr
- #define f_standard_input stdin
- #define f_standard_output stdout
- #define f_standard_warning stdout
-#endif // _di_f_type_standard_input_output_
+#ifndef _di_f_type_input_output_
+ #define f_type_debug stdout
+ #define f_type_error stderr
+ #define f_type_input stdin
+ #define f_type_output stdout
+ #define f_type_warning stdout
+
+ #define f_type_descriptor_debug STDOUT_FILENO
+ #define f_type_descriptor_error STDERR_FILENO
+ #define f_type_descriptor_input STDIN_FILENO
+ #define f_type_descriptor_output STDOUT_FILENO
+ #define f_type_descriptor_warning STDOUT_FILENO
+#endif // _di_f_type_input_output_
/**
* Defines a variable to be used by arrays.
* f_none on success.
* f_invalid_parameter (with error bit) if a parameter is invalid.
*
- * Errors from (with error bit): f_file_read_quantity().
+ * Errors from (with error bit): f_file_read_until().
* Errors from (with error bit): fl_fss_identify()
* File errors (with error bit): f_file_error_seek, f_file_not_open.
*
- * @see f_file_read_quantity()
+ * @see f_file_read_until()
* @see fl_fss_identify()
*/
#ifndef _di_fl_fss_identify_file_
case f_no_data_on_stop:
*string = fl_status_string_no_data_on_stop;
break;
+ case f_no_data_on_block:
+ *string = fl_status_string_no_data_on_block;
+ break;
case f_none_on_eof:
*string = fl_status_string_none_on_eof;
break;
case f_none_on_stop:
*string = fl_status_string_none_on_stop;
break;
+ case f_none_on_block:
+ *string = fl_status_string_none_on_block;
+ break;
case f_error_on_eof:
*string = fl_status_string_error_on_eof;
break;
case f_error_on_stop:
*string = fl_status_string_error_on_stop;
break;
+ case f_error_on_block:
+ *string = fl_status_string_error_on_block;
+ break;
case f_buffer_too_small:
*string = fl_status_string_buffer_too_small;
break;
case f_unterminated_on_stop:
*string = fl_status_string_unterminated_on_stop;
break;
+ case f_unterminated_on_block:
+ *string = fl_status_string_unterminated_on_block;
+ break;
case f_unterminated_group:
*string = fl_status_string_unterminated_group;
break;
case f_unterminated_group_on_stop:
*string = fl_status_string_unterminated_group_on_stop;
break;
+ case f_unterminated_group_on_block:
+ *string = fl_status_string_unterminated_group_on_block;
+ break;
case f_unterminated_nest:
*string = fl_status_string_unterminated_nest;
break;
case f_unterminated_nest_on_stop:
*string = fl_status_string_unterminated_nest_on_stop;
break;
+ case f_unterminated_nest_on_block:
+ *string = fl_status_string_unterminated_nest_on_block;
+ break;
case f_incomplete_utf:
*string = fl_status_string_incomplete_utf;
break;
case f_incomplete_utf_on_stop:
*string = fl_status_string_incomplete_utf_on_stop;
break;
+ case f_incomplete_utf_on_block:
+ *string = fl_status_string_incomplete_utf_on_block;
+ break;
#endif // _di_fl_status_buffers_
#ifndef _di_fl_status_allocation_
#define fl_status_string_no_data_on_stop "f_no_data_on_stop"
#define fl_status_string_no_data_on_stop_length 17
+ #define fl_status_string_no_data_on_block "f_no_data_on_block"
+ #define fl_status_string_no_data_on_block_length 18
+
#define fl_status_string_none_on_eol "f_none_on_eol"
#define fl_status_string_none_on_eol_length 13
#define fl_status_string_none_on_stop "f_none_on_stop"
#define fl_status_string_none_on_stop_length 14
+ #define fl_status_string_none_on_block "f_none_on_block"
+ #define fl_status_string_none_on_block_length 15
+
#define fl_status_string_error_on_eof "f_error_on_eof"
#define fl_status_string_error_on_eof_length 14
#define fl_status_string_error_on_stop "f_error_on_stop"
#define fl_status_string_error_on_stop_length 15
+ #define fl_status_string_error_on_block "f_error_on_block"
+ #define fl_status_string_error_on_block_length 16
+
#define fl_status_string_buffer_too_small "f_buffer_too_small"
#define fl_status_string_buffer_too_small_length 18
#define fl_status_string_unterminated_on_stop "f_unterminated_on_stop"
#define fl_status_string_unterminated_on_stop_length 22
+ #define fl_status_string_unterminated_on_block "f_unterminated_on_block"
+ #define fl_status_string_unterminated_on_block_length 23
+
#define fl_status_string_unterminated_group "f_unterminated_group"
#define fl_status_string_unterminated_group_length 20
#define fl_status_string_unterminated_group_on_stop "f_unterminated_group_on_stop"
#define fl_status_string_unterminated_group_on_stop_length 28
+ #define fl_status_string_unterminated_group_on_block "f_unterminated_group_on_block"
+ #define fl_status_string_unterminated_group_on_block_length 29
+
#define fl_status_string_unterminated_nest "f_unterminated_nest"
#define fl_status_string_unterminated_nest_length 19
#define fl_status_string_unterminated_nest_on_stop "f_unterminated_nest_on_stop"
#define fl_status_string_unterminated_nest_on_stop_length 27
+ #define fl_status_string_unterminated_nest_on_block "f_unterminated_nest_on_block"
+ #define fl_status_string_unterminated_nest_on_block_length 28
+
#define fl_status_string_incomplete_utf "f_incomplete_utf"
#define fl_status_string_incomplete_utf_length 16
#define fl_status_string_incomplete_utf_on_stop "f_incomplete_utf_on_stop"
#define fl_status_string_incomplete_utf_on_stop_length 24
+
+ #define fl_status_string_incomplete_utf_on_block "f_incomplete_utf_on_block"
+ #define fl_status_string_incomplete_utf_on_block_length 25
#endif // _di_fl_status_buffers_
#ifndef _di_fl_status_allocation_
f_return_status fl_utf_file_read(const f_file file, f_utf_string_dynamic *buffer) {
#ifndef _di_level_1_parameter_checking_
if (file.size_read == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer->used >= buffer->size) return f_status_set_error(f_invalid_parameter);
+ if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (file.id <= 0) return f_status_set_error(f_file_not_open);
f_return_status fl_utf_file_read_block(const f_file file, f_utf_string_dynamic *buffer) {
#ifndef _di_level_1_parameter_checking_
if (file.size_read == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer->used >= buffer->size) return f_status_set_error(f_invalid_parameter);
+ if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (file.id <= 0) return f_status_set_error(f_file_not_open);
f_return_status fl_utf_file_read_until(const f_file file, f_utf_string_dynamic *buffer, const f_utf_string_length total) {
#ifndef _di_level_1_parameter_checking_
if (file.size_read == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer->used >= buffer->size) return f_status_set_error(f_invalid_parameter);
+ if (buffer->used > buffer->size) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (file.id <= 0) return f_status_set_error(f_file_not_open);
clearenv();
for (f_array_length i = 0; i < names.used; i++) {
- f_environment_set_dynamic(names.array[i], values.array[i], true);
+ f_environment_set_dynamic(names.array[i], values.array[i], f_true);
} // for
execv(program_path, fixed_arguments);
clearenv();
for (f_array_length i = 0; i < names.used; i++) {
- f_environment_set_dynamic(names.array[i], values.array[i], true);
+ f_environment_set_dynamic(names.array[i], values.array[i], f_true);
}
execvp(program_path, fixed_arguments);
* Print file error messages.
*
* @param file
- * The file to write to, such as f_standard_output or f_standard_error.
+ * The file 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
#ifndef _di_fll_program_print_help_header_
f_return_status fll_program_print_help_header(const fl_color_context context, const f_string name, const f_string version) {
printf("%c", f_string_eol);
- fl_color_print(f_standard_output, context.title, context.reset, " %s", name);
+ fl_color_print(f_type_output, context.title, context.reset, " %s", name);
printf("%c", f_string_eol);
- fl_color_print(f_standard_output, context.notable, context.reset, " Version %s", version);
+ fl_color_print(f_type_output, context.notable, context.reset, " Version %s", version);
printf("%c%c", f_string_eol, f_string_eol);
- fl_color_print(f_standard_output, context.important, context.reset, " Available Options: ");
+ fl_color_print(f_type_output, context.important, context.reset, " Available Options: ");
return f_none;
}
f_return_status fll_program_print_help_option(const fl_color_context context, const f_string option_short, const f_string option_long, const f_string symbol_short, const f_string symbol_long, const f_string description) {
printf("%c", f_string_eol);
printf(" %s", symbol_short);
- fl_color_print(f_standard_output, context.standout, context.reset, option_short);
+ fl_color_print(f_type_output, context.standout, context.reset, option_short);
printf(", %s", symbol_long);
- fl_color_print(f_standard_output, context.standout, context.reset, option_long);
+ fl_color_print(f_type_output, context.standout, context.reset, option_long);
printf(" %s", description);
return f_none;
f_return_status fll_program_print_help_option_long(const fl_color_context context, const f_string option_long, const f_string symbol_long, const f_string description) {
printf("%c", f_string_eol);
printf(" %s", symbol_long);
- fl_color_print(f_standard_output, context.standout, context.reset, option_long);
+ fl_color_print(f_type_output, context.standout, context.reset, option_long);
printf(" %s", description);
return f_none;
#ifndef _di_fll_program_print_help_option_other_
f_return_status fll_program_print_help_option_other(const fl_color_context context, const f_string option_other, const f_string description) {
printf("%c ", f_string_eol);
- fl_color_print(f_standard_output, context.standout, context.reset, option_other);
+ fl_color_print(f_type_output, context.standout, context.reset, option_other);
printf(" %s", description);
#ifndef _di_fll_program_print_help_usage_
f_return_status fll_program_print_help_usage(const fl_color_context context, const f_string name, const f_string parameters) {
printf("%c%c", f_string_eol, f_string_eol);
- fl_color_print(f_standard_output, context.important, context.reset, " Usage:");
+ fl_color_print(f_type_output, context.important, context.reset, " Usage:");
printf("%c ", f_string_eol);
- fl_color_print(f_standard_output, context.standout, context.reset, name);
+ fl_color_print(f_type_output, context.standout, context.reset, name);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "[");
+ fl_color_print(f_type_output, context.notable, context.reset, "[");
printf(" options ");
- fl_color_print(f_standard_output, context.notable, context.reset, "]");
+ fl_color_print(f_type_output, context.notable, context.reset, "]");
if (parameters[0] != '\0') {
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "[");
+ fl_color_print(f_type_output, context.notable, context.reset, "[");
printf(" %s ", parameters);
- fl_color_print(f_standard_output, context.notable, context.reset, "]");
+ fl_color_print(f_type_output, context.notable, context.reset, "]");
}
printf("%c%c", f_string_eol, f_string_eol);
status = f_status_set_fine(status);
if (status == f_no_data) {
- fl_color_print_line(f_standard_error, context->error, context->reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass.");
+ fl_color_print_line(f_type_error, context->error, context->reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass.");
// @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
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "f_console_parameter_process");
- fl_color_print_line(f_standard_error, context->error, context->reset, ").");
+ fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process");
+ fl_color_print_line(f_type_error, context->error, context->reset, ").");
}
else if (status == f_invalid_utf) {
- fl_color_print(f_standard_error, context->error, context->reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "f_console_parameter_process()");
- fl_color_print_line(f_standard_error, context->error, context->reset, ".");
+ fl_color_print(f_type_error, context->error, context->reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()");
+ fl_color_print_line(f_type_error, context->error, context->reset, ".");
}
else if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "f_console_parameter_process()");
- fl_color_print_line(f_standard_error, context->error, context->reset, ".");
+ fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()");
+ fl_color_print_line(f_type_error, context->error, context->reset, ".");
}
else {
- fl_color_print(f_standard_error, context->error, context->reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context->notable, context->reset, "%u", status);
- fl_color_print(f_standard_error, context->error, context->reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "f_console_parameter_process()");
- fl_color_print_line(f_standard_error, context->error, context->reset, ".");
+ fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context->notable, context->reset, "%u", status);
+ fl_color_print(f_type_error, context->error, context->reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "f_console_parameter_process()");
+ fl_color_print_line(f_type_error, context->error, context->reset, ".");
}
return f_status_set_error(status);
status = f_status_set_fine(status);
if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "%s", function);
- fl_color_print_line(f_standard_error, context->error, context->reset, ").");
+ fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "%s", function);
+ fl_color_print_line(f_type_error, context->error, context->reset, ").");
}
else if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "%s", function);
- fl_color_print_line(f_standard_error, context->error, context->reset, "().");
+ fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "%s", function);
+ fl_color_print_line(f_type_error, context->error, context->reset, "().");
}
else {
- fl_color_print(f_standard_error, context->error, context->reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context->notable, context->reset, "%u", status);
- fl_color_print(f_standard_error, context->error, context->reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "%s", function);
- fl_color_print_line(f_standard_error, context->error, context->reset, "().");
+ fl_color_print(f_type_error, context->error, context->reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context->notable, context->reset, "%u", status);
+ fl_color_print(f_type_error, context->error, context->reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "%s", function);
+ fl_color_print_line(f_type_error, context->error, context->reset, "().");
}
return f_status_set_error(status);
fl_macro_color_context_new(allocation_status, (*context));
if (f_status_is_error(allocation_status)) {
- fl_color_print(f_standard_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
- fl_color_print(f_standard_error, context->notable, context->reset, "fl_macro_color_context_new");
- fl_color_print_line(f_standard_error, context->error, context->reset, "().");
+ fl_color_print(f_type_error, context->error, context->reset, "CRITICAL ERROR: Unable to allocate memory while calling ");
+ fl_color_print(f_type_error, context->notable, context->reset, "fl_macro_color_context_new");
+ fl_color_print_line(f_type_error, context->error, context->reset, "().");
return allocation_status;
}
return f_none;
}
+ if (fl_string_compare(string, fl_status_string_no_data_on_block, length, fl_status_string_no_data_on_block_length) == f_equal_to) {
+ *code = f_no_data_on_block;
+ return f_none;
+ }
+
if (fl_string_compare(string, fl_status_string_none_on_eof, length, fl_status_string_none_on_eof_length) == f_equal_to) {
*code = f_none_on_eof;
return f_none;
return f_none;
}
+ if (fl_string_compare(string, fl_status_string_none_on_block, length, fl_status_string_none_on_block_length) == f_equal_to) {
+ *code = f_none_on_block;
+ return f_none;
+ }
+
if (fl_string_compare(string, fl_status_string_error_on_eof, length, fl_status_string_error_on_eof_length) == f_equal_to) {
*code = f_error_on_eof;
return f_none;
return f_none;
}
+ if (fl_string_compare(string, fl_status_string_error_on_block, length, fl_status_string_error_on_block_length) == f_equal_to) {
+ *code = f_error_on_block;
+ return f_none;
+ }
+
if (fl_string_compare(string, fl_status_string_buffer_too_small, length, fl_status_string_buffer_too_small_length) == f_equal_to) {
*code = f_buffer_too_small;
return f_none;
return f_none;
}
+ if (fl_string_compare(string, fl_status_string_unterminated_on_block, length, fl_status_string_unterminated_on_block_length) == f_equal_to) {
+ *code = f_unterminated_on_block;
+ return f_none;
+ }
+
if (fl_string_compare(string, fl_status_string_unterminated_group, length, fl_status_string_unterminated_group_length) == f_equal_to) {
*code = f_unterminated_group;
return f_none;
return f_none;
}
+ if (fl_string_compare(string, fl_status_string_unterminated_group_on_block, length, fl_status_string_unterminated_group_on_block_length) == f_equal_to) {
+ *code = f_unterminated_group_on_block;
+ return f_none;
+ }
+
if (fl_string_compare(string, fl_status_string_unterminated_nest, length, fl_status_string_unterminated_nest_length) == f_equal_to) {
*code = f_unterminated_nest;
return f_none;
return f_none;
}
+ if (fl_string_compare(string, fl_status_string_unterminated_nest_on_block, length, fl_status_string_unterminated_nest_on_block_length) == f_equal_to) {
+ *code = f_unterminated_nest_on_block;
+ return f_none;
+ }
+
if (fl_string_compare(string, fl_status_string_incomplete_utf, length, fl_status_string_incomplete_utf_length) == f_equal_to) {
*code = f_incomplete_utf;
return f_none;
*code = f_incomplete_utf_on_stop;
return f_none;
}
+
+ if (fl_string_compare(string, fl_status_string_incomplete_utf_on_block, length, fl_status_string_incomplete_utf_on_block_length) == f_equal_to) {
+ *code = f_incomplete_utf_on_block;
+ return f_none;
+ }
#endif // _di_fll_status_buffers_
#ifndef _di_fll_status_allocation_
fll_program_print_help_usage(context, byte_dump_name, "filename(s)");
printf(" When using the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_text);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_text);
printf(" option, some UTF-8 characters may be replaced by your instance and cause display alignment issues.");
printf("%c%c", f_string_eol, f_string_eol);
printf(" Special UTF-8 characters and non-spacing UTF-8 characters may be replaced with a space (or a placeholder when the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_placeholder);
printf(" option is used).");
printf("%c%c", f_string_eol, f_string_eol);
printf("%c%c", f_string_eol, f_string_eol);
printf(" When ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
printf(" is used, any UTF-8 sequences will still be printed in full should any part is found within the requested range.");
printf("%c%c", f_string_eol, f_string_eol);
}
else if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[byte_dump_parameter_width].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' was specified, but no value was given.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given.");
byte_dump_delete_data(data);
return f_status_set_error(status);
status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[byte_dump_parameter_width].additional.array[data->parameters[byte_dump_parameter_width].additional.used - 1]], &number);
if (f_status_is_error(status) || number < 1 || number >= 0xfb) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' value can only be a number between ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "0");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " and ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "251");
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number between ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "0");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " and ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "251");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' was specified, but no value was given.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given.");
byte_dump_delete_data(data);
return f_status_set_error(status);
status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[byte_dump_parameter_first].additional.array[data->parameters[byte_dump_parameter_first].additional.used - 1]], &number);
if (f_status_is_error(status) || number > f_type_number_size_unsigned) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "0");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " and ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%llu", f_type_number_size_unsigned);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "0");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " and ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_type_number_size_unsigned);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' was specified, but no value was given.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' was specified, but no value was given.");
byte_dump_delete_data(data);
return f_status_set_error(status);
status = fl_console_parameter_to_number_unsigned(arguments.argv[data->parameters[byte_dump_parameter_last].additional.array[data->parameters[byte_dump_parameter_last].additional.used - 1]], &number);
if (f_status_is_error(status) || number < 0 || number > f_type_number_size_unsigned) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "0");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " and ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%llu", f_type_number_size_unsigned);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' value can only be a number (inclusively) between ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "0");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " and ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%llu", f_type_number_size_unsigned);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' value cannot be greater than the parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' value.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' value cannot be greater than the parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' value.");
byte_dump_delete_data(data);
return f_status_set_error(status);
if (data->process_pipe) {
f_file file = f_file_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
printf("%c", f_string_eol);
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Piped Byte Dump: (in ");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Piped Byte Dump: (in ");
if (data->mode == byte_dump_mode_hexidecimal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Hexidecimal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Hexidecimal");
}
else if (data->mode == byte_dump_mode_duodecimal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Duodecimal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Duodecimal");
}
else if (data->mode == byte_dump_mode_octal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Octal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Octal");
}
else if (data->mode == byte_dump_mode_binary) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Binary");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Binary");
}
else if (data->mode == byte_dump_mode_decimal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Decimal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Decimal");
}
- fl_color_print_line(f_standard_output, data->context.title, data->context.reset, ")");
+ fl_color_print_line(f_type_output, data->context.title, data->context.reset, ")");
status = byte_dump_file(*data, "-", file);
for (f_array_length counter = 0; counter < data->remaining.used; counter++) {
f_file file = f_file_initialize;
- status = f_file_open(&file, arguments.argv[data->remaining.array[counter]]);
+ status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file);
if (f_status_is_error(status)) {
byte_dump_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
byte_dump_delete_data(data);
}
printf("%c", f_string_eol);
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Byte Dump of: ");
- fl_color_print(f_standard_output, data->context.notable, data->context.reset, "%s", arguments.argv[data->remaining.array[counter]]);
- fl_color_print(f_standard_output, data->context.title, data->context.reset, " (in ");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Byte Dump of: ");
+ fl_color_print(f_type_output, data->context.notable, data->context.reset, "%s", arguments.argv[data->remaining.array[counter]]);
+ fl_color_print(f_type_output, data->context.title, data->context.reset, " (in ");
if (data->mode == byte_dump_mode_hexidecimal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Hexidecimal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Hexidecimal");
}
else if (data->mode == byte_dump_mode_duodecimal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Duodecimal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Duodecimal");
}
else if (data->mode == byte_dump_mode_octal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Octal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Octal");
}
else if (data->mode == byte_dump_mode_binary) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Binary");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Binary");
}
else if (data->mode == byte_dump_mode_decimal) {
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "Decimal");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "Decimal");
}
- fl_color_print_line(f_standard_output, data->context.title, data->context.reset, ")");
+ fl_color_print_line(f_type_output, data->context.title, data->context.reset, ")");
status = byte_dump_file(*data, arguments.argv[data->remaining.array[counter]], file);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
byte_dump_delete_data(data);
}
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more filenames.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more filenames.");
status = f_status_set_error(f_invalid_parameter);
}
const f_console_arguments arguments = { argc, argv };
byte_dump_data data = byte_dump_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
uint8_t invalid[data.width];
memset(&invalid, 0, sizeof(uint8_t) * data.width);
- fseek(file.address, data.first, SEEK_SET);
-
while ((size = read(file.id, &byte, 1)) > 0) {
// Storing the next character is designated by width_utf == -1.
if (width_utf == -1) {
printf("%c", f_string_eol);
// make sure to flush standard out to help prevent standard error from causing poblems.
- fflush(f_standard_output);
+ fflush(f_type_output);
if (found_invalid_utf) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "Invalid UTF-8 codes were detected for file '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "Invalid UTF-8 codes were detected for file '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
printf("%c", f_string_eol);
}
if (size < 0) {
// @todo: determine what the error from read() is and display it.
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: read() failed for '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: read() failed for '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
printf("%c", f_string_eol);
status = f_status_set_error(f_failure);
}
- fflush(f_standard_error);
+ fflush(f_type_error);
return status;
}
}
if (cell->column == 0) {
- fl_color_print(f_standard_output, data.context.notable, data.context.reset, "%016X ", (uint64_t) cell->row);
+ fl_color_print(f_type_output, data.context.notable, data.context.reset, "%016X ", (uint64_t) cell->row);
if (*offset > 0) {
uint8_t offset_to_print = *offset;
if (cell->column < data.width) {
if (data.mode == byte_dump_mode_hexidecimal) {
if (invalid[character_current]) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, " %02x", (uint8_t) byte);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, " %02x", (uint8_t) byte);
}
else {
printf(" %02x", (uint8_t) byte);
}
else if (data.mode == byte_dump_mode_duodecimal) {
if (invalid[character_current]) {
- f_print_string_dynamic(f_standard_output, data.context.error);
+ f_print_string_dynamic(f_type_output, data.context.error);
}
printf(" %01d", byte / 144);
}
if (invalid[character_current]) {
- f_print_string_dynamic(f_standard_output, data.context.reset);
+ f_print_string_dynamic(f_type_output, data.context.reset);
}
}
else if (data.mode == byte_dump_mode_octal) {
if (invalid[character_current]) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, " %03o", (uint8_t) byte);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, " %03o", (uint8_t) byte);
}
else {
printf(" %03o", (uint8_t) byte);
binary_string[7] = (byte & 0x01) ? '1' : '0';
if (invalid[character_current]) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, " %s", binary_string);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, " %s", binary_string);
}
else {
printf(" %s", binary_string);
}
else if (data.mode == byte_dump_mode_decimal) {
if (invalid[character_current]) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, " %3d", (uint8_t) byte);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, " %3d", (uint8_t) byte);
}
else {
printf(" %3d", (uint8_t) byte);
uint8_t width_utf = 0;
bool printed = f_false;
- fl_color_print(f_standard_output, data.context.notable, data.context.reset, " %s ", byte_dump_character_wall);
+ fl_color_print(f_type_output, data.context.notable, data.context.reset, " %s ", byte_dump_character_wall);
if (*offset > 0) {
}
while (*offset > 0 && j < data.width) {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", placeholder);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", placeholder);
(*offset)--;
j++;
} // while
if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
for (; j < previous->bytes && j < data.width; j++) {
if (previous->invalid) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
printf(".");
}
else {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
}
} // for
}
width_utf = f_macro_utf_byte_width_is(output);
if (invalid[i]) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, "%s", byte_dump_character_incomplete);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_incomplete);
}
else if (output >= 0 && output <= 32 || output == 127) {
if (data.presentation == byte_dump_presentation_normal) {
if (output == 0) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_null);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_null);
}
else if (output == 1) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_start_of_header);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_start_of_header);
}
else if (output == 2) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_start_of_text);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_start_of_text);
}
else if (output == 3) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_text);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_text);
}
else if (output == 4) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_transmission);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_transmission);
}
else if (output == 5) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_enquiry);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_enquiry);
}
else if (output == 6) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_acknowledge);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_acknowledge);
}
else if (output == 7) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_bell);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_bell);
}
else if (output == 8) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_backspace);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_backspace);
}
else if (output == 9) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_tab);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_tab);
}
else if (output == 10) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_new_line);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_new_line);
}
else if (output == 11) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_tab_vertical);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_tab_vertical);
}
else if (output == 12) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_form_feed);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_form_feed);
}
else if (output == 13) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_carriage_return);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_carriage_return);
}
else if (output == 14) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_shift_out);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_shift_out);
}
else if (output == 15) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_shift_in);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_shift_in);
}
else if (output == 16) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_data_link_escape);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_data_link_escape);
}
else if (output == 17) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_1);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_1);
}
else if (output == 18) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_2);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_2);
}
else if (output == 19) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_3);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_3);
}
else if (output == 20) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_4);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_device_control_4);
}
else if (output == 21) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_negative_acknowledge);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_negative_acknowledge);
}
else if (output == 22) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_synchronous_idle);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_synchronous_idle);
}
else if (output == 23) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_transmission_block);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_transmission_block);
}
else if (output == 24) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_cancel);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_cancel);
}
else if (output == 25) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_medium);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_end_of_medium);
}
else if (output == 26) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_substitute);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_substitute);
}
else if (output == 27) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_escape);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_escape);
}
else if (output == 28) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_file_separator);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_file_separator);
}
else if (output == 29) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_group_separator);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_group_separator);
}
else if (output == 30) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_record_separator);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_record_separator);
}
else if (output == 31) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_unit_separator);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_unit_separator);
}
else if (output == 32) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_space);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_space);
}
else if (output == 127) {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_delete);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_delete);
}
}
else if (data.presentation == byte_dump_presentation_simple) {
printf(".");
}
else {
- fl_color_print2(f_standard_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_space);
+ fl_color_print2(f_type_output, data.context.notable, data.context.warning, data.context.reset, "%s", byte_dump_sequence_space);
}
}
else if (f_utf_character_is_zero_width(characters.string[i]) == f_true) {
printf(".");
}
else if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
}
else {
printf(" ");
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_standard_output, data.context.warning, data.context.reset, ".");
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, ".");
}
else {
printf(" ");
else if (width_utf == 1) {
// print invalid placeholder for invalid UTF-8 widths.
if (invalid[i]) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, "%s", byte_dump_character_incomplete);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_incomplete);
}
else {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", byte_dump_character_incomplete);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_incomplete);
}
}
else if (width_utf > 0) {
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_standard_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
printf(".");
}
else {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
}
}
else {
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_standard_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
printf(".");
}
else {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
}
}
else {
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_standard_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
printf(".");
}
else {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
}
}
else {
if (data.parameters[byte_dump_parameter_placeholder].result == f_console_result_found) {
for (; j < data.width; j++) {
if (invalid[j]) {
- fl_color_print(f_standard_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.error, data.context.reset, "%s", byte_dump_character_placeholder);
}
else if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
printf(".");
}
else {
- fl_color_print(f_standard_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
+ fl_color_print(f_type_output, data.context.warning, data.context.reset, "%s", byte_dump_character_placeholder);
}
} // for
}
} // for
}
- fl_color_print(f_standard_output, data.context.notable, data.context.reset, " |");
+ fl_color_print(f_type_output, data.context.notable, data.context.reset, " |");
printf("%c", f_string_eol);
}
#endif // _di_byte_dump_file_
#ifndef _di_byte_dump_print_file_error_
void byte_dump_print_file_error(const fl_color_context context, const f_string function, const f_string file_name, const f_status status) {
if (status == f_false) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: failed to find file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to find file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ", function, file_name);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", function);
- fl_color_print(f_standard_error, context.error, context.reset, "() for the file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ", function, file_name);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+ fl_color_print(f_type_error, context.error, context.reset, "() for the file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
if (status == f_invalid_name) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Invalid filename '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid filename '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
if (status == f_out_of_memory) {
- fl_color_print(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to access file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to access file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
if (status == f_number_overflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Overflow while trying to access file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to access file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
if (status == f_invalid_directory) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Invalid directory while trying to access file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to access file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
if (status == f_access_denied) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Access denied while trying to access file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to access file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
if (status == f_loop) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Loop while trying to access file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to access file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
return;
}
- fl_color_print(f_standard_error, context.error, context.reset, "UNKNOWN ERROR: (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%d", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") occurred for file '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", file_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") occurred for file '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", file_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
#endif // _di_byte_dump_print_file_error_
printf("%c%c", f_string_eol, f_string_eol);
- fl_color_print(f_standard_output, context.important, context.reset, " Special Options: ");
+ fl_color_print(f_type_output, context.important, context.reset, " Special Options: ");
fll_program_print_help_option_long(context, fake_long_documents_disabled, f_console_symbol_long_enable, " Forcibly do not build documents files.");
fll_program_print_help_option_long(context, fake_long_documents_enabled, f_console_symbol_long_enable, " Forcibly do build documents files.");
printf("%c%c", f_string_eol, f_string_eol);
- fl_color_print(f_standard_output, context.important, context.reset, " Operations: ");
+ fl_color_print(f_type_output, context.important, context.reset, " Operations: ");
fll_program_print_help_option_other(context, fake_other_operation_build, " Build or compile the code based on build settings file.");
fll_program_print_help_option_other(context, fake_other_operation_clean, " Delete all build files.");
fll_program_print_help_usage(context, fake_name, "operation");
printf(" When performing the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s", fake_other_operation_build);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s", fake_other_operation_build);
printf(" operation, the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
printf(" parameter specifies a name (limited to alpha-numeric, underscore, and dash) to be used in addition to the global.");
printf("%c", f_string_eol);
printf(" For example, when a ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s", fake_long_mode);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s", fake_long_mode);
printf(" of 'fll_monolithic' is specified, build libaries from both 'build_libraries' and 'build_libraries-fll_monolithic' are used (but not 'build_libraries-fll_level').");
printf("%c%c", f_string_eol, f_string_eol);
}
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the operation '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", fake_other_operation_make);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' is not yet implemented.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the operation '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", fake_other_operation_make);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' is not yet implemented.");
}
}
else if (operations[i] == fake_operation_skeleton) {
if (f_status_is_error(status)) {
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the operation '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", operations_name[i]);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' failed.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the operation '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", operations_name[i]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' failed.");
}
break;
// ensure a newline is always put at the end of the program execution, unless in quite mode.
if (data->verbosity != fake_verbosity_quiet) {
if (f_status_is_error(status)) {
- fprintf(f_standard_error, "%c", f_string_eol);
+ fprintf(f_type_error, "%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "%cAll operations complete.%c%c", f_string_eol, f_string_eol, f_string_eol);
+ fprintf(f_type_output, "%cAll operations complete.%c%c", f_string_eol, f_string_eol, f_string_eol);
}
}
}
else {
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify an operation.");
- fprintf(f_standard_error, "%c", f_string_eol);
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify an operation.");
+ fprintf(f_type_error, "%c", f_string_eol);
}
status = f_status_set_error(f_invalid_parameter);
if (names.used + settings.environment.used > names.size) {
if (names.used + settings.environment.used > f_array_length_size) {
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The values for the settings '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", fake_build_settings_name_environment);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' of settings file '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' is too large.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The values for the settings '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", fake_build_settings_name_environment);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' of settings file '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' is too large.");
}
f_macro_string_dynamic_delete_simple(part);
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_failure) {
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to execute script: ");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", path.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, ".");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to execute script: ");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, ".");
}
}
else {
f_return_status fake_build_operate(const fake_data data) {
if (data.verbosity != fake_verbosity_quiet) {
printf("%c", f_string_eol);
- fl_color_print_line(f_standard_output, data.context.important, data.context.reset, "Building project.");
+ fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Building project.");
}
f_status status = f_none;
if (status == f_true) {
name_function = "f_file_open";
- status = f_file_open(&file, data.file_data_build_settings.string);
+ status = f_file_open(data.file_data_build_settings.string, 0, &file);
if (status == f_none) {
name_function = "f_file_read";
- status = f_file_read(&file, &buffer);
+ status = f_file_read(file, &buffer);
- f_file_close(&file);
+ f_file_close(&file.id);
}
}
else if (status == f_false) {
if (status == f_status_set_error(f_incomplete_utf_on_stop)) {
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%d", range.start);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, " of settings file '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "').");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%d", range.start);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, " of settings file '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "').");
}
}
else if (status == f_status_set_error(f_incomplete_utf_on_stop)) {
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%d", range.start);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, " of settings file '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "').");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%d", range.start);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, " of settings file '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "').");
}
}
else {
- fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_fss_extended_read", true);
+ fake_print_error(data.context, data.verbosity, f_status_set_fine(status), "fll_fss_extended_read", f_true);
}
f_macro_fss_objects_delete_simple(objects);
if (found == f_false) {
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: the specified mode '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", modes->array[i].string);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' is not a valid mode, according to '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: the specified mode '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", modes->array[i].string);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' is not a valid mode, according to '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
}
error_printed = f_true;
if (status == f_status_set_error(f_string_too_large)) {
if (data.verbosity != fake_verbosity_quiet) {
// @todo update FSS functions to return which setting index the problem happened on.
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: a setting in the build settings file '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' is too long.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: a setting in the build settings file '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' is too long.");
}
}
else if (!error_printed) {
if (settings_single_source[i]->used > 1) {
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_warning, "%c", f_string_eol);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "WARNING: the setting '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "' in the file '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "' may only have a single property, only using the first: '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", settings_single_source[i]->array[0].string);
- fl_color_print_line(f_standard_warning, data.context.warning, data.context.reset, "'.");
+ fprintf(f_type_warning, "%c", f_string_eol);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' may only have a single property, only using the first: '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_source[i]->array[0].string);
+ fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'.");
}
}
*settings_single_bool[i] = f_true;
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_warning, "%c", f_string_eol);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "WARNING: the setting '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "' in the file '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "' may be either '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", fake_build_settings_bool_yes);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "' or '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", fake_build_settings_bool_no);
- fl_color_print(f_standard_warning, data.context.warning, data.context.reset, "', defaulting to '");
- fl_color_print(f_standard_warning, data.context.notable, data.context.reset, "%s", fake_build_settings_bool_yes);
- fl_color_print_line(f_standard_warning, data.context.warning, data.context.reset, "'.");
+ fprintf(f_type_warning, "%c", f_string_eol);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' may be either '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_settings_bool_yes);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' or '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_settings_bool_no);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', defaulting to '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_settings_bool_yes);
+ fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'.");
}
}
}
if (data.verbosity != fake_verbosity_quiet) {
printf("%c", f_string_eol);
- fl_color_print(f_standard_output, data.context.important, data.context.reset, "Deleting all files within build directory '");
- fl_color_print(f_standard_output, data.context.notable, data.context.reset, "%s", data.path_build.string);
- fl_color_print_line(f_standard_output, data.context.important, data.context.reset, "'.");
+ fl_color_print(f_type_output, data.context.important, data.context.reset, "Deleting all files within build directory '");
+ fl_color_print(f_type_output, data.context.notable, data.context.reset, "%s", data.path_build.string);
+ fl_color_print_line(f_type_output, data.context.important, data.context.reset, "'.");
}
if (data.verbosity == fake_verbosity_verbose) {
if (status == f_invalid_parameter) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Invalid parameter when calling function ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", function);
- fl_color_print_line(f_standard_error, context.error, context.reset, "().");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid parameter when calling function ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+ fl_color_print_line(f_type_error, context.error, context.reset, "().");
}
return f_none;
if (status == f_error_allocation || status == f_error_reallocation) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Unable to allocate memory in function ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", function);
- fl_color_print_line(f_standard_error, context.error, context.reset, "().");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Unable to allocate memory in function ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+ fl_color_print_line(f_type_error, context.error, context.reset, "().");
}
return f_none;
}
if (fallback && verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "UNKNOWN ERROR: (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%d", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") in function ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", function);
- fl_color_print_line(f_standard_error, context.error, context.reset, "().");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") in function ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+ fl_color_print_line(f_type_error, context.error, context.reset, "().");
}
return f_unknown;
if (status == f_file_not_found) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: failed to find %s '", file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to find %s '", file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (status == f_invalid_parameter) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", function);
- fl_color_print(f_standard_error, context.error, context.reset, "() for the %s '", file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", function);
+ fl_color_print(f_type_error, context.error, context.reset, "() for the %s '", file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (status == f_invalid_name) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Invalid %s name '", file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid %s name '", file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (status == f_out_of_memory) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory, while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (status == f_number_overflow) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Overflow while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (status == f_invalid_directory) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Invalid directory while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (status == f_access_denied) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Access denied while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (status == f_loop) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: Loop while trying to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: Loop while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
if (is_file) {
if (status == f_directory_not_found) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' due to an invalid directory in the path.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path.");
}
return f_none;
else {
if (status == f_directory_not_found) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' due to an invalid directory in the path.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' due to an invalid directory in the path.");
}
return f_none;
if (status == f_failure) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: failed to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_none;
}
if (fake_print_error(context, verbosity, status, function, f_false) == f_unknown && fallback && verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "UNKNOWN ERROR: (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%d", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") occurred while trying to %s %s '", operation, file_or_directory);
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "UNKNOWN ERROR: (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%d", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") occurred while trying to %s %s '", operation, file_or_directory);
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
return f_unknown;
#ifndef _di_fake_print_error_parameter_missing_value_
void fake_print_error_parameter_missing_value(const fl_color_context context, const uint8_t verbosity, const f_string parameter) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' was specified, but no value was given.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' was specified, but no value was given.");
}
}
#endif // _di_fake_print_error_parameter_missing_value_
#ifndef _di_fake_print_error_parameter_too_many_
void fake_print_error_parameter_too_many(const fl_color_context context, const uint8_t verbosity, const f_string parameter) {
if (verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' specified too many times.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' specified too many times.");
}
}
#endif // _di_fake_print_error_parameter_too_many_
for (uint8_t i = 0; i < 4; i++) {
if (data->parameters[parameters_id[i]].total > 1) {
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the operation '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", parameters_name[i]);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' specified too many times.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the operation '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", parameters_name[i]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' specified too many times.");
}
return f_status_set_error(f_invalid_parameter);
if (f_status_is_error(status)) {
if (status == f_status_set_error(f_string_too_large)) {
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' is too long.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' is too long.");
}
}
else {
if (length == 0 || status == f_no_data) {
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' must not be empty and must not contain only whitespace.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' must not be empty and must not contain only whitespace.");
}
}
}
if (f_status_is_error(status)) {
if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fl_console_parameter_to_string_dynamic_directory", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: failed to process parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to process parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return status;
if (f_status_is_error(status)) {
if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "f_macro_string_dynamic_new", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: failed to load default for the parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to load default for the parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return status;
if (f_status_is_error(status)) {
if (status == f_status_set_error(f_string_too_large)) {
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the (combined) parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_defines);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' is too long.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the (combined) parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_defines);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' is too long.");
}
}
else {
if (f_status_is_error(status)) {
if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "fll_program_parameter_additional_rip", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: failed to process the parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to process the parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return status;
if (f_status_is_error(status)) {
if (fake_print_error(data->context, data->verbosity, f_status_set_fine(status), "f_utf_is_word_dash_plus", f_false) == f_unknown && data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: failed to process the parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: failed to process the parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return status;
if (status == f_false) {
if (data->verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameters value '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", data->mode.array[i].string);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' contains non-word, non-dash, and non-plus characters.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fake_long_mode);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameters value '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", data->mode.array[i].string);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' contains non-word, non-dash, and non-plus characters.");
}
return f_status_set_error(f_invalid_parameter);
if (parameters_value[i]->used > 0) {
memset(&directory_stat, 0, sizeof(struct stat));
- status = f_file_stat(parameters_value[i]->string, &directory_stat);
+ status = f_file_stat(parameters_value[i]->string, f_true, &directory_stat);
if (status == f_status_set_error(f_file_not_found)) status = f_status_set_error(f_directory_not_found);
}
}
else if (parameters_required[i]) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: No valid path for the (required) directory parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' was found.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: No valid path for the (required) directory parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, parameters_name[i]);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' was found.");
return f_status_set_error(f_directory_not_found);
}
if (data.verbosity != fake_verbosity_quiet) {
printf("%c", f_string_eol);
- fl_color_print_line(f_standard_output, data.context.important, data.context.reset, "Generating skeleton structure.");
+ fl_color_print_line(f_type_output, data.context.important, data.context.reset, "Generating skeleton structure.");
}
{
if (status == f_false) {
if (data.verbosity != fake_verbosity_quiet) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The path '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", path.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' exists but is not a directory.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' exists but is not a directory.");
}
return f_status_set_warning(f_failure);
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_file_not_found) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The path '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", path.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The path '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist.");
}
else {
fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), "f_directory_create", path.string, "create", f_false, f_true);
mode = f_file_mode_all_rwx;
}
- status = f_file_create(path.string, mode, true);
+ status = f_file_create(path.string, mode, f_true, f_true);
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_file_not_found) {
- fprintf(f_standard_error, "%c", f_string_eol);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The path '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s", path.string);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist.");
+ fprintf(f_type_error, "%c", f_string_eol);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The file '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s", path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' could not be created, a parent directory does not exist.");
}
else {
fake_print_error_file(data.context, data.verbosity, f_status_set_fine(status), "f_file_create", path.string, "create", f_true, f_true);
#endif // _en_firewall_debug_
printf("%c%c", f_string_eol, f_string_eol);
- fl_color_print(f_standard_output, context.important, context.reset, " Available Commands: ");
+ fl_color_print(f_type_output, context.important, context.reset, " Available Commands: ");
printf("%c ", f_string_eol);
- fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_start);
+ fl_color_print(f_type_output, context.standout, context.reset, firewall_command_start);
printf(" Turn on the firewall");
printf("%c ", f_string_eol);
- fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_stop);
+ fl_color_print(f_type_output, context.standout, context.reset, firewall_command_stop);
printf(" Turn off the firewall");
printf("%c ", f_string_eol);
- fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_restart);
+ fl_color_print(f_type_output, context.standout, context.reset, firewall_command_restart);
printf(" Turn off and then turn on the firewall");
printf("%c ", f_string_eol);
- fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_lock);
+ fl_color_print(f_type_output, context.standout, context.reset, firewall_command_lock);
printf(" Prevent all communication");
printf("%c ", f_string_eol);
- fl_color_print(f_standard_output, context.standout, context.reset, firewall_command_show);
+ fl_color_print(f_type_output, context.standout, context.reset, firewall_command_show);
printf(" Show active firewall settings");
fll_program_print_help_usage(context, firewall_name, "command");
if (strncmp("nat", arguments.argv[data->remaining.array[counter]], 4) != 0) {
if (strncmp("mangle", arguments.argv[data->remaining.array[counter]], 7) != 0) {
if (strncmp("ports", arguments.argv[data->remaining.array[counter]], 6) != 0) {
- fl_color_print_line(f_standard_warning, data->context.warning, data->context.reset, "WARNING: '%s' is not a valid show option", arguments.argv[data->remaining.array[counter]]);
+ fl_color_print_line(f_type_warning, data->context.warning, data->context.reset, "WARNING: '%s' is not a valid show option", arguments.argv[data->remaining.array[counter]]);
}
else {
show_ports = f_true;
f_macro_string_dynamics_resize(status, parameters, 7);
if (f_status_is_error(status)) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
firewall_delete_local_data(&local);
firewall_delete_data(data);
return status;
}
if (show_nat) {
- fl_color_print(f_standard_output, data->context.standout, data->context.reset, "=========================== ");
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "NAT");
- fl_color_print_line(f_standard_output, data->context.standout, data->context.reset, " ============================");
- fflush(f_standard_output);
+ fl_color_print(f_type_output, data->context.standout, data->context.reset, "=========================== ");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "NAT");
+ fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " ============================");
+ fflush(f_type_output);
parameters.used = 6;
status = fll_execute_program((f_string) firewall_tool_iptables, parameters, &results);
- fprintf(f_standard_output, "\n");
- fflush(f_standard_output);
+ fprintf(f_type_output, "\n");
+ fflush(f_type_output);
}
if (f_status_is_not_error(status) && show_mangle) {
- fl_color_print(f_standard_output, data->context.standout, data->context.reset, "========================== ");
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "MANGLE");
- fl_color_print_line(f_standard_output, data->context.standout, data->context.reset, " ==========================");
- fflush(f_standard_output);
+ fl_color_print(f_type_output, data->context.standout, data->context.reset, "========================== ");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "MANGLE");
+ fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " ==========================");
+ fflush(f_type_output);
parameters.used = 6;
status = fll_execute_program((f_string) firewall_tool_iptables, parameters, &results);
- fprintf(f_standard_output, "\n");
- fflush(f_standard_output);
+ fprintf(f_type_output, "\n");
+ fflush(f_type_output);
}
if (f_status_is_not_error(status) && show_ports) {
- fl_color_print(f_standard_output, data->context.standout, data->context.reset, "========================== ");
- fl_color_print(f_standard_output, data->context.title, data->context.reset, "FILTER");
- fl_color_print_line(f_standard_output, data->context.standout, data->context.reset, " ==========================");
- fflush(f_standard_output);
+ fl_color_print(f_type_output, data->context.standout, data->context.reset, "========================== ");
+ fl_color_print(f_type_output, data->context.title, data->context.reset, "FILTER");
+ fl_color_print_line(f_type_output, data->context.standout, data->context.reset, " ==========================");
+ fflush(f_type_output);
parameters.used = 4;
status = fll_execute_program((f_string) firewall_tool_iptables, parameters, &results);
- fprintf(f_standard_output, "\n");
- fflush(f_standard_output);
+ fprintf(f_type_output, "\n");
+ fflush(f_type_output);
}
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables);
- fprintf(f_standard_error, " ");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables);
+ fprintf(f_type_error, " ");
f_string_length i = 0;
- fl_color_print_code(f_standard_error, data->context.error);
+ fl_color_print_code(f_type_error, data->context.error);
- fprintf(f_standard_error, "%s ", firewall_tool_iptables);
+ fprintf(f_type_error, "%s ", firewall_tool_iptables);
for (; i < parameters.used; i++) {
- fprintf(f_standard_error, "%s ", parameters.array[i].string);
+ fprintf(f_type_error, "%s ", parameters.array[i].string);
} // for
- fl_color_print_code(f_standard_error, data->context.reset);
- fprintf(f_standard_error, "\n");
+ fl_color_print_code(f_type_error, data->context.reset);
+ fprintf(f_type_error, "\n");
}
status = f_status_set_error(status);
status = f_status_set_fine(status);
if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status == f_no_data) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: could not find any network devices");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: could not find any network devices");
}
else if (status == f_failure) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: failed to read the device directory '%s'", network_devices);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: failed to read the device directory '%s'", network_devices);
}
firewall_delete_local_data(&local);
return status;
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to perform lock request because the lock instructions are missing from: %s.", network_path firewall_file_other);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform lock request because the lock instructions are missing from: %s.", network_path firewall_file_other);
firewall_delete_local_data(&local);
firewall_delete_data(data);
}
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to perform stop request because the lock instructions are missing from: %s.", network_path firewall_file_other);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform stop request because the lock instructions are missing from: %s.", network_path firewall_file_other);
firewall_delete_local_data(&local);
firewall_delete_data(data);
f_macro_string_dynamic_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_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
firewall_delete_local_data(&local);
firewall_delete_data(data);
return status;
firewall_delete_local_data(&local);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: You did not pass a command");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: You did not pass a command");
status = f_status_set_error(f_invalid_parameter);
}
}
const f_console_arguments arguments = { argc, argv };
firewall_data data = firewall_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
if (length >= firewall_chain_length && fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_chain, length, firewall_chain_length) == f_equal_to) {
if (chain == firewall_chain_custom_id) {
// custom chains can only apply to themselves, so silently ignore chain commands specified within a custom chain.
- fprintf(f_standard_warning, "WARNING: At line %i, the chain option is meaningle ss inside of a custom chain.", i);
+ fprintf(f_type_warning, "WARNING: At line %i, the chain option is meaningle ss inside of a custom chain.", i);
continue;
}
// process rule rule, if the remaining rule does not match as firewall_rule, then it is an invalid rule.
else if (length < firewall_rule_length || fl_string_compare(local.buffer.string + local.rule_objects.array[i].start, (f_string) firewall_rule, length, firewall_rule_length) == f_not_equal_to) {
if (length > 0) {
- fl_color_print_code(f_standard_warning, data.context.warning);
- fprintf(f_standard_warning, "WARNING: At line %i, the object '", i);
- f_print_string(f_standard_warning, local.buffer.string + local.rule_objects.array[i].start, length);
- fprintf(f_standard_warning, "' is invalid");
- fl_color_print_code(f_standard_warning, data.context.reset);
+ fl_color_print_code(f_type_warning, data.context.warning);
+ fprintf(f_type_warning, "WARNING: At line %i, the object '", i);
+ f_print_string(f_type_warning, local.buffer.string + local.rule_objects.array[i].start, length);
+ fprintf(f_type_warning, "' is invalid");
+ fl_color_print_code(f_type_warning, data.context.reset);
}
else {
- fprintf(f_standard_warning, "WARNING: At line %i, the object is missing", i);
+ fprintf(f_type_warning, "WARNING: At line %i, the object is missing", i);
}
- fprintf(f_standard_warning, "\n");
+ fprintf(f_type_warning, "\n");
continue;
}
length = firewall_macro_structure_size(local.rule_objects, i);
if (length > 0) {
- fl_color_print_code(f_standard_warning, data.context.warning);
- fprintf(f_standard_warning, "WARNING: At line %i, the object '", i);
- f_print_string(f_standard_warning, local.buffer.string + local.rule_objects.array[i].start, length);
- fprintf(f_standard_warning, "' has invalid content '");
- f_print_string(f_standard_warning, local.buffer.string + local.rule_contents.array[i].array[0].start, firewall_macro_structure_size(local.rule_contents.array[i], 0));
- fprintf(f_standard_warning, "'");
- fl_color_print_code(f_standard_warning, data.context.reset);
- fprintf(f_standard_warning, "\n");
+ fl_color_print_code(f_type_warning, data.context.warning);
+ fprintf(f_type_warning, "WARNING: At line %i, the object '", i);
+ f_print_string(f_type_warning, local.buffer.string + local.rule_objects.array[i].start, length);
+ fprintf(f_type_warning, "' has invalid content '");
+ f_print_string(f_type_warning, local.buffer.string + local.rule_contents.array[i].array[0].start, firewall_macro_structure_size(local.rule_contents.array[i], 0));
+ fprintf(f_type_warning, "'");
+ fl_color_print_code(f_type_warning, data.context.reset);
+ fprintf(f_type_warning, "\n");
}
else {
- fl_color_print_line(f_standard_warning, data.context.warning, data.context.reset, "WARNING: At line %i, the object has no content", i);
+ fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "WARNING: At line %i, the object has no content", i);
}
continue;
else {
length = firewall_macro_structure_size(local.rule_objects, i);
- fl_color_print_code(f_standard_warning, data.context.warning);
- fprintf(f_standard_warning, "WARNING: At line %i, the object '", i);
- f_print_string(f_standard_warning, local.buffer.string + local.rule_objects.array[i].start, length);
- fprintf(f_standard_warning, "' has no content");
- fl_color_print_code(f_standard_warning, data.context.reset);
- fprintf(f_standard_warning, "\n");
+ fl_color_print_code(f_type_warning, data.context.warning);
+ fprintf(f_type_warning, "WARNING: At line %i, the object '", i);
+ f_print_string(f_type_warning, local.buffer.string + local.rule_objects.array[i].start, length);
+ fprintf(f_type_warning, "' has no content");
+ fl_color_print_code(f_type_warning, data.context.reset);
+ fprintf(f_type_warning, "\n");
break;
}
file_path.used = file_path.size;
file_path.string[file_path.used] = 0;
- status = f_file_open(&file, file_path.string);
+ status = f_file_open(file_path.string, 0, &file);
}
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
}
else if (status == f_file_not_found) {
// the file does not have to exist
- fl_color_print_line(f_standard_warning, data.context.warning, data.context.reset, "WARNING: Cannot find the file '%.*s'", file_path.used, file_path.string);
+ fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "WARNING: Cannot find the file '%.*s'", file_path.used, file_path.string);
status = f_none;
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%.*s'", file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%.*s'", file_path.used, file_path.string);
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%.*s'", file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%.*s'", file_path.used, file_path.string);
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
}
if (status != f_file_not_found) {
status = f_status_set_error(status);
}
- f_file_close(&file);
+ f_file_close(&file.id);
}
else {
- status = f_file_read(&file, &local_buffer);
+ status = f_file_read(file, &local_buffer);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_read_position()");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read()");
}
else if (status == f_number_overflow) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%.*s'", file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%.*s'", file_path.used, file_path.string);
}
else if (status == f_file_not_open) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%.*s' is no longer open", file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%.*s' is no longer open", file_path.used, file_path.string);
}
else if (status == f_file_error_seek) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%.*s'", file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%.*s'", file_path.used, file_path.string);
}
else if (status == f_file_error_read) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%.*s'", file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%.*s'", file_path.used, file_path.string);
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_read_position()", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read()", status);
}
status = f_status_set_error(status);
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_read() for the file '%.*s'", file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_read() for the file '%.*s'", file_path.used, file_path.string);
}
else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
// empty files are to be silently ignored
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'", status, file_path.used, file_path.string);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_read() for the file '%.*s'", status, file_path.used, file_path.string);
}
status = f_status_set_error(status);
}
if (f_status_is_error(status)) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
f_macro_string_dynamic_delete_simple(ip_list_action);
}
f_macro_string_dynamic_new(status, ip_argument, ip_length);
if (f_status_is_error(status)) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
break;
}
// print command when debugging.
#ifdef _en_firewall_debug_
if (data.parameters[firewall_parameter_debug].result == f_console_result_found) {
- fl_color_print_code(f_standard_debug, data.context.warning);
- fprintf(f_standard_debug, "%s ", current_tool);
+ fl_color_print_code(f_type_debug, data.context.warning);
+ fprintf(f_type_debug, "%s ", current_tool);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_debug, data.context.reset);
- fprintf(f_standard_debug, "\n");
+ fl_color_print_code(f_type_debug, data.context.reset);
+ fprintf(f_type_debug, "\n");
}
#endif // _en_firewall_debug_
status = fll_execute_program((f_string) current_tool, arguments, &results);
if (status == f_failure) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool);
- fprintf(f_standard_error, " ");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool);
+ fprintf(f_type_error, " ");
- fl_color_print_code(f_standard_error, data.context.error);
+ fl_color_print_code(f_type_error, data.context.error);
- fprintf(f_standard_error, "%s ", current_tool);
+ fprintf(f_type_error, "%s ", current_tool);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_error, data.context.reset);
- fprintf(f_standard_error, "\n");
+ fl_color_print_code(f_type_error, data.context.reset);
+ fprintf(f_type_error, "\n");
// remove ip_argument from arguments string.
f_macro_string_dynamic_delete_simple(arguments.array[arguments.used]);
break;
}
else if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
// remove ip_argument from arguments string.
f_macro_string_dynamic_delete_simple(arguments.array[arguments.used]);
// print command when debugging.
#ifdef _en_firewall_debug_
if (data.parameters[firewall_parameter_debug].result == f_console_result_found) {
- fl_color_print_code(f_standard_debug, data.context.warning);
- fprintf(f_standard_debug, "%s ", current_tool);
+ fl_color_print_code(f_type_debug, data.context.warning);
+ fprintf(f_type_debug, "%s ", current_tool);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_debug, data.context.reset);
- fprintf(f_standard_debug, "\n");
+ fl_color_print_code(f_type_debug, data.context.reset);
+ fprintf(f_type_debug, "\n");
}
#endif // _en_firewall_debug_
status = fll_execute_program(current_tool, arguments, &results);
if (status == f_failure) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool);
- fprintf(f_standard_error, " ");
- fl_color_print_code(f_standard_error, data.context.error);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", current_tool);
+ fprintf(f_type_error, " ");
+ fl_color_print_code(f_type_error, data.context.error);
- fprintf(f_standard_error, "%s ", current_tool);
+ fprintf(f_type_error, "%s ", current_tool);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_error, data.context.reset);
- fprintf(f_standard_error, "\n");
+ fl_color_print_code(f_type_error, data.context.reset);
+ fprintf(f_type_error, "\n");
break;
}
else if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
break;
}
}
// print command when debugging.
#ifdef _en_firewall_debug_
if (data->parameters[firewall_parameter_debug].result == f_console_result_found) {
- fl_color_print_code(f_standard_debug, data->context.warning);
- fprintf(f_standard_debug, "%s ", firewall_tool_iptables);
+ fl_color_print_code(f_type_debug, data->context.warning);
+ fprintf(f_type_debug, "%s ", firewall_tool_iptables);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_debug, data->context.reset);
- fprintf(f_standard_debug, "\n");
+ fl_color_print_code(f_type_debug, data->context.reset);
+ fprintf(f_type_debug, "\n");
}
#endif // _en_firewall_debug_
// print command when debugging.
#ifdef _en_firewall_debug_
if (data->parameters[firewall_parameter_debug].result == f_console_result_found) {
- fl_color_print_code(f_standard_debug, data->context.warning);
- fprintf(f_standard_debug, "%s ", firewall_tool_ip6tables);
+ fl_color_print_code(f_type_debug, data->context.warning);
+ fprintf(f_type_debug, "%s ", firewall_tool_ip6tables);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_debug, data->context.reset);
- fprintf(f_standard_debug, "\n");
+ fl_color_print_code(f_type_debug, data->context.reset);
+ fprintf(f_type_debug, "\n");
}
#endif // _en_firewall_debug_
if (status == f_failure) {
if (tool == firewall_program_iptables) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_iptables);
}
else if (tool == firewall_program_ip6tables) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_ip6tables);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to perform requested %s operation:", firewall_tool_ip6tables);
}
- fprintf(f_standard_error, " ");
- fl_color_print_code(f_standard_error, data->context.error);
+ fprintf(f_type_error, " ");
+ fl_color_print_code(f_type_error, data->context.error);
if (tool == firewall_program_iptables) {
- fprintf(f_standard_error, "%s ", firewall_tool_iptables);
+ fprintf(f_type_error, "%s ", firewall_tool_iptables);
}
else if (tool == firewall_program_ip6tables) {
- fprintf(f_standard_error, "%s ", firewall_tool_ip6tables);
+ fprintf(f_type_error, "%s ", firewall_tool_ip6tables);
}
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_error, data->context.reset);
- fprintf(f_standard_error, "\n");
+ fl_color_print_code(f_type_error, data->context.reset);
+ fprintf(f_type_error, "\n");
}
else if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
}
f_macro_string_dynamics_delete_simple(arguments);
// print command when debugging.
#ifdef _en_firewall_debug_
if (data.parameters[firewall_parameter_debug].result == f_console_result_found) {
- fl_color_print_code(f_standard_debug, data.context.warning);
- fprintf(f_standard_debug, "%s ", tools[i]);
+ fl_color_print_code(f_type_debug, data.context.warning);
+ fprintf(f_type_debug, "%s ", tools[i]);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_debug, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_debug, data.context.reset);
- fprintf(f_standard_debug, "\n");
+ fl_color_print_code(f_type_debug, data.context.reset);
+ fprintf(f_type_debug, "\n");
}
#endif // _en_firewall_debug_
status = f_status_set_fine(status);
if (status == f_failure) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]);
- fprintf(f_standard_error, " ");
- fl_color_print_code(f_standard_error, data.context.error);
+ fprintf(f_type_error, " ");
+ fl_color_print_code(f_type_error, data.context.error);
- fprintf(f_standard_error, "%s ", tools[i]);
+ fprintf(f_type_error, "%s ", tools[i]);
for (f_string_length i = 0; i < arguments.used; i++) {
- fprintf(f_standard_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
+ fprintf(f_type_error, "%.*s ", arguments.array[i].used, arguments.array[i].string);
} // for
- fl_color_print_code(f_standard_error, data.context.reset);
- fprintf(f_standard_error, "\n");
+ fl_color_print_code(f_type_error, data.context.reset);
+ fprintf(f_type_error, "\n");
}
else if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
}
else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
}
return status;
// print command when debugging.
#ifdef _en_firewall_debug_
if (data.parameters[firewall_parameter_debug].result == f_console_result_found) {
- fl_color_print_code(f_standard_debug, data.context.warning);
- fprintf(f_standard_debug, "%s ", tools[i]);
+ fl_color_print_code(f_type_debug, data.context.warning);
+ fprintf(f_type_debug, "%s ", tools[i]);
for (f_string_length j = 0; j < arguments.used; j++) {
- fprintf(f_standard_debug, "%.*s ", arguments.array[j].used, arguments.array[j].string);
+ fprintf(f_type_debug, "%.*s ", arguments.array[j].used, arguments.array[j].string);
} // for
- fl_color_print_code(f_standard_debug, data.context.reset);
- fprintf(f_standard_debug, "\n");
+ fl_color_print_code(f_type_debug, data.context.reset);
+ fprintf(f_type_debug, "\n");
}
#endif // _en_firewall_debug_
status = f_status_set_fine(status);
if (status == f_failure) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[i]);
- fprintf(f_standard_error, " ");
- fl_color_print_code(f_standard_error, data.context.error);
+ fprintf(f_type_error, " ");
+ fl_color_print_code(f_type_error, data.context.error);
- fprintf(f_standard_error, "%s ", tools[i]);
+ fprintf(f_type_error, "%s ", tools[i]);
for (f_string_length j = 0; j < arguments.used; j++) {
- fprintf(f_standard_error, "%.*s ", arguments.array[j].used, arguments.array[j].string);
+ fprintf(f_type_error, "%.*s ", arguments.array[j].used, arguments.array[j].string);
} // for
- fl_color_print_code(f_standard_error, data.context.reset);
- fprintf(f_standard_error, "\n");
+ fl_color_print_code(f_type_error, data.context.reset);
+ fprintf(f_type_error, "\n");
}
else if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
}
else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
}
return status;
// print command when debugging.
#ifdef _en_firewall_debug_
if (data.parameters[firewall_parameter_debug].result == f_console_result_found) {
- fl_color_print_code(f_standard_debug, data.context.warning);
- fprintf(f_standard_debug, "%s ", tools[j]);
+ fl_color_print_code(f_type_debug, data.context.warning);
+ fprintf(f_type_debug, "%s ", tools[j]);
for (f_string_length k = 0; k < arguments.used; k++) {
- fprintf(f_standard_debug, "%.*s ", arguments.array[k].used, arguments.array[k].string);
+ fprintf(f_type_debug, "%.*s ", arguments.array[k].used, arguments.array[k].string);
} // for
- fl_color_print_code(f_standard_debug, data.context.reset);
- fprintf(f_standard_debug, "\n");
+ fl_color_print_code(f_type_debug, data.context.reset);
+ fprintf(f_type_debug, "\n");
}
#endif // _en_firewall_debug_
status = f_status_set_fine(status);
if (status == f_failure) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[j]);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Failed to perform requested %s operation:", tools[j]);
- fprintf(f_standard_error, " ");
- fl_color_print_code(f_standard_error, data.context.error);
+ fprintf(f_type_error, " ");
+ fl_color_print_code(f_type_error, data.context.error);
- fprintf(f_standard_error, "%s ", tools[j]);
+ fprintf(f_type_error, "%s ", tools[j]);
for (f_string_length k = 0; k < arguments.used; k++) {
- fprintf(f_standard_error, "%.*s ", arguments.array[k].used, arguments.array[k].string);
+ fprintf(f_type_error, "%.*s ", arguments.array[k].used, arguments.array[k].string);
} // for
- fl_color_print_code(f_standard_error, data.context.reset);
- fprintf(f_standard_error, "\n");
+ fl_color_print_code(f_type_error, data.context.reset);
+ fprintf(f_type_error, "\n");
}
else if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_execute_program()");
}
else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_execute_program()", status);
}
return status;
f_file file = f_file_initialize;
f_status status = f_none;
- status = f_file_open(&file, filename);
+ status = f_file_open(filename, 0, &file);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (optional) {
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
}
else if (status != f_file_not_found && status != f_file_error_open && status != f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
}
} else {
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
}
else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'.", filename);
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'.", filename);
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
}
}
return status;
}
- status = f_file_read(&file, &local->buffer);
+ status = f_file_read(file, &local->buffer);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_read_position().");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read().");
}
else if (status == f_number_overflow) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename);
}
else if (status == f_file_not_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename);
}
else if (status == f_file_error_seek) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename);
}
else if (status == f_file_error_read) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename);
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_read_position().", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read().", status);
}
return status;
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename);
}
else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: No relevant data was found within the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: No relevant data was found within the file '%s'.", filename);
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename);
}
return status;
status = f_status_set_fine(status);
if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status == f_failure) {
// the error message has already been displayed.
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
}
f_macro_fss_objects_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_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+// TODO: also report: fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
#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); \
fll_program_print_help_usage(context, fss_basic_list_read_name, "filename(s)");
- fl_color_print(f_standard_output, context.important, context.reset, " Notes:");
+ fl_color_print(f_type_output, context.important, context.reset, " Notes:");
printf("%c", f_string_eol, f_string_eol);
printf("%c", f_string_eol);
printf(" When using the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol);
printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
printf(": An object index at the specified depth.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
printf(": An object name at the specified depth.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol);
printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol);
printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
printf(" selects a content index at a given depth.%c", f_string_eol);
printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol);
printf("%c", f_string_eol);
printf(" Specify both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
printf(" and the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total);
printf(" parameters to get the total objects.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" When both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
printf(" and ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
printf(" parameters are specified (at the same depth), the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
printf(" parameter value will be treated as a position relative to the specified ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
printf(" parameter value.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" This program may support parameters, such as ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
printf(" or ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
printf(", even if not supported by the standard.%c", f_string_eol);
printf(" This is done to help ensure consistency for scripting.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim);
printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol);
printf("%c", f_string_eol);
}
else 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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_at);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_depth].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_name].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a string.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_additional) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_line);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_total);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_basic_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
fss_basic_list_read_depths depths = fss_basic_list_read_depths_initialize;
f_string_length counter = 0;
- f_string_length original_size = data->file_position.total;
+ f_string_length original_size = data->quantity.total;
status = fss_basic_list_read_main_preprocess_depth(arguments, *data, &depths);
if (f_status_is_error(status)) {
macro_fss_basic_list_read_depths_delete_simple(depths);
if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
fss_basic_list_read_delete_data(data);
return f_none;
}
if (data->parameters[fss_basic_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
macro_fss_basic_list_read_depths_delete_simple(depths);
fss_basic_list_read_delete_data(data);
if (data->process_pipe) {
f_file file = f_file_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
- status = fl_file_read(&file, &data->buffer);
+ status = f_file_read(file, &data->buffer);
if (f_status_is_error(status)) {
fss_basic_list_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status));
for (; counter < data->remaining.used; counter++) {
f_file file = f_file_initialize;
- status = f_file_open(&file, arguments.argv[data->remaining.array[counter]]);
+ status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file);
- data->file_position.total = original_size;
+ data->quantity.total = original_size;
if (f_status_is_error(status)) {
fss_basic_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
return status;
}
- if (data->file_position.total == 0) {
- fseek(file.address, 0, SEEK_END);
+ if (data->quantity.total == 0) {
+ status = f_file_size_by_id(file.id, &data->quantity.total);
- data->file_position.total = ftell(file.address);
+ if (f_status_is_error(status)) {
+ fss_basic_list_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ macro_fss_basic_list_read_depths_delete_simple(depths);
+ fss_basic_list_read_delete_data(data);
+ }
// Skip past empty files.
- if (data->file_position.total == 0) {
- f_file_close(&file);
+ if (data->quantity.total == 0) {
+ f_file_close(&file.id);
continue;
}
-
- fseek(file.address, 0, SEEK_SET);
}
- status = fl_file_read_position(&file, &data->buffer, data->file_position);
+ status = f_file_read_until(file, &data->buffer, data->quantity.total);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
- fss_basic_list_read_print_file_error(data->context, "fl_file_read_position", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ fss_basic_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
macro_fss_basic_list_read_depths_delete_simple(depths);
fss_basic_list_read_delete_data(data);
return status;
macro_fss_basic_list_read_depths_delete_simple(depths);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
status = f_status_set_error(f_invalid_parameter);
}
const f_console_arguments arguments = { argc, argv };
fss_basic_list_read_data data = fss_basic_list_read_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
#ifndef _di_fss_basic_list_read_print_file_error_
void fss_basic_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) {
- if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) {
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
}
#endif // _di_fss_basic_list_read_print_file_error_
void fss_basic_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) {
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
else if (status == f_number_invalid) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is not a valid number for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_underflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too small for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_overflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too large for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_negative) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_positive) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' contains a '");
- fl_color_print(f_standard_error, context.notable, context.reset, "+");
- fl_color_print(f_standard_error, context.error, context.reset, "', which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' contains a '");
+ fl_color_print(f_type_error, context.notable, context.reset, "+");
+ fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_no_data) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string.");
}
else {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' with the value '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' with the value '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
}
#endif // _di_fss_basic_list_read_print_number_argument_error_
macro_fss_basic_list_read_depths_new(status, (*depths), depth_size);
if (f_status_is_error(status)) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
return status;
}
// @todo: move error printing into common function.
if (status_code == f_error_allocation || status_code == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status_code == f_string_length_size) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_trim);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
}
else {
f_string function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%u", status_code);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s()", function);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, ".");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, ".");
}
return status;
}
if (depths->array[i].value_name.used == 0) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_name);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string.");
return f_status_set_error(f_invalid_parameter);
}
for (f_array_length i = 0; i < depths->used; i++) {
for (f_array_length j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may not have the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' before the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_list_read_long_depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status == f_incomplete_utf_on_stop) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else if (status == f_incomplete_utf_on_eos) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%u", status);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return f_status_set_error(status);
if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
if (depths.array[0].index_at > 0) {
if (depths.array[0].value_at < data->objects.used && names[depths.array[0].value_at]) {
- fprintf(f_standard_output, "1%c", f_string_eol);
+ fprintf(f_type_output, "1%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
}
else if (depths.array[0].index_name > 0) {
total++;
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
}
else {
- fprintf(f_standard_output, "%llu%c", data->objects.used, f_string_eol);
+ fprintf(f_type_output, "%llu%c", data->objects.used, f_string_eol);
}
return f_none;
for (; i < data->objects.used; i++) {
if (names[i]) {
if (at == depths.array[0].value_at) {
- print_object(f_standard_output, data->buffer, data->objects.array[i]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, data->objects.array[i]);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
for (f_string_length i = 0; i < data->objects.used; i++) {
if (names[i] == 0) continue;
- print_object(f_standard_output, data->buffer, data->objects.array[i]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, data->objects.array[i]);
+ fprintf(f_type_output, "%c", f_string_eol);
} // for
return f_none;
if (depths.array[0].index_at > 0) {
if (depths.array[0].value_at >= data->objects.used) {
if (names[depths.array[0].value_at] && data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
return f_none;
if (at == depths.array[0].value_at) {
if (data->parameters[fss_basic_list_read_parameter_total].result == f_console_result_found) {
if (data->contents.array[i].used == 0) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
else {
f_string_length total = 1;
}
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
}
return f_none;
if (data->parameters[fss_basic_list_read_parameter_line].result == f_console_result_additional) {
if (data->contents.array[i].used == 0) {
if (include_empty && line == 0) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
for (; i <= data->contents.array[i].array[0].stop; i++) {
if (data->buffer.string[i] == 0) continue;
if (data->buffer.string[i] == f_string_eol) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
- fprintf(f_standard_output, "%c", data->buffer.string[i]);
+ fprintf(f_type_output, "%c", data->buffer.string[i]);
} // for
}
else {
for (; i <= data->contents.array[i].array[0].stop; i++) {
if (data->buffer.string[i] == 0) continue;
if (data->buffer.string[i] == f_string_eol) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
- fprintf(f_standard_output, "%c", data->buffer.string[i]);
+ fprintf(f_type_output, "%c", data->buffer.string[i]);
} // for
break;
}
if (data->contents.array[i].used > 0) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
}
else if (include_empty) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
break;
} // for
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
return f_none;
}
if (data->contents.array[i].used == 0) {
if (include_empty) {
if (line_current == line) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
if (data->buffer.string[j] == 0) continue;
if (data->buffer.string[j] == f_string_eol) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
- fprintf(f_standard_output, "%c", data->buffer.string[j]);
+ fprintf(f_type_output, "%c", data->buffer.string[j]);
} // for
break;
if (data->contents.array[i].used == 0) {
if (include_empty) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
continue;
}
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
} // for
return f_none;
f_file file = f_file_initialize;
f_string_dynamic input = f_string_dynamic_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
- status = fl_file_read(&file, &input);
+ status = f_file_read(file, &input);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
}
else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-");
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-");
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
}
f_macro_string_dynamic_delete_simple(input);
if (data->parameters[fss_basic_list_write_parameter_file].result == f_console_result_additional) {
f_file output = f_file_initialize;
- output.mode = f_file_write_append;
- status = f_file_open(&output, arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
+ output.flags = f_file_flag_append_wo;
+
+ status = f_file_open(arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]], 0, &output);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
- f_file_close(&output);
+ f_file_close(&output.id);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
}
else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
}
fss_basic_list_write_delete_data(data);
return f_status_set_error(status);
}
- status = fl_file_write(output, buffer);
- f_file_close(&output);
+ status = f_file_write(output, buffer, 0);
+ f_file_close(&output.id);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()");
}
else if (status == f_file_error_write) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_list_write_parameter_file].additional.array[0]]);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status);
}
fss_basic_list_write_delete_data(data);
}
}
else {
- f_print_string_dynamic(f_standard_output, buffer);
+ f_print_string_dynamic(f_type_output, buffer);
}
}
const f_console_arguments arguments = { argc, argv };
fss_basic_list_write_data data = fss_basic_list_write_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
fll_program_print_help_usage(context, fss_basic_read_name, "filename(s)");
- fl_color_print(f_standard_output, context.important, context.reset, " Notes:");
+ fl_color_print(f_type_output, context.important, context.reset, " Notes:");
printf("%c", f_string_eol, f_string_eol);
printf("%c", f_string_eol);
printf(" When using the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol);
printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
printf(": An object index at the specified depth.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
printf(": An object name at the specified depth.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol);
printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol);
printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
printf(" selects a content index at a given depth.%c", f_string_eol);
printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol);
printf("%c", f_string_eol);
printf(" Specify both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
printf(" and the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total);
printf(" parameters to get the total objects.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" When both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
printf(" and ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
printf(" parameters are specified (at the same depth), the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
printf(" parameter value will be treated as a position relative to the specified ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
printf(" parameter value.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" This program may support parameters, such as ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
printf(" or ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
printf(", even if not supported by the standard.%c", f_string_eol);
printf(" This is done to help ensure consistency for scripting.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim);
printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol);
printf("%c", f_string_eol);
}
else if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[fss_basic_read_parameter_at].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_at);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_read_parameter_depth].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_read_parameter_name].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a string.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_additional) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_line);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_total);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_basic_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
fss_basic_read_depths depths = fss_basic_read_depths_initialize;
f_string_length counter = 0;
- f_string_length original_size = data->file_position.total;
+ f_string_length original_size = data->quantity.total;
status = fss_basic_read_main_preprocess_depth(arguments, *data, &depths);
if (f_status_is_error(status)) {
macro_fss_basic_read_depths_delete_simple(depths);
if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
fss_basic_read_delete_data(data);
return f_none;
}
if (data->parameters[fss_basic_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
macro_fss_basic_read_depths_delete_simple(depths);
fss_basic_read_delete_data(data);
if (data->process_pipe) {
f_file file = f_file_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
- status = fl_file_read(&file, &data->buffer);
+ status = f_file_read(file, &data->buffer);
if (f_status_is_error(status)) {
fss_basic_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status));
for (; counter < data->remaining.used; counter++) {
f_file file = f_file_initialize;
- status = f_file_open(&file, arguments.argv[data->remaining.array[counter]]);
+ status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file);
- data->file_position.total = original_size;
+ data->quantity.total = original_size;
if (f_status_is_error(status)) {
fss_basic_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
return status;
}
- if (data->file_position.total == 0) {
- fseek(file.address, 0, SEEK_END);
+ if (data->quantity.total == 0) {
+ status = f_file_size_by_id(file.id, &data->quantity.total);
- data->file_position.total = ftell(file.address);
+ if (f_status_is_error(status)) {
+ fss_basic_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ macro_fss_basic_read_depths_delete_simple(depths);
+ fss_basic_read_delete_data(data);
+ }
// Skip past empty files.
- if (data->file_position.total == 0) {
- f_file_close(&file);
+ if (data->quantity.total == 0) {
+ f_file_close(&file.id);
continue;
}
-
- fseek(file.address, 0, SEEK_SET);
}
- status = fl_file_read_position(&file, &data->buffer, data->file_position);
+ status = f_file_read_until(file, &data->buffer, data->quantity.total);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
- fss_basic_read_print_file_error(data->context, "fl_file_read_position", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ fss_basic_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
macro_fss_basic_read_depths_delete_simple(depths);
fss_basic_read_delete_data(data);
macro_fss_basic_read_depths_delete_simple(depths);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
status = f_status_set_error(f_invalid_parameter);
}
const f_console_arguments arguments = { argc, argv };
fss_basic_read_data data = fss_basic_read_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
#ifndef _di_fss_basic_read_print_file_error_
void fss_basic_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) {
- if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) {
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
}
#endif // _di_fss_basic_read_print_file_error_
void fss_basic_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) {
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
else if (status == f_number_invalid) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is not a valid number for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_underflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too small for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_overflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too large for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_negative) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_positive) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' contains a '");
- fl_color_print(f_standard_error, context.notable, context.reset, "+");
- fl_color_print(f_standard_error, context.error, context.reset, "', which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' contains a '");
+ fl_color_print(f_type_error, context.notable, context.reset, "+");
+ fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_no_data) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string.");
}
else {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' with the value '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' with the value '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
}
#endif // _di_fss_basic_read_print_number_argument_error_
macro_fss_basic_read_depths_new(status, (*depths), depth_size);
if (f_status_is_error(status)) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
return status;
}
// @todo: move error printing into common function.
if (status_code == f_error_allocation || status_code == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status_code == f_string_length_size) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_trim);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
}
else {
f_string function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%u", status_code);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s()", function);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, ".");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, ".");
}
return status;
}
if (depths->array[i].value_name.used == 0) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_name);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string.");
return f_status_set_error(f_invalid_parameter);
}
for (f_array_length i = 0; i < depths->used; i++) {
for (f_array_length j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may not have the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' before the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_basic_read_long_depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status == f_incomplete_utf_on_stop) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else if (status == f_incomplete_utf_on_eos) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%u", status);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_basic_list_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return f_status_set_error(status);
if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
if (depths.array[0].index_at > 0) {
if (depths.array[0].value_at < data->objects.used && names[depths.array[0].value_at]) {
- fprintf(f_standard_output, "1%c", f_string_eol);
+ fprintf(f_type_output, "1%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
}
else if (depths.array[0].index_name > 0) {
total++;
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
}
else {
- fprintf(f_standard_output, "%llu%c", data->objects.used, f_string_eol);
+ fprintf(f_type_output, "%llu%c", data->objects.used, f_string_eol);
}
return f_none;
for (; i < data->objects.used; i++) {
if (names[i]) {
if (at == depths.array[0].value_at) {
- print_object(f_standard_output, data->buffer, data->objects.array[i]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, data->objects.array[i]);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
for (f_array_length i = 0; i < data->objects.used; i++) {
if (names[i] == 0) continue;
- print_object(f_standard_output, data->buffer, data->objects.array[i]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, data->objects.array[i]);
+ fprintf(f_type_output, "%c", f_string_eol);
} // for
return f_none;
if (depths.array[0].index_at > 0) {
if (depths.array[0].value_at >= data->objects.used) {
if (names[depths.array[0].value_at] && data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
return f_none;
if (at == depths.array[0].value_at) {
if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
if (data->contents.array[i].used == 0) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "1%c", f_string_eol);
+ fprintf(f_type_output, "1%c", f_string_eol);
}
}
else if (data->parameters[fss_basic_read_parameter_line].result == f_console_result_additional) {
if (data->contents.array[i].used > 0) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ fprintf(f_type_output, "%c", f_string_eol);
}
else if (include_empty) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
if (data->contents.array[i].used > 0) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ fprintf(f_type_output, "%c", f_string_eol);
}
else if (include_empty) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
total++;
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
return f_none;
}
if (data->contents.array[i].used == 0) {
if (include_empty) {
if (line_current == line) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
}
if (line_current == line) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
if (data->contents.array[i].used == 0) {
if (include_empty) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
continue;
}
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[0]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[0]);
+ fprintf(f_type_output, "%c", f_string_eol);
} // for
return f_none;
f_file file = f_file_initialize;
f_string_dynamic input = f_string_dynamic_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
- status = fl_file_read(&file, &input);
+ status = f_file_read(file, &input);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
}
else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-");
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-");
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
}
f_macro_string_dynamic_delete_simple(input);
if (data->parameters[fss_basic_write_parameter_file].result == f_console_result_additional) {
f_file output = f_file_initialize;
- output.mode = f_file_write_append;
- status = f_file_open(&output, arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
+ output.flags = f_file_flag_append_wo;
+
+ status = f_file_open(arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]], 0, &output);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
- f_file_close(&output);
+ f_file_close(&output.id);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
}
else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
}
fss_basic_write_delete_data(data);
return status;
}
- status = fl_file_write(output, buffer);
- f_file_close(&output);
+ status = f_file_write(output, buffer, 0);
+ f_file_close(&output.id);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()");
}
else if (status == f_file_error_write) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_basic_write_parameter_file].additional.array[0]]);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status);
}
fss_basic_write_delete_data(data);
}
}
else {
- f_print_string_dynamic(f_standard_output, buffer);
+ f_print_string_dynamic(f_type_output, buffer);
}
}
fll_program_print_help_usage(context, fss_extended_list_read_name, "filename(s)");
- fl_color_print(f_standard_output, context.important, context.reset, " Notes:");
+ fl_color_print(f_type_output, context.important, context.reset, " Notes:");
printf("%c", f_string_eol, f_string_eol);
printf("%c", f_string_eol);
printf(" When using the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol);
printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
printf(": An object index at the specified depth.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
printf(": An object name at the specified depth.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol);
printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol);
printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
printf(" selects a content index at a given depth.%c", f_string_eol);
printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol);
printf("%c", f_string_eol);
printf(" Specify both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
printf(" and the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total);
printf(" parameters to get the total objects.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" When both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
printf(" and ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
printf(" parameters are specified (at the same depth), the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
printf(" parameter value will be treated as a position relative to the specified ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
printf(" parameter value.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" This program may support parameters, such as ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
printf(" or ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
printf(", even if not supported by the standard.%c", f_string_eol);
printf(" This is done to help ensure consistency for scripting.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim);
printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol);
printf("%c", f_string_eol);
}
else 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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_at);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_depth].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_name].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a string.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_additional) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_line);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_total);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_extended_list_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
fss_extended_list_read_depths depths = fss_extended_list_read_depths_initialize;
f_string_length counter = 0;
- f_string_length original_size = data->file_position.total;
+ f_string_length original_size = data->quantity.total;
status = fss_extended_list_read_main_preprocess_depth(arguments, *data, &depths);
if (f_status_is_error(status)) {
}
if (data->parameters[fss_extended_list_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
macro_fss_extended_list_read_depths_delete_simple(depths);
fss_extended_list_read_delete_data(data);
if (data->process_pipe) {
f_file file = f_file_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
- status = fl_file_read(&file, &data->buffer);
+ status = f_file_read(file, &data->buffer);
if (f_status_is_error(status)) {
fss_extended_list_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status));
for (; counter < data->remaining.used; counter++) {
f_file file = f_file_initialize;
- status = f_file_open(&file, arguments.argv[data->remaining.array[counter]]);
+ status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file);
- data->file_position.total = original_size;
+ data->quantity.total = original_size;
if (f_status_is_error(status)) {
fss_extended_list_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
return status;
}
- if (data->file_position.total == 0) {
- fseek(file.address, 0, SEEK_END);
+ if (data->quantity.total == 0) {
+ status = f_file_size_by_id(file.id, &data->quantity.total);
- data->file_position.total = ftell(file.address);
+ if (f_status_is_error(status)) {
+ fss_extended_list_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ macro_fss_extended_list_read_depths_delete_simple(depths);
+ fss_extended_list_read_delete_data(data);
+ }
// Skip past empty files.
- if (data->file_position.total == 0) {
- f_file_close(&file);
+ if (data->quantity.total == 0) {
+ f_file_close(&file.id);
continue;
}
-
- fseek(file.address, 0, SEEK_SET);
}
- status = fl_file_read_position(&file, &data->buffer, data->file_position);
+ status = f_file_read_until(file, &data->buffer, data->quantity.total);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
- fss_extended_list_read_print_file_error(data->context, "fl_file_read_position", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ fss_extended_list_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
macro_fss_extended_list_read_depths_delete_simple(depths);
fss_extended_list_read_delete_data(data);
macro_fss_extended_list_read_depths_delete_simple(depths);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
status = f_status_set_error(f_invalid_parameter);
}
f_console_parameter_initialize_fss_extended_list_read, \
f_string_dynamic_initialize, \
f_fss_nest_initialize, \
- f_quantity_initialize, \
+ f_string_quantity_initialize, \
f_string_lengths_initialize, \
f_false, \
fl_color_context_initialize, \
const f_console_arguments arguments = { argc, argv };
fss_extended_list_read_data data = fss_extended_list_read_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
#ifndef _di_fss_extended_list_read_print_file_error_
void fss_extended_list_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) {
- if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) {
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
}
#endif // _di_fss_extended_list_read_print_file_error_
void fss_extended_list_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) {
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
else if (status == f_number_invalid) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is not a valid number for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_underflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too small for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_overflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too large for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_negative) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_positive) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' contains a '");
- fl_color_print(f_standard_error, context.notable, context.reset, "+");
- fl_color_print(f_standard_error, context.error, context.reset, "', which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' contains a '");
+ fl_color_print(f_type_error, context.notable, context.reset, "+");
+ fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_no_data) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string.");
}
else {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' with the value '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' with the value '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
}
#endif // _di_fss_extended_list_read_print_number_argument_error_
macro_fss_extended_list_read_depths_new(status, (*depths), depth_size);
if (f_status_is_error(status)) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
return status;
}
// @todo: move error printing into common function.
if (status_code == f_error_allocation || status_code == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status_code == f_string_length_size) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_trim);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
}
else {
f_string function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%u", status_code);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s()", function);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, ".");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, ".");
}
return status;
}
if (depths->array[i].value_name.used == 0) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_name);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string.");
return f_status_set_error(f_invalid_parameter);
}
for (f_array_length i = 0; i < depths->used; i++) {
for (f_array_length j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may not have the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' before the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_list_read_long_depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status == f_incomplete_utf_on_stop) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else if (status == f_incomplete_utf_on_eos) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%u", status);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_list_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return f_status_set_error(status);
// Requested depths cannot be greater than contents depth.
if (depths.used > data->nest.used) {
if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
return f_none;
}
if (depth_setting.index_at > 0) {
if (depth_setting.value_at < items->used && names[depth_setting.value_at]) {
- fprintf(f_standard_output, "1%c", f_string_eol);
+ fprintf(f_type_output, "1%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
return f_none;
total++;
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
return f_none;
}
- fprintf(f_standard_output, "%llu%c", items->used, f_string_eol);
+ fprintf(f_type_output, "%llu%c", items->used, f_string_eol);
return f_none;
}
if (depth_setting.index_at > 0) {
if (depth_setting.value_at < items->used && names[depth_setting.value_at]) {
- print_object(f_standard_output, data->buffer, items->array[depth_setting.value_at].object);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, items->array[depth_setting.value_at].object);
+ fprintf(f_type_output, "%c", f_string_eol);
}
return f_none;
for (f_array_length i = 0; i < items->used; i++) {
if (names[i]) {
- print_object(f_standard_output, data->buffer, items->array[i].object);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, items->array[i].object);
+ fprintf(f_type_output, "%c", f_string_eol);
}
} // for
if (depth_setting.index_at > 0) {
if (depth_setting.value_at >= items->used) {
if (names[depth_setting.value_at] && data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
return f_none;
if (at == depth_setting.value_at) {
if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
if (items->array[i].content.used == 0) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
else {
f_string_length total = 1;
}
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
}
return f_none;
if (data->parameters[fss_extended_list_read_parameter_line].result == f_console_result_additional) {
if (items->array[i].content.used == 0) {
if (include_empty && line == 0) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
for (; i <= items->array[i].content.array[0].stop; i++) {
if (data->buffer.string[i] == 0) continue;
if (data->buffer.string[i] == f_string_eol) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
- fprintf(f_standard_output, "%c", data->buffer.string[i]);
+ fprintf(f_type_output, "%c", data->buffer.string[i]);
} // for
}
else {
for (; i <= items->array[i].content.array[0].stop; i++) {
if (data->buffer.string[i] == 0) continue;
if (data->buffer.string[i] == f_string_eol) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
- fprintf(f_standard_output, "%c", data->buffer.string[i]);
+ fprintf(f_type_output, "%c", data->buffer.string[i]);
} // for
break;
}
if (items->array[i].content.used > 0) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, items->array[i].content.array[0]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, items->array[i].content.array[0]);
}
else if (include_empty) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
break;
} // for
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
return f_none;
}
if (items->array[i].content.used == 0) {
if (include_empty) {
if (line_current == line) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
if (data->buffer.string[j] == 0) continue;
if (data->buffer.string[j] == f_string_eol) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
- fprintf(f_standard_output, "%c", data->buffer.string[j]);
+ fprintf(f_type_output, "%c", data->buffer.string[j]);
} // for
break;
if (items->array[i].content.used == 0) {
if (include_empty) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
continue;
}
- f_print_string_dynamic_partial(f_standard_output, data->buffer, items->array[i].content.array[0]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, items->array[i].content.array[0]);
} // for
return f_none;
fll_program_print_help_usage(context, fss_extended_read_name, "filename(s)");
- fl_color_print(f_standard_output, context.important, context.reset, " Notes:");
+ fl_color_print(f_type_output, context.important, context.reset, " Notes:");
printf("%c", f_string_eol, f_string_eol);
printf("%c", f_string_eol);
printf(" When using the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
printf(" option, an order of operations is enforced on the parameters.%c", f_string_eol);
printf(" When this order of operations is in effect, parameters to the right of a depth parameter are influenced by that depth parameter:%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
printf(": An object index at the specified depth.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
printf(": A new depth within the specified depth, indexed from the root.%c", f_string_eol);
printf(" ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
printf(": An object name at the specified depth.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
printf(" must be in numeric order, but values in between may be skipped.%c", f_string_eol);
printf(" ('-d 0 -a 1 -d 2 -a 2' would specify index 1 at depth 0, any index at depth 1, and index 2 at depth 2.)%c", f_string_eol);
printf(" ('-d 2 -a 1 -d 0 -a 2' would be invalid because depth 2 is before depth 1.)%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
printf(" selects a content index at a given depth.%c", f_string_eol);
printf(" (This parameter is not synonymous with the depth parameter and does not relate to nested content).%c", f_string_eol);
printf("%c", f_string_eol);
printf(" Specify both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
printf(" and the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total);
printf(" parameters to get the total objects.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" When both ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
printf(" and ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
printf(" parameters are specified (at the same depth), the ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
printf(" parameter value will be treated as a position relative to the specified ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
printf(" parameter value.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" This program may support parameters, such as ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
printf(" or ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
printf(", even if not supported by the standard.%c", f_string_eol);
printf(" This is done to help ensure consistency for scripting.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
printf(", if the standard doesn't support nested content, then only a depth of 0 would be valid.%c", f_string_eol);
printf(" For parameters like ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
printf(", if the standard doesn't support multiple content groups, then only a select of 0 would be valid.%c", f_string_eol);
printf("%c", f_string_eol);
printf(" The parameter ");
- fl_color_print(f_standard_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim);
+ fl_color_print(f_type_output, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim);
printf(" will remove leading and trailing whitespaces when selecting objects or when printing objects.%c", f_string_eol);
printf("%c", f_string_eol);
}
else if (data->remaining.used > 0 || data->process_pipe) {
if (data->parameters[fss_extended_read_parameter_at].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_at);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_read_parameter_depth].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_read_parameter_line].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_read_parameter_name].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a string.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a string.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' requires a positive number.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
}
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_object);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_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(f_standard_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' parameter with the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: Cannot specify the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_line);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' parameter with the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_total);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter.");
fss_extended_read_delete_data(data);
return f_status_set_error(f_invalid_parameter);
fss_extended_read_depths depths = fss_extended_read_depths_initialize;
f_string_length counter = 0;
- f_string_length original_size = data->file_position.total;
+ f_string_length original_size = data->quantity.total;
status = fss_extended_read_main_preprocess_depth(arguments, *data, &depths);
if (f_status_is_error(status)) {
macro_fss_extended_read_depths_delete_simple(depths);
if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
fss_extended_read_delete_data(data);
return f_none;
}
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_found) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ERROR: the '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: the '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_select);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "' parameter requires a positive number.");
macro_fss_extended_read_depths_delete_simple(depths);
fss_extended_read_delete_data(data);
if (data->process_pipe) {
f_file file = f_file_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
- status = fl_file_read(&file, &data->buffer);
+ status = f_file_read(file, &data->buffer);
if (f_status_is_error(status)) {
fss_extended_read_print_file_error(data->context, "fl_file_read", "-", f_status_set_fine(status));
for (; counter < data->remaining.used; counter++) {
f_file file = f_file_initialize;
- status = f_file_open(&file, arguments.argv[data->remaining.array[counter]]);
+ status = f_file_open(arguments.argv[data->remaining.array[counter]], 0, &file);
- data->file_position.total = original_size;
+ data->quantity.total = original_size;
if (f_status_is_error(status)) {
fss_extended_read_print_file_error(data->context, "f_file_open", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
return status;
}
- if (data->file_position.total == 0) {
- fseek(file.address, 0, SEEK_END);
+ if (data->quantity.total == 0) {
+ status = f_file_size_by_id(file.id, &data->quantity.total);
- data->file_position.total = ftell(file.address);
+ if (f_status_is_error(status)) {
+ fss_extended_read_print_file_error(data->context, "f_file_size_by_id", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ macro_fss_extended_read_depths_delete_simple(depths);
+ fss_extended_read_delete_data(data);
+ }
// Skip past empty files.
- if (data->file_position.total == 0) {
- f_file_close(&file);
+ if (data->quantity.total == 0) {
+ f_file_close(&file.id);
continue;
}
-
- fseek(file.address, 0, SEEK_SET);
}
- status = fl_file_read_position(&file, &data->buffer, data->file_position);
+ status = f_file_read_until(file, &data->buffer, data->quantity.total);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
- fss_extended_read_print_file_error(data->context, "fl_file_read_position", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
+ fss_extended_read_print_file_error(data->context, "f_file_read_until", arguments.argv[data->remaining.array[counter]], f_status_set_fine(status));
macro_fss_extended_read_depths_delete_simple(depths);
fss_extended_read_delete_data(data);
macro_fss_extended_read_depths_delete_simple(depths);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify one or more files.");
status = f_status_set_error(f_invalid_parameter);
}
const f_console_arguments arguments = { argc, argv };
fss_extended_read_data data = fss_extended_read_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
#ifndef _di_fss_extended_read_print_file_error_
void fss_extended_read_print_file_error(const fl_color_context context, const f_string function_name, const f_string file_name, const f_status status) {
- if (fll_file_error_print(f_standard_error, context, function_name, file_name, status) == f_false) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ if (fll_file_error_print(f_type_error, context, function_name, file_name, status) == f_false) {
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
}
#endif // _di_fss_extended_read_print_file_error_
void fss_extended_read_print_number_argument_error(const fl_color_context context, const f_string function_name, const f_string parameter_name, const f_string argument, const f_status status) {
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, ".");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, ".");
}
else if (status == f_number_invalid) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is not a valid number for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is not a valid number for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_underflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too small for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too small for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_overflow) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is too large for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is too large for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_negative) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' is negative, which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_number_positive) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The argument '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print(f_standard_error, context.error, context.reset, "' contains a '");
- fl_color_print(f_standard_error, context.notable, context.reset, "+");
- fl_color_print(f_standard_error, context.error, context.reset, "', which is not allowed for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The argument '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print(f_type_error, context.error, context.reset, "' contains a '");
+ fl_color_print(f_type_error, context.notable, context.reset, "+");
+ fl_color_print(f_type_error, context.error, context.reset, "', which is not allowed for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
else if (status == f_no_data) {
- fl_color_print(f_standard_error, context.error, context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print_line(f_standard_error, context.error, context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, context.error, context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print_line(f_type_error, context.error, context.reset, "' must not be an empty string.");
}
else {
- fl_color_print(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, context.notable, context.reset, "%u", status);
- fl_color_print(f_standard_error, context.error, context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s()", function_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' for the parameter '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
- fl_color_print(f_standard_error, context.error, context.reset, "' with the value '");
- fl_color_print(f_standard_error, context.notable, context.reset, "%s", argument);
- fl_color_print_line(f_standard_error, context.error, context.reset, "'.");
+ fl_color_print(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, context.notable, context.reset, "%u", status);
+ fl_color_print(f_type_error, context.error, context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s()", function_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' for the parameter '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s%s", f_console_symbol_long_enable, parameter_name);
+ fl_color_print(f_type_error, context.error, context.reset, "' with the value '");
+ fl_color_print(f_type_error, context.notable, context.reset, "%s", argument);
+ fl_color_print_line(f_type_error, context.error, context.reset, "'.");
}
}
#endif // _di_fss_extended_read_print_number_argument_error_
macro_fss_extended_read_depths_new(status, (*depths), depth_size);
if (f_status_is_error(status)) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
return status;
}
// @todo: move error printing into common function.
if (status_code == f_error_allocation || status_code == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status_code == f_string_length_size) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to process '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_trim);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' because the maximum buffer size was reached.");
}
else {
f_string function = "fl_string_append";
function = "fl_string_rip";
}
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%u", status_code);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s()", function);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, ".");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%u", status_code);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s()", function);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, ".");
}
return status;
}
if (depths->array[i].value_name.used == 0) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "' must not be an empty string.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_name);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "' must not be an empty string.");
return f_status_set_error(f_invalid_parameter);
}
for (f_array_length i = 0; i < depths->used; i++) {
for (f_array_length j = i + 1; j < depths->used; j++) {
if (depths->array[i].depth == depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may only be specified once for the parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
else if (depths->array[i].depth > depths->array[j].depth) {
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' may not have the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
- fl_color_print(f_standard_error, data.context.error, data.context.reset, "' before the value '");
- fl_color_print(f_standard_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "'.");
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%s%s", f_console_symbol_long_enable, fss_extended_read_long_depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' may not have the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[i].depth);
+ fl_color_print(f_type_error, data.context.error, data.context.reset, "' before the value '");
+ fl_color_print(f_type_error, data.context.notable, data.context.reset, "%llu", depths->array[j].depth);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "'.");
return f_status_set_error(f_invalid_parameter);
}
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_extended_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status == f_incomplete_utf_on_stop) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at stop position (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else if (status == f_incomplete_utf_on_eos) {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%d", input.start);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ").");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: error occurred on invalid UTF-8 character at end of string (at ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%d", input.start);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ").");
}
else {
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%u", status);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, ") has occurred while calling ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "fll_fss_extended_read()");
- fl_color_print(f_standard_error, data->context.error, data->context.reset, " for the file '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s", filename);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "'.");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%u", status);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, ") has occurred while calling ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "fll_fss_extended_read()");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, " for the file '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s", filename);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "'.");
}
return f_status_set_error(status);
if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
if (depths.array[0].index_at > 0) {
if (depths.array[0].value_at < data->objects.used && names[depths.array[0].value_at]) {
- fprintf(f_standard_output, "1%c", f_string_eol);
+ fprintf(f_type_output, "1%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
}
else if (depths.array[0].index_name > 0) {
total++;
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
}
else {
- fprintf(f_standard_output, "%llu%c", data->objects.used, f_string_eol);
+ fprintf(f_type_output, "%llu%c", data->objects.used, f_string_eol);
}
return f_none;
for (; i < data->objects.used; i++) {
if (names[i]) {
if (at == depths.array[0].value_at) {
- print_object(f_standard_output, data->buffer, data->objects.array[i]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, data->objects.array[i]);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
for (f_string_length i = 0; i < data->objects.used; i++) {
if (names[i] == 0) continue;
- print_object(f_standard_output, data->buffer, data->objects.array[i]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ print_object(f_type_output, data->buffer, data->objects.array[i]);
+ fprintf(f_type_output, "%c", f_string_eol);
} // for
return f_none;
if (depths.array[0].index_at > 0) {
if (depths.array[0].value_at >= data->objects.used) {
if (names[depths.array[0].value_at] && data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
return f_none;
if (at == depths.array[0].value_at) {
if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
if (data->contents.array[i].used == 0) {
- fprintf(f_standard_output, "0%c", f_string_eol);
+ fprintf(f_type_output, "0%c", f_string_eol);
}
else {
- fprintf(f_standard_output, "1%c", f_string_eol);
+ fprintf(f_type_output, "1%c", f_string_eol);
}
return f_none;
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select < data->contents.array[i].used) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[select]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[select]);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
for (j = 0; j < data->contents.array[i].used; j++) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[j]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[j]);
if (j + 1 < data->contents.array[i].used) {
printf(" ");
}
} // for
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else if (include_empty) {
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select == 0) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
}
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select < data->contents.array[i].used) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[select]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[select]);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
for (j = 0; j < data->contents.array[i].used; j++) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[j]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[j]);
if (j + 1 < data->contents.array[i].used) {
printf(" ");
}
} // for
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else if (include_empty) {
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select == 0) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
total++;
} // for
- fprintf(f_standard_output, "%llu%c", total, f_string_eol);
+ fprintf(f_type_output, "%llu%c", total, f_string_eol);
return f_none;
}
if (data->contents.array[i].used == 0) {
if (include_empty) {
if (line_current == line) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
break;
}
if (line_current == line) {
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select < data->contents.array[i].used) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[select]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[select]);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
for (j = 0; j < data->contents.array[i].used; j++) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[j]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[j]);
if (j + 1 < data->contents.array[i].used) {
printf(" ");
}
} // for
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
break;
if (data->contents.array[i].used == 0) {
if (include_empty && select == 0) {
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
continue;
if (data->parameters[fss_extended_read_parameter_select].result == f_console_result_additional) {
if (select < data->contents.array[i].used) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[select]);
- fprintf(f_standard_output, "%c", f_string_eol);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[select]);
+ fprintf(f_type_output, "%c", f_string_eol);
}
}
else {
for (j = 0; j < data->contents.array[i].used; j++) {
- f_print_string_dynamic_partial(f_standard_output, data->buffer, data->contents.array[i].array[j]);
+ f_print_string_dynamic_partial(f_type_output, data->buffer, data->contents.array[i].array[j]);
if (j + 1 < data->contents.array[i].used) {
printf(" ");
}
} // for
- fprintf(f_standard_output, "%c", f_string_eol);
+ fprintf(f_type_output, "%c", f_string_eol);
}
} // for
status = f_status_set_fine(status);
if (status == f_no_data) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: One of the parameters you passed requires an additional parameter that you did not pass.");
// 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 arguments.argv[] is improperly created
}
else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else if (status == f_invalid_utf) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling f_console_parameter_process().");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ENCODING ERROR: Invalid UTF-8 character in parameter when calling f_console_parameter_process().");
}
else if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_console_parameter_process().");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_console_parameter_process().");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_console_parameter_process().", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_console_parameter_process().", status);
}
fss_extended_write_delete_data(data);
f_file file = f_file_initialize;
f_string_dynamic input = f_string_dynamic_initialize;
- file.address = f_pipe;
+ file.id = f_type_descriptor_input;
- status = fl_file_read(&file, &input);
+ status = f_file_read(file, &input);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
}
else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", "-");
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", "-");
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", "-");
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
}
f_macro_string_dynamic_delete_simple(input);
if (data->parameters[fss_extended_write_parameter_file].result == f_console_result_additional) {
f_file output = f_file_initialize;
- output.mode = f_file_write_append;
- status = f_file_open(&output, arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
+ output.flags = f_file_flag_append_wo;
+
+ status = f_file_open(arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]], 0, &output);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
- f_file_close(&output);
+ f_file_close(&output.id);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open()");
}
else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to find the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
}
else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
}
else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: File descriptor error while trying to open the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open()", status);
}
fss_extended_write_delete_data(data);
return status;
}
- status = fl_file_write(output, buffer);
- f_file_close(&output);
+ status = f_file_write(output, buffer, 0);
+ f_file_close(&output.id);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_write()");
}
else if (status == f_file_error_write) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Unable to write to the file '%s'", arguments.argv[data->parameters[fss_extended_write_parameter_file].additional.array[0]]);
}
else {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_write()", status);
}
fss_extended_write_delete_data(data);
}
}
else {
- f_print_string_dynamic(f_standard_output, buffer);
+ f_print_string_dynamic(f_type_output, buffer);
}
}
const f_console_arguments arguments = { argc, argv };
fss_extended_write_data data = fss_extended_write_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_error);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_warning);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, fss_status_code_long_is_fine);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
fss_status_code_delete_data(data);
return f_status_set_error(status);
}
if (data->remaining.used == 0 && !data->process_pipe) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify an error code.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify an error code.");
fss_status_code_delete_data(data);
return f_status_set_error(f_invalid_parameter);
const f_console_arguments arguments = { argc, argv };
fss_status_code_data data = fss_status_code_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
status = fl_console_parameter_to_number_unsigned(value, &number);
if (status == f_none) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "invalid name");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid name");
return f_status_set_error(f_invalid_parameter);
}
if (status == f_no_data || f_status_set_fine(status) == f_invalid_parameter) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "invalid data");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid data");
return status;
}
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_invalid_data) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "unknown name");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown name");
}
else {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "failed to convert");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert");
}
return status;
}
if (status == f_invalid_data) {
- fl_color_print_line(f_standard_output, data.context.warning, data.context.reset, "unknown code");
+ fl_color_print_line(f_type_output, data.context.warning, data.context.reset, "unknown code");
return f_none;
}
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_invalid_data) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "unknown code");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown code");
}
else {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "failed to convert");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert");
}
return status;
f_status status = fl_console_parameter_to_number_unsigned(value, number);
if (*number > f_status_size_max_with_signal) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "out of range");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range");
return status;
}
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_number_negative) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "out of range");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range");
}
else {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "invalid number");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid number");
}
return status;
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_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to clone services process (errno = %i).", errno);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to clone services process (errno = %i).", errno);
}
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_line(f_standard_error, data->context.error, data->context.reset, "ERROR: Failed to clone control via file process (errno = %i).", errno);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: Failed to clone control via file process (errno = %i).", errno);
}
*/
continue;
}
else if (errno != EINTR) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: sigwaitinfo() failed (errno = %i).", errno);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: sigwaitinfo() failed (errno = %i).", errno);
signal_problem_count++;
if (signal_problem_count > problem_count_max_signal_size) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: max signal problem count has been reached, sleeping for a period of time.", errno);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: max signal problem count has been reached, sleeping for a period of time.", errno);
sleep(init_panic_signal_sleep_seconds);
signal_problem_count = 0;
}
const f_console_arguments arguments = { argc, argv };
init_data data = init_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
f_status status = f_none;
f_string_quantity quantity = f_string_quantity_initialize;
- status = f_file_open(&file, filename);
+ status = f_file_open(filename, 0, 0, &file);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (optional) {
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
} else if (status != f_file_not_found && status != f_file_error_open && status != f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
}
} else {
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_open().");
} else if (status == f_file_not_found) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to find the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to find the file '%s'.", filename);
} else if (status == f_file_error_open) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Unable to open the file '%s'.", filename);
} else if (status == f_file_error_descriptor) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: File descriptor error while trying to open the file '%s'.", filename);
} else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_open().", status);
}
}
f_macro_file_reset_position(quantity, file)
fflush(stdout);
- status = fl_file_read_position(&file, buffer, quantity);
+ status = f_file_read_until(file, buffer, quantity);
- f_file_close(&file);
+ f_file_close(&file.id);
if (f_status_is_error(status)) {
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fl_file_read_position().");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling f_file_read_until().");
} else if (status == f_number_overflow) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: Integer overflow while trying to buffer the file '%s'.", filename);
} else if (status == f_file_not_open) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: The file '%s' is no longer open.", filename);
} else if (status == f_file_error_seek) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A seek error occurred while accessing the file '%s'.", filename);
} else if (status == f_file_error_read) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: A read error occurred while accessing the file '%s'.", filename);
} else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
} else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fl_file_read_position().", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling f_file_read_until().", status);
}
return f_status_set_error(status);
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", filename);
} else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", filename);
} else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
} else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling fll_fss_basic_list_read() for the file '%s'.", status, filename);
}
return f_status_set_error(status);
status = f_status_set_fine(status);
if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
} else if (status == f_failure) {
// the error message has already been displayed.
} else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
}
f_macro_fss_objects_delete_simple(local->rule_objects);
status = f_status_set_fine(status);
if (status == f_invalid_parameter) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: Invalid parameter when calling fll_fss_basic_list_read() for the file '%s'.", init_rule_core_file);
} else if (status == f_no_data_on_eos || status == f_no_data || status == f_no_data_on_stop) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "ERROR: No relevant data was found within the file '%s'.", init_rule_core_file);
} else if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
} else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "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_line(f_type_error, data.context.error, data.context.reset, "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_delete(buffer);
if (f_status_is_error(status_process)) {
if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "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_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, data.context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, data.context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory.");
} else if (status == f_failure) {
// the error message has already been displayed.
} else {
- fl_color_print_line(f_standard_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
+ fl_color_print_line(f_type_error, data.context.error, data.context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling firewall_perform_commands().", status);
}
f_macro_fss_objects_delete_simple((*rule_objects));
}
else {
if (status == f_error_allocation || status == f_error_reallocation) {
- fl_color_print_line(f_standard_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory.");
+ fl_color_print_line(f_type_error, context.error, context.reset, "CRITICAL ERROR: Unable to allocate memory.");
}
else {
- fl_color_print_line(f_standard_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status);
+ fl_color_print_line(f_type_error, context.error, context.reset, "INTERNAL ERROR: An unhandled error (%u) has occurred while calling init_load_main_rule().", status);
}
}
const f_console_arguments arguments = { argc, argv };
status_code_data data = status_code_data_initialize;
- if (f_pipe_exists()) {
+ if (f_pipe_input_exists()) {
data.process_pipe = f_true;
}
status = fl_console_parameter_to_number_unsigned(value, &number);
if (status == f_none) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "invalid name");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid name");
return f_status_set_error(f_invalid_parameter);
}
if (status == f_no_data || f_status_set_fine(status) == f_invalid_parameter) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "invalid data");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid data");
return status;
}
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_invalid_data) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "unknown name");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown name");
}
else {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "failed to convert");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert");
}
return status;
}
if (status == f_invalid_data) {
- fl_color_print_line(f_standard_output, data.context.warning, data.context.reset, "unknown code");
+ fl_color_print_line(f_type_output, data.context.warning, data.context.reset, "unknown code");
return f_none;
}
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_invalid_data) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "unknown code");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "unknown code");
}
else {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "failed to convert");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "failed to convert");
}
return status;
f_status status = fl_console_parameter_to_number_unsigned(value, number);
if (*number > f_status_size_max_with_signal) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "out of range");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range");
return status;
}
if (f_status_is_error(status)) {
if (f_status_set_fine(status) == f_number_negative) {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "out of range");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "out of range");
}
else {
- fl_color_print_line(f_standard_output, data.context.error, data.context.reset, "invalid number");
+ fl_color_print_line(f_type_output, data.context.error, data.context.reset, "invalid number");
}
return status;
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_error);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
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(f_standard_error, data->context.error, data->context.reset, "ERROR: The parameter '");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
- fl_color_print(f_standard_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
- fl_color_print(f_standard_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, ".");
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "ERROR: The parameter '");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_warning);
+ fl_color_print(f_type_error, data->context.error, data->context.reset, "' cannot be used with the parameter ");
+ fl_color_print(f_type_error, data->context.notable, data->context.reset, "%s%s", f_console_symbol_long_enable, status_code_long_is_fine);
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, ".");
status_code_delete_data(data);
return f_status_set_error(status);
}
if (data->remaining.used == 0 && !data->process_pipe) {
- fl_color_print_line(f_standard_error, data->context.error, data->context.reset, "ERROR: you failed to specify a status code.");
+ fl_color_print_line(f_type_error, data->context.error, data->context.reset, "ERROR: you failed to specify a status code.");
status_code_delete_data(data);
return f_status_set_error(f_invalid_parameter);