if (new_length < old_length) {
// uint8_t * is of a data type size of 1, casting it to uint8_t should result in a single-length increment.
// this is done to avoid problems with (void *) having arithmetic issues.
- memset(((uint8_t *)*pointer) + new_length, 0, type * (old_length - new_length));
+ memset(((uint8_t *) *pointer) + new_length, 0, type * (old_length - new_length));
}
}
if (new_length > old_length) {
// uint8_t * is of a data type size of 1, casting it to bool should result in a single-length increment.
// this is done to avoid problems with (void *) having arithmetic issues.
- memset(((uint8_t *)new_pointer) + (type * old_length), 0, type * (new_length - old_length));
+ memset(((uint8_t *) new_pointer) + (type * old_length), 0, type * (new_length - old_length));
}
*pointer = new_pointer;
* F_none on success.
* F_memory_allocation (with error bit) on allocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see calloc()
*/
#ifndef _di_f_memory_new_
extern f_return_status f_memory_new(void **pointer, const f_memory_size_t type, const f_memory_length length);
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see free()
*/
#if ! ( defined (_di_f_memory_delete_) || defined (_f_memory_FORCE_secure_memory_) )
extern f_return_status f_memory_delete(void **pointer, const f_memory_size_t type, const f_memory_length length);
* @return
* F_none on success.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see free()
+ * @see memset()
*/
#if ! ( defined (_di_f_memory_destroy_) || defined (_f_memory_FORCE_fast_memory_) )
extern f_return_status f_memory_destroy(void **pointer, const f_memory_size_t type, const f_memory_length length);
* F_none on success.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see calloc()
+ * @see memset()
+ * @see realloc()
*/
#if ! ( defined (_di_f_memory_resize_) || defined (_f_memory_FORCE_secure_memory_) )
extern f_return_status f_memory_resize(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length);
* F_none on success.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * @see calloc()
+ * @see memset()
+ * @see realloc()
*/
#if ! ( defined (_di_f_memory_adjust_) || defined (_f_memory_FORCE_fast_memory_) )
extern f_return_status f_memory_adjust(void **pointer, const f_memory_size_t type, const f_memory_length old_length, const f_memory_length new_length);
unsigned short width = 0;
- while (i < serialize.used) {
+ for (; i < serialize.used; i += width) {
width = f_macro_utf_byte_width(serialize.string[i]);
if (serialize.string[i] == f_serialize_simple_splitter) {
if (current == index) {
if (start == i) {
+
// provide an invalid start to stop range to communicate that there is no data.
location->start = 1;
location->stop = 0;
}
if (i + width > serialize.used) return F_status_set_error(F_incomplete_utf_eos);
-
- i += width;
- } // while
+ } // for
return F_data_not_eos;
}
uint8_t width = 0;
- while (i < serialize.used) {
+ for (; i < serialize.used; i += width) {
width = f_macro_utf_byte_width(serialize.string[i]);
if (serialize.string[i] == f_serialize_simple_splitter || i + 1 >= serialize.used) {
locations->used++;
- if (i + width > serialize.used) return F_status_set_error(F_incomplete_utf_eos);
+ if (i + width > serialize.used) {
+ return F_status_set_error(F_incomplete_utf_eos);
+ }
start = i + width;
}
else if (i + width > serialize.used) {
return F_status_set_error(F_incomplete_utf_eos);
}
-
- i += width;
- } // while
+ } // for
return F_none;
}
#endif // _di_level_0_parameter_checking_
if (sigaddset(set, signal) < 0) {
- if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == EINVAL) {
+ return F_status_set_error(F_parameter);
+ }
return F_status_set_error(F_failure);
}
#endif // _di_level_0_parameter_checking_
if (sigdelset(set, signal) < 0) {
- if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == EINVAL) {
+ return F_status_set_error(F_parameter);
+ }
return F_status_set_error(F_failure);
}
#endif // _di_level_0_parameter_checking_
if (sigemptyset(set) < 0) {
- if (errno == EINVAL) return F_status_set_error(F_parameter);
+ if (errno == EINVAL) {
+ return F_status_set_error(F_parameter);
+ }
return F_status_set_error(F_failure);
}
#ifndef _di_f_statuss_t_
typedef struct {
f_status_t *array;
+
f_array_length_t size;
f_array_length_t used;
} f_statuss_t;
const uint8_t width = f_macro_utf_character_t_width_is(character);
if (width == 0) {
+
// There are no control picture characters in ASCII.
return F_false;
}
const uint8_t width = f_macro_utf_character_t_width_is(character);
if (width == 0) {
+
// There are no ASCII phonetic characters.
return F_false;
}
const uint8_t width = f_macro_utf_character_t_width_is(character);
if (width == 0) {
+
// There are no ASCII private characters.
return F_false;
}
const uint8_t width = f_macro_utf_character_t_width_is(character);
if (width == 0) {
+
// ASCII: '!' to '#'.
if (character > 0x20000000 && character < 0x24000000) {
return F_true;
const uint8_t width = f_macro_utf_character_t_width_is(character);
if (width == 0) {
+
// ASCII: '$' or '+'.
if (character == 0x24000000 || character == 0x2b000000) {
return F_true;
const uint8_t width = f_macro_utf_character_t_width_is(character);
if (width == 0) {
+
// There are no ASCII whitespace other.
return F_false;
}
const uint8_t width = f_macro_utf_byte_width_is(*character);
if (width == 0) {
+
// ASCII: '!' to '#'.
if (character[0] > 0x20 && character[0] < 0x24) {
return F_true;
const uint8_t width = f_macro_utf_byte_width_is(*character);
if (width == 0) {
+
// ASCII: '$' or '+'.
if (character[0] == 0x24 || character[0] == 0x2b) {
return F_true;
const uint8_t width = f_macro_utf_byte_width_is(*character);
if (width == 0) {
+
// There are no ASCII whitespace modifiers.
return F_false;
}
const uint8_t width = f_macro_utf_byte_width_is(*character);
if (width == 0) {
+
// There are no ASCII whitespace other.
return F_false;
}
const uint8_t width = f_macro_utf_byte_width_is(*character);
if (width == 0) {
+
// These control characters are considered zero-width spaces.
if (*character >= 0x00 && *character <= 0x08) {
return F_true;
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_binary(string[i], &digit) == F_none) {
if (scale) {
scale++;
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_binary(string[i], &digit) == F_none) {
if (scale) {
scale++;
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_decimal(string[i], &digit) == F_none) {
if (scale) {
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_decimal(string[i], &digit) == F_none) {
if (scale) {
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) {
if (scale) {
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) {
if (scale) {
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) {
if (scale) {
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) {
if (scale) {
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_octal(string[i], &digit) == F_none) {
if (scale) {
f_number_unsigned_t converted = 0;
for (f_string_length_t i = range.start; i <= range.stop; i++) {
+
if (f_conversion_character_to_octal(string[i], &digit) == F_none) {
if (scale) {
f_string_length_t i = source_length;
for (; i > 0; i--, static_source.used--) {
+
if (source[i - 1] == 0) continue;
if (source[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
i = destination_length;
for (; i > 0; i--, static_destination.used--) {
+
if (destination[i - 1] == 0) continue;
if (destination[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
}
f_string_length_t i = source_length;
for (; i > 0; i--, static_source.used--) {
+
if (source[i - 1] == 0) continue;
if (source[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
i = destination_length;
for (; i > 0; i--, static_destination.used--) {
+
if (destination[i - 1] == 0) continue;
if (destination[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
}
f_string_length_t i = source_length;
for (; i > 0; i--, static_source.used--) {
+
if (source[i - 1] == 0) continue;
if (source[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
i = destination_length;
for (; i > 0; i--, static_destination.used--) {
+
if (destination[i - 1] == 0) continue;
if (destination[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
}
f_string_length_t i = source_length;
for (; i > 0; i--, static_source.used--) {
+
if (source[i - 1] == 0) continue;
if (source[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
i = destination_length;
for (; i > 0; i--, static_destination.used--) {
+
if (destination[i - 1] == 0) continue;
if (destination[i - 1] == f_path_separator[0]) continue;
+
break;
} // for
}
f_status_t status = F_none;
for (; i > 0; i--) {
+
if (path->string[i] == 0) continue;
status = f_utf_is_control(path->string + i, path->used - i);
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if appended string length is too large to store in the buffer.
*
+ * Errors (with error bit) from: f_file_stat_at().
+ *
* @see alphasort()
* @see opendir()
* @see scandir()
* F_data_not if path.used is 0.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if appended string length is too large to store in the buffer.
+ *
+ * Errors (with error bit) from: f_utf_is_control().
*/
#ifndef _di_fl_directory_path_pop_
extern f_return_status fl_directory_path_pop(f_string_static_t *path);
f_directory_listing_t listing = f_directory_listing_t_initialize;
status = private_fl_directory_list(source.string, 0, 0, F_false, &listing);
+
if (F_status_is_error(status)) {
f_macro_directory_listing_t_delete_simple(listing);
return status;
f_array_length_t j = 0;
for (; i < 7; i++) {
+
for (j = 0; F_status_is_fine(status) && j < list[i]->used; j++) {
status = private_fl_directory_clone_file(list[i]->array[j], source, destination, role, recurse);
} // for
f_directory_listing_t listing = f_directory_listing_t_initialize;
status = private_fl_directory_list(source.string, 0, 0, F_false, &listing);
+
if (F_status_is_error(status)) {
f_macro_directory_listing_t_delete_simple(listing);
return status;
memset(&source_stat, 0, sizeof(struct stat));
status = f_file_stat(source.string, F_false, &source_stat);
+
if (F_status_is_error(status)) {
if (status == F_status_set_error(F_string_too_large)) {
size = f_string_length_t_size - 1;
size_t i = 0;
for (; i < length; i++) {
+
size = strnlen(entity[i]->d_name, f_directory_name_max);
// There is no reason to include "." and ".." in the directory listing.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if appended string length is too large to store in the buffer.
*
+ * Errors (with error bit) from: f_file_stat_at().
+ *
* @see fl_directory_list()
*/
#if !defined(_di_fl_directory_list_)
const f_string_length_t length = strnlen(path, PATH_MAX);
if (length == 0) {
+
// When PATH is "", this is actually a valid search path for PWD.
// Append an equivalent representation of PWD (string used length is 0).
f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large);
f_string_length_t total = 0;
for (i = 0; i <= length; i++) {
+
if (i == length || path[i] == f_path_separator_variable[0]) {
f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large);
if (F_status_is_error(status)) return status;
f_status_t status = F_none;
if (path.used == 0) {
+
// When PATH is "", this is actually a valid search path for PWD.
// Therefore append an equivalent representation of PWD (string used length is 0).
f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large);
f_string_dynamic_t part = f_string_dynamic_t_initialize;
for (i = 0; i <= path.used; i++) {
+
if (i == path.used || path.string[i] == f_path_separator_variable[0]) {
f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large);
if (F_status_is_error(status)) return status;
const f_string_length_t length = strnlen(path, PATH_MAX);
if (length == 0) {
+
// When PATH is "", this is actually a valid search path for PWD.
// Therefore append an equivalent representation of PWD (string used length is 0).
f_macro_memory_structure_macro_increment(status, (*paths), 1, f_memory_default_allocation_step, f_macro_string_dynamics_resize, F_buffer_too_large);
last = j;
}
else if (j == 0) {
+
// when j = 0, the total is actually the entire length to max.
total = last - j;
f_string_lengths_t delimits = f_string_lengths_t_initialize;
status = private_fl_fss_basic_object_read(buffer, range, found, quoted, &delimits);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
return status;
found->array[found->used].start = range->start;
// search for valid content.
- for (;;) {
+ for (;; range->start++) {
+
fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*range));
fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*range), (*found), delimits, F_none_eos, F_none_stop);
if (buffer->string[range->start] == f_fss_basic_close) break;
-
- range->start++;
} // for
// Save the stop length/
}
while (range->start <= range->stop && range->start < content.used) {
+
if (content.string[range->start] == f_string_eol[0]) {
destination->string[buffer_position.stop] = f_string_eol[0];
destination->used = buffer_position.stop + 1;
// identify where the object ends.
while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
f_string_length_t first_slash = range->start;
f_string_length_t slash_count = 1;
if (F_status_is_error(status)) return status;
while (range->start < buffer->used && range->start <= range->stop && (buffer->string[range->start] == f_fss_delimit_placeholder || buffer->string[range->start] == f_fss_delimit_slash)) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
slash_count++;
}
if (slash_count % 2 == 0) {
while (slash_count > 0) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits.array[delimits.used] = range->start;
// identify where the content ends.
while (range->start < buffer->used && range->start <= range->stop) {
+
if (buffer->string[range->start] == f_string_eol[0]) {
found_newline = F_true;
last_newline = range->start;
if (F_status_is_error(status)) return status;
while (range->start < buffer->used && range->start <= range->stop && (buffer->string[range->start] == f_fss_delimit_placeholder || buffer->string[range->start] == f_fss_delimit_slash)) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
slash_count++;
}
}
while (slash_count > 0) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits.array[delimits.used] = range->start;
buffer_position.stop = destination->used;
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_comment) {
// comments are not allowed and this format has no way of "wrapping" a comment.
return F_status_set_error(FL_fss_found_comment);
} // while
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_delimit_slash) {
f_string_length_t slash_count = 1;
if (F_status_is_error(status)) return status;
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(object, range, 1);
if (F_status_is_error(status)) return status;
buffer_position.stop = destination->used;
while (range->start <= range->stop && range->start < content.used) {
+
if (content.string[range->start] == f_fss_delimit_slash && !is_comment) {
f_string_length_t slash_count = 1;
if (F_status_is_error(status)) return status;
while (range->start <= range->stop && range->start < content.used) {
+
if (content.string[range->start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(content, range, 1);
if (F_status_is_error(status)) return status;
f_string_lengths_t delimits = f_string_lengths_t_initialize;
status = private_fl_fss_basic_object_read(buffer, range, found, quoted, &delimits);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
return status;
// identify where the object ends.
while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
f_string_length_t first_slash = range->start;
f_string_length_t slash_count = 1;
if (F_status_is_error(status)) return status;
while (range->start < buffer->used && range->start <= range->stop) {
+
if (buffer->string[range->start] == f_string_eol[0] || (status = f_fss_is_graph(*buffer, *range)) == F_true) {
break;
}
if (slash_count % 2 == 0) {
while (slash_count > 0) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits.array[delimits.used] = range->start;
// seek to the end of the line when no valid object is found.
while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) {
+
status = f_utf_buffer_increment(*buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
f_string_length_t last_newline = range->start;
f_macro_string_lengths_t_new(status, positions_start, f_fss_default_allocation_step);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
}
f_macro_fss_objects_t_new(status, objects, f_fss_default_allocation_step);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(positions_start);
f_macro_string_lengths_t_delete_simple(delimits);
positions_start.used = 1;
while (range->start < buffer->used && range->start <= range->stop) {
+
if (buffer->string[range->start] == f_string_eol[0]) {
last_newline = range->start;
position_previous = range->start;
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
}
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
range->start++;
while (range->start < buffer->used && range->start <= range->stop) {
+
if (buffer->string[range->start] == f_string_eol[0]) {
last_newline = range->start;
line_start = range->start + 1;
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
// apply slash delimits, only slashes and placeholders should be present.
while (slash_count > 0) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits.array[delimits.used] = range->start;
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
// No valid object open found, seek until EOL.
else {
while (range->start < buffer->used && range->start <= range->stop) {
+
if (buffer->string[range->start] == f_string_eol[0]) {
last_newline = range->start;
line_start = range->start + 1;
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
}
else if (buffer->string[range->start] == f_fss_extended_list_close) {
while (range->start < buffer->used && range->start <= range->stop) {
+
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
if (depth == 0) {
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
// No valid object close found, seek until EOL.
else {
while (range->start < buffer->used && range->start <= range->stop) {
+
if (buffer->string[range->start] == f_string_eol[0]) {
last_newline = range->start;
line_start = range->start + 1;
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
else if (buffer->string[range->start] != f_string_eol[0]) {
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
position_previous = range->start;
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
f_macro_string_lengths_t_delete_simple(delimits);
f_macro_string_lengths_t_delete_simple(positions_start);
f_macro_fss_objects_t_delete_simple(objects);
if (range->start > range->stop) {
- if (depth == 0) return F_status_set_error(F_unterminated_stop);
+ if (depth == 0) {
+ return F_status_set_error(F_unterminated_stop);
+ }
return F_status_set_error(F_unterminated_nest_stop);
}
- if (depth == 0) return F_status_set_error(F_unterminated_eos);
+ if (depth == 0) {
+ return F_status_set_error(F_unterminated_eos);
+ }
return F_status_set_error(F_unterminated_nest_eos);
}
buffer_position.stop = destination->used;
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_comment) {
// comments are not allowed and this format has no way of "wrapping" a comment.
return F_status_set_error(FL_fss_found_comment);
} // while
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_delimit_slash) {
f_string_length_t slash_count = 1;
if (F_status_is_error(status)) return status;
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(object, range, 1);
if (F_status_is_error(status)) return status;
buffer_position.stop = destination->used;
while (range->start <= range->stop && range->start < content.used) {
+
if (content.string[range->start] == f_fss_delimit_slash && !is_comment) {
f_string_length_t slash_count = 1;
if (F_status_is_error(status)) return status;
while (range->start <= range->stop && range->start < content.used) {
+
if (content.string[range->start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(content, range, 1);
if (F_status_is_error(status)) return status;
if (F_status_is_error(status)) return status;
while (range->start < content.used && range->start <= range->stop) {
+
if (content.string[range->start] == f_string_eol[0] || (status = f_fss_is_graph(content, *range)) == F_true) {
break;
}
if (F_status_is_error(status)) return status;
while (range->start < content.used && range->start <= range->stop) {
+
if (content.string[range->start] == f_string_eol[0] || (status = f_fss_is_graph(content, *range)) == F_true) {
break;
}
if (F_status_is_error(status)) return status;
while (range->start <= range->stop && range->start < buffer->used) {
+
status = f_fss_is_zero_width(*buffer, *range);
if (F_status_is_error(status)) return status;
}
status = f_utf_buffer_increment(*buffer, range, 1);
+
if (F_status_is_error(status)) {
return status;
}
status = F_none;
while (range->start <= range->stop && range->start < buffer->used) {
+
status = f_fss_is_space(*buffer, *range);
if (F_status_is_error(status)) return status;
}
while (slash_count > 0) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
if ((status = f_fss_is_graph(*buffer, *range)) == F_true) {
while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) {
+
status = f_utf_buffer_increment(*buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
}
while (slash_count > 0) {
+
if (buffer->string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
if (F_status_is_error(status)) return status;
while (range->start <= range->stop && range->start < buffer->used) {
+
if (buffer->string[range->start] == f_string_eol[0]) {
range->start++;
return FL_fss_found_object_content_not;
else if (buffer->string[range->start] != f_fss_delimit_placeholder) {
while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) {
+
status = f_utf_buffer_increment(*buffer, range, 1);
if (F_status_is_error(status)) return status;
-
} // while
if (range->start >= buffer->used) {
// seek to the end of the line when no valid object is found->
while (range->start < buffer->used && range->start <= range->stop && buffer->string[range->start] != f_string_eol[0]) {
+
status = f_utf_buffer_increment(*buffer, range, 1);
if (F_status_is_error(status)) return status;
} // while
if (object.string[range->start] == f_fss_delimit_slash) {
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(object, range, 1);
if (F_status_is_error(status)) return status;
}
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(object, range, 1);
if (F_status_is_error(status)) return status;
bool must_delimit = F_false;
while (next.start <= next.stop && next.start < object.used) {
+
if (object.string[next.start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(object, &next, 1);
if (F_status_is_error(status)) return status;
} // while
if (next.start <= next.stop && next.start < object.used) {
+
// identify if quoted exists and could be considered a valid closing quoted.
if (object.string[next.start] == destination->string[destination_position.start]) {
fl_macro_fss_skip_past_delimit_placeholders(object, next);
if (must_delimit) {
for (f_string_length_t i = 0; i < slashes; i++) {
+
destination->string[destination_position.stop] = f_fss_delimit_slash;
destination_position.stop++;
} // for
if (object.string[range->start] == f_fss_delimit_slash) {
while (range->start <= range->stop && range->start < object.used) {
+
if (object.string[range->start] == f_fss_delimit_placeholder) {
status = f_utf_buffer_increment(object, range, 1);
if (F_status_is_error(status)) return status;
* F_memory_reallocation (with error bit) on memory reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if a string length is too large to store in the buffer.
+ *
+ * Errors (with error bit) from: f_iki_read().
*/
#ifndef _di_fl_iki_read_
extern f_return_status fl_iki_read(f_string_static_t *buffer, f_string_range_t *range, f_iki_variable_t *variable, f_iki_vocabulary_t *vocabulary, f_iki_content_t *content);
uint8_t width_max = 0;
for (; i < length; i += f_macro_utf_byte_width(string[i])) {
+
width_max = (length - i) + 1;
status = f_utf_is_whitespace(string + i, width_max);
#if !defined(_di_fl_string_append_) || !defined(_di_fl_string_dynamic_append_) || !defined(_di_fl_string_append_mash_) || !defined(_di_fl_string_dynamic_mash_)
f_return_status private_fl_string_append(const f_string_t source, const f_string_length_t length, f_string_dynamic_t *destination) {
-
f_status_t status = F_none;
if (destination->used + length > destination->size) {
f_string_length_t i2 = offset2;
for (; i1 < stop1 && i2 < stop2; i1++, i2++) {
+
// skip past NULL in string1.
while (i1 < stop1 && string1[i1] == 0) i1++;
if (i1 == stop1) break;
// skip past leading whitespace in string1.
for (; i1 < stop1; i1 += width) {
+
// skip past NULL in string1.
while (i1 < stop1 && string1[i1] == 0) i1++;
if (i1 == stop1) break;
// skip past leading whitespace in string2.
for (; i2 < stop2; i2 += width) {
+
// skip past NULL in string2.
while (i2 < stop2 && string2[i2] == 0) i2++;
if (i2 == stop2) break;
// determine where the last non-whitespace is in string1.
for (f_string_length_t j = i1; j < stop1; j += width) {
+
// skip past NULL in string1.
while (j < stop1 && string1[j] == 0) j++;
if (j == stop1) break;
width_max = (stop1 - j) + 1;
status = f_utf_is_whitespace(string1 + j, width_max);
+
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
// determine where the last non-whitespace is in string2.
for (f_string_length_t j = i2; j < stop2; j += width) {
+
// skip past NULL in string2.
while (j < stop2 && string2[j] == 0) j++;
if (j == stop2) break;
}
for (; i1 < last1 && i2 < last2; i1++, i2++) {
+
// skip past NULL in string1.
while (i1 < last1 && string1[i1] == 0) i1++;
if (i1 == last1) break;
f_string_length_t size = 0;
for (f_string_length_t i = 0; i <= length; i++) {
+
if (i == length) {
if (i > first) {
size = i - first;
// skip past leading whitespace.
for (; *start <= *stop; *start += width) {
+
// skip past NULL.
while (*start < *stop && source[*start] == 0) (*start)++;
if (*start > *stop) break;
status = f_utf_is_whitespace(source + *start, (*stop - *start) + 1);
+
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
return F_status_set_error(F_utf);
// each UTF-8 character of width 1 is an incomplete part.
// go left until either width is 0 (ascii, or > 1) to determine the character.
for (;;) {
+
width = f_macro_utf_byte_width_is(source[*stop]);
if (width == 1) {
if (*stop == *start) break;
}
- else break;
+ else {
+ break;
+ }
} // for
if (*stop == *start) break;
status = f_utf_is_whitespace(source + *stop, (stop_original - *stop) + 1);
+
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
return F_status_set_error(F_utf);
if (*stop == *start) {
status = f_utf_is_whitespace(source + *stop, (stop_original - *stop) + 1);
+
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
return F_status_set_error(F_utf);
* F_equal_to_not when both strings do not equal.
* F_parameter (with error bit) if a parameter is invalid.
*
+ * Errors (with error bit) from: f_utf_is_whitespace().
+ *
* @see fl_string_compare_trim()
* @see fl_string_dynamic_compare_trim()
* @see fl_string_dynamic_partial_compare_trim()
if (i > first) {
f_utf_string_length_t size = i - first;
- if (destination->used + size > f_utf_string_t_size_max) return F_status_set_error(F_string_too_large);
+ if (destination->used + size > f_utf_string_t_size_max) {
+ return F_status_set_error(F_string_too_large);
+ }
f_utf_string_length_t total = destination->used + size;
if (i > first) {
f_utf_string_length_t size = i - first;
- if (destination->used + size > f_utf_string_t_size_max) return F_status_set_error(F_string_too_large);
+ if (destination->used + size > f_utf_string_t_size_max) {
+ return F_status_set_error(F_string_too_large);
+ }
f_utf_string_length_t total = destination->used + size;
f_utf_string_length_t i2 = offset2;
for (; i1 < stop1 && i2 < stop2; i1++, i2++) {
+
// skip past NULL in string1.
while (i1 < stop1 && string1[i1] == 0) i1++;
if (i1 == stop1) break;
if (i1 == stop1) break;
status = f_utf_character_is_whitespace(string1[i1]);
+
if (F_status_is_error(status)) {
// ignore possibly invalid UTF-8 codes.
if (F_status_set_fine(status) != F_maybe) {
// skip past leading whitespace in string2.
for (; i2 < stop2; i2++) {
+
// skip past NULL in string2.
while (i2 < stop2 && string2[i2] == 0) i2++;
if (i2 == stop2) break;
status = f_utf_character_is_whitespace(string2[i2]);
+
if (F_status_is_error(status)) {
// ignore possibly invalid UTF-8 codes.
if (F_status_set_fine(status) != F_maybe) {
// determine where the last non-whitespace is in string1.
for (f_utf_string_length_t j = i1; j < stop1; j++) {
+
// skip past NULL in string1.
while (j < stop1 && string1[j] == 0) j++;
if (j == stop1) break;
status = f_utf_character_is_whitespace(string1[j]);
+
if (F_status_is_error(status)) {
// ignore possibly invalid UTF-8 codes.
if (F_status_set_fine(status) != F_maybe) {
if (j == stop2) break;
status = f_utf_character_is_whitespace(string2[j]);
+
if (F_status_is_error(status)) {
// ignore possibly invalid UTF-8 codes.
if (F_status_set_fine(status) != F_maybe) {
if (*start > *stop) break;
status = f_utf_character_is_whitespace(source[*start]);
+
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
return F_status_set_error(F_utf);
if (*stop == *start) break;
status = f_utf_character_is_whitespace(source[*stop]);
+
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
return F_status_set_error(F_utf);
if (*stop == *start) {
status = f_utf_character_is_whitespace(source[*stop]);
+
if (F_status_is_error(status)) {
if (F_status_set_fine(status) == F_maybe) {
return F_status_set_error(F_utf);
f_utf_string_length_t j = 1;
while (i <= source.used && j <= destination->used) {
+
if (source.string[source.used - i] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 1;
while (i <= source.used && j <= destination->used) {
+
if (source.string[source.used - i] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (source.string[range.stop - i] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (source.string[range.stop - i] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 0;
while (i < length && j < destination->used) {
+
if (source.string[i + range.start] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 0;
while (i < length && j < destination->used) {
+
if (source.string[i + range.start] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 0;
while (i < source.used && j < destination->used) {
+
if (source.string[i] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 0;
while (i < source.used && j < destination->used) {
+
if (source.string[i] == f_utf_character_t_eos) {
i++;
continue;
}
while (buffer.string[range->start] != seek_to_this) {
- if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol;
+
+ if (buffer.string[range->start] == f_utf_character_t_eol) {
+ return F_none_eol;
+ }
range->start++;
}
while (buffer.string[range->start] != seek_to_character) {
- if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol;
+
+ if (buffer.string[range->start] == f_utf_character_t_eol) {
+ return F_none_eol;
+ }
range->start++;
}
while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_graph(buffer.string[range->start])) == F_false) {
+
if (F_status_is_error(status)) return status;
if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol;
}
while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == F_false) {
+
if (F_status_is_error(status)) return status;
if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol;
if (destination->used > 0) {
for (; destination->used > 0; destination->used--) {
+
if (destination->string[destination->used - 1] == 0) continue;
break;
} // for
f_utf_string_length_t j = 0;
while (i < length && j < destination->used) {
+
if (source[i] == f_utf_character_t_eos) {
i++;
continue;
f_utf_string_length_t j = 0;
while (i < length && j < destination->used) {
+
if (source[i] == f_utf_character_t_eos) {
i++;
continue;
}
while (string[range->start] != seek_to_this) {
- if (string[range->start] == f_utf_character_t_eol) return F_none_eol;
+
+ if (string[range->start] == f_utf_character_t_eol) {
+ return F_none_eol;
+ }
range->start++;
f_utf_character_t seek_to_character = seek_to_this << 24;
for (; range->start <= range->stop; range->start++) {
+
if (f_macro_utf_character_t_width_is(string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
}
while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == F_false) {
+
if (F_status_is_error(status)) return status;
if (string[range->start] == f_utf_character_t_eol) return F_none_eol;
if (f_macro_utf_character_t_width_is(string[range->start]) == 1) return F_status_set_error(F_utf);
while (string[range->start] == placeholder || (status = f_utf_character_is_graph(string[range->start])) == F_true) {
+
if (F_status_is_error(status)) return status;
if (string[range->start] == f_utf_character_t_eol) return F_none_eol;
}
while (range->start <= range->stop) {
- if (string[range->start] == seek_to_character) return F_none;
+
+ if (string[range->start] == seek_to_character) {
+ return F_none;
+ }
range->start++;
memset(buffer_write, 0, write_size);
for (i = 0, used = 0; used < write_size && *written + i < write_max; i++, used += width) {
+
if (width_written < width) {
if (width_written < 2) {
buffer_write[used] = f_macro_utf_character_t_to_char_2(string[*written + i]);
f_status_t status = F_none;
status = private_fll_execute_arguments_add(source, length, arguments);
-
if (F_status_is_error(status)) return status;
return F_none;
f_status_t status = F_none;
status = private_fll_execute_arguments_add_parameter(prefix, prefix_length, name, name_length, value, value_length, arguments);
-
if (F_status_is_error(status)) return status;
return F_none;
if (value_length[i] == 0) continue;
status = private_fll_execute_arguments_add_parameter(prefix[i], prefix_length[i], name[i], name_length[i], value[i], value_length[i], arguments);
-
if (F_status_is_error(status)) return status;
} // for
if (length[i] == 0) continue;
status = private_fll_execute_arguments_add(source[i], length[i], arguments);
-
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
status = private_fll_execute_arguments_add(source.string, source.used, arguments);
-
if (F_status_is_error(status)) return status;
return F_none;
f_status_t status = F_none;
status = private_fll_execute_arguments_add_parameter(prefix.string, prefix.used, name.string, name.used, value.string, value.used, arguments);
-
if (F_status_is_error(status)) return status;
return F_none;
if (value[i].used > value[i].size) continue;
status = private_fll_execute_arguments_add_parameter(prefix[i].string, prefix[i].used, name[i].string, name[i].used, value[i].string, value[i].used, arguments);
-
if (F_status_is_error(status)) return status;
} // for
if (source[i].used > source[i].size) continue;
status = private_fll_execute_arguments_add(source[i].string, source[i].used, arguments);
-
if (F_status_is_error(status)) return status;
} // for
if (name_size > 1) {
f_macro_string_t_new(status, program_name, name_size + 1);
-
if (F_status_is_error(status)) return status;
memcpy(program_name, program_path, name_size);
if (name_size > 1) {
f_macro_string_t_new(status, program_name, name_size + 1);
-
if (F_status_is_error(status)) return status;
memcpy(program_name, last_slash + 1, name_size);
fixed_arguments[arguments.used + 1] = 0;
status = f_file_exists(program_path);
+
if (F_status_is_error(status)) {
if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size);
process_id = fork();
if (process_id < 0) {
- if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size);
+ if (name_size > 0) {
+ f_macro_string_t_delete_simple(program_name, name_size);
+ }
return F_status_set_error(F_fork);
}
// have the parent wait for the child process to finish
waitpid(process_id, result, WUNTRACED | WCONTINUED);
- if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size);
+ if (name_size > 0) {
+ f_macro_string_t_delete_simple(program_name, name_size);
+ }
- if (result != 0 && *result != 0) return F_status_set_error(F_failure);
+ if (result != 0 && *result != 0) {
+ return F_status_set_error(F_failure);
+ }
return F_none;
}
// have the parent wait for the child process to finish.
waitpid(process_id, result, WUNTRACED | WCONTINUED);
- if (name_size > 0) f_macro_string_t_delete_simple(program_name, name_size);
+ if (name_size > 0) {
+ f_macro_string_t_delete_simple(program_name, name_size);
+ }
if (result != 0) {
if (WIFEXITED(*result)) {
// have the parent wait for the child process to finish
waitpid(process_id, result, WUNTRACED | WCONTINUED);
- if (result != 0 && *result != 0) return F_status_set_error(F_failure);
+ if (result != 0 && *result != 0) {
+ return F_status_set_error(F_failure);
+ }
return F_none;
}
status = f_environment_get("PATH", &path);
if (F_status_is_error(status)) {
+
// Do not consider PATH is not available (or valid?) to be an error.
if (F_status_set_fine(status) == F_invalid || F_status_set_fine(status) == F_failure) {
status = F_none;
}
f_macro_string_dynamic_t_delete(status, path);
+
if (F_status_is_error(status)) {
f_macro_string_dynamics_t_delete_simple(paths);
return status;
f_string_dynamic_t *found = 0;
for (i = 0; i < paths.used; i++) {
+
status = fl_string_append(program_name, program_name_length, &paths.array[i]);
if (F_status_is_error_not(status)) {
memcpy(&program_path, found->string, found->used);
f_macro_string_dynamics_t_delete(status, paths);
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
pid_t process_id = 0;
for (i = 0; i < names.used; i++) {
f_environment_set_dynamic(names.array[i], values.array[i], F_true);
- }
+ } // for
const int code = execvp(program_path, fixed_arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_add_
extern f_return_status fll_execute_arguments_add(const f_string_t source, const f_string_length_t length, f_string_dynamics_t *arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_add_parameter_
extern f_return_status fll_execute_arguments_add_parameter(const f_string_t prefix, const f_string_length_t prefix_length, const f_string_t name, const f_string_length_t name_length, const f_string_t value, const f_string_length_t value_length, f_string_dynamics_t *arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_add_parameter_set_
extern f_return_status fll_execute_arguments_add_parameter_set(const f_string_t prefix[], const f_string_length_t prefix_length[], const f_string_t name[], const f_string_length_t name_length[], const f_string_t value[], const f_string_length_t value_length[], const f_array_length_t size, f_string_dynamics_t *arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_add_set_
extern f_return_status fll_execute_arguments_add_set(const f_string_t source[], const f_string_length_t length[], const f_array_length_t size, f_string_dynamics_t *arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_dynamic_add_
extern f_return_status fll_execute_arguments_dynamic_add(const f_string_static_t source, f_string_dynamics_t *arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_dynamic_add_parameter_
extern f_return_status fll_execute_arguments_dynamic_add_parameter(const f_string_static_t prefix, const f_string_static_t name, const f_string_static_t value, f_string_dynamics_t *arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_dynamic_add_parameter_set_
extern f_return_status fll_execute_arguments_dynamic_add_parameter_set(const f_string_static_t prefix[], const f_string_static_t name[], const f_string_static_t value[], const f_array_length_t size, f_string_dynamics_t *arguments);
* F_memory_allocation (with error bit) on allocation error.
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
*/
#ifndef _di_fll_execute_arguments_dynamic_add_set_
extern f_return_status fll_execute_arguments_dynamic_add_set(const f_string_static_t source[], const f_array_length_t size, f_string_dynamics_t *arguments);
* F_number_overflow (with error bit) on overflow error.
* F_parameter (with error bit) if a parameter is invalid.
*
+ * Errors (with error bit) from: f_file_exists().
+ *
* @see execv()
*/
#ifndef _di_fll_execute_path_
* F_number_overflow (with error bit) on overflow error.
* F_parameter (with error bit) if a parameter is invalid.
*
+ * Errors (with error bit) from: f_file_exists().
+ *
* @see execv()
*/
#ifndef _di_fll_execute_path_environment_
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string (generated from PATH) is too large.
*
+ * Errors (with error bit) from: f_file_exists().
+ *
* @see execvp()
*/
#ifndef _di_fll_execute_program_
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string (generated from PATH) is too large.
*
+ * Errors (with error bit) from: f_file_exists().
+ * Errors (with error bit) from: fl_environment_path_explode_dynamic().
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_dynamic_terminate().
+ *
* @see execvpe()
*/
#ifndef _di_fll_execute_program_environment_
f_string_dynamic_t argument = f_string_dynamic_t_initialize;
status = fl_string_append(source, length, &argument);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(argument);
return status;
}
status = fl_string_dynamic_terminate(&argument);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(argument);
return status;
if (prefix_length > 0) {
status = fl_string_append(prefix, prefix_length, &argument);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(argument);
return status;
}
status = fl_string_append(name, name_length, &argument);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(argument);
return status;
}
status = fl_string_dynamic_terminate(&argument);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(argument);
return status;
f_macro_string_dynamic_t_clear(argument);
status = fl_string_append(value, value_length, &argument);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(argument);
return status;
}
status = fl_string_dynamic_terminate(&argument);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(argument);
return status;
* F_parameter (with error bit) if a parameter is invalid.
* F_read_only (with error bit) if file is read-only.
* F_failure (with error bit) for any other error.
+ *
+ * Errors (with error bit) from: f_file_mode_set().
+ * Errors (with error bit) from: f_directory_exists().
+ * Errors (with error bit) from: fl_directory_list().
*/
#ifndef _di_fll_file_mode_set_all_
extern f_return_status fll_file_mode_set_all(const f_string_t path, const mode_t mode, const f_number_unsigned_t depth_max);
* F_parameter (with error bit) if a parameter is invalid.
* F_read_only (with error bit) if file is read-only.
* F_failure (with error bit) for any other error.
+ *
+ * Errors (with error bit) from: f_directory_is().
+ * Errors (with error bit) from: f_file_role_change().
+ * Errors (with error bit) from: fl_directory_list().
*/
#ifndef _di_fll_file_role_change_all_
extern f_return_status fll_file_role_change_all(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference, const f_number_unsigned_t depth_max);
f_array_length_t j = 0;
for (; i < 7; i++) {
+
for (j = 0; F_status_is_fine(status) && j < list[i]->used; j++) {
+
const f_string_length_t length = path_length + list[i]->array[j].used + 1;
char path_sub[length + 1];
f_macro_string_dynamics_t_delete_simple(listing.unknown);
for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) {
+
const f_string_length_t length = path_length + listing.directory.array[i].used + 1;
char path_sub[length + 1];
f_macro_string_dynamics_t_delete_simple(listing.directory);
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return f_file_mode_set(path, mode);
}
f_array_length_t j = 0;
for (; i < 7; i++) {
+
for (j = 0; F_status_is_fine(status) && j < list[i]->used; j++) {
+
const f_string_length_t length = path_length + list[i]->array[j].used + 1;
char path_sub[length + 1];
}
for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) {
+
const f_string_length_t length = path_length + listing.directory.array[i].used + 1;
char path_sub[length + 1];
f_macro_string_dynamics_t_delete_simple(listing.directory);
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return f_file_role_change(path, uid, gid, dereference);
}
memset(&matched, 0, sizeof(bool) * size);
for (; i < objects.used; i++) {
+
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
f_array_length_t k = 0;
for (; i < objects.used; i++) {
+
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
if (F_status_is_error(status)) return status;
}
for (k = 0; k < contents.array[i].used; k++) {
+
status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]);
if (F_status_is_error(status)) return status;
length_name = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_name, lengths[j]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
length_name = (contents.array[i].array[0].stop - contents.array[i].array[0].start) + 1;
for (k = 0; k < values[j]->used; k++) {
+
status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used);
if (F_status_is_error(status)) {
}
f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
}
else {
f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
if (contents.array[i].used > 1) {
status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[1], &map->value);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
if (F_status_is_error(status)) return status;
}
for (k = 1; k < contents.array[i].used; k++) {
+
status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[k], &map_multi->value.array[map_multi->value.used]);
if (F_status_is_error(status)) return status;
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
if (F_status_is_error(status)) return status;
if (contents.array[i].used > 1) {
for (k = 1; k < contents.array[i].used; k++) {
+
status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map->value);
if (F_status_is_error(status)) return status;
} // for
if (status == F_equal_to_not) continue;
status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
length_name = (contents.array[i].array[0].stop - contents.array[i].array[0].start) + 1;
for (k = 0; k < values[j]->used; k++) {
+
status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used);
if (F_status_is_error(status)) {
}
for (k = 1; k < contents.array[i].used; k++) {
+
status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &map_multi->value.array[map_multi->value.used]);
if (F_status_is_error(status)) return status;
} // for
length_name = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_name, lengths[j]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
status = fl_string_dynamic_partial_append_nulless(buffer, contents.array[i].array[0], &name);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
length_name = (contents.array[i].array[0].stop - contents.array[i].array[0].start) + 1;
for (k = 0; k < values[j]->used; k++) {
+
status = fl_string_compare_trim(buffer.string + contents.array[i].array[0].start, values[j]->array[k].name.string, length_name, values[j]->array[k].name.used);
if (F_status_is_error(status)) {
}
f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + 1);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
}
else {
f_macro_string_maps_t_resize(status, (*values[j]), values[j]->used + f_fss_default_allocation_step);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
if (contents.array[i].used > 1) {
status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[1], &map->value);
+
if (F_status_is_error(status)) {
f_macro_string_dynamic_t_delete_simple(name);
return status;
memset(&matched, 0, sizeof(bool) * size);
for (; i < objects.used; i++) {
+
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
matched[j] = F_true;
for (k = 0; k < contents.array[i].used; k++) {
+
status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]);
if (F_status_is_error(status)) return status;
} // for
f_array_length_t k = 0;
for (; i < objects.used; i++) {
+
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
if (F_status_is_error(status)) return status;
}
for (k = 0; k < contents.array[i].used; k++) {
+
status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], &values[j]->array[values[j]->used]);
if (F_status_is_error(status)) return status;
} // for
f_array_length_t k = 0;
for (; i < objects.used; i++) {
+
length_object = (objects.array[i].stop - objects.array[i].start) + 1;
for (j = 0; j < size; j++) {
+
status = fl_string_compare_trim(buffer.string + objects.array[i].start, names[j], length_object, lengths[j]);
if (F_status_is_error(status)) return status;
if (status == F_equal_to_not) continue;
for (k = 0; k < contents.array[i].used; k++) {
+
status = fl_string_dynamic_partial_mash_nulless(glue, glue_length, buffer, contents.array[i].array[k], values[j]);
if (F_status_is_error(status)) return status;
} // for
if (contents.used > 0) {
range.start = 0;
range.stop = contents.array[0].used - 1;
+
status = fl_fss_basic_content_write(contents.array[0], &range, destination);
if (F_status_is_error(status)) {
* F_number_overflow (with error bit) if the maximimum buffer size is reached.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
+ *
+ * Errors (with error bit) from: fl_fss_basic_content_read().
+ * Errors (with error bit) from: fl_fss_basic_object_read().
*/
#ifndef _di_fll_fss_basic_read_
extern f_return_status fll_fss_basic_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quoteds_t *quoted_objects);
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
+ *
+ * Errors (with error bit) from: fl_fss_basic_content_write().
+ * Errors (with error bit) from: fl_fss_basic_object_write().
+ * Errors (with error bit) from: fl_string_dynamic_size_increase().
*/
#ifndef _di_fll_fss_basic_write_
extern f_return_status fll_fss_basic_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer);
if (contents.used > 0) {
range.start = 0;
range.stop = contents.array[0].used - 1;
+
status = fl_fss_basic_list_content_write(contents.array[0], &range, buffer);
if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) {
* F_number_overflow (with error bit) if the maximimum buffer size is reached.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
+ *
+ * Errors (with error bit) from: fl_fss_basic_list_content_read().
+ * Errors (with error bit) from: fl_fss_basic_list_object_read().
*/
#ifndef _di_fll_fss_basic_list_read_
extern f_return_status fll_fss_basic_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents);
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
+ *
+ * Errors (with error bit) from: fl_fss_basic_list_content_write().
+ * Errors (with error bit) from: fl_fss_basic_list_object_write().
+ * Errors (with error bit) from: fl_string_dynamic_size_increase().
*/
#ifndef _di_fll_fss_basic_list_write_
extern f_return_status fll_fss_basic_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer);
if (status == F_none || status == F_none_stop || status == F_none_eos || status == F_none_eol) {
while (current < contents.used) {
+
range.start = 0;
range.stop = contents.array[current].used - 1;
status = fl_fss_extended_content_write(contents.array[current], 0, &range, buffer);
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_number_overflow (with error bit) if the maximimum buffer size is reached.
+ *
+ * Errors (with error bit) from: fl_fss_extended_content_read().
+ * Errors (with error bit) from: fl_fss_extended_object_read().
*/
#ifndef _di_fll_fss_extended_read_
extern f_return_status fll_fss_extended_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_objects_t *objects, f_fss_contents_t *contents, f_fss_quoteds_t *quoted_objects, f_fss_quotedss_t *quoted_contents);
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
+ *
+ * Errors (with error bit) from: fl_fss_extended_content_write().
+ * Errors (with error bit) from: fl_fss_extended_object_write().
+ * Errors (with error bit) from: fl_string_dynamic_size_increase().
*/
#ifndef _di_fll_fss_extended_write_
extern f_return_status fll_fss_extended_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer);
if (range->start >= range->stop || range->start >= buffer->used) {
if (status == FL_fss_found_object || status == FL_fss_found_object_content_not) {
+
// extended list requires content closure, so this could be an error.
return FL_fss_found_object_content_not;
}
if (status == FL_fss_found_object) {
found_data = F_true;
+
status = fl_fss_extended_list_content_read(buffer, range, nest);
break;
return status;
}
else if (status == F_data_not_eos || status == F_data_not_stop) {
+
// If at least some valid object was found, then return F_none equivalents.
if (nest->depth[0].used > initial_used) {
if (status == F_data_not_eos) return F_none_eos;
return status;
}
else if (status == F_unterminated_eos || status == F_unterminated_stop || status == F_unterminated_nest_eos || status == F_unterminated_nest_stop) {
+
// If at least some valid object was found, then return F_none equivalents.
if (nest->depth[0].used > initial_used) {
if (status == F_data_not_eos) return F_none_eos;
if (contents.used > 0) {
range.start = 0;
range.stop = contents.array[0].used - 1;
+
status = fl_fss_extended_list_content_write(contents.array[0], &range, buffer);
if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) {
* F_unterminated_stop (with error bit) if stop location is reached before a closing bracket is found (object was found).
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
* FL_fss_found_object_content_not on success and object was found but no content was found (start location is at end of object).
+ *
+ * Errors (with error bit) from: fl_fss_extended_list_content_read().
+ * Errors (with error bit) from: fl_fss_extended_list_object_read().
*/
#ifndef _di_fll_fss_extended_list_read_
extern f_return_status fll_fss_extended_list_read(f_string_dynamic_t *buffer, f_string_range_t *range, f_fss_nest_t *nest);
* F_memory_reallocation (with error bit) on reallocation error.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
+ *
+ * Errors (with error bit) from: fl_fss_extended_list_content_write().
+ * Errors (with error bit) from: fl_fss_extended_list_object_write().
+ * Errors (with error bit) from: fl_string_dynamic_size_increase().
*/
#ifndef _di_fll_fss_extended_list_write_
//extern f_return_status fll_fss_extended_list_write(const f_string_static_t object, const f_string_statics_t contents, f_string_dynamic_t *buffer);
#ifndef _di_fll_fss_status_is_error_
f_return_status fll_fss_status_is_error(const f_status_t code) {
+
if (fll_fss_status_is_fine(code) == F_true) {
return F_false;
}
#ifndef _di_fll_fss_status_is_warning_
f_return_status fll_fss_status_is_warning(const f_status_t code) {
+
switch (code) {
#ifndef _di_fll_fss_status_basic_
case F_data_not:
#ifndef _di_fll_fss_status_is_fine_
f_return_status fll_fss_status_is_fine(const f_status_t code) {
+
switch (code) {
#ifndef _di_fll_fss_status_booleans_
case F_false:
* F_data (with error bit) if not found.
* F_parameter (with error bit) if a parameter is invalid.
*
- * @see fll_status_from_string
+ * Errors (with error bit) from: f_conversion_character_is_decimal().
*/
#ifndef _di_fll_fss_status_from_string_
extern f_return_status fll_fss_status_from_string(const f_string_t string, f_status_t *code);
*
* @return
* F_none on success.
+ *
+ * Errors (with error bit) from: f_path_current().
+ * Errors (with error bit) from: fl_string_append().
+ * Errors (with error bit) from: fl_string_append_assure().
+ * Errors (with error bit) from: fl_string_dynamic_terminate_after().
*/
#ifndef _di_fll_path_canonical_
extern f_return_status fll_path_canonical(const f_string_t path, f_string_dynamic_t *canonical);
#ifndef _di_fll_program_print_help_option_other_
f_return_status fll_program_print_help_option_other(const f_color_context_t context, const f_string_t option_other, const f_string_t description) {
+
printf("%c ", f_string_eol[0]);
fl_color_print(f_type_output, context.set.standout, option_other);
const f_string_length_t start = destination->used;
for (f_string_length_t i = 0; i < additional.used; i++) {
+
length = strnlen(argv[additional.array[i]], f_console_length_size);
if (length > 0) {
const f_string_length_t start = destination->used;
for (f_string_length_t i = 0; i < additional.used; i++) {
+
length = strnlen(argv[additional.array[i]], f_console_length_size);
if (length > 0) {
const f_string_length_t start = destination->used;
for (f_string_length_t i = 0; i < additional.used; i++) {
+
length = strnlen(argv[additional.array[i]], f_console_length_size);
if (length > 0) {
f_string_dynamic_t ripped = f_string_dynamic_t_initialize;
for (f_string_length_t i = 0; i < additional.used; i++) {
+
length = strnlen(argv[additional.array[i]], f_console_length_size);
if (length > 0) {
* F_data_not if string is empty.
* F_data (with error bit) if not found.
* F_parameter (with error bit) if a parameter is invalid.
+ *
+ * Errors (with error bit) from: f_conversion_character_is_decimal().
*/
#ifndef _di_fll_status_from_string_
extern f_return_status fll_status_from_string(const f_string_t string, f_status_t *code);
#ifndef _di_byte_dump_print_help_
f_return_status byte_dump_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, byte_dump_name_long, byte_dump_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
f_number_unsigned_t number = 0;
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
+
if (F_status_is_error(status) || number < 1 || number >= 0xfb) {
fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '");
fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_width);
f_number_unsigned_t number = 0;
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
+
if (F_status_is_error(status) || number > f_number_t_size_unsigned) {
fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '");
fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_first);
f_number_unsigned_t number = 0;
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
+
if (F_status_is_error(status) || number < 0 || number > f_number_t_size_unsigned) {
fl_color_print(f_type_error, data->context.set.error, "ERROR: The parameter '");
fl_color_print(f_type_error, data->context.set.notable, "%s%s", f_console_symbol_long_enable, byte_dump_long_last);
f_status_t missing_files = F_none;
for (f_array_length_t counter = 0; counter < data->remaining.used; counter++) {
+
status = f_file_exists(arguments.argv[data->remaining.array[counter]]);
+
if (status == F_false || F_status_is_error(status)) {
if (missing_files == F_none) {
missing_files = status;
f_file_t file = f_file_t_initialize;
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);
memset(&invalid, 0, sizeof(uint8_t) * data.width);
while ((size = read(file.id, &byte, 1)) > 0) {
+
// Storing the next character is designated by width_utf == -1.
if (width_utf == -1) {
width_utf = f_macro_utf_byte_width_is(byte);
// UTF-8 character fragments must have a width of 1 (and ASCII characters can only be the first character in a sequence).
if (width_current == 1) {
+
// Grab the next UTF-8 character fragment if the entire sequence is not collected yet.
if (width_count < width_utf) continue;
}
fl_color_print(f_type_output, data.context.set.notable, " %s ", byte_dump_character_wall);
-
if (*offset > 0) {
if (data.parameters[byte_dump_parameter_classic].result == f_console_result_found) {
while (*offset > 0 && j < data.width) {
if (previous->bytes > 0) {
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_type_output, data.context.set.error, "%s", byte_dump_character_placeholder);
}
}
for (uint8_t i = 0; i < characters.used && j < data.width; i++, j++) {
+
output = f_macro_utf_character_t_to_char_1(characters.string[i]);
width_utf = f_macro_utf_byte_width_is(output);
#ifndef _di_byte_dump_print_file_error_
void byte_dump_print_file_error(const f_color_context_t context, const f_string_t function, const f_string_t file_name, const f_status_t status) {
+
if (status == F_false) {
fl_color_print(f_type_error, context.set.error, "ERROR: Failed to find file '");
fl_color_print(f_type_error, context.set.notable, "%s", file_name);
#ifndef _di_fake_print_help_
f_return_status fake_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fake_name_long, fake_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
f_string_length_t k = 0;
for (; i < data->parameters[fake_parameter_operation_build].locations.used; i++, locations_length++) {
+
operations[locations_length] = fake_operation_build;
locations[locations_length] = data->parameters[fake_parameter_operation_build].locations.array[i];
} // for
for (i = 0; i < data->parameters[fake_parameter_operation_clean].locations.used; i++) {
+
for (j = 0; j < locations_length; j++) {
+
if (data->parameters[fake_parameter_operation_clean].locations.array[i] < locations[j]) {
for (k = locations_length; k > j; k--) {
locations[k] = locations[k - 1];
} // for
for (i = 0; i < data->parameters[fake_parameter_operation_make].locations.used; i++) {
+
for (j = 0; j < locations_length; j++) {
+
if (data->parameters[fake_parameter_operation_make].locations.array[i] < locations[j]) {
for (k = locations_length; k > j; k--) {
locations[k] = locations[k - 1];
} // for
for (i = 0; i < data->parameters[fake_parameter_operation_skeleton].locations.used; i++) {
+
for (j = 0; j < locations_length; j++) {
+
if (data->parameters[fake_parameter_operation_skeleton].locations.array[i] < locations[j]) {
for (k = locations_length; k > j; k--) {
locations[k] = locations[k - 1];
}
f_macro_string_dynamic_t_new(*status, path_source, source.used);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "f_macro_string_dynamic_t_new", F_true);
path_source.used = source.used;
*status = fl_string_dynamic_append_nulless(files.array[i], &path_source);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(&path_source);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
destination_file.used = 0;
*status = fl_string_dynamic_append_nulless(destination, &destination_file);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
*status = f_file_name_base(path_source.string, path_source.used, &destination_file);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "f_file_name_base", F_true);
break;
if (data.define.used) {
for (f_array_length_t i = 0; i < data.define.used; i++) {
+
*status = fl_string_dynamic_mash(" ", 1, data.define.array[i], &defines);
if (F_status_is_error(*status)) {
}
*status = fl_string_dynamic_terminate_after(&defines);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
if (path.used == 0) return F_none;
f_status_t status = f_file_name_base(path.string, path.used, name);
+
if (F_status_is_error(status)) {
fake_print_error(data, F_status_set_fine(status), "f_file_name_base", F_true);
return status;
} // for
status = fl_string_dynamic_terminate_after(name);
+
if (F_status_is_error(status)) {
fake_print_error(data, F_status_set_fine(status), "fl_string_dynamic_terminate_after", F_true);
return status;
f_string_length_t source_length = 0;
for (f_array_length_t i = 0; i < data_build.setting.build_sources_library.used; i++) {
+
source_length = path_sources->used + data_build.setting.build_sources_library.array[i].used;
char source[source_length + 1];
source_path.used = 0;
*status = fake_build_get_file_name_without_extension(data, data_build.setting.build_sources_library.array[i], &file_name);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
break;
if (source_path.used) {
*status = fl_string_dynamic_prepend(data.path_build_objects, &source_path);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true);
break;
}
*status = fl_string_append_assure(f_path_separator, f_path_separator_length, &source_path);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_append_assure", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(&source_path);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
};
for (uint8_t i = 0; i < 1; i++) {
+
if (settings[i]->used == 0) {
fprintf(f_type_error, "%c", f_string_eol[0]);
fl_color_print(f_type_error, data.context.set.error, "ERROR: The setting '");
found = F_false;
for (j = 0; j < setting->modes.used; j++) {
+
if (fl_string_dynamic_compare_trim(modes->array[i], setting->modes.array[j]) == F_equal_to) {
found = F_true;
break;
memset(&setting_mode_lengths, 0, sizeof(f_string_length_t) * fake_build_setting_total);
for (j = 0; j < fake_build_setting_total; j++) {
+
setting_mode_lengths[j] = settings_length[j] + 1 + modes->array[i].used;
f_macro_string_dynamic_t_new(*status, settings_mode_name_dynamic[j], setting_mode_lengths[j]);
+
if (F_status_is_error(*status)) {
function = "f_macro_string_dynamic_t_new";
break;
for (uint8_t i = 0; i < fake_build_stage_total; i++) {
*status = fl_string_dynamic_append_nulless(data.path_build_stage, values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
if (data.process.used) {
*status = fl_string_append(data.process.string, data.process.used, values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
*status = fl_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
*status = fl_string_append_nulless(names[i], lengths[i], values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append_nulless", F_true);
break;
}
*status = fl_string_append(fake_build_stage_separate, fake_build_stage_separate_length, values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
*status = fl_string_dynamic_append(settings_file_base, values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_append", F_true);
break;
}
*status = fl_string_append(fake_build_stage_built, fake_build_stage_built_length, values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_append", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(values[i]);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
source[source_length] = 0;
*status = fake_build_get_file_name_without_extension(data, data_build.setting.build_sources_library.array[i], &file_name);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fake_build_get_file_name_without_extension", F_true);
break;
}
*status = f_file_name_directory(data_build.setting.build_sources_library.array[i].string, data_build.setting.build_sources_library.array[i].used, &destination_path);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "f_file_name_directory", F_true);
break;
if (destination_path.used) {
*status = fl_string_dynamic_prepend(data.path_build_objects, &destination_path);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_prepend", F_true);
break;
}
*status = fl_string_append_assure(f_path_separator, f_path_separator_length, &destination_path);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_append_assure", F_true);
break;
}
*status = fl_string_dynamic_terminate_after(&destination_path);
+
if (F_status_is_error(*status)) {
fake_print_error(data, F_status_set_fine(*status), "fl_string_dynamic_terminate_after", F_true);
break;
};
for (uint8_t j = 0; j < 5; j++) {
+
*status = fll_execute_arguments_add(values[j], lengths[j], &arguments);
if (F_status_is_error(*status)) break;
} // for
}
f_macro_string_dynamic_t_new((status), (*buffer), size_file);
+
if (F_status_is_error(status)) {
fake_print_error_file(data, F_status_set_fine(status), name_function, path_file, "allocate buffer size for", F_true, F_true);
};
for (uint8_t i = 0; i < 3; i++) {
+
if (data->parameters[parameters_id[i]].result == f_console_result_found) {
fake_print_error_parameter_missing_value(*data, parameters_name[i]);
return F_status_set_error(F_parameter);
};
for (uint8_t i = 0; i < 4; i++) {
+
if (data->parameters[parameters_id[i]].result == f_console_result_found) {
fake_print_error_parameter_missing_value(*data, parameters_name[i]);
return F_status_set_error(F_parameter);
f_string_length_t width_max = 0;
for (; i < data->define.used; i++) {
+
for (j = 0; j < data->define.array[i].used; j++) {
+
width_max = data->define.array[i].used - j;
status = f_utf_is_word(data->define.array[i].string + j, width_max, F_false);
f_string_length_t width_max = 0;
for (; i < data->mode.used; i++) {
+
for (j = 0; j < data->mode.array[i].used; j++) {
+
width_max = data->mode.array[i].used - j;
status = f_utf_is_word_dash_plus(data->mode.array[i].string + j, width_max, F_false);
f_string_dynamic_t combined = f_string_dynamic_t_initialize;
for (f_array_length_t i = 0; i < define.used; i++) {
+
status_validate = fake_make_operate_validate_define_name(define.array[i].name);
if (status_validate) {
f_array_length_t j = 0;
for (; i < 2; i ++) {
+
for (j = 0; j < source[i]->used; j++) {
if (destination[i]->used >= destination[i]->size) {
used_arguments = arguments->used;
*status = fl_iki_read(&data_make->buffer, &range, &iki_variable, &iki_vocabulary, &iki_content);
+
if (F_status_is_error(*status)) {
fake_print_message(data, F_status_set_fine(*status), "fl_iki_read", F_true, data_make->print);
break;
if (arguments->used >= arguments->size) {
*status = fl_string_dynamics_size_increase(f_memory_default_allocation_step, arguments);
+
if (F_status_is_error(*status)) {
fake_print_message(data, F_status_set_fine(*status), "fl_string_lengths_size_increase", F_true, data_make->print);
return;
range.stop = iki_variable.array[0].start - 1;
*status = fl_string_dynamic_partial_append_nulless(data_make->buffer, range, &arguments->array[arguments->used]);
+
if (F_status_is_error(*status)) {
fake_print_message(data, F_status_set_fine(*status), "fl_string_dynamic_partial_append_nulless", F_true, data_make->print);
break;
if (unmatched) {
*status = fake_make_operate_expand_build(data, quoteds.array[i], iki_content.array[j], data_make, arguments);
+
if (F_status_is_error(*status)) {
fake_print_message(data, F_status_set_fine(*status), "fake_make_operate_expand_build", F_true, data_make->print);
break;
}
else if (define_is && data_make->setting_make.load_build) {
*status = fake_make_operate_expand_environment(data, quoteds.array[i], iki_content.array[j], data_make, arguments);
+
if (F_status_is_error(*status)) {
fake_print_message(data, F_status_set_fine(*status), "fake_make_operate_expand_environment", F_true, data_make->print);
break;
}
else {
*status = fl_string_dynamic_partial_append_nulless(data_make->buffer, content.array[i], &arguments->array[arguments->used]);
+
if (F_status_is_error(*status)) {
fake_print_message(data, F_status_set_fine(*status), "fl_string_append_nulless", F_true, data_make->print);
break;
// if iki variable did not match (results in empty string) or iki variable is inside quotes, then increment.
if (used_arguments == arguments->used) {
*status = fl_string_dynamic_terminate_after(&arguments->array[arguments->used]);
+
if (F_status_is_error(*status)) {
fake_print_message(data, F_status_set_fine(*status), "fl_string_terminate_after", F_true, data_make->print);
break;
}
for (j = 0; j < fake_make_operation_total; j++) {
+
if (fl_string_dynamic_partial_compare(operations_name[j], data_make->buffer, operations_range[j], section->objects.array[i]) == F_equal_to) {
operation = operations_type[j];
operation_name = &operations_name[j];
f_status_t status_file = F_none;
for (f_array_length_t i = 1; i < arguments.used; i++) {
+
status_file = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(status_file)) {
uint8_t mode_replace = 0;
*status = fake_make_get_id_mode(data, data_make->print, arguments.array[2], &mode_rule, &mode_replace);
+
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
return;
}
*status = f_file_mode_to_mode(mode_rule, &mode_match);
+
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
fake_print_message(data, F_status_set_fine(*status), "f_file_mode_to_mode", F_true, data_make->print);
for (f_array_length_t i = 3; i < arguments.used; i++, mode_file = 0) {
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
+
if (F_status_is_error(*status)) {
*operation_if = fake_make_operation_if_type_false_always_next;
fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "get mode of", F_true, F_true, data_make->print);
f_array_length_t j = 0;
for (; i < arguments.used; i++) {
+
for (j = i + 1; j < arguments.used; j++) {
if (fl_string_dynamic_compare(arguments.array[i], arguments.array[j]) == F_equal_to) {
mode = 0;
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
+
if (F_status_is_error(*status)) {
fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
break;
}
*status = f_file_mode_determine(mode_file, mode_rule, replace, f_macro_file_type_is_directory(mode_file), &mode);
+
if (F_status_is_error(*status)) {
fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_determine", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
break;
}
*status = f_file_mode_set(arguments.array[i].string, mode);
+
if (F_status_is_error(*status)) {
fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_set", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
break;
mode = 0;
*status = f_file_mode_read(arguments.array[i].string, &mode_file);
+
if (F_status_is_error(*status)) {
fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_read", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
break;
}
*status = f_file_mode_determine(mode_file, mode_rule, replace, f_macro_file_type_is_directory(mode_file), &mode);
+
if (F_status_is_error(*status)) {
fake_print_message_file(data, F_status_set_fine(*status), "f_file_mode_determine", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
break;
}
*status = fll_file_mode_set_all(arguments.array[i].string, mode, fake_make_operation_recursion_depth_max);
+
if (F_status_is_error(*status)) {
fake_print_message_file(data, F_status_set_fine(*status), "fll_file_mode_set_all", arguments.array[i].string, "change mode of", F_true, F_true, data_make->print);
break;
f_status_t status_file = F_none;
for (f_array_length_t i = 1; i < arguments.used; i++) {
+
status_file = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(status_file)) {
f_status_t status_file = F_none;
for (f_array_length_t i = 1; i < arguments.used; i++) {
+
status_file = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(status_file)) {
data_make->path.stack.used--;
*status = f_path_change(data_make->path.stack.array[data_make->path.stack.used - 1].string);
+
if (F_status_is_error(*status)) {
fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", data_make->path.stack.array[data_make->path.stack.used - 1].string, data_make->print);
return;
if (operation == fake_make_operation_type_top) {
*status = f_path_change_at(data_make->path.top);
+
if (F_status_is_error(*status)) {
fake_print_message_section_operation_path_stack_max(data, F_status_set_fine(*status), "f_path_change", arguments.array[0].string, data_make->print);
return;
}
status = f_environment_get(data_make->setting_build.environment.array[i].string, &data_make->environment.values.array[data_make->environment.values.used]);
+
if (F_status_is_error(status)) {
fake_print_message(data, F_status_set_fine(status), "f_environment_get", F_true, data_make->print);
return status;
if (status == F_exist_not) continue;
fl_string_dynamic_append(data_make->setting_build.environment.array[i], &data_make->environment.names.array[data_make->environment.names.used]);
+
if (F_status_is_error(status)) {
fake_print_message(data, F_status_set_fine(status), "f_environment_get", F_true, data_make->print);
return status;
f_string_dynamic_t number = f_string_dynamic_t_initialize;
status2 = f_conversion_number_signed_to_string(WEXITSTATUS(return_code), 10, &number);
+
if (F_status_is_error(status2)) {
*status = status2;
if (operation == fake_make_operation_type_clone) {
if (arguments.used > 1) {
for (f_array_length_t i = 0; i < arguments.used; i++) {
+
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
} // for
for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
+
if (f_file_exists(arguments.array[i].string) != F_true) {
if (data.verbosity != fake_verbosity_quiet && data_make->print.to) {
printf("%c", f_string_eol[0]);
if (operation == fake_make_operation_type_copy) {
if (arguments.used > 1) {
for (f_array_length_t i = 0; i < arguments.used; i++) {
+
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
} // for
for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
+
if (f_file_exists(arguments.array[i].string) != F_true) {
if (data.verbosity != fake_verbosity_quiet && data_make->print.to) {
printf("%c", f_string_eol[0]);
if (operation == fake_make_operation_type_delete || operation == fake_make_operation_type_deletes) {
if (arguments.used) {
for (f_array_length_t i = 0; i < arguments.used; i++) {
+
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
f_string_length_t i = 0;
for (; i < 14; i++) {
+
if (fl_string_dynamic_compare_string(if_type_strings[i], arguments.array[0], if_type_lengths[i]) == F_equal_to) {
*operation_if = if_type_codes[i];
break;
uint8_t type_file = 0;
for (i = 1; i < arguments.used; i++) {
+
if (fl_string_dynamic_compare_string(fake_make_operation_argument_if_is_for, arguments.array[i], fake_make_operation_argument_if_is_for_length) == F_equal_to) {
i++;
break;
if (i < arguments.used) {
for (f_status_t status_file = F_none; i < arguments.used; i++) {
+
status_file = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(status_file)) {
// @fixme there needs to handle converting numbers with decimals (like 1.01), perhaps operate on them as strings or provide a special processor.
for (i = 1; i < arguments.used; i++, status_number = F_none) {
+
if (arguments.array[i].used) {
range.start = 0;
range.stop = arguments.array[i].used - 1;
if (operation == fake_make_operation_type_move) {
if (arguments.used > 1) {
for (f_array_length_t i = 0; i < arguments.used; i++) {
+
*status = fake_make_assure_inside_project(data, arguments.array[i], data_make);
if (F_status_is_error(*status)) {
} // for
for (f_array_length_t i = 0; i < arguments.used - 1; i++) {
+
if (f_file_exists(arguments.array[i].string) != F_true) {
if (data.verbosity != fake_verbosity_quiet && data_make->print.to) {
printf("%c", f_string_eol[0]);
f_array_length_t id_section = 0;
for (; id_section < data_make->fakefile.used; id_section++) {
+
if (fl_string_dynamic_partial_compare_string(arguments.array[0].string, data_make->buffer, arguments.array[0].used, data_make->fakefile.array[id_section].name) == F_equal_to) {
break;
}
}
else {
for (f_array_length_t i = 0; i < section_stack->used; i++) {
+
if (section_stack->array[i] == id_section) {
printf("%c", f_string_eol[0]);
fl_color_print(data_make->print.to, data_make->print.context, "%s: The section operation '", data_make->print.prefix);
}
for (f_string_length_t i = 0; i < name.used; i++) {
+
if (!(isalnum(name.string[i]) || name.string[i] == '_')) {
return F_false;
}
if (path.used == 0) return F_none;
status = f_directory_exists(path.string);
+
if (status == F_true) {
if (data.verbosity == fake_verbosity_verbose) {
printf("Directory '%s' already exists.%c", path.string, f_string_eol[0]);
if (path.used == 0) return F_none;
status = f_file_is(path.string, f_file_type_regular, F_false);
+
if (status == F_true) {
if (data.verbosity == fake_verbosity_verbose) {
printf("File '%s' already exists.%c", path.string, f_string_eol[0]);
file.size_write = content.used;
status = f_file_open(path.string, 0, &file);
+
if (F_status_is_error(status)) {
fake_print_error_file(data, F_status_set_fine(status), "f_file_open", path.string, "pre-populate", F_true, F_true);
}
status = f_file_write(file, content, 0);
+
if (F_status_is_error(status)) {
fake_print_error_file(data, F_status_set_fine(status), "f_file_write", path.string, "pre-populate", F_true, F_true);
#ifndef _di_firewall_print_help_
f_return_status firewall_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, firewall_name_long, firewall_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
f_string_length_t counter = 0;
for (; counter < data->remaining.used; counter++) {
+
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) {
local.is_lock = F_false;
while (i < local.chain_contents.used) {
+
input.start = local.chain_contents.array[i].array[0].start;
input.stop = local.chain_contents.array[i].array[0].stop;
local.is_lock = F_false;
for (; j < local.chain_contents.used; j++) {
+
input.start = local.chain_contents.array[j].array[0].start;
input.stop = local.chain_contents.array[j].array[0].stop;
local.is_lock = F_false;
while (i < local.chain_contents.used) {
+
input.start = local.chain_contents.array[i].array[0].start;
input.stop = local.chain_contents.array[i].array[0].stop;
}
for (r = repeat; r > 0; r--) {
+
// first add the program name
f_macro_string_dynamics_t_delete_simple(arguments);
f_macro_string_dynamics_new(status, arguments, firewall_default_allocation_step);
}
for (; subcounter < local.rule_contents.array[i].used; subcounter++) {
+
length = firewall_macro_structure_size(local.rule_contents.array[i], subcounter);
if (length > 0) {
// the ip_list file contains objects and no content, all objects are what matter an nothing else
for (; buffer_counter < basic_objects.used; buffer_counter++) {
+
ip_length = firewall_macro_structure_size(basic_objects, buffer_counter);
f_macro_string_dynamic_t_new(status, ip_argument, ip_length);
// copy the string character by character, ignoring placeholders.
while (j <= local->chain_objects.array[i].stop) {
+
if (local->buffer.string[j] == f_fss_delimit_placeholder) {
j++;
continue;
#ifndef _di_fss_basic_list_read_print_help_
f_return_status fss_basic_list_read_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_basic_list_read_name_long, fss_basic_list_read_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
if (data.parameters[fss_basic_list_read_parameter_at].result == f_console_result_additional) {
for (; position_at < data.parameters[fss_basic_list_read_parameter_at].additional.used; position_at++) {
+
if (data.parameters[fss_basic_list_read_parameter_at].additional.array[position_at] < position_depth) {
continue;
}
if (data.parameters[fss_basic_list_read_parameter_name].result == f_console_result_additional) {
for (; position_name < data.parameters[fss_basic_list_read_parameter_name].additional.used; position_name++) {
+
if (data.parameters[fss_basic_list_read_parameter_name].additional.array[position_name] < position_depth) {
continue;
}
} // for
for (f_array_length_t i = 0; i < depths->used; i++) {
+
for (f_array_length_t j = i + 1; j < depths->used; j++) {
+
if (depths->array[i].depth == depths->array[j].depth) {
fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '");
fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth);
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range);
+
if (F_status_is_error(status)) {
fss_basic_list_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_basic_list_read_long_select, arguments.argv[index], F_status_set_fine(status));
return status;
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range);
+
if (F_status_is_error(status)) {
fss_basic_list_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_basic_list_read_long_line, arguments.argv[index], F_status_set_fine(status));
return status;
if (data->parameters[fss_basic_list_read_parameter_trim].result == f_console_result_found) {
for (f_string_length_t i = 0; i < data->objects.used; i++) {
+
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
if (name_length == depths.array[0].value_name.used) {
f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
+
if (names[i]) {
if (at == depths.array[0].value_at) {
print_object(f_type_output, data->buffer, data->objects.array[i]);
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[0]) {
fprintf(f_type_output, "%c", f_string_eol[0]);
break;
f_string_length_t j = 0;
for (; i < data->contents.used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (data->contents.array[i].used == 0) {
if (include_empty) {
if (line_current != line) {
for (; j <= data->contents.array[i].array[0].stop; j++) {
+
if (data->buffer.string[j] == f_string_eol[0]) {
line_current++;
}
for (f_string_length_t i = 0; i < data->contents.used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (data->contents.array[i].used == 0) {
if (include_empty) {
#ifndef _di_fss_basic_list_write_print_help_
f_return_status fss_basic_list_write_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_basic_list_write_name_long, fss_basic_list_write_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
#ifndef _di_fss_basic_read_print_help_
f_return_status fss_basic_read_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_basic_read_name_long, fss_basic_read_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
}
status = fss_basic_read_main_process_file(arguments, data, "-", depths);
+
if (F_status_is_error(status)) {
macro_fss_basic_read_depths_t_delete_simple(depths);
fss_basic_read_delete_data(data);
}
status = fss_basic_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths);
+
if (F_status_is_error(status)) {
macro_fss_basic_read_depths_t_delete_simple(depths);
fss_basic_read_delete_data(data);
}
macro_fss_basic_read_depths_t_new(status, (*depths), depth_size);
+
if (F_status_is_error(status)) {
fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
return status;
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[position_depth]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth, range);
+
if (F_status_is_error(status)) {
fss_basic_read_print_number_argument_error(data.context, "fl_conversion_string_to_number_unsigned", fss_basic_read_long_depth, arguments.argv[position_depth], F_status_set_fine(status));
return status;
if (data.parameters[fss_basic_read_parameter_at].result == f_console_result_additional) {
for (; position_at < data.parameters[fss_basic_read_parameter_at].additional.used; position_at++) {
+
if (data.parameters[fss_basic_read_parameter_at].additional.array[position_at] < position_depth) {
continue;
}
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[depths->array[i].index_at]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at, range);
+
if (F_status_is_error(status)) {
fss_basic_read_print_number_argument_error(data.context, "fl_conversion_string_to_number_unsigned", fss_basic_read_long_at, arguments.argv[depths->array[i].index_at], F_status_set_fine(status));
return status;
if (data.parameters[fss_basic_read_parameter_name].result == f_console_result_additional) {
for (; position_name < data.parameters[fss_basic_read_parameter_name].additional.used; position_name++) {
+
if (data.parameters[fss_basic_read_parameter_name].additional.array[position_name] < position_depth) {
continue;
}
} // for
for (f_array_length_t i = 0; i < depths->used; i++) {
+
for (f_array_length_t j = i + 1; j < depths->used; j++) {
+
if (depths->array[i].depth == depths->array[j].depth) {
fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '");
fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth);
return F_status_set_error(status);
}
else if (status == F_data_not_stop || status == F_data_not_eos) {
+
// Clear buffers, then attempt the next file.
f_macro_fss_contents_t_delete_simple(data->contents);
f_macro_fss_objects_t_delete_simple(data->objects);
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range);
+
if (F_status_is_error(status)) {
fss_basic_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_basic_read_long_select, arguments.argv[index], F_status_set_fine(status));
return status;
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range);
+
if (F_status_is_error(status)) {
fss_basic_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_basic_read_long_line, arguments.argv[index], F_status_set_fine(status));
return status;
if (data->parameters[fss_basic_read_parameter_trim].result == f_console_result_found) {
for (f_string_length_t i = 0; i < data->objects.used; i++) {
+
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
if (name_length == depths.array[0].value_name.used) {
}
else {
for (f_string_length_t i = 0; i < data->objects.used; i++) {
+
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
if (name_length == depths.array[0].value_name.used) {
f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
+
if (names[i]) {
if (at == depths.array[0].value_at) {
print_object(f_type_output, data->buffer, data->objects.array[i]);
f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
+
if (names[i]) {
if (at == depths.array[0].value_at) {
if (data->parameters[fss_basic_read_parameter_total].result == f_console_result_found) {
f_string_length_t total = 0;
for (f_string_length_t i = 0; i < data->objects.used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (data->contents.array[i].used == 0 && !include_empty) {
continue;
f_string_length_t line_current = 0;
for (f_string_length_t i = 0; i < data->contents.used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (data->contents.array[i].used == 0) {
if (include_empty) {
}
for (f_string_length_t i = 0; i < data->contents.used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (data->contents.array[i].used == 0) {
if (include_empty) {
#ifndef _di_fss_basic_write_print_help_
f_return_status fss_basic_write_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_basic_write_name_long, fss_basic_write_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
const f_console_parameters_t parameters = { data->parameters, fss_basic_write_total_parameters };
status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context);
+
if (F_status_is_error(status)) {
fss_basic_write_delete_data(data);
return status;
#ifndef _di_fss_extended_list_read_print_help_
f_return_status fss_extended_list_read_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_extended_list_read_name_long, fss_extended_list_read_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
f_string_length_t original_size = data->quantity.total;
status = fss_extended_list_read_main_preprocess_depth(arguments, *data, &depths);
+
if (F_status_is_error(status)) {
macro_fss_extended_list_read_depths_t_delete_simple(depths);
fss_extended_list_read_delete_data(data);
file.id = f_type_descriptor_input;
status = f_file_read(file, &data->buffer);
+
if (F_status_is_error(status)) {
fss_extended_list_read_print_file_error(data->context, "f_file_read", "-", F_status_set_fine(status));
}
status = fss_extended_list_read_main_process_file(arguments, data, "-", depths);
+
if (F_status_is_error(status)) {
macro_fss_extended_list_read_depths_t_delete_simple(depths);
fss_extended_list_read_delete_data(data);
}
macro_fss_extended_list_read_depths_t_new(status, (*depths), depth_size);
+
if (F_status_is_error(status)) {
fl_color_print_line(f_type_error, data.context.set.error, "CRITICAL ERROR: Unable to allocate memory.");
return status;
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[position_depth]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth, range);
+
if (F_status_is_error(status)) {
fss_extended_list_read_print_number_argument_error(data.context, "fl_conversion_string_to_number_unsigned", fss_extended_list_read_long_depth, arguments.argv[position_depth], F_status_set_fine(status));
return status;
if (data.parameters[fss_extended_list_read_parameter_at].result == f_console_result_additional) {
for (; position_at < data.parameters[fss_extended_list_read_parameter_at].additional.used; position_at++) {
+
if (data.parameters[fss_extended_list_read_parameter_at].additional.array[position_at] < position_depth) {
continue;
}
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[depths->array[i].index_at]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at, range);
+
if (F_status_is_error(status)) {
fss_extended_list_read_print_number_argument_error(data.context, "fl_conversion_string_to_number_unsigned", fss_extended_list_read_long_at, arguments.argv[depths->array[i].index_at], F_status_set_fine(status));
return status;
if (data.parameters[fss_extended_list_read_parameter_name].result == f_console_result_additional) {
for (; position_name < data.parameters[fss_extended_list_read_parameter_name].additional.used; position_name++) {
+
if (data.parameters[fss_extended_list_read_parameter_name].additional.array[position_name] < position_depth) {
continue;
}
} // for
for (f_array_length_t i = 0; i < depths->used; i++) {
+
for (f_array_length_t j = i + 1; j < depths->used; j++) {
+
if (depths->array[i].depth == depths->array[j].depth) {
fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '");
fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth);
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range);
+
if (F_status_is_error(status)) {
fss_extended_list_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_extended_list_read_long_select, arguments.argv[index], F_status_set_fine(status));
return status;
f_number_unsigned_t number = 0;
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
+
if (F_status_is_error(status)) {
fss_extended_list_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_extended_list_read_long_line, arguments.argv[index], F_status_set_fine(status));
return status;
}
for (f_array_length_t i = 0; i < items->used; i++) {
+
if (names[i]) {
print_object(f_type_output, data->buffer, items->array[i].object);
fprintf(f_type_output, "%c", f_string_eol[0]);
f_array_length_t i = 0;
for (; i < items->used; i++) {
+
if (names[i]) {
if (at == depth_setting.value_at) {
if (data->parameters[fss_extended_list_read_parameter_total].result == f_console_result_found) {
if (line == 0) {
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[0]) {
fprintf(f_type_output, "%c", f_string_eol[0]);
break;
i++;
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[0]) {
fprintf(f_type_output, "%c", f_string_eol[0]);
break;
f_string_length_t j = 0;
for (; i < items->used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (items->array[i].content.used == 0) {
if (include_empty) {
}
for (f_string_length_t i = 0; i < items->used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (items->array[i].content.used == 0) {
if (include_empty) {
#ifndef _di_fss_extended_read_print_help_
f_return_status fss_extended_read_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_extended_read_name_long, fss_extended_read_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
f_string_length_t 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_t_delete_simple(depths);
fss_extended_read_delete_data(data);
file.id = f_type_descriptor_input;
status = f_file_read(file, &data->buffer);
+
if (F_status_is_error(status)) {
fss_extended_read_print_file_error(data->context, "f_file_read", "-", F_status_set_fine(status));
}
status = fss_extended_read_main_process_file(arguments, data, "-", depths);
+
if (F_status_is_error(status)) {
macro_fss_extended_read_depths_t_delete_simple(depths);
fss_extended_read_delete_data(data);
}
status = fss_extended_read_main_process_file(arguments, data, arguments.argv[data->remaining.array[counter]], depths);
+
if (F_status_is_error(status)) {
macro_fss_extended_read_depths_t_delete_simple(depths);
fss_extended_read_delete_data(data);
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[position_depth]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[position_depth], &depths->array[i].depth, range);
+
if (F_status_is_error(status)) {
fss_extended_read_print_number_argument_error(data.context, "fl_conversion_string_to_number_unsigned", fss_extended_read_long_depth, arguments.argv[position_depth], F_status_set_fine(status));
return status;
if (data.parameters[fss_extended_read_parameter_at].result == f_console_result_additional) {
for (; position_at < data.parameters[fss_extended_read_parameter_at].additional.used; position_at++) {
+
if (data.parameters[fss_extended_read_parameter_at].additional.array[position_at] < position_depth) {
continue;
}
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[depths->array[i].index_at]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[depths->array[i].index_at], &depths->array[i].value_at, range);
+
if (F_status_is_error(status)) {
fss_extended_read_print_number_argument_error(data.context, "fl_conversion_string_to_number_unsigned", fss_extended_read_long_at, arguments.argv[depths->array[i].index_at], F_status_set_fine(status));
return status;
if (data.parameters[fss_extended_read_parameter_name].result == f_console_result_additional) {
for (; position_name < data.parameters[fss_extended_read_parameter_name].additional.used; position_name++) {
+
if (data.parameters[fss_extended_read_parameter_name].additional.array[position_name] < position_depth) {
continue;
}
} // for
for (f_array_length_t i = 0; i < depths->used; i++) {
+
for (f_array_length_t j = i + 1; j < depths->used; j++) {
+
if (depths->array[i].depth == depths->array[j].depth) {
fl_color_print(f_type_error, data.context.set.error, "ERROR: The value '");
fl_color_print(f_type_error, data.context.set.notable, "%llu", depths->array[i].depth);
return F_status_set_error(status);
}
else if (status == F_data_not_stop || status == F_data_not_eos) {
+
// Clear buffers, then attempt the next file.
f_macro_fss_contents_t_delete_simple(data->contents);
f_macro_fss_objects_t_delete_simple(data->objects);
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &select, range);
+
if (F_status_is_error(status)) {
fss_extended_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_extended_read_long_select, arguments.argv[index], F_status_set_fine(status));
return status;
const f_string_range_t range = f_macro_string_range_t_initialize(strlen(arguments.argv[index]));
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &line, range);
+
if (F_status_is_error(status)) {
fss_extended_read_print_number_argument_error(data->context, "fl_conversion_string_to_number_unsigned", fss_extended_read_long_line, arguments.argv[index], F_status_set_fine(status));
return status;
if (data->parameters[fss_extended_read_parameter_trim].result == f_console_result_found) {
for (f_string_length_t i = 0; i < data->objects.used; i++) {
+
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
if (name_length == depths.array[0].value_name.used) {
}
else {
for (f_string_length_t i = 0; i < data->objects.used; i++) {
+
name_length = (data->objects.array[i].stop - data->objects.array[i].start) + 1;
if (name_length == depths.array[0].value_name.used) {
f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
+
if (names[i]) {
if (at == depths.array[0].value_at) {
print_object(f_type_output, data->buffer, data->objects.array[i]);
f_array_length_t i = 0;
for (; i < data->objects.used; i++) {
+
if (names[i]) {
if (at == depths.array[0].value_at) {
if (data->parameters[fss_extended_read_parameter_total].result == f_console_result_found) {
f_string_length_t j = 0;
for (; i < data->contents.used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (data->contents.array[i].used == 0) {
if (include_empty) {
f_string_length_t j = 0;
for (; i < data->contents.used; i++) {
- if (!names[i]) {
- continue;
- }
+ if (!names[i]) continue;
if (data->contents.array[i].used == 0) {
if (include_empty && select == 0) {
#ifndef _di_fss_extended_write_print_help_
f_return_status fss_extended_write_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_extended_write_name_long, fss_extended_write_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
const f_console_parameters_t parameters = { data->parameters, fss_extended_write_total_parameters };
status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context);
+
if (F_status_is_error(status)) {
fss_extended_write_delete_data(data);
return status;
range.stop = input.used - 1;
status = fl_fss_extended_object_write(input, 0, &range, &buffer);
+
if (F_status_is_error(status) || status == F_data_not_stop || status == F_data_not_eos) {
f_macro_string_dynamic_t_delete_simple(buffer);
fss_extended_write_delete_data(data);
#ifndef _di_fss_status_code_print_help_
f_return_status fss_status_code_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, fss_status_code_name_long, fss_status_code_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
if (data->remaining.used > 0) {
for (f_array_length_t i = 0; i < data->remaining.used; i++) {
+
status2 = fss_status_code_process_check(*data, arguments.argv[data->remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
if (data->remaining.used > 0) {
for (f_array_length_t i = 0; i < data->remaining.used; i++) {
+
status2 = fss_status_code_process_number(*data, arguments.argv[data->remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
#ifndef _di_fss_status_code_process_check_
f_return_status fss_status_code_process_check(const fss_status_code_data_t data, const f_string_t value) {
f_number_unsigned_t number = 0;
- f_status_t status = fss_status_code_convert_number(data, value, &number);
- if (F_status_is_error(status)) {
- return status;
- }
+ f_status_t status = fss_status_code_convert_number(data, value, &number);
+ if (F_status_is_error(status)) return status;
if (data.parameters[fss_status_code_parameter_is_error].result == f_console_result_found) {
if (F_status_is_error(number)) {
#ifndef _di_fss_status_code_process_normal_
f_return_status fss_status_code_process_normal(const fss_status_code_data_t data, const f_string_t value) {
f_number_unsigned_t number = 0;
- f_status_t status = fss_status_code_convert_number(data, value, &number);
- if (F_status_is_error(status)) {
- return status;
- }
+ f_status_t status = fss_status_code_convert_number(data, value, &number);
+ if (F_status_is_error(status)) return status;
const f_status_t code = (f_status_t) number;
f_string_t string = 0;
#ifndef _di_iki_read_print_help_
f_return_status iki_read_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, iki_read_name_long, iki_read_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
const f_console_parameters_t parameters = { data->parameters, iki_read_total_parameters };
status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context);
+
if (F_status_is_error(status)) {
iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "fll_program_parameter_process", F_true);
f_number_unsigned_t number = 0;
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
+
if (F_status_is_error(status)) {
iki_read_print_error_number_argument(data->context, data->verbosity, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", iki_read_long_line, arguments.argv[index]);
f_number_unsigned_t number = 0;
status = fl_conversion_string_to_number_unsigned(arguments.argv[index], &number, range);
+
if (F_status_is_error(status)) {
iki_read_print_error_number_argument(data->context, data->verbosity, F_status_set_fine(status), "fl_conversion_string_to_number_unsigned", iki_read_long_line, arguments.argv[index]);
total = 0;
status = f_file_open(arguments.argv[data->remaining.array[i]], 0, &file);
+
if (F_status_is_error(status)) {
iki_read_print_error_file(data->context, data->verbosity, F_status_set_fine(status), "f_file_open", arguments.argv[data->remaining.array[i]], "process", F_true, F_true);
break;
}
status = f_file_size_by_id(file.id, &total);
+
if (F_status_is_error(status)) {
iki_read_print_error_file(data->context, data->verbosity, F_status_set_fine(status), "f_file_size_by_id", arguments.argv[data->remaining.array[i]], "process", F_true, F_true);
bool unmatched = F_true;
status = fl_iki_read(&data->buffer, buffer_range, variable, vocabulary, content);
+
if (F_status_is_error(status)) {
iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_iki_read", F_true);
return status;
if (data->mode == iki_read_mode_literal || data->mode == iki_read_mode_content) {
status = iki_read_substitutions_identify(arguments, file_name, data, vocabulary, substitutionss);
+
if (F_status_is_error(status)) {
iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "iki_read_substitutions_identify", F_true);
buffer_range->start = 0;
for (; i < data->parameters[iki_read_parameter_name].additional.used; i++) {
+
index = data->parameters[iki_read_parameter_name].additional.array[i];
name.used = 0;
status = fl_string_append_nulless(arguments.argv[index], strlen(arguments.argv[index]), &name);
+
if (F_status_is_error(status)) {
iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true);
buffer_range->stop = name.used - 1;
for (j = 0; j < vocabulary->used; j++) {
+
status = fl_string_dynamic_partial_compare(name, data->buffer, *buffer_range, vocabulary->array[j]);
if (status == F_equal_to) {
f_string_length_t length_argument = 0;
for (f_array_length_t index = 0; i < data->parameters[iki_read_parameter_name].additional.used; i++) {
+
index = data->parameters[iki_read_parameter_name].additional.array[i];
length_argument = strnlen(arguments.argv[index], f_console_length_size);
for (j = 0, name_missed = F_true; j < names.used; j++) {
+
status = fl_string_compare(arguments.argv[index], names.array[j].string, length_argument, names.array[j].used);
if (status == F_equal_to) {
}
status = fl_iki_read(&data->buffer, &range, variable, vocabulary, content);
+
if (F_status_is_error(status)) {
iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_iki_read", F_true);
return status;
range.start = 0;
for (; i < data->parameters[iki_read_parameter_name].additional.used; i++) {
+
index = data->parameters[iki_read_parameter_name].additional.array[i];
name.used = 0;
status = fl_string_append_nulless(arguments.argv[index], strlen(arguments.argv[index]), &name);
+
if (F_status_is_error(status)) {
iki_read_print_error(data->context, data->verbosity, F_status_set_fine(status), "fl_string_append_nulless", F_true);
#ifndef _di_iki_read_substitutions_identify_
f_return_status iki_read_substitutions_identify(const f_console_arguments_t arguments, const f_string_t file_name, iki_read_data_t *data, f_iki_vocabulary_t *vocabulary, iki_read_substitutions_t *substitutionss) {
- if (data->parameters[iki_read_parameter_substitute].result != f_console_result_additional) return F_none;
+
+ if (data->parameters[iki_read_parameter_substitute].result != f_console_result_additional) {
+ return F_none;
+ }
f_status_t status = F_none;
f_console_parameter_t *parameter = &data->parameters[iki_read_parameter_substitute];
for (; i < parameter->additional.used; i += 3) {
+
index = parameter->additional.array[i];
length = strnlen(arguments.argv[index], f_console_length_size);
for (j = 0; j < vocabulary->used; j++) {
+
status = fl_string_compare(arguments.argv[index], data->buffer.string + vocabulary->array[j].start, length, (vocabulary->array[j].stop - vocabulary->array[j].start) + 1);
if (status == F_equal_to) {
#ifndef _di_iki_write_print_help_
f_return_status iki_write_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, iki_write_name_long, iki_write_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
const f_console_parameter_ids_t choices = { ids, 3 };
status = fll_program_parameter_process(arguments, parameters, choices, F_true, &data->remaining, &data->context);
+
if (F_status_is_error(status)) {
iki_write_print_error(data->context, data->verbosity, F_status_set_fine(status), "fll_program_parameter_process", F_true);
#ifndef _di_init_print_help_
f_return_status init_print_help(const f_color_context_t context) {
+
fll_program_print_help_header(context, init_name_long, init_version);
fll_program_print_help_option(context, f_console_standard_short_help, f_console_standard_long_help, f_console_symbol_short_enable, f_console_symbol_long_enable, " Print this help message.");
system(init_program_chgrp " " init_group_process_random " " init_path_device_random);
system(init_program_chgrp " " init_group_process_urandom " " init_path_device_urandom);
-
// attempt to load kernel command line, but do not stop on failure.
if (run_level > 0 && run_level[0] != 0) {
f_file_p kernel_command_line_file = 0;
// create the required directories if they do not already exist and then perform appropriate mount.
status = f_file_stat(init_paths_devices, &stat);
+
if (status == F_file_found_not || status == F_status_set_error(F_directory)) {
system(init_program_mkdir " -p " init_paths_devices);
memset(&stat, 0, sizeof(f_stat));
system(init_program_mount " " tmp_path);
-
// create the required devices
system(init_program_mknod " -m 0660 " init_path_device_null " c 1 3");
system(init_program_mknod " -m 0660 " init_path_device_zero " c 1 5");
if (data->remaining.used > 0) {
for (f_array_length_t i = 0; i < data->remaining.used; i++) {
+
status2 = status_code_process_check(*data, arguments.argv[data->remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {
if (data->remaining.used > 0) {
for (f_array_length_t i = 0; i < data->remaining.used; i++) {
+
status2 = status_code_process_normal(*data, arguments.argv[data->remaining.array[i]]);
if (F_status_is_error(status2) && status == F_none) {