This is a "quick" run through to refresh the syntax and style with the latest practices.
This fixes any observed styling change.
I noticed some probably errors and added appropriate @fixme comments.
/**
* An array of accounts.
*
- * array: the array of accounts.
- * size: total amount of space available.
- * used: total number of space used.
+ * array: The array of accounts.
+ * size: Total amount of space available.
+ * used: Total number of space used.
*/
#ifndef _di_f_accounts_t_
typedef struct {
*
* @return
* F_none on success.
+ *
* F_buffer_too_small (with error bit) if the buffer is too small to store the account data.
- * F_exist_non if no user by that name exists.
* F_file_descriptor_max (with error bit) if max file descriptors was reached.
* F_file_open_max (with error bit) too many open files.
* F_input_output (with error bit) if an I/O error occurred.
*
* @return
* F_none on success.
+ *
* F_buffer_too_small (with error bit) if the buffer is too small to store the account data.
- * F_exist_non if no user by that name exists.
* F_file_descriptor_max (with error bit) if max file descriptors was reached.
* F_file_open_max (with error bit) too many open files.
* F_input_output (with error bit) if an I/O error occurred.
*
* @return
* F_none on success.
+ *
* F_buffer_too_small (with error bit) if the buffer is too small to store the account data.
- * F_exist_non if no group by that name exists.
* F_file_descriptor_max (with error bit) if max file descriptors was reached.
* F_file_open_max (with error bit) too many open files.
* F_input_output (with error bit) if an I/O error occurred.
*
* @return
* F_none on success.
+ *
* F_buffer_too_small (with error bit) if the buffer is too small to store the account data.
- * F_exist_non if no user by that name exists.
* F_file_descriptor_max (with error bit) if max file descriptors was reached.
* F_file_open_max (with error bit) too many open files.
* F_input_output (with error bit) if an I/O error occurred.
*
* @return
* F_none on success.
+ *
* F_buffer_too_small (with error bit) if the buffer is too small to store the account data.
- * F_exist_non if no user by that name exists.
* F_file_descriptor_max (with error bit) if max file descriptors was reached.
* F_file_open_max (with error bit) too many open files.
* F_input_output (with error bit) if an I/O error occurred.
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_color_set_
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_color_set_to_
*
* @return
* F_none on success.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*/
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_color_print_
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_color_print2_
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_print_dynamic().
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_print_to_dynamic().
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_print_dynamic().
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_print_dynamic().
*
* @return
* F_none on success.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*/
/**
* Provide console type enumerations:
*
- * - none: parameter not found.
- * - found: parameter found.
- * - values: parameter found, extra data exists (such as '-f filename', 'filename' would be the extra data).
+ * - none: Parameter not found.
+ * - found: Parameter found.
+ * - values: Parameter found, extra data exists (such as '-f filename', 'filename' would be the extra data).
*
- * - normal: parameters using minus sign, such as '--help'.
- * - inverse: parameters using plus sign, such as '++version'.
- * - other: parameters using neither minus nor plus sign, such as 'build'.
+ * - normal: Parameters using minus sign, such as '--help'.
+ * - inverse: Parameters using plus sign, such as '++version'.
+ * - other: Parameters using neither minus nor plus sign, such as 'build'.
*/
#ifndef _di_f_console_types_t_
typedef uint16_t f_console_id_t;
* The other parameters are for any other parameter that has no prepended characters.
*
* - symbol_short: The single character string, such as 'h' in '-h'.
- * - symbol_long: The multi-character string, such as 'help' in '--help'.
+ * - symbol_long: The multi-character string, such as 'help' in '--help'.
* - symbol_other: The special meaning parameter, such as 'all' in 'make all'.
*
* - has_values: Designates that a parameter will have a given number of values arguments, such as 'blue' in '--color blue'.
- * - type: One of the f_console_type_* codes, defining how this parameter is to be processed.
+ * - type: One of the f_console_type_* codes, defining how this parameter is to be processed.
*
* - result: A code representing that the parameter is found and how it is found ('-h' vs '--help').
*
- * - location: The last location in argv[] where this parameter is found.
- * - location_sub: The last sub-location at location in argv (only used by short parameters, such as -h or +l).
- * - locations: All locations within argv where this parameter is found (order is preserved).
+ * - location: The last location in argv[] where this parameter is found.
+ * - location_sub: The last sub-location at location in argv (only used by short parameters, such as -h or +l).
+ * - locations: All locations within argv where this parameter is found (order is preserved).
* - locations_sub: All sub-locations within argv where this parameter is found (order is preserved).
- * - values: An array of locations representing where in the argv[] the values arguments are found.
+ * - values: An array of locations representing where in the argv[] the values arguments are found.
*/
#ifndef _di_f_console_parameter_t_
typedef struct {
if (!length) {
*result = f_console_none;
+
return F_data_not;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
needs_value.array[i] = needs_value.array[i + 1];
} // for
- location++;
+ ++location;
continue;
}
// The sub_location is used on a per increment basis (such as 'tar -xcf', the '-' would have an increment of 1, therefore x, c, and f would all be three separate parameters).
while (sub_location < argument_length) {
- for (i = 0; i < parameters.used; i++) {
+ for (i = 0; i < parameters.used; ++i) {
if (parameters.parameter[i].type != console_type) {
continue;
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
}
- for (values = 0; values < parameters.parameter[i].has_values; values++) {
+ for (values = 0; values < parameters.parameter[i].has_values; ++values) {
needs_value.array[needs_value.used++] = i;
} // for
}
else {
found = F_false;
- for (i = 0; i < parameters.used; i++) {
+ for (i = 0; i < parameters.used; ++i) {
if (parameters.parameter[i].type != f_console_type_other) continue;
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(needs_value);
+
return status;
}
}
- for (values = 0; values < parameters.parameter[i].has_values; values++) {
+ for (values = 0; values < parameters.parameter[i].has_values; ++values) {
needs_value.array[needs_value.used++] = i;
} // for
}
}
}
- location++;
+ ++location;
} // while
if (needs_value.used > 0) {
if (!choices.id) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!choices.used) return F_data_not;
- if (!parameters.used) return F_data_not;
+ if (!choices.used) {
+ return F_data_not;
+ }
+
+ if (!parameters.used) {
+ return F_data_not;
+ }
f_array_length_t location = 0;
f_array_length_t location_sub = 0;
f_console_parameter_id_t priority = 0;
- for (f_array_length_t i = 0; i < choices.used; i++) {
+ for (f_array_length_t i = 0; i < choices.used; ++i) {
- if (choices.id[i] > parameters.used) return F_status_set_error(F_parameter);
+ if (choices.id[i] > parameters.used) {
+ return F_status_set_error(F_parameter);
+ }
if (parameters.parameter[choices.id[i]].result == f_console_result_found) {
if (parameters.parameter[choices.id[i]].location < location) {
if (!choices.id) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!choices.used) return F_data_not;
- if (!parameters.used) return F_data_not;
+ if (!choices.used) {
+ return F_data_not;
+ }
+
+ if (!parameters.used) {
+ return F_data_not;
+ }
f_array_length_t location = 0;
f_array_length_t location_sub = 0;
f_console_parameter_id_t priority = 0;
- for (f_array_length_t i = 0; i < choices.used; i++) {
+ for (f_array_length_t i = 0; i < choices.used; ++i) {
- if (choices.id[i] > parameters.used) return F_status_set_error(F_parameter);
+ if (choices.id[i] > parameters.used) {
+ return F_status_set_error(F_parameter);
+ }
if (parameters.parameter[choices.id[i]].result == f_console_result_found) {
if (parameters.parameter[choices.id[i]].location > location) {
* @return
* F_none on success.
* F_data_not if "values" parameters were expected but not found.
+ *
* F_array_too_large (with error bit) if a buffer would exceed max length.
* F_failure (with error bit) if width is not long enough to convert when processing arguments as UTF-8.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if no parameters were found.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_console_parameter_prioritize_left_
* @return
* F_none on success.
* F_data_not if no parameters were found.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_console_parameter_prioritize_right_
f_array_length_t total = 0;
- for (register f_number_signed_t work = current; work; total++) {
+ for (register f_number_signed_t work = current; work; ++total) {
work /= base;
} // for
macro_f_string_dynamic_t_resize(status, (*destination), destination->used + total + 1);
}
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
f_number_unsigned_t work = 0;
f_number_unsigned_t power = 1;
if (negative) {
destination->string[destination->used] = f_string_ascii_minus_s[0];
- destination->used++;
+ ++destination->used;
}
- for (register uint8_t i = 1; i < total; i++) {
+ for (register uint8_t i = 1; i < total; ++i) {
power *= base;
} // for
- for (; power; total--) {
+ for (; power; --total) {
+
work = current / power;
current -= work * power;
power /= base;
break;
}
- destination->used++;
+ ++destination->used;
} // for
destination->string[destination->used] = 0;
- destination->used++;
+ ++destination->used;
return F_none;
}
f_array_length_t total = 0;
- for (register f_number_unsigned_t work = number; work; total++) {
+ for (register f_number_unsigned_t work = number; work; ++total) {
work /= base;
} // for
f_number_unsigned_t work = 0;
f_number_unsigned_t power = 1;
- for (register uint8_t i = 1; i < total; i++) {
+ for (register uint8_t i = 1; i < total; ++i) {
power *= base;
} // for
- for (; power; total--) {
+ for (; power; --total) {
+
work = current / power;
current -= work * power;
power /= base;
break;
}
- destination->used++;
+ ++destination->used;
} // for
destination->string[destination->used] = 0;
- destination->used++;
+ ++destination->used;
return F_none;
}
*
* @return
* F_none if character was converted to a binary.
+ *
* F_number (with error bit) if no conversion was made due to non-binary values being found.
* F_parameter (with error bit) if a parameter is invalid.
*/
*
* @return
* F_none if character was converted to a decimal.
+ *
* F_number (with error bit) if no conversion was made due to non-decimal values being found.
* F_parameter (with error bit) if a parameter is invalid.
*/
*
* @return
* F_none if character was converted to a duodecimal.
+ *
* F_number (with error bit) if no conversion was made due to non-duodecimal values being found.
* F_parameter (with error bit) if a parameter is invalid.
*/
*
* @return
* F_none if character was converted to a hexidecimal.
+ *
* F_number (with error bit) if no conversion was made due to non-hexidecimal values being found.
* F_parameter (with error bit) if a parameter is invalid.
*/
*
* @return
* F_none if character was converted to a hexidecimal.
+ *
* F_number (with error bit) if no conversion was made due to non-hexidecimal values being found.
* F_parameter (with error bit) if a parameter is invalid.
*/
*
* @return
* F_none if the number was converted to a string.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_memory_not (with error bit) on out of memory.
*/
*
* @return
* F_none if the number was converted to a string.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_memory_not (with error bit) on out of memory.
*/
#ifndef _di_f_directory_create_
f_status_t f_directory_create(const f_string_t path, const mode_t mode) {
+
return private_f_directory_create(path, mode);
}
#endif // _di_f_directory_create_
#ifndef _di_f_directory_exists_
f_status_t f_directory_exists(const f_string_t path) {
+
struct stat file_stat;
memset(&file_stat, 0, sizeof(struct stat));
return F_status_set_error(F_file_stat);
}
- if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true;
+ if ((file_stat.st_mode & S_IFMT) == S_IFDIR) {
+ return F_true;
+ }
return F_false;
}
#ifndef _di_f_directory_exists_at_
f_status_t f_directory_exists_at(const int at_id, const f_string_t path, const int flag) {
+
struct stat file_stat;
memset(&file_stat, 0, sizeof(struct stat));
return F_status_set_error(F_file_stat);
}
- if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true;
+ if ((file_stat.st_mode & S_IFMT) == S_IFDIR) {
+ return F_true;
+ }
return F_false;
}
#ifndef _di_f_directory_is_
f_status_t f_directory_is(const f_string_t path) {
+
struct stat file_stat;
memset(&file_stat, AT_SYMLINK_NOFOLLOW, sizeof(struct stat));
return F_status_set_error(F_file_stat);
}
- if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true;
+ if ((file_stat.st_mode & S_IFMT) == S_IFDIR) {
+ return F_true;
+ }
return F_false;
}
#ifndef _di_f_directory_is_at_
f_status_t f_directory_is_at(const int at_id, const f_string_t path, const int flag) {
+
struct stat file_stat;
memset(&file_stat, 0, sizeof(struct stat));
return F_status_set_error(F_file_stat);
}
- if ((file_stat.st_mode & S_IFMT) == S_IFDIR) return F_true;
+ if ((file_stat.st_mode & S_IFMT) == S_IFDIR) {
+ return F_true;
+ }
return F_false;
}
else return F_status_set_error(F_failure);
}
- for (; i < length; i++) {
+ for (; i < length; ++i) {
+
size = strnlen(listing[i]->d_name, f_directory_name_max);
// There is no reason to include "." and ".." in the directory listing.
if (!strncmp(listing[i]->d_name, "..", 3) || !strncmp(listing[i]->d_name, ".", 2)) {
f_memory_delete(size, sizeof(char *), (void **) & listing[i]);
+
continue;
}
f_memory_delete(size, sizeof(char *), (void **) & listing[i]);
} // for
- for (; i < length; i++) {
+ for (; i < length; ++i) {
f_memory_delete(size, sizeof(char *), (void **) & listing[i]);
} // for
f_memory_delete(1, sizeof(struct dirent *), (void **) & listing);
- if (F_status_is_error(status)) return status;
- if (!length) return F_data_not;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (!length) {
+ return F_data_not;
+ }
return F_none;
}
}
}
else {
+
// Not recursively deleting and the path is requested to be preserved, so there is nothing to delete.
- if (preserve) return F_none;
+ if (preserve) {
+ return F_none;
+ }
result = remove(path);
}
}
}
else {
+
// Not recursively deleting and the path is requested to be preserved, so there is nothing to delete.
- if (preserve) return F_none;
+ if (preserve) {
+ return F_none;
+ }
result = remove(path);
}
memset(&file_stat, 0, sizeof(struct stat));
if (stat(path, &file_stat) < 0) {
-
if (errno == ENOENT) {
return private_f_directory_create(path, mode);
}
}
if (utimensat(f_directory_at_current_working, path, 0, 0) < 0) {
-
if (errno == EACCES) return F_status_set_error(F_access_denied);
if (errno == EBADF) return F_status_set_error(F_directory_descriptor);
if (errno == EFAULT) return F_status_set_error(F_buffer);
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_link_max (with error bit) max links limit reached or exceeded.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
* F_true if path was found and path is a directory (or a symlink to a directory).
* F_false if path was found and path is not a directory.
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_loop (with error bit) on loop error.
* F_memory_not (with error bit) if out of memory.
* F_true if path was found and path is a directory (or a symlink to a directory).
* F_false if path was found and path is not a directory.
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
* F_loop (with error bit) on loop error.
* F_true if path was found and path is a directory.
* F_false if path was found and path is not a directory (this includes symlinks).
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_loop (with error bit) on loop error.
* F_memory_not (with error bit) if out of memory.
* F_true if path was found and path is a directory.
* F_false if path was found and path is not a directory.
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
* F_loop (with error bit) on loop error.
* @return
* F_none on success.
* F_data_not if directory is empty.
+ *
* F_array_too_large (with error bit) if the directory buffer max length would be exceeded.
* F_failure (with error bit) if failed to read directory information.
* F_memory_not (with error bit) on out of memory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory_found_not (with error bit) if directory was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory_found_not (with error bit) if directory was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if file is busy.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if file is busy.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* The allocation macros apply to the path.
*
- * status: the status code.
- * path: the dynamically allocated path associated with the status code.
+ * status: The status code.
+ * path: The dynamically allocated path associated with the status code.
*/
#ifndef _di_f_directory_status_t_
typedef struct {
#if !defined(_di_f_directory_remove_)
int private_f_directory_remove_recursively(const char *path, const struct stat *file_stat, int type, struct FTW *entity) {
- if (!entity->level) return 0;
+
+ if (!entity->level) {
+ return 0;
+ }
+
return remove(path);
}
#endif // !defined(_di_f_directory_remove_)
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_link_max (with error bit) max links limit reached or exceeded.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
if (value->used > value->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!name.used) return F_data_not;
+ if (!name.used) {
+ return F_data_not;
+ }
if (!name.string[name.used - 1]) {
return private_f_environment_get(name.string, value);
if (value.used > value.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!name.used) return F_data_not;
+ if (!name.used) {
+ return F_data_not;
+ }
if (!name.string[name.used - 1]) {
if (value.used > 0 && !value.string[value.used - 1]) {
* @return
* F_true on success and environment variable exists.
* F_false on success and environment variable does not exist.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* @see getenv()
* @return
* F_none on success.
* F_exist_not if name does not exist.
+ *
* F_memory_not (with error bit) on out of memory.
* 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.
* F_none on success.
* F_data_not if name.used is 0.
* F_exist_not if name does not exist.
+ *
* F_memory_not (with error bit) on out of memory.
* 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.
*
* @return
* F_none on success.
+ *
* F_valid_not (with error bit) if name is an invalid string.
* F_memory_not (with error bit) on out of memory.
* F_failure (with error bit) on any other error.
* @return
* F_none on success.
* F_data_not if name.used is 0.
+ *
* F_valid_not (with error bit) if name is an invalid string.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
+ *
* F_valid_not (with error bit) if name is an invalid string.
* F_memory_not (with error bit) on out of memory.
* F_failure (with error bit) on any other error.
*
* @return
* F_none on success.
+ *
* F_valid_not (with error bit) if name is an invalid string.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_exist_not if name does not exist.
+ *
* F_memory_not (with error bit) on out of memory.
* F_string_too_large (with error bit) if appended string length is too large to store in the buffer.
*
*
* @return
* F_none on success.
+ *
* F_valid_not (with error bit) if name is an invalid string.
* F_memory_not (with error bit) on out of memory.
* F_failure (with error bit) on any other error.
*
* @return
* F_none on success.
+ *
* F_valid_not (with error bit) if name is an invalid string.
* F_memory_not (with error bit) on out of memory.
* F_failure (with error bit) on any other error.
*
* @todo move this into a f_scheduler project.
*
- * policy: the scheduler policy.
- * priority: the scheduler priority;
+ * policy: The scheduler policy.
+ * priority: The scheduler priority;
*/
#ifndef _di_f_execute_scheduler_t_
typedef struct {
/**
* Commonly used file related properties.
*
- * stream: File stream.
- * id: File descriptor, with a value of -1 represents a closed file.
- * flag: Flags used for opening the file.
- * size_read: The default number of 1-byte characters to read at a time and is often used for the read buffer size.
+ * stream: File stream.
+ * id: File descriptor, with a value of -1 represents a closed file.
+ * flag: Flags used for opening the file.
+ * size_read: The default number of 1-byte characters to read at a time and is often used for the read buffer size.
* size_write: The default number of 1-byte characters to read at a time and is often used for the write buffer size.
*/
#ifndef _di_f_file_t_
if (!path) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
-
if (!macro_f_file_type_is_fifo(mode) && !macro_f_file_type_is_character(mode) && !macro_f_file_type_is_block(mode)) {
return F_status_set_error(F_supported_not);
}
#ifndef _di_f_file_descriptor_
f_status_t f_file_descriptor(f_file_t *file) {
+ #ifndef _di_level_0_parameter_checking_
+ if (!file) return F_status_set_error(F_parameter);
+ #endif // _di_level_0_parameter_checking_
+
file->id = fileno(file->stream);
if (file->id == -1) {
if (!path) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- f_status_t status = F_none;
struct stat stat_file;
memset(&stat_file, 0, sizeof(struct stat));
- status = private_f_file_stat(path, F_false, &stat_file);
+ const f_status_t status = private_f_file_stat(path, F_false, &stat_file);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_file_found_not) return F_false;
+ if (F_status_set_fine(status) == F_file_found_not) {
+ return F_false;
+ }
return status;
}
if (!path) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- f_status_t status = F_none;
struct stat stat_file;
memset(&stat_file, 0, sizeof(struct stat));
- status = private_f_file_stat_at(at_id, path, flag, &stat_file);
+ const f_status_t status = private_f_file_stat_at(at_id, path, flag, &stat_file);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_file_found_not) return F_false;
+ if (F_status_set_fine(status) == F_file_found_not) {
+ return F_false;
+ }
return status;
}
memset(&stat_file, 0, sizeof(struct stat));
- f_status_t status = private_f_file_stat(path, F_true, &stat_file);
- if (F_status_is_error(status)) {
- return status;
+ {
+ const f_status_t status = private_f_file_stat(path, F_true, &stat_file);
+ if (F_status_is_error(status)) return status;
}
*group = stat_file.st_gid;
memset(&stat_file, 0, sizeof(struct stat));
- f_status_t status = private_f_file_stat(path, dereference, &stat_file);
- if (F_status_is_error(status)) return status;
+ {
+ const f_status_t status = private_f_file_stat(path, dereference, &stat_file);
+ if (F_status_is_error(status)) return status;
+ }
- if (macro_f_file_type_get(stat_file.st_mode) == type) return F_true;
+ if (macro_f_file_type_get(stat_file.st_mode) == type) {
+ return F_true;
+ }
return F_false;
}
return F_status_set_error(F_file_stat);
}
- if (stat_file.st_mode == (S_IFMT & S_IFDIR)) return F_true;
+ if (stat_file.st_mode == (S_IFMT & S_IFDIR)) {
+ return F_true;
+ }
return F_false;
}
mode_umask |= f_file_mode_t_block_world & f_file_mode_t_mask_bit_execute;
}
- for (f_array_length_t i = 0; syntax && string[i]; i++) {
+ for (f_array_length_t i = 0; syntax && string[i]; ++i) {
if (string[i] == f_string_ascii_o_s[0]) {
on |= 1;
mode_mask = f_file_mode_t_block_all;
}
- for (i++; string[i]; i++) {
+ for (++i; string[i]; ++i) {
if (string[i] == f_string_ascii_r_s[0]) {
what = f_file_mode_t_mask_bit_read;
if (string[i]) {
f_array_length_t j = 0;
- for (; string[i + j] && j < 4; j++) {
+ for (; string[i + j] && j < 4; ++j) {
if (j) {
*mode <<= 8;
memset(&stat_file, 0, sizeof(struct stat));
- const f_status_t status = private_f_file_stat(path, F_true, &stat_file);
- if (F_status_is_error(status)) {
- return status;
+ {
+ const f_status_t status = private_f_file_stat(path, F_true, &stat_file);
+ if (F_status_is_error(status)) return status;
}
*mode = stat_file.st_mode;
memset(&stat_file, 0, sizeof(struct stat));
- const f_status_t status = private_f_file_stat(path, F_true, &stat_file);
- if (F_status_is_error(status)) {
- return status;
+ {
+ const f_status_t status = private_f_file_stat(path, F_true, &stat_file);
+ if (F_status_is_error(status)) return status;
}
*mode = stat_file.st_mode;
memset(&stat_file, 0, sizeof(struct stat));
- const f_status_t status = private_f_file_stat(path, F_true, &stat_file);
- if (F_status_is_error(status)) {
- return status;
+ {
+ const f_status_t status = private_f_file_stat(path, F_true, &stat_file);
+ if (F_status_is_error(status)) return status;
}
*owner = stat_file.st_uid;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id == -1) return F_status_set_error(F_file_closed);
+ if (file.id == -1) {
+ return F_status_set_error(F_file_closed);
+ }
f_status_t status = F_none;
ssize_t size_read = 0;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id == -1) return F_status_set_error(F_file_closed);
+ if (file.id == -1) {
+ return F_status_set_error(F_file_closed);
+ }
f_status_t status = F_none;
ssize_t size_read = 0;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id == -1) return F_status_set_error(F_file_closed);
+ if (file.id == -1) {
+ return F_status_set_error(F_file_closed);
+ }
f_array_length_t buffer_size = file.size_read;
f_array_length_t buffer_count = 0;
memset(&stat_file, 0, sizeof(struct stat));
- f_status_t status = private_f_file_stat(path, dereference, &stat_file);
-
- if (F_status_is_error(status)) return status;
+ {
+ const f_status_t status = private_f_file_stat(path, dereference, &stat_file);
+ if (F_status_is_error(status)) return status;
+ }
*size = stat_file.st_size;
memset(&stat_file, 0, sizeof(struct stat));
- f_status_t status = private_f_file_stat_at(at_id, path, dereference, &stat_file);
-
- if (F_status_is_error(status)) return status;
+ {
+ const f_status_t status = private_f_file_stat_at(at_id, path, dereference, &stat_file);
+ if (F_status_is_error(status)) return status;
+ }
*size = stat_file.st_size;
memset(&stat_file, 0, sizeof(struct stat));
- f_status_t status = private_f_file_stat_by_id(id, &stat_file);
-
- if (F_status_is_error(status)) return status;
+ {
+ const f_status_t status = private_f_file_stat_by_id(id, &stat_file);
+ if (F_status_is_error(status)) return status;
+ }
*size = stat_file.st_size;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!file.stream) return F_status_set_error(F_file_closed);
+ if (!file.stream) {
+ return F_status_set_error(F_file_closed);
+ }
f_status_t status = F_none;
ssize_t size_read = 0;
if (amount < 1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!file.stream) return F_status_set_error(F_file_closed);
+ if (!file.stream) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
if (written) *written = 0;
if (written) {
private_f_file_stream_write_until(file, buffer.string, amount, buffer.used, written);
- if (status == F_none && *written == buffer.used) return F_none_eos;
+ if (status == F_none && *written == buffer.used) {
+ return F_none_eos;
+ }
}
else {
f_array_length_t written_local = 0;
private_f_file_stream_write_until(file, buffer.string, amount, buffer.used, &written_local);
- if (status == F_none && written_local == buffer.used) return F_none_eos;
+ if (status == F_none && written_local == buffer.used) {
+ return F_none_eos;
+ }
}
- if (F_status_is_error(status)) return F_status_set_error(status);
+ if (F_status_is_error(status)) {
+ return F_status_set_error(status);
+ }
return status;
}
if (amount < 1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!file.stream) return F_status_set_error(F_file_closed);
+ if (!file.stream) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
if (written) *written = 0;
+
return F_data_not;
}
private_f_file_stream_write_until(file, buffer.string, amount, write_max, written);
if (status == F_none) {
- if (*written == buffer.used) return F_none_eos;
- if (*written == write_max) return F_none_stop;
+ if (*written == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (*written == write_max) {
+ return F_none_stop;
+ }
}
}
else {
private_f_file_stream_write_until(file, buffer.string, amount, write_max, &written_local);
if (status == F_none) {
- if (written_local == buffer.used) return F_none_eos;
- if (written_local == write_max) return F_none_stop;
+ if (written_local == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (written_local == write_max) {
+ return F_none_stop;
+ }
}
}
if (!total) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!file.stream) return F_status_set_error(F_file_closed);
+ if (!file.stream) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used || !total) {
if (written) *written = 0;
+
return F_data_not;
}
private_f_file_stream_write_until(file, buffer.string, amount, write_max, written);
if (status == F_none) {
- if (*written == buffer.used) return F_none_eos;
- if (*written == write_max) return F_none_stop;
+ if (*written == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (*written == write_max) {
+ return F_none_stop;
+ }
}
}
else {
private_f_file_stream_write_until(file, buffer.string, amount, buffer.used, &written_local);
if (status == F_none) {
- if (written_local == buffer.used) return F_none_eos;
- if (written_local == write_max) return F_none_stop;
+ if (written_local == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (written_local == write_max) {
+ return F_none_stop;
+ }
}
}
if (range.start >= buffer.used) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!file.stream) return F_status_set_error(F_file_closed);
+ if (!file.stream) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
if (written) *written = 0;
+
return F_data_not;
}
private_f_file_stream_write_until(file, buffer.string + range.start, amount, write_max, written);
if (status == F_none) {
- if (range.start + *written == buffer.used) return F_none_stop;
- if (range.start + *written == total) return F_none_eos;
+ if (range.start + *written == buffer.used) {
+ return F_none_stop;
+ }
+
+ if (range.start + *written == total) {
+ return F_none_eos;
+ }
}
}
else {
private_f_file_stream_write_until(file, buffer.string + range.start, amount, write_max, &written_local);
if (status == F_none) {
- if (range.start + written_local == buffer.used) return F_none_eos;
- if (range.start + written_local == total) return F_none_stop;
+ if (range.start + written_local == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (range.start + written_local == total) {
+ return F_none_stop;
+ }
}
}
if (buffer.used > buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id == -1) return F_status_set_error(F_file_closed);
+ if (file.id == -1) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
if (written) *written = 0;
+
return F_data_not;
}
if (written) {
private_f_file_write_until(file, buffer.string, buffer.used, written);
- if (status == F_none && *written == buffer.used) return F_none_eos;
+ if (status == F_none && *written == buffer.used) {
+ return F_none_eos;
+ }
}
else {
f_array_length_t written_local = 0;
private_f_file_write_until(file, buffer.string, buffer.used, &written_local);
- if (status == F_none && written_local == buffer.used) return F_none_eos;
+ if (status == F_none && written_local == buffer.used) {
+ return F_none_eos;
+ }
}
- if (F_status_is_error(status)) return F_status_set_error(status);
+ if (F_status_is_error(status)) {
+ return F_status_set_error(status);
+ }
return status;
}
if (buffer.used > buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id == -1) return F_status_set_error(F_file_closed);
+ if (file.id == -1) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
if (written) *written = 0;
+
return F_data_not;
}
private_f_file_write_until(file, buffer.string, write_max, written);
if (status == F_none) {
- if (*written == buffer.used) return F_none_eos;
- if (*written == write_max) return F_none_stop;
+ if (*written == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (*written == write_max) {
+ return F_none_stop;
+ }
}
}
else {
private_f_file_write_until(file, buffer.string, write_max, &written_local);
if (status == F_none) {
- if (written_local == buffer.used) return F_none_eos;
- if (written_local == write_max) return F_none_stop;
+ if (written_local == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (written_local == write_max) {
+ return F_none_stop;
+ }
}
}
if (!total) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id == -1) return F_status_set_error(F_file_closed);
+ if (file.id == -1) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used || !total) {
if (written) *written = 0;
+
return F_data_not;
}
private_f_file_write_until(file, buffer.string, write_max, written);
if (status == F_none) {
- if (*written == buffer.used) return F_none_eos;
- if (*written == write_max) return F_none_stop;
+ if (*written == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (*written == write_max) {
+ return F_none_stop;
+ }
}
}
else {
private_f_file_write_until(file, buffer.string, buffer.used, &written_local);
if (status == F_none) {
- if (written_local == buffer.used) return F_none_eos;
- if (written_local == write_max) return F_none_stop;
+ if (written_local == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (written_local == write_max) {
+ return F_none_stop;
+ }
}
}
if (range.start >= buffer.used) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id == -1) return F_status_set_error(F_file_closed);
+ if (file.id == -1) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
if (written) *written = 0;
+
return F_data_not;
}
private_f_file_write_until(file, buffer.string + range.start, write_max, written);
if (status == F_none) {
- if (range.start + *written == buffer.used) return F_none_stop;
- if (range.start + *written == total) return F_none_eos;
+ if (range.start + *written == buffer.used) {
+ return F_none_stop;
+ }
+
+ if (range.start + *written == total) {
+ return F_none_eos;
+ }
}
}
else {
private_f_file_write_until(file, buffer.string + range.start, write_max, &written_local);
if (status == F_none) {
- if (range.start + written_local == buffer.used) return F_none_eos;
- if (range.start + written_local == total) return F_none_stop;
+ if (range.start + written_local == buffer.used) {
+ return F_none_eos;
+ }
+
+ if (range.start + written_local == total) {
+ return F_none_stop;
+ }
}
}
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
* F_access_mode (with error bit) if the current user does not have access to assign the file mode.
*
* @return
* F_none on success.
+ *
* F_file_close (with error bit) if fclose() failed for any other reason.
* F_file_descriptor (with error bit) if file descriptor is invalid.
* F_file_synchronize (with error bit) on flush failure.
*
* @return
* F_none on success.
+ *
* F_file_close (with error bit) if fclose() failed for any other reason.
* F_file_descriptor (with error bit) if file descriptor is invalid.
* F_file_synchronize (with error bit) on flush failure.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_file_found (with error bit) if a file was found while exclusive is TRUE.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_file_found (with error bit) if a file was found while exclusive is TRUE.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_file_found (with error bit) if a file was found while exclusive is TRUE.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
*
* @return
* F_none is returned on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_file (with error bit) if file is not a valid stream.
*
* @return
* F_true if path was found.
* F_false if path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_loop (with error bit) on loop error.
* @return
* F_true if file exists.
* F_false if file does not exist.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) on invalid directory.
* F_false (with error bit) on unknown/unhandled errors.
*
* @return
* F_none is returned on success.
+ *
* F_file_descriptor (with error bit) if file descriptor is invalid.
* F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted.
* F_input_output (with error bit) on I/O error.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
* F_true if path was found and path is type.
* F_false if path was found and path is not type.
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_loop (with error bit) on loop error.
* F_true if path was found and path is type.
* F_false if path was found and path is not type.
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_loop (with error bit) on loop error.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_buffer (with error bit) if the buffer is invalid.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* @see f_file_mode_from_string()
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_syntax (with error bit) if the string fails to follow the syntax rules.
*
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_mode (with error bit) if the current user does not have access to assign the file mode.
* F_directory (with error bit) on invalid directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_mode (with error bit) if the current user does not have access to assign the file mode.
* F_file_found_not (with error bit) if file at path was not found.
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* @see f_file_mode_from_string()
*
* @return
* F_none on success.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if string is too large to store in the buffer.
*
* @return
* F_none on success.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if string is too large to store in the buffer.
*
* @return
* F_none is returned on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
* F_file_found_not (with error bit) if the file was not found.
* F_file_open (with error bit) if the file is already open.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none_eof on success and EOF was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_none_eof on success and EOF was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none_eof on success and EOF was reached.
* F_none_stop on success and total was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if file is busy.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if file is busy.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
* F_access_owner (with error bit) if the current user does not have access to assign the specified owner.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
* F_access_owner (with error bit) if the current user does not have access to assign the specified owner.
*
* @return
* F_none on success.
+ *
* F_bound_not (with error bit) if SEEK_DATA or SEEK_HOLE is specified as whence and offset is beyond the end of file.
* F_file_descriptor (with error bit) if the file descriptor is invalid.
* F_file_type_pipe (with error bit) if file descriptor represents a pipe, socket, or FIFO.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none is returned on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_block (with error bit) if the action would block and non-blocking is set on the stream.
* F_buffer (with error bit) if the buffer is invalid.
*
* @return
* F_none is returned on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_deadlock (with error bit) if operation would cause a deadlock.
*
* @return
* F_none is returned on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none_eof on success and EOF was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_none_eof on success and EOF was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none_eof on success and EOF was reached.
* F_none_stop on success and total was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none is returned on success.
* F_access_denied (with error bit) on access denied.
+ *
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_file_descriptor (with error bit) if unable to load the file descriptor.
* @return
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_descriptor (with error bit) if the file descriptor is invalid.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_none on success.
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
+ *
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
* @return
* F_none if path was found and and the type was loaded in the type parameter.
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_loop (with error bit) on loop error.
* @return
* F_none if path was found and and the type was loaded in the type parameter.
* F_file_found_not if the path was not found.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_loop (with error bit) on loop error.
* @return
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_descriptor (with error bit) if the file descriptor is invalid.
#if !defined(_di_f_file_copy_) || !defined(_di_f_file_clone_)
f_status_t private_f_file_copy_content(const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) {
+
f_file_t file_source = f_file_t_initialize;
f_file_t file_destination = f_file_t_initialize;
#if !defined(_di_f_file_copy_at_) || !defined(_di_f_file_clone_at_)
f_status_t private_f_file_copy_content_at(const int at_id, const f_string_t source, const f_string_t destination, const f_number_unsigned_t size_block) {
+
f_file_t file_source = f_file_t_initialize;
f_file_t file_destination = f_file_t_initialize;
#if !defined(_di_f_file_create_) || !defined(_di_f_file_copy_)
f_status_t private_f_file_create(const f_string_t path, const mode_t mode, const bool exclusive) {
+
f_file_t file = f_file_t_initialize;
file.flag = f_file_flag_close_execute | f_file_flag_create | f_file_flag_write_only;
#if !defined(_di_f_file_create_at_) || !defined(_di_f_file_copy_at_)
f_status_t private_f_file_create_at(const int at_id, const f_string_t path, const mode_t mode, const bool exclusive) {
+
f_file_t file = f_file_t_initialize;
file.flag = f_file_flag_close_execute | f_file_flag_create | f_file_flag_write_only;
#if !defined(_di_f_file_link_read_) || !defined(_di_f_file_copy_)
f_status_t private_f_file_link_read(const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) {
+
// create a NULL terminated string based on file stat.
if (link_stat.st_size + 1 > target->size) {
if (link_stat.st_size + 1 > f_array_length_t_size) {
#if !defined(_di_f_file_link_read_at_) || !defined(_di_f_file_copy_at_)
f_status_t private_f_file_link_read_at(const int at_id, const f_string_t path, const struct stat link_stat, f_string_dynamic_t *target) {
+
// create a NULL terminated string based on file stat.
if (link_stat.st_size + 1 > target->size) {
if (link_stat.st_size + 1 > f_array_length_t_size) {
#if !defined(_di_f_file_role_change_) || !defined(_di_f_file_copy_)
f_status_t private_f_file_role_change(const f_string_t path, const uid_t uid, const gid_t gid, const bool dereference) {
+
int result = 0;
if (dereference) {
#if !defined(_di_f_file_role_change_at_) || !defined(_di_f_file_copy_at_)
f_status_t private_f_file_role_change_at(const int at_id, const f_string_t path, const uid_t uid, const gid_t gid, const int flag) {
+
int result = 0;
if (uid != -1) {
#if !defined(_di_f_file_stat_by_id_) || !defined(_di_f_file_size_by_id_)
f_status_t private_f_file_stat_by_id(const int id, struct stat *file_stat) {
+
const int result = fstat(id, file_stat);
if (result < 0) {
#if !defined(f_file_stream_write) || !defined(_di_f_file_stream_write_block_) || !defined(f_file_stream_write_until) || !defined(f_file_stream_write_range)
f_status_t private_f_file_stream_write_until(const f_file_t file, const f_string_t string, const f_array_length_t amount, const f_array_length_t total, f_array_length_t *written) {
+
*written = 0;
f_status_t status = F_none;
#if !defined(f_file_write) || !defined(_di_f_file_write_block_) || !defined(f_file_write_until) || !defined(f_file_write_range)
f_status_t private_f_file_write_until(const f_file_t file, const f_string_t string, const f_array_length_t total, f_array_length_t *written) {
+
*written = 0;
f_status_t status = F_none;
*
* @return
* F_none on success.
+ *
* F_file_close (with error bit) if fclose() failed for any other reason.
* F_file_descriptor (with error bit) if file descriptor is invalid.
* F_file_synchronize (with error bit) on flush failure.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_file_found (with error bit) if a file was found while exclusive is TRUE.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_file_found (with error bit) if a file was found while exclusive is TRUE.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
*
* @return
* F_none is returned on success.
+ *
* F_file_descriptor (with error bit) if file descriptor is invalid.
* F_filesystem_quota_block (with error bit) if filesystem's disk blocks or inodes are exhausted.
* F_input_output (with error bit) on I/O error.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_busy (with error bit) if filesystem is too busy to perform write.
* F_buffer (with error bit) if the buffer is invalid.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_mode (with error bit) if the current user does not have access to assign the file mode.
* F_directory (with error bit) on invalid directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_mode (with error bit) if the current user does not have access to assign the file mode.
* F_file_found_not (with error bit) if file at path was not found.
*
* @return
* F_none on success.
+ *
* F_file_descriptor (with error bit) if unable to load the file descriptor (the file pointer may still be valid).
* F_file_found_not (with error bit) if the file was not found.
* F_file_open (with error bit) if the file is already open.
*
* @return
* F_none on success.
+ *
* F_directory_descriptor (with error bit) for bad directory descriptor for at_id.
* F_file_found_not (with error bit) if the file was not found.
* F_file_open (with error bit) if the file is already open.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
* F_access_owner (with error bit) if the current user does not have access to assign the specified owner.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
* F_access_owner (with error bit) if the current user does not have access to assign the specified owner.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) if access to the file was denied.
* F_directory (with error bit) on invalid directory.
* F_file_found_not (with error bit) if the file was not found.
* @return
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
* @return
* F_none on success.
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
*
* Only "next" and "end" are only meaningful for a Content and will be treated as "none" for an Object.
*
- * none: disable completeness.
- * end: complete as if this is the final piece of a set (such as FSS-0001, adding terminating EOL).
- * full: complete and add terminating EOL, where applicable.
- * full_trim: complete and add terminating EOL but remove any leading or trailing whitespace, where applicable.
- * next: complete as if this is a piece of a set (such as FSS-0001, adding a separating space).
- * partial: complete, but do not add terminating EOL, where applicable.
- * partial_trim: complete, but do not add terminating EOL and remove any leading or trailing whitespace, where applicable.
+ * none: Disable completeness.
+ * end: Complete as if this is the final piece of a set (such as FSS-0001, adding terminating EOL).
+ * full: Complete and add terminating EOL, where applicable.
+ * full_trim: Complete and add terminating EOL but remove any leading or trailing whitespace, where applicable.
+ * next: Complete as if this is a piece of a set (such as FSS-0001, adding a separating space).
+ * partial: Complete, but do not add terminating EOL, where applicable.
+ * partial_trim: Complete, but do not add terminating EOL and remove any leading or trailing whitespace, where applicable.
*/
#ifndef _di_f_fss_complete_
enum {
*
* @todo change this to use a range instead if a length to support multiple sub-headers.
*
- * type: the kind of fss file is this.
+ * type: The kind of fss file is this.
* length: Total length of the header.
*/
#ifndef _di_f_fss_header_t_
if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- for (f_array_length_t i = 0; i < delimits.used; i++) {
+ for (f_array_length_t i = 0; i < delimits.used; ++i) {
+
if (delimits.array[i] < buffer->used) {
buffer->string[delimits.array[i]] = f_fss_delimit_placeholder;
}
if (!buffer) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- for (f_array_length_t i = 0; i < delimits.used; i++) {
+ for (f_array_length_t i = 0; i < delimits.used; ++i) {
+
if (delimits.array[i] < buffer->used && delimits.array[i] >= range.start && delimits.array[i] <= range.stop) {
buffer->string[delimits.array[i]] = f_fss_delimit_placeholder;
}
return F_none;
}
- for (f_array_length_t i = before; i > 0; i--) {
+ for (f_array_length_t i = before; i > 0; --i) {
+
if (buffer.string[i] == f_fss_eol) {
- (*line)++;
+ ++(*line);
}
} // for
if (buffer.string[0] == f_fss_eol) {
- (*line)++;
+ ++(*line);
}
return F_none;
return F_none;
}
- for (f_array_length_t i = before; i > range.start; i--) {
+ for (f_array_length_t i = before; i > range.start; --i) {
+
if (buffer.string[i] == f_fss_eol) {
- (*line)++;
+ ++(*line);
}
} // for
if (buffer.string[range.start] == f_fss_eol) {
- (*line)++;
+ ++(*line);
}
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- for (;; range->start++) {
+ for (;; ++range->start) {
+
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
if (buffer.string[range->start] == f_fss_eol) break;
while (position < buffer->used && position <= range.stop) {
if (buffer->string[position] == f_fss_delimit_placeholder) {
- distance++;
+ ++distance;
}
// do not waste time trying to process what is only going to be replaced with a delimit placeholder.
while (utf_width) {
buffer->string[position] = buffer->string[position + distance];
- utf_width--;
- position++;
+ --utf_width;
+ ++position;
} // while
}
}
buffer->string[position] = buffer->string[position + distance];
}
- position++;
+ ++position;
}
}
while (position < buffer->used + distance && position <= range.stop) {
buffer->string[position] = f_fss_delimit_placeholder;
- position++;
+ ++position;
}
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- for (;; range->start++) {
+ for (;; ++range->start) {
+
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
if (buffer.string[range->start] != f_fss_delimit_placeholder) break;
}
if (buffer.string[range->start] == f_fss_delimit_placeholder) {
- range->start++;
+ ++range->start;
if (range->start >= buffer.used) {
return F_none_eos;
}
} // for
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_fss_apply_delimit_
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_fss_apply_delimit_between_
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_fss_count_lines_
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_fss_count_lines_range_
* @return
* F_true if the character in the buffer is a graph character.
* F_false if the character in the buffer is not a graph character.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_is_graph().
* @return
* F_true if the character in the buffer is a space character.
* F_false if the character in the buffer is not a space character.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_is_control().
* @return
* F_true if the character in the buffer is a space character.
* F_false if the character in the buffer is not a space character.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_is_control().
* F_none on success.
* F_none_eos on success and EOS was reached.
* F_none_stop on success and stop point was reached.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_fss_seek_to_eol_
* F_none on success.
* F_none_eos on success and EOS was reached.
* F_none_stop on success and stop point was reached.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if UTF-8 cannot be fully processed (buffer or range range not long enough).
*/
* F_none on success.
* F_none_eos on success and EOS was reached.
* F_none_stop on success and stop point was reached.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_fss_skip_past_delimit_
* F_none_eol on success and EOL was reached.
* F_none_eos on success and EOS was reached.
* F_none_stop on success and stop point was reached.
+ *
* F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment was found.
* F_complete_not_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS.
* F_complete_not_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached.
* F_none_eol on success and EOL was reached.
* F_none_eos on success and EOS was reached.
* F_none_stop on success and stop point was reached.
+ *
* F_complete_not_utf (with error bit) if an incomplete UTF-8 fragment was found.
* F_complete_not_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS.
* F_complete_not_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached.
/**
* An array of f_fss_comment_t.
*
- * array: the array of fss quote.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of fss quote.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_fss_comments_t_
typedef f_string_ranges_t f_fss_comments_t;
/**
* An array of f_fss_comments_t.
*
- * array: the array of fss quotes.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of fss quotes.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_fss_commentss_t_
typedef f_string_rangess_t f_fss_commentss_t;
/**
* An array of f_fss_delimit_t.
*
- * array: the array of fss quote.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of fss quote.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_fss_delimits_t_
typedef f_array_lengths_t f_fss_delimits_t;
/**
* An array of f_fss_delimits_t.
*
- * array: the array of fss quotes.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of fss quotes.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_fss_delimitss_t_
typedef f_array_lengthss_t f_fss_delimitss_t;
/**
* This holds an array of f_fss_named_t.
*
- * array: an array of f_fss_named_t.
- * size: Total amount of allocated space.
- * used: Total number of allocated spaces used.
+ * array: An array of f_fss_named_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_fss_nameds_t_
typedef struct {
/**
* An array of f_fss_quote_t.
*
- * array: the array of fss quote.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of fss quote.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_fss_quotes_t_
typedef f_uint8s_t f_fss_quotes_t;
/**
* An array of f_fss_quotes_t.
*
- * array: the array of fss quotes.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of fss quotes.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_fss_quotess_t_
typedef f_uint8ss_t f_fss_quotess_t;
#if !defined(_di_f_fss_items_adjust_) || !defined(_di_f_fss_items_decimate_by_)
f_status_t private_f_fss_items_adjust(const f_array_length_t length, f_fss_items_t *items) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < items->size; ++i) {
#if !defined(_di_f_fss_items_decrease_by_) || !defined(_di_f_fss_items_increase_) || !defined(_di_f_fss_items_increase_by_) || !defined(_di_f_fss_items_resize_)
f_status_t private_f_fss_items_resize(const f_array_length_t length, f_fss_items_t *items) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < items->size; ++i) {
#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
f_status_t private_f_fss_named_adjust(const f_array_length_t length, f_fss_named_t *named) {
+
f_status_t status = F_none;
macro_f_string_ranges_t_adjust(status, named->objects, length)
#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
f_status_t private_f_fss_named_resize(const f_array_length_t length, f_fss_named_t *named) {
+
f_status_t status = F_none;
macro_f_string_ranges_t_resize(status, named->objects, length)
#if !defined(_di_f_fss_nameds_adjust_) || !defined(_di_f_fss_nameds_decimate_by_)
f_status_t private_f_fss_nameds_adjust(const f_array_length_t length, f_fss_nameds_t *nameds) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < nameds->size; ++i) {
#if !defined(_di_f_fss_nameds_decrease_by_) || !defined(_di_f_fss_nameds_increase_) || !defined(_di_f_fss_nameds_increase_by_) || !defined(_di_f_fss_nameds_resize_)
f_status_t private_f_fss_nameds_resize(const f_array_length_t length, f_fss_nameds_t *nameds) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < nameds->size; ++i) {
#if !defined(_di_f_fss_nest_adjust_) || !defined(_di_f_fss_nest_decimate_by_)
f_status_t private_f_fss_nest_adjust(const f_array_length_t length, f_fss_nest_t *nest) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < nest->size; ++i) {
#if !defined(_di_f_fss_nest_decrease_by_) || !defined(_di_f_fss_nest_increase_) || !defined(_di_f_fss_nest_increase_by_) || !defined(_di_f_fss_nest_resize_)
f_status_t private_f_fss_nest_resize(const f_array_length_t length, f_fss_nest_t *nest) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < nest->size; ++i) {
#if !defined(_di_f_fss_nests_adjust_) || !defined(_di_f_fss_nests_decimate_by_)
f_status_t private_f_fss_nests_adjust(const f_array_length_t length, f_fss_nests_t *nests) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < nests->size; ++i) {
#if !defined(_di_f_fss_nests_decrease_by_) || !defined(_di_f_fss_nests_increase_) || !defined(_di_f_fss_nests_increase_by_) || !defined(_di_f_fss_nests_resize_)
f_status_t private_f_fss_nests_resize(const f_array_length_t length, f_fss_nests_t *nests) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < nests->size; ++i) {
#if !defined(_di_f_fss_set_adjust_) || !defined(_di_f_fss_set_decimate_by_)
f_status_t private_f_fss_set_adjust(const f_array_length_t length, f_fss_set_t *set) {
+
f_status_t status = F_none;
macro_f_fss_objects_t_adjust(status, set->objects, length);
#if !defined(_di_f_fss_set_decrease_by_) || !defined(_di_f_fss_set_increase_) || !defined(_di_f_fss_set_increase_by_) || !defined(_di_f_fss_set_resize_)
f_status_t private_f_fss_set_resize(const f_array_length_t length, f_fss_set_t *set) {
+
f_status_t status = F_none;
macro_f_fss_objects_t_resize(status, set->objects, length);
#if !defined(_di_f_fss_set_quote_adjust_) || !defined(_di_f_fss_set_quote_decimate_by_)
f_status_t private_f_fss_set_quote_adjust(const f_array_length_t length, f_fss_set_quote_t *set_quote) {
+
f_status_t status = F_none;
macro_f_fss_objects_t_adjust(status, set_quote->objects, length);
#if !defined(_di_f_fss_set_quote_decrease_by_) || !defined(_di_f_fss_set_quote_increase_) || !defined(_di_f_fss_set_quote_increase_by_) || !defined(_di_f_fss_set_quote_resize_)
f_status_t private_f_fss_set_quote_resize(const f_array_length_t length, f_fss_set_quote_t *set_quote) {
+
f_status_t status = F_none;
macro_f_fss_objects_t_resize(status, set_quote->objects, length);
#if !defined(_di_f_fss_set_quotes_adjust_) || !defined(_di_f_fss_set_quotes_decimate_by_)
f_status_t private_f_fss_set_quotes_adjust(const f_array_length_t length, f_fss_set_quotes_t *set_quotes) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < set_quotes->size; ++i) {
#if !defined(_di_f_fss_sets_adjust_) || !defined(_di_f_fss_sets_decimate_by_)
f_status_t private_f_fss_sets_adjust(const f_array_length_t length, f_fss_sets_t *sets) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < sets->size; ++i) {
#if !defined(_di_f_fss_sets_decrease_by_) || !defined(_di_f_fss_sets_increase_) || !defined(_di_f_fss_sets_increase_by_) || !defined(_di_f_fss_sets_resize_)
f_status_t private_f_fss_sets_resize(const f_array_length_t length, f_fss_sets_t *sets) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < sets->size; ++i) {
while (range->start <= range->stop && range->start < buffer->used) {
if (buffer->string[range->start] == f_iki_syntax_placeholder) {
- range->start++;
+ ++range->start;
continue;
}
// found a valid vocabulary name.
if (buffer->string[range->start] == f_iki_syntax_quote_single || buffer->string[range->start] == f_iki_syntax_quote_double) {
quote = buffer->string[range->start];
- range->start++;
+ ++range->start;
break;
}
macro_f_iki_seek_word_dash_plus(status, buffer, range, width_max, F_false);
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
while (range->start <= range->stop && range->start < buffer->used) {
if (buffer->string[range->start] == f_iki_syntax_placeholder) {
- range->start++;
+ ++range->start;
continue;
}
vocabulary_delimited = F_true;
quote = buffer->string[range->start];
- range->start++;
+ ++range->start;
break;
}
else {
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
} // while
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
else if (range->start > range->stop) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return F_data_not_stop;
}
else if (range->start >= buffer->used) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return F_data_not_eos;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
} // while
while (range->start <= range->stop && range->start < buffer->used) {
if (buffer->string[range->start] == f_iki_syntax_placeholder) {
- range->start++;
+ ++range->start;
+
continue;
}
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
delimits.array[delimits.used] = vocabulary_slash_first;
- delimits.used++;
+ ++delimits.used;
find_next = F_true;
vocabulary_delimited = F_false;
quote = 0;
- range->start++;
+ ++range->start;
break;
}
else {
variable->array[variable->used].start = found_vocabulary.start;
variable->array[variable->used].stop = range->start;
- variable->used++;
+ ++variable->used;
vocabulary->array[vocabulary->used].start = found_vocabulary.start;
vocabulary->array[vocabulary->used].stop = found_vocabulary.stop;
- vocabulary->used++;
+ ++vocabulary->used;
content->array[content->used].start = found_content;
content->array[content->used].stop = range->start - 1;
- content->used++;
+ ++content->used;
- for (f_array_length_t i = 0; i < delimits.used; i++) {
+ for (f_array_length_t i = 0; i < delimits.used; ++i) {
buffer->string[delimits.array[i]] = f_iki_syntax_placeholder;
} // for
macro_f_array_lengths_t_delete_simple(delimits);
if (F_status_is_error(status)) return status;
- range->start++;
+ ++range->start;
if (range->start > range->stop) {
return F_none_stop;
while (range->start <= range->stop && range->start < buffer->used) {
if (buffer->string[range->start] == f_iki_syntax_placeholder) {
- range->start++;
+ ++range->start;
+
continue;
}
f_array_length_t i = 0;
if (content_slash_total % 2) {
- content_slash_delimits++;
+ ++content_slash_delimits;
}
if (delimits.used + content_slash_delimits > delimits.size) {
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
}
if (buffer->string[content_range.start] == f_iki_syntax_slash) {
delimits.array[delimits.used] = content_range.start;
- delimits.used++;
+ ++delimits.used;
- i++;
+ ++i;
}
status = f_utf_buffer_increment(*buffer, (&content_range), 1);
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
delimits.array[delimits.used] = vocabulary_slash_first;
- delimits.used++;
+ ++delimits.used;
vocabulary_delimited = F_false;
quote = 0;
- range->start++;
+ ++range->start;
// skip past all initial non-word, non-dash, and non-plus.
macro_f_iki_seek_word_dash_plus(status, buffer, range, width_max, F_true);
if (F_status_is_error(status)) {
macro_f_array_lengths_t_delete_simple(delimits);
+
return status;
}
variable->array[variable->used].start = found_vocabulary.start;
variable->array[variable->used].stop = range->start;
- variable->used++;
+ ++variable->used;
vocabulary->array[vocabulary->used].start = found_vocabulary.start;
vocabulary->array[vocabulary->used].stop = found_vocabulary.stop;
- vocabulary->used++;
+ ++vocabulary->used;
content->array[content->used].start = found_content;
content->array[content->used].stop = range->start - 1;
- content->used++;
+ ++content->used;
- for (f_array_length_t i = 0; i < delimits.used; i++) {
+ for (f_array_length_t i = 0; i < delimits.used; ++i) {
buffer->string[delimits.array[i]] = f_iki_syntax_placeholder;
} // for
macro_f_array_lengths_t_delete_simple(delimits);
if (F_status_is_error(status)) return status;
- range->start++;
+ ++range->start;
if (range->start > range->stop) {
return F_none_stop;
break;
}
- content_slash_total++;
+ ++content_slash_total;
status = f_utf_buffer_increment(*buffer, range, 1);
}
} while (range->start <= range->stop && range->start < buffer->used);
- for (f_array_length_t i = 0; i < delimits.used; i++) {
+ for (f_array_length_t i = 0; i < delimits.used; ++i) {
buffer->string[delimits.array[i]] = f_iki_syntax_placeholder;
} // for
* @return
* F_true on success and string is a valid content name.
* F_false on success and string is not a valid content name.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_iki_content_partial_is_
* @return
* F_true on success and string is a valid object name.
* F_false on success and string is not a valid object name.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_is_word().
* @return
* F_true on success and string is a valid object name.
* F_false on success and string is not a valid object name.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_is_word().
* F_data_not on success, but there were no IKI vocabulary names found.
* F_data_not_eos on success and EOS was reached, but there were no IKI vocabulary names found.
* F_data_not_stop on success and stop point was reached, but there were no IKI vocabulary names found.
+ *
* F_memory_not (with error bit) on out of memory.
* 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.
#if !defined(_di_f_iki_content_is_) || !defined(_di_f_iki_content_partial_is_)
f_status_t private_f_iki_content_partial_is(const f_string_static_t buffer, const f_string_range_t range, const uint8_t quote) {
+
f_array_length_t delimits = 0;
- for (f_array_length_t i = 0; i < buffer.used; i++) {
+ for (f_array_length_t i = 0; i < buffer.used; ++i) {
if (buffer.string[i] == quote) {
if (delimits && delimits % 2) {
delimits = 0;
+
continue;
}
return F_false;
}
else if (buffer.string[i] == f_iki_syntax_slash) {
- delimits++;
+ ++delimits;
}
else {
delimits = 0;
#if !defined(_di_f_iki_object_is_) || !defined(_di_f_iki_object_partial_is_)
f_status_t private_f_iki_object_partial_is(const f_string_static_t buffer, const f_string_range_t range) {
+
f_status_t status = F_none;
- for (f_array_length_t i = 0; i < buffer.used; i++) {
+ for (f_array_length_t i = 0; i < buffer.used; ++i) {
status = f_utf_is_word(buffer.string + i, buffer.used - i, F_false);
if (F_status_is_error(status)) return status;
* @return
* F_true on success and string is a valid content name.
* F_false on success and string is not a valid content name.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* @see f_iki_content_is()
* @return
* F_true on success and string is a valid object name.
* F_false on success and string is not a valid object name.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* @see f_iki_object_is()
/**
* A limit value structure.
*
- * rlim_cur: the soft limit.
- * rlim_max: the hard limit.
+ * rlim_cur: The soft limit.
+ * rlim_max: The hard limit.
*/
#ifndef _di_f_limit_value_t_
typedef struct rlimit f_limit_value_t;
/**
* A limit value structure.
*
- * type: the limit resource type code.
- * value: the limit value containing the soft and hard limit.
+ * type: The limit resource type code.
+ * value: The limit value containing the soft and hard limit.
*/
#ifndef _di_f_limit_set_t_
typedef struct {
}
for (f_array_length_t i = 0; i < source.used; ++i) {
+
destination->array[i].type = source.array[i].type;
destination->array[i].value = source.array[i].value;
} // for
}
for (f_array_length_t i = 0; i < source.used; ++i) {
+
destination->array[i].rlim_cur = source.array[i].rlim_cur;
destination->array[i].rlim_max = source.array[i].rlim_max;
} // for
#endif // _di_level_0_parameter_checking_
// prevent double-frees.
- if (!*pointer || !size) return F_data_not;
+ if (!*pointer || !size) {
+ return F_data_not;
+ }
#ifdef _f_memory_FORCE_secure_memory_
if (!length) {
#endif // _di_level_0_parameter_checking_
// prevent double-frees.
- if (!*pointer) return F_data_not;
+ if (!*pointer) {
+ return F_data_not;
+ }
#ifndef _f_memory_FORCE_fast_memory_
if (!length) {
#endif // _di_level_0_parameter_checking_
// prevent double-allocations.
- if (*pointer || !length) return F_data_not;
+ if (*pointer || !length) {
+ return F_data_not;
+ }
// Some people use malloc(size * length) to produce the same results.
// This has been observed to sometimes causes an increase in L1/L2 cache misses (0.02% L1 increase, 0.01% L2 increase).
#endif // _di_level_0_parameter_checking_
// prevent double-allocations.
- if (*pointer || !length) return F_data_not;
+ if (*pointer || !length) {
+ return F_data_not;
+ }
const int result = posix_memalign(pointer, alignment, length);
if (result) {
- if (result == EINVAL) return F_status_set_error(F_parameter);
+ if (result == EINVAL) {
+ return F_status_set_error(F_parameter);
+ }
return F_status_set_error(F_memory_not);
}
return F_false;
}
- for (f_array_length_t i = 0; i < length; i++) {
+ for (f_array_length_t i = 0; i < length; ++i) {
if (path[i] == f_path_separator_s[0]) {
return F_true;
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_buffer_too_small (with error bit) if the buffer is too small to store the path.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_buffer_too_small (with error bit) if the buffer is too small to store the path.
#if !defined(_di_f_path_current_) || !defined(_di_f_path_real_)
f_status_t private_f_path_real(const f_string_t path, f_string_dynamic_t *real) {
+
char buffer[f_path_length_max];
if (!realpath(path, buffer)) {
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_input_output (with error bit) on I/O error.
* @return
* F_true if there is piped data.
* F_false if there is no piped data.
+ *
* F_file_stat (with error bit) on stat() error.
*
* @see fstat()
* @return
* F_true if there is piped data.
* F_false if there is no piped data.
+ *
* F_file_stat (with error bit) on stat() error.
*
* @see fstat()
* @return
* F_false if there is no piped data.
* F_true if there is piped data.
+ *
* F_file_stat (with error bit) on stat() error.
*
* @see fstat()
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!string || !length) return F_data_not;
+ if (!string || !length) {
+ return F_data_not;
+ }
return private_f_print(output, string, length);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not;
+ if (!buffer.used) {
+ return F_data_not;
+ }
return private_f_print(output, buffer.string, buffer.used);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!string || length == 0) return F_data_not;
+ if (!string || length == 0) {
+ return F_data_not;
+ }
return private_f_print_except(output, string, 0, length, except);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!string || length == 0) return F_data_not;
+ if (!string || length == 0) {
+ return F_data_not;
+ }
return private_f_print_to(id, string, length);
}
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not;
+ if (!buffer.used) {
+ return F_data_not;
+ }
return private_f_print_to(id, buffer.string, buffer.used);
}
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!string || length == 0) return F_data_not;
+ if (!string || length == 0) {
+ return F_data_not;
+ }
return private_f_print_to_except(id, string, 0, length, except);
}
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used) return F_data_not;
+ if (!buffer.used) {
+ return F_data_not;
+ }
return private_f_print_to_except(id, buffer.string, 0, buffer.used, except);
}
if (id == -1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_data_not if there is nothing to print.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
for (; i < length; ++i) {
if (string[i]) {
- total++;
+ ++total;
+
continue;
}
if (j >= except.used || except.array[j] != i) {
if (string[i]) {
- total++;
+ ++total;
+
continue;
}
}
* @return
* F_none on success.
* F_data_not if length is 0.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if length is 0.
+ *
* F_output (with error bit) on failure.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if length is 0.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
* @return
* F_none on success.
* F_data_not if length is 0.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
unsigned short width = 0;
for (; i < serialize.used; i += width) {
+
width = macro_f_utf_byte_width(serialize.string[i]);
if (serialize.string[i] == f_serialize_simple_splitter_s[0]) {
}
start = i + width;
- current++;
+ ++current;
}
else if (i == serialize.used) {
if (current == index) {
return F_none_eos;
}
- if (i + width > serialize.used) return F_status_set_error(F_complete_not_utf_eos);
+ if (i + width > serialize.used) {
+ return F_status_set_error(F_complete_not_utf_eos);
+ }
} // for
return F_data_not_eos;
* F_none on success.
* F_none_eos on success at end of string.
* F_data_not_eos if end of string reached before index was reached.
+ *
* F_complete_not_utf_eos (with error bit) if end of string is reached before a complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
*/
uint8_t width = 0;
while (i < serialize.used) {
+
width = macro_f_utf_byte_width(serialize.string[i]);
if (serialize.string[i] == f_serialize_simple_splitter_s[0] || i + 1 >= serialize.used) {
if (start == i) {
strings->array[strings->used].used = 0;
- strings->used++;
+ ++strings->used;
}
else {
f_array_length_t total;
total = (i - start) + 1;
}
else {
+
// subtract one from stop point to disclused the f_serialize_simple_splitter_s[0] character.
total = ((i - 1) - start) + 1;
}
uint8_t width = 0;
for (; i < serialize.used; i += width) {
+
width = macro_f_utf_byte_width(serialize.string[i]);
if (serialize.string[i] == f_serialize_simple_splitter_s[0] || i + 1 >= serialize.used) {
if (F_status_is_error(status)) return status;
if (start == i) {
+
// provide an invalid start to stop range to communicate that there is no data.
locations->array[locations->used].start = 1;
locations->array[locations->used].stop = 0;
locations->array[locations->used].stop = i;
}
else {
+
// subtract one from stop point to disclused the f_serialize_simple_splitter_s[0] character.
locations->array[locations->used].start = start;
locations->array[locations->used].stop = i - 1;
}
- locations->used++;
+ ++locations->used;
if (i + width > serialize.used) {
return F_status_set_error(F_complete_not_utf_eos);
if (status == F_data_not_eos) {
dynamic->used = 0;
+
return status;
}
f_array_length_t first = 0;
f_array_length_t size = 0;
- for (; i < length; i++) {
+ for (; i < length; ++i) {
if (source[i]) continue;
}
while (i + 1 < length && !source[i + 1]) {
- i++;
+ ++i;
} // while
first = i + 1;
f_status_t status = F_none;
for (f_array_length_t i = length; i < dynamics->size; ++i) {
+
status = private_f_string_dynamic_adjust(0, &dynamics->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
for (f_array_length_t i = length; i < dynamics->size; ++i) {
+
status = private_f_string_dynamic_resize(0, &dynamics->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_array_length_t size = 0;
- for (f_array_length_t i = 0; i <= length; i++) {
+ for (f_array_length_t i = 0; i <= length; ++i) {
if (i == length) {
if (i > first) {
}
while (i + 1 < length && !source[i + 1]) {
- i++;
+ ++i;
} // while
first = i + 1;
f_status_t status = F_none;
for (f_array_length_t i = length; i < quantityss->size; ++i) {
+
status = private_f_string_quantitys_adjust(0, &quantityss->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
for (f_array_length_t i = length; i < quantityss->size; ++i) {
+
status = private_f_string_quantitys_resize(0, &quantityss->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
for (f_array_length_t i = length; i < rangess->size; ++i) {
+
status = private_f_string_ranges_adjust(0, &rangess->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
for (f_array_length_t i = length; i < rangess->size; ++i) {
+
status = private_f_string_ranges_resize(0, &rangess->array[i]);
if (F_status_is_error(status)) return status;
} // for
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
return private_f_string_append(source, length, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
- if (destination->used < length) return private_f_string_append(source, length, destination);
+ if (!length) {
+ return F_data_not_eos;
+ }
+
+ if (destination->used < length) {
+ return private_f_string_append(source, length, destination);
+ }
f_array_length_t i = 1;
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source[length - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_append(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (destination->used < length) {
return private_f_string_append_nulless(source, length, destination);
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source[length - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_append_nulless(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
return private_f_string_append_nulless(source, length, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_append(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_append_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_prepend(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
return private_f_string_prepend(source, length, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (destination->used < length) {
return private_f_string_prepend(source, length, destination);
while (i < length && j < destination->used) {
if (!source[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_prepend(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (destination->used < length) {
return private_f_string_prepend_nulless(source, length, destination);
while (i < length && j < destination->used) {
if (!source[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_prepend_nulless(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
return private_f_string_prepend_nulless(source, length, destination);
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
while (string[range->start] != f_string_eol_s[0]) {
- range->start++;
- if (range->start > range->stop) return F_none_stop;
+ ++range->start;
+
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
while (string[range->start] != seek_to) {
- if (string[range->start] == f_string_eol_s[0]) return F_none_eol;
- range->start++;
+ if (string[range->start] == f_string_eol_s[0]) {
+ return F_none_eol;
+ }
+
+ ++range->start;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
while (string[range->start] != seek_to) {
- range->start++;
- if (range->start > range->stop) return F_none_stop;
+ ++range->start;
+
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
return private_f_string_append(source.string, source.used, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (destination->used < source.used) {
return private_f_string_append(source.string, source.used, destination);
f_array_length_t j = 1;
while (i <= source.used && j <= destination->used) {
+
if (!source.string[source.used - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_append(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (destination->used < source.used) {
return private_f_string_append_nulless(source.string, source.used, destination);
f_array_length_t j = 1;
while (i <= source.used && j <= destination->used) {
+
if (!source.string[source.used - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_append_nulless(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
return private_f_string_append_nulless(source.string, source.used, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_string_append(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_string_append_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_string_prepend(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return private_f_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
const f_array_length_t length = (range.stop - range.start) + 1;
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source.string[range.stop - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_append(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
const f_array_length_t length = (range.stop - range.start) + 1;
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source.string[range.stop - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_append_nulless(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return private_f_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_append(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_append_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_prepend(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_string_prepend_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return private_f_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
const f_array_length_t length = (range.stop - range.start) + 1;
f_array_length_t j = 0;
while (i < length && j < destination->used) {
+
if (!source.string[i + range.start]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_prepend(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
const f_array_length_t length = (range.stop - range.start) + 1;
f_array_length_t j = 0;
while (i < length && j < destination->used) {
+
if (!source.string[i + range.start]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_prepend_nulless(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return private_f_string_prepend_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
return private_f_string_prepend(source.string, source.used, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (destination->used < source.used) {
return private_f_string_prepend(source.string, source.used, destination);
f_array_length_t j = 0;
while (i < source.used && j < destination->used) {
+
if (!source.string[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_prepend(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (destination->used < source.used) {
return private_f_string_prepend_nulless(source.string, source.used, destination);
f_array_length_t j = 0;
while (i < source.used && j < destination->used) {
+
if (!source.string[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_string_prepend_nulless(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (range->start > range->stop) return F_data_not_stop;
while (buffer.string[range->start] != f_string_eol_s[0]) {
- range->start++;
+
+ ++range->start;
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
#endif // _di_level_0_parameter_checking_
if (destination->used) {
- for (; destination->used; destination->used--) {
+ for (; destination->used; --destination->used) {
+
if (!destination->string[destination->used - 1]) continue;
break;
} // for
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not;
+ if (!source.used) {
+ return F_data_not;
+ }
return private_f_string_dynamics_append(source, destination);
}
*
* A special macro_f_string_static_t_initialize() is provided for the special purpose of easily initialize a static string.
*
- * string: the string.
- * size: total amount of space available.
- * used: total number of space used.
+ * string: The string.
+ * size: Total amount of space available.
+ * used: Total number of space used.
*/
#ifndef _di_f_string_static_t_
typedef struct {
* This is a sub-type of f_string_static_t, allowing it to be passed into any f_string_static_t type.
* It is recommended that f_string_static_t are not otherwise casted into f_string_dynamic_t to avoid potential memory allocation issues.
*
- * string: the string.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * string: The string.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_string_dynamic_t_
typedef f_string_static_t f_string_dynamic_t;
/**
* An array of static dynamics.
*
- * array: the array of static dynamics.
- * size: total amount of space available.
- * used: total number of space used.
+ * array: The array of static dynamics.
+ * size: Total amount of space available.
+ * used: Total number of space used.
*/
#ifndef _di_f_string_statics_t_
typedef struct {
/**
* An array of dynamic dynamics.
*
- * array: the array of dynamic dynamics.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of dynamic dynamics.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_string_dynamics_t_
typedef f_string_statics_t f_string_dynamics_t;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not;
+ if (!source.used) {
+ return F_data_not;
+ }
f_status_t status = F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not;
+ if (!source.used) {
+ return F_data_not;
+ }
f_status_t status = F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not;
+ if (!source.used) {
+ return F_data_not;
+ }
f_status_t status = F_none;
/**
* A string triple consisting of a set of three strings.
*
- * one: A string representing the first string in the triple.
- * two: A string representing the second string in the triple.
+ * one: A string representing the first string in the triple.
+ * two: A string representing the second string in the triple.
* three: A string representing the third string in the triple.
*/
#ifndef _di_f_string_triple_t_
/**
* An array of string triples.
*
- * array: the array of string triples.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of string triples.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_string_triples_t_
typedef struct {
#if !defined(_di_f_thread_spins_decrease_) || !defined(_di_f_thread_spins_decrease_by_) || !defined(_di_f_thread_spins_increase_) || !defined(_di_f_thread_spins_increase_by_)
f_status_t private_f_thread_spins_resize(const f_array_length_t length, f_thread_spins_t *spins) {
+
f_status_t status = F_none;
for (f_array_length_t i = length; i < spins->size; ++i) {
/**
* An array of f_thread_attribute_t.
*
- * array: the array of f_thread_attribute_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_attribute_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_attributes_t_
typedef struct {
/**
* An array of f_thread_barrier_t.
*
- * array: the array of f_thread_barrier_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_barrier_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_barriers_t_
typedef struct {
/**
* An array of f_thread_barrier_attribute_t.
*
- * array: the array of f_thread_barrier_attribute_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_barrier_attribute_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_barrier_attributes_t_
typedef struct {
/**
* An array of thread conditions.
*
- * array: the array of f_thread_condition_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_condition_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_conditions_t_
typedef struct {
/**
* An array of thread condition attributes.
*
- * array: the array of f_thread_condition_attribute_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_condition_attribute_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_condition_attributes_t_
typedef struct {
/**
* An array of thread IDs.
*
- * array: the array of f_thread_id_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_id_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_ids_t_
typedef struct {
/**
* An array of thread keys.
*
- * array: the array of f_thread_key_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_key_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_keys_t_
typedef struct {
/**
* An array of thread locks.
*
- * array: the array of f_thread_lock_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_lock_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_locks_t_
typedef struct {
/**
* An array of read/write lock attributees.
*
- * array: the array of f_thread_lock_attribute_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_lock_attribute_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_lock_attributes_t_
typedef struct {
/**
* An array of thread mutexes.
*
- * array: the array of f_thread_mutex_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_mutex_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_mutexs_t_
typedef struct {
/**
* An array of thread mutex_attributees.
*
- * array: the array of f_thread_mutex_attribute_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_mutex_attribute_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_mutex_attributes_t_
typedef struct {
/**
* An array of thread onces.
*
- * array: the array of f_thread_once_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_once_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_onces_t_
typedef struct {
/**
* An array of thread semaphorees.
*
- * array: the array of f_thread_semaphore_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_semaphore_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_semaphores_t_
typedef struct {
/**
* An array of f_thread_set_t.
*
- * array: the array of f_thread_set_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_set_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_sets_t_
typedef struct {
/**
* A typedef representing pthread_spinlock_t.
*
- * Note: there appears to be no pthread init macro for spinlock, so initialize manually similarly to how the other inits work.
+ * Note: There appears to be no pthread init macro for spinlock, so initialize manually similarly to how the other inits work.
*/
#ifndef _di_f_thread_spin_t_
typedef pthread_spinlock_t f_thread_spin_t;
/**
* An array of thread spins.
*
- * array: the array of f_thread_spin_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_thread_spin_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_thread_spins_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array lengths.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array lengths.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_array_lengthss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of f_cell_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_cell_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_f_cells_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array int8_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array int8_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_int8ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array uint8_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array uint8_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_uint8ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array int16_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array int16_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_int16ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array uint16_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array uint16_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_uint16ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array int32_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array int32_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_int32ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array uint32_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array uint32_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_uint32ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array int64_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array int64_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_int64ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of an array of array uint64_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of an array of array uint64_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_uint64ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of f_int128_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_int128_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_int128s_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of and array of f_int128_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of and array of f_int128_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_int128ss_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of f_uint128_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of f_uint128_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_uint128s_t_
typedef struct {
*
* The macros are defined in type_array.h or type_array-common.h.
*
- * array: the array of and array of f_uint128_t.
- * size: total amount of allocated space.
- * used: total number of allocated spaces used.
+ * array: The array of and array of f_uint128_t.
+ * size: Total amount of allocated space.
+ * used: Total number of allocated spaces used.
*/
#ifndef _di_uint128ss_t_
typedef struct {
#if !defined(_di_f_utf_character_is_zero_width_) || !defined(_di_f_utf_is_zero_width_)
f_status_t private_f_utf_character_is_zero_width(const f_utf_character_t character, const uint8_t width) {
+
// reduce the number of checks by grouping checks by first byte.
const uint8_t byte_first = macro_f_utf_character_t_to_char_1(character);
f_array_length_t first = 0;
f_array_length_t size = 0;
- for (; i < length; i++) {
+ for (; i < length; ++i) {
if (source[i]) continue;
}
while (i + 1 < length && !source[i + 1]) {
- i++;
+ ++i;
} // while
first = i + 1;
f_status_t status = F_none;
for (f_array_length_t i = length; i < dynamics->size; ++i) {
+
status = private_f_utf_string_dynamic_adjust(0, &dynamics->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_array_length_t size = 0;
- for (f_array_length_t i = 0; i <= length; i++) {
+ for (f_array_length_t i = 0; i <= length; ++i) {
if (i == length) {
if (i > first) {
}
while (i + 1 < length && !source[i + 1]) {
- i++;
+ ++i;
} // while
first = i + 1;
f_status_t status = F_none;
for (f_array_length_t i = length; i < quantityss->size; ++i) {
+
status = private_f_utf_string_quantitys_adjust(0, &quantityss->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
for (f_array_length_t i = length; i < quantityss->size; ++i) {
+
status = private_f_utf_string_quantitys_resize(0, &quantityss->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
for (f_array_length_t i = length; i < rangess->size; ++i) {
+
status = private_f_utf_string_ranges_adjust(0, &rangess->array[i]);
if (F_status_is_error(status)) return status;
} // for
f_status_t status = F_none;
for (f_array_length_t i = length; i < rangess->size; ++i) {
+
status = private_f_utf_string_ranges_resize(0, &rangess->array[i]);
if (F_status_is_error(status)) return status;
} // for
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_alpha()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_alpha_digit()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_alpha_numeric()
* @return
* F_true if a UTF-8 control picture character.
* F_false if not a UTF-8 control picture character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_ascii()
* @return
* F_true if a UTF-8 control picture character.
* F_false if not a UTF-8 control picture character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_combining()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_control()
* @return
* F_true if a UTF-8 control picture character.
* F_false if not a UTF-8 control picture character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_control_picture()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_digit()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_emoji()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_numeric()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_phonetic()
* @return
* F_true if a UTF-8 character.
* F_false if not a UTF-8 character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_private()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_punctuation()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_symbol()
* @return
* F_true if a UTF-8 character.
* F_false if not a UTF-8 character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_unassigned()
* @return
* F_true if a UTF-8 character.
* F_false if not a UTF-8 character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_valid()
* @return
* F_true if a UTF-8 whitespace.
* F_false if not a UTF-8 whitespace.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_whitespace()
* @return
* F_true if a UTF-8 phonetic whitespace.
* F_false if not a UTF-8 phonetic whitespace.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_whitespace_modifier()
* @return
* F_true if a UTF-8 whitespace.
* F_false if not a UTF-8 whitespace.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_whitespace_other()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_word()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_word_dash()
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_word_dash_plus()
* @return
* F_true if a UTF-8 non-printing or zero-width character.
* F_false if not a UTF-8 non-printing or zero-width character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_zero_width()
if (step < 1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used || range->start > range->stop || range->start >= buffer.used) return F_data_not;
+ if (!buffer.used || range->start > range->stop || range->start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t i = 0;
uint8_t width = 0;
return F_none_eos;
}
- i++;
+ ++i;
range->start -= width;
+
} while (i < step);
return F_none;
if (step < 1) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!buffer.used || range->start > range->stop || range->start >= buffer.used) return F_data_not;
+ if (!buffer.used || range->start > range->stop || range->start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t i = 0;
uint8_t width = 0;
return F_none_eos;
}
- i++;
+ ++i;
range->start += width;
+
} while (i < step);
return F_none;
if (!width) {
*character_utf = macro_f_utf_character_t_from_char_1(character[0]);
+
return F_none;
}
else if (width == 1) {
#ifndef _di_f_utf_character_is_
f_status_t f_utf_character_is(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_alpha_
f_status_t f_utf_character_is_alpha(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_alpha_digit_
f_status_t f_utf_character_is_alpha_digit(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_alpha_numeric_
f_status_t f_utf_character_is_alpha_numeric(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_ascii_
f_status_t f_utf_character_is_ascii(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (width == 1) {
#ifndef _di_f_utf_character_is_combining_
f_status_t f_utf_character_is_combining(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_control_
f_status_t f_utf_character_is_control(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_control_picture_
f_status_t f_utf_character_is_control_picture(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_digit_
f_status_t f_utf_character_is_digit(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_emoji_
f_status_t f_utf_character_is_emoji(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_fragment_
f_status_t f_utf_character_is_fragment(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (width == 1) return F_true;
#ifndef _di_f_utf_character_is_graph_
f_status_t f_utf_character_is_graph(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_numeric_
f_status_t f_utf_character_is_numeric(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_phonetic_
f_status_t f_utf_character_is_phonetic(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_private_
f_status_t f_utf_character_is_private(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_punctuation_
f_status_t f_utf_character_is_punctuation(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_symbol_
f_status_t f_utf_character_is_symbol(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_unassigned_
f_status_t f_utf_character_is_unassigned(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width || width == 1) {
#ifndef _di_f_utf_character_is_valid_
f_status_t f_utf_character_is_valid(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (width == 1) {
#ifndef _di_f_utf_character_is_whitespace_
f_status_t f_utf_character_is_whitespace(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_whitespace_modifier_
f_status_t f_utf_character_is_whitespace_modifier(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_whitespace_other_
f_status_t f_utf_character_is_whitespace_other(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_word_
f_status_t f_utf_character_is_word(const f_utf_character_t character, const bool strict) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_word_dash_
f_status_t f_utf_character_is_word_dash(const f_utf_character_t character, const bool strict) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_word_dash_plus_
f_status_t f_utf_character_is_word_dash_plus(const f_utf_character_t character, const bool strict) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
#ifndef _di_f_utf_character_is_zero_width_
f_status_t f_utf_character_is_zero_width(const f_utf_character_t character) {
+
const uint8_t width = macro_f_utf_character_t_width_is(character);
if (!width) {
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
const uint8_t width = macro_f_utf_byte_width_is(*character);
if (!width) {
+
// There are no ASCII phonetic characters.
return F_false;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
const uint8_t width = macro_f_utf_byte_width_is(*character);
if (!width) {
+
// There are no ASCII private characters.
return F_false;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_utf_character_t character_utf = 0;
{
- f_status_t status = 0;
-
- status = f_utf_char_to_character(character, width_max, &character_utf);
-
+ const f_status_t status = f_utf_char_to_character(character, width_max, &character_utf);
if (F_status_is_error(status)) return status;
}
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source[length - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_append(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (destination->used < length) {
return private_f_utf_string_append_nulless(source, length, destination);
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source[length - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_append_nulless(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
while (i < length && j < destination->used) {
if (!source[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_prepend(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
if (destination->used < length) {
return private_f_utf_string_prepend_nulless(source, length, destination);
while (i < length && j < destination->used) {
if (!source[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_prepend_nulless(source, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
while (string[range->start] != f_utf_character_t_eol) {
return F_status_set_error(F_utf);
}
- range->start++;
+ ++range->start;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
while (string[range->start] != seek_to) {
return F_status_set_error(F_utf);
}
- 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++;
+ ++range->start;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
while (string[range->start] != seek_to) {
return F_status_set_error(F_utf);
}
- range->start++;
+ ++range->start;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
* F_none_stop if the stop range is reached before all steps are completed.
* F_none_eos if the end of buffer is reached before all steps are completed.
* F_data_not if buffer is empty or out of range.
+ *
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
*/
* F_none_stop if the stop range is reached before all steps are completed.
* F_none_eos if the end of buffer is reached before all steps are completed.
* F_data_not if buffer is empty or out of range.
+ *
* F_complete_not_utf_stop (with error bit) if the stop range is reached before the complete UTF-8 character can be processed.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_true if a UTF-8 character.
* F_false if not a UTF-8 character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is_valid()
* @return
* F_true if a UTF-8 alphabet character.
* F_false if not a UTF-8 alphabet character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isalpha()
* @return
* F_true if a UTF-8 alpha-digit character.
* F_false if not a UTF-8 alpha-digit character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isalnum()
* @return
* F_true if a UTF-8 alpha-numeric character.
* F_false if not a UTF-8 alpha-numeric character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isalnum()
* @return
* F_true if an ASCII character.
* F_false if not an ASCII character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_ascii_
* @return
* F_true if a UTF-8 control picture character.
* F_false if not a UTF-8 control picture character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_combining_
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see iscntrl()
* @return
* F_true if a UTF-8 control picture character.
* F_false if not a UTF-8 control picture character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_control_picture_
* @return
* F_true if a UTF-8 digit character.
* F_false if not a UTF-8 digit character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isdigit()
* @return
* F_true if a UTF-8 emoji character.
* F_false if not a UTF-8 emoji character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_emoji_
* @return
* F_true if a UTF-8 character.
* F_false if not a UTF-8 character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is()
* @return
* F_true if a UTF-8 graph.
* F_false if not a UTF-8 graph.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isgraph()
* @return
* F_true if a UTF-8 numeric character.
* F_false if not a UTF-8 numeric character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isdigit()
* @return
* F_true if a UTF-8 phonetic character.
* F_false if not a UTF-8 phonetic character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_phonetic_
* @return
* F_true if a UTF-8 private character.
* F_false if not a UTF-8 private character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_private_
* @return
* F_true if a UTF-8 punctuation character.
* F_false if not a UTF-8 punctuation character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_punctuation_
* @return
* F_true if a UTF-8 symbol character.
* F_false if not a UTF-8 symbol character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_symbol_
* @return
* F_true if a UTF-8 unassigned character.
* F_false if not a UTF-8 unassigned character.
+ *
* F_utf (with error bit) if character is an inunassigned UTF-8 character.
*
* @see f_utf_character_is()
* @return
* F_true if a UTF-8 character.
* F_false if not a UTF-8 character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see f_utf_character_is()
* @return
* F_true if a UTF-8 whitespace.
* F_false if not a UTF-8 whitespace.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isspace()
* @return
* F_true if a UTF-8 modifier character.
* F_false if not a UTF-8 modifier character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_whitespace_modifier_
* @return
* F_true if a UTF-8 (other) whitespace.
* F_false if not a UTF-8 (other) whitespace.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isspace()
* @return
* F_true if a UTF-8 word character.
* F_false if not a UTF-8 word character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isalnum()
* @return
* F_true if a UTF-8 word or dash character.
* F_false if not a UTF-8 word or dash character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isalnum()
* @return
* F_true if a UTF-8 word or dash character.
* F_false if not a UTF-8 word or dash character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*
* @see isalnum()
* @return
* F_true if a UTF-8 non-printing or zero-width character.
* F_false if not a UTF-8 non-printing or zero-width character.
+ *
* F_utf (with error bit) if character is an invalid UTF-8 character.
*/
#ifndef _di_f_utf_character_is_zero_width_
*
* @return
* F_none if conversion was successful.
+ *
* F_failure (with error bit) if width is not long enough to convert.
* F_parameter (with error bit) if a parameter is invalid.
* F_memory_not (with error bit) on out of memory.
* @return
* F_true if a UTF-8 character.
* F_false if not a UTF-8 character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_parameter (with error bit) if a parameter is invalid.
*/
* @return
* F_true if a UTF-8 alphabet character.
* F_false if not a UTF-8 alphabet character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isalpha()
*
* @return
* F_true if a UTF-8 alphabet character.
- * F_false if not a UTF-8 alpha-numeric character.x
+ * F_false if not a UTF-8 alpha-numeric character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isalnum()
*
* @return
* F_true if a UTF-8 alphabet character.
- * F_false if not a UTF-8 alpha-numeric character.x
+ * F_false if not a UTF-8 alpha-numeric character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isalnum()
* @return
* F_true if an ASCII character.
* F_false if not an ASCII character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_is_ascii_
* @return
* F_true if a UTF-8 control picture character.
* F_false if not a UTF-8 control picture character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_is_combining_
* @return
* F_true if a UTF-8 control character.
* F_false if not a UTF-8 control character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see iscntrl()
* @return
* F_true if a UTF-8 control picture character.
* F_false if not a UTF-8 control picture character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_is_control_picture_
* @return
* F_true if a UTF-8 digit character.
* F_false if not a UTF-8 digit character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isdigit()
* @return
* F_true if a UTF-8 graph.
* F_false if not a UTF-8 graph.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_maybe (with error bit) if this could be a graph but width is not long enough.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_true if a UTF-8 numeric character.
* F_false if not a UTF-8 numeric character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isdigit()
* @return
* F_true if a UTF-8 phonetic character.
* F_false if not a UTF-8 phonetic character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_is_phonetic_
* @return
* F_true if a UTF-8 punctuation character.
* F_false if not a UTF-8 punctuation character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_is_private_
* @return
* F_true if a UTF-8 punctuation character.
* F_false if not a UTF-8 punctuation character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_is_punctuation_
* @return
* F_true if a UTF-8 symbol character.
* F_false if not a UTF-8 symbol character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*/
#ifndef _di_f_utf_is_symbol_
* @return
* F_true if an unassigned UTF-8 character.
* F_false if not an unassigned UTF-8 character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_parameter (with error bit) if a parameter is inunassigned.
*/
* @return
* F_true if a valid UTF-8 character.
* F_false if not a valid UTF-8 character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_parameter (with error bit) if a parameter is invalid.
*/
* @return
* F_true if a UTF-8 whitespace.
* F_false if not a UTF-8 whitespace.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_maybe (with error bit) if this could be a whitespace but width is not long enough.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_true if a UTF-8 whitespace.
* F_false if not a UTF-8 whitespace.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_maybe (with error bit) if this could be a whitespace but width is not long enough.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_true if a UTF-8 whitespace.
* F_false if not a UTF-8 whitespace.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_maybe (with error bit) if this could be a whitespace but width is not long enough.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_true if a UTF-8 word character.
* F_false if not a UTF-8 word character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isalnum()
* @return
* F_true if a UTF-8 word or dash character.
* F_false if not a UTF-8 word or dash character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isalnum()
* @return
* F_true if a UTF-8 word or dash character.
* F_false if not a UTF-8 word or dash character.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
*
* @see isalnum()
* @return
* F_true if a UTF-8 whitespace.
* F_false if not a UTF-8 whitespace.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_maybe (with error bit) if this could be a whitespace but width is not long enough.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none if conversion was successful.
+ *
* F_failure (with error bit) if width is not long enough to convert.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if character is an invalid UTF-8 character.
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
return private_f_utf_string_append(source.string, source.used, destination);
}
f_array_length_t j = 1;
while (i <= source.used && j <= destination->used) {
+
if (!source.string[source.used - i]) {
- i++;
+ ++i;
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_append(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
f_array_length_t j = 1;
while (i <= source.used && j <= destination->used) {
+
if (!source.string[source.used - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_append_nulless(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_utf_string_append(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (glue_length && destination->used) {
const f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return private_f_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
const f_array_length_t length = (range.stop - range.start) + 1;
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source.string[range.stop - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_append(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
f_array_length_t j = 1;
while (i <= length && j <= destination->used) {
+
if (!source.string[range.stop - i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[destination->used - j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_append_nulless(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return private_f_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_append(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_append_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_prepend(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
if (glue_length && destination->used) {
f_status_t status = private_f_utf_string_prepend_nulless(glue, glue_length, destination);
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return private_f_utf_string_prepend(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
const f_array_length_t length = (range.stop - range.start) + 1;
f_array_length_t j = 0;
while (i < length && j < destination->used) {
+
if (!source.string[i + range.start]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_prepend(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
const f_array_length_t length = (range.stop - range.start) + 1;
f_array_length_t j = 0;
while (i < length && j < destination->used) {
+
if (!source.string[i + range.start]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_prepend_nulless(source.string + range.start, length, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
f_array_length_t j = 0;
while (i < source.used && j < destination->used) {
+
if (!source.string[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_prepend(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
if (destination->used < source.used) {
return private_f_utf_string_prepend_nulless(source.string, source.used, destination);
f_array_length_t j = 0;
while (i < source.used && j < destination->used) {
+
if (!source.string[i]) {
- i++;
+ ++i;
+
continue;
}
if (!destination->string[j]) {
- j++;
+ ++j;
+
continue;
}
return private_f_utf_string_prepend_nulless(source.string, source.used, destination);
}
- i++;
- j++;
+ ++i;
+ ++j;
} // while
return F_none;
return F_status_set_error(F_utf);
}
- range->start++;
+ ++range->start;
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
if (buffer.string[range->start] == f_utf_character_t_eol) return F_none_eol;
- range->start++;
+ ++range->start;
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
return F_status_set_error(F_utf);
}
- range->start++;
+ ++range->start;
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
if (destination->used) {
for (; destination->used; destination->used--) {
+
if (!destination->string[destination->used - 1]) continue;
break;
} // for
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (!source.used) return F_data_not;
+ if (!source.used) {
+ return F_data_not;
+ }
f_status_t status = F_none;
if (!length) {
directory->used = 0;
+
return F_none;
}
if (length > 1) {
while (length > 1 && argument[length - 1] == f_path_separator_s[0]) {
- length--;
+ --length;
} // while
if (argument[0] == f_path_separator_s[0]) {
f_array_length_t begin = 1;
while (begin < length && argument[begin] == f_path_separator_s[0]) {
- begin++;
+ ++begin;
} // while
length -= begin;
f_array_length_t begin = 3;
while (begin < length && argument[begin] == f_path_separator_s[0]) {
- begin++;
+ ++begin;
} // while
length -= begin;
f_array_length_t begin = 2;
while (begin < length && argument[begin] == f_path_separator_s[0]) {
- begin++;
+ ++begin;
} // while
length -= begin;
}
}
else {
- length++;
+ ++length;
macro_f_string_dynamic_t_clear((*directory))
macro_f_string_dynamic_t_resize(status, (*directory), length)
*
* @return
* F_none on success.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*/
*
* @return
* F_none on success.
+ *
* F_memory_not (with error bit) if a out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_prohibited (with error bit) if the current user/process has insufficient privileges to set certain cgroup settings.
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_binary(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (negative) {
if (digits > f_conversion_digits_binary_signed) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_binary(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (digits > f_conversion_digits_binary_unsigned) {
return F_status_set_error(F_number_overflow);
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_decimal(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (negative) {
if (digits > f_conversion_digits_decimal_signed) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_decimal(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (digits > f_conversion_digits_decimal_unsigned) {
if ((converted * 10) + digit > f_number_t_size_unsigned || (converted * 10) + digit < converted) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_duodecimal(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (digits > f_conversion_digits_duodecimal_unsigned) {
if ((converted * 12) + digit > f_number_t_size_unsigned || (converted * 12) + digit < converted) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (negative) {
if (digits > f_conversion_digits_hexidecimal_signed) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_hexidecimal(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (digits > f_conversion_digits_hexidecimal_unsigned) {
if ((converted << 4) + digit > f_number_t_size_unsigned || (converted << 4) + digit < converted) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_octal(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (negative) {
if (digits > f_conversion_digits_octal_signed) {
f_number_unsigned_t digit = 0;
f_number_unsigned_t converted = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
if (f_conversion_character_to_octal(string[i], &digit) == F_none) {
if (digits) {
- digits++;
+ ++digits;
if (digits > f_conversion_digits_octal_unsigned) {
if ((converted << 3) + digit > f_number_t_size_unsigned || (converted << 3) + digit < converted) {
f_array_length_t offset = 0;
f_status_t status = F_none;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+
width = macro_f_utf_byte_width_is(string[i]);
if (!width) {
if (isspace(string[i])) {
if (!mode && !vector) {
- offset++;
+ ++offset;
+
continue;
}
if (status == F_true) {
offset = i + 1;
+
continue;
}
if (string[i] == 0x2b) {
if (!mode && !vector) {
vector = 1;
- offset++;
+ ++offset;
}
else {
return F_status_set_error(F_number);
if (string[i] == 0x2d) {
if (!mode && !vector) {
vector = -1;
- offset++;
+ ++offset;
}
else {
return F_status_set_error(F_number);
f_status_t status = F_none;
int8_t sign_found = 0;
- for (f_array_length_t i = range.start; i <= range.stop; i++) {
+ for (f_array_length_t i = range.start; i <= range.stop; ++i) {
+
width = macro_f_utf_byte_width_is(string[i]);
if (!width) {
if (isspace(string[i])) {
if (!mode) {
- offset++;
+ ++offset;
+
continue;
}
if (status == F_true) {
offset = i + 1;
+
continue;
}
}
if (string[i] == 0x2b) {
- offset++;
+ ++offset;
sign_found = 1;
}
if (string[i] == 0x2d) {
- offset++;
+ ++offset;
sign_found = -1;
}
}
f_status_t status = f_directory_exists(path);
-
if (F_status_is_error(status)) return status;
- if (status == F_true) return F_directory_found;
+
+ if (status == F_true) {
+ return F_directory_found;
+ }
{
f_array_length_t at_tree = 0;
{
f_array_length_t i = source_length;
- for (; i > 0; i--, static_source.used--) {
+ for (; i > 0; --i, --static_source.used) {
if (!source[i - 1]) continue;
if (source[i - 1] == f_path_separator_s[0]) continue;
i = destination_length;
- for (; i > 0; i--, static_destination.used--) {
+ for (; i > 0; --i, --static_destination.used) {
if (!destination[i - 1]) continue;
if (destination[i - 1] == f_path_separator_s[0]) continue;
{
f_array_length_t i = source_length;
- for (; i > 0; i--, static_source.used--) {
+ for (; i > 0; --i, --static_source.used) {
if (!source[i - 1]) continue;
if (source[i - 1] == f_path_separator_s[0]) continue;
i = destination_length;
- for (; i > 0; i--, static_destination.used--) {
+ for (; i > 0; --i, --static_destination.used) {
if (!destination[i - 1]) continue;
if (destination[i - 1] == f_path_separator_s[0]) continue;
{
f_array_length_t i = source_length;
- for (; i > 0; i--, static_source.used--) {
+ for (; i > 0; --i, --static_source.used) {
if (!source[i - 1]) continue;
if (source[i - 1] == f_path_separator_s[0]) continue;
i = destination_length;
- for (; i > 0; i--, static_destination.used--) {
+ for (; i > 0; --i, --static_destination.used) {
if (!destination[i - 1]) continue;
if (destination[i - 1] == f_path_separator_s[0]) continue;
{
f_array_length_t i = source_length;
- for (; i > 0; i--, static_source.used--) {
+ for (; i > 0; --i, --static_source.used) {
if (!source[i - 1]) continue;
if (source[i - 1] == f_path_separator_s[0]) continue;
i = destination_length;
- for (; i > 0; i--, static_destination.used--) {
+ for (; i > 0; --i, --static_destination.used) {
if (!destination[i - 1]) continue;
if (destination[i - 1] == f_path_separator_s[0]) continue;
f_status_t status = F_none;
- for (; i > 0; i--) {
+ for (; i > 0; --i) {
if (!path->string[i]) continue;
else {
first_nulless = F_true;
- for (j = i; j > 0; j--) {
+ for (j = i; j > 0; --j) {
if (!path->string[j]) continue;
status = f_utf_is_control(path->string + j, path->used - j);
typedef struct {
f_number_unsigned_t depth_max;
f_number_unsigned_t size_block;
+
bool exclusive;
f_file_t output;
+
void (*verbose)(const f_file_t, const f_string_t, const f_string_t);
+
f_directory_statuss_t *failures;
} fl_directory_recurse_t;
* F_none on success.
* F_data_not on success, but there was no string to process (length is 0).
* F_directory_found on success, but the directory already exists.
+ *
* F_access_denied (with error bit) on access denied.
* F_directory (with error bit) if a supposed directory in path is not actually a directory.
* F_directory_link_max (with error bit) max links limit reached or exceeded.
*
* @return
* F_none on success.
+ *
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* Errors (with error bit) from: f_directory_create().
*
* @return
* F_none on success.
+ *
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* Errors (with error bit) from: f_directory_exists().
*
* @return
* F_none on success.
+ *
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* Errors (with error bit) from: f_directory_create().
*
* @return
* F_none on success.
+ *
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* Errors (with error bit) from: f_directory_exists().
* @return
* F_none on success.
* F_data_not if directory is empty.
+ *
* F_directory_descriptor (with error bit) on directory file descriptor error.
* F_directory_open (with error bit) on directory open error.
* F_directory_stream (with error bit) on directory stream error.
* @return
* F_none on success.
* 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.
*
* @return
* F_none on success.
* F_data_not if length 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.
*
* @return
* F_none on success.
* F_data_not if source.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.
*
#if !defined(_di_fl_directory_clone_)
f_status_t private_fl_directory_clone(const f_string_static_t source, const f_string_static_t destination, const bool role, const fl_directory_recurse_t recurse, const f_number_unsigned_t depth) {
+
f_status_t status = F_none;
f_directory_listing_t listing = f_directory_listing_t_initialize;
uint8_t i = 0;
f_array_length_t j = 0;
- for (; i < 7; i++) {
+ for (; i < 7; ++i) {
- for (j = 0; F_status_is_fine(status) && j < list[i]->used; j++) {
+ 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
} // for
}
- for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) {
+ for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) {
+
f_string_static_t source_sub = f_string_static_t_initialize;
f_string_static_t destination_sub = f_string_static_t_initialize;
macro_f_string_dynamics_t_delete_simple(listing.directory);
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
- if (recurse.failures && failures_used < recurse.failures->used) return F_failure;
+ if (recurse.failures && failures_used < recurse.failures->used) {
+ return F_failure;
+ }
return F_none;
}
#if !defined(_di_fl_directory_clone_file_)
f_status_t private_fl_directory_clone_file(const f_string_static_t file, const f_string_static_t source, const f_string_static_t destination, const bool role, const fl_directory_recurse_t recurse) {
+
char path_source[source.used + file.used + 2];
char path_destination[destination.used + file.used + 2];
recurse.failures->array[recurse.failures->used].path.used = size;
recurse.failures->array[recurse.failures->used].path.size = size + 1;
recurse.failures->array[recurse.failures->used].status = status_failure;
- recurse.failures->used++;
+ ++recurse.failures->used;
return F_failure;
}
#if !defined(_di_fl_directory_copy_)
f_status_t private_fl_directory_copy(const f_string_static_t source, const f_string_static_t destination, const f_mode_t mode, const fl_directory_recurse_t recurse, const f_number_unsigned_t depth) {
+
f_status_t status = F_none;
f_directory_listing_t listing = f_directory_listing_t_initialize;
if (F_status_is_error(status)) {
macro_f_directory_listing_t_delete_simple(listing);
+
return status;
}
uint8_t i = 0;
f_array_length_t j = 0;
- for (; i < 7; i++) {
- for (j = 0; F_status_is_fine(status) && j < list[i]->used; j++) {
+ for (; i < 7; ++i) {
+
+ for (j = 0; F_status_is_fine(status) && j < list[i]->used; ++j) {
status = private_fl_directory_copy_file(list[i]->array[j], source, destination, mode, recurse);
} // for
} // for
}
- for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; i++) {
+ for (f_array_length_t i = 0; F_status_is_fine(status) && i < listing.directory.used; ++i) {
+
f_string_static_t source_sub = f_string_static_t_initialize;
f_string_static_t destination_sub = f_string_static_t_initialize;
macro_f_string_dynamics_t_delete_simple(listing.directory);
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
- if (recurse.failures && failures_used < recurse.failures->used) return F_failure;
+ if (recurse.failures && failures_used < recurse.failures->used) {
+ return F_failure;
+ }
return F_none;
}
return F_status_set_error(status);
}
- if (!recurse.failures) return F_failure;
+ if (!recurse.failures) {
+ return F_failure;
+ }
const f_status_t status_failure = status;
recurse.failures->array[recurse.failures->used].path.used = size;
recurse.failures->array[recurse.failures->used].path.size = size + 1;
recurse.failures->array[recurse.failures->used].status = status_failure;
- recurse.failures->used++;
+ ++recurse.failures->used;
return F_failure;
}
#if !defined(_di_fl_directory_list_)
f_status_t private_fl_directory_list(const f_string_t path, int (*filter)(const struct dirent *), int (*sort)(const struct dirent **, const struct dirent **), const bool dereference, f_directory_listing_t *listing) {
+
struct dirent **entity = 0;
f_array_length_t size = 0;
if (length == -1) {
closedir(parent);
- if (errno == ENOMEM) return F_status_set_error(F_memory_not);
- else return F_status_set_error(F_failure);
+ if (errno == ENOMEM) {
+ return F_status_set_error(F_memory_not);
+ }
+ else {
+ return F_status_set_error(F_failure);
+ }
}
f_string_dynamics_t *names = 0;
int mode = 0;
size_t i = 0;
- for (; i < length; i++) {
+ 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.
if (!strncmp(entity[i]->d_name, "..", 3) || !strncmp(entity[i]->d_name, ".", 2)) {
f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]);
+
continue;
}
memcpy(names->array[names->used].string, entity[i]->d_name, size);
names->array[names->used].used = size;
- names->used++;
+ ++names->used;
f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]);
} // for
closedir(parent);
- for (; i < length; i++) {
+ for (; i < length; ++i) {
f_memory_resize(1, 0, sizeof(char *), (void **) & entity[i]);
} // for
#if !defined(_di_fl_directory_path_push_) || !defined(_di_fl_directory_path_push_dynamic_)
f_status_t private_fl_directory_path_push(const f_string_t source, const f_array_length_t length, f_string_dynamic_t *destination) {
+
bool terminated_null = F_false;
bool separator_prepend = F_false;
bool separator_append = F_false;
terminated_null = F_true;
total = 1;
- destination->used--;
+ --destination->used;
}
- for (i = destination->used - 1; i > 0; i--) {
+ for (i = destination->used - 1; i > 0; --i) {
+
if (!destination->string[i]) continue;
status = f_utf_is_control(destination->string + i, destination->used - i);
if (destination->string[i] == f_path_separator_s[0]) {
if (i - 1 > 0) {
- for (j = i - 1; j > 0; j--) {
+ for (j = i - 1; j > 0; --j) {
+
if (!destination->string[j]) continue;
status = f_utf_is_control(destination->string + j, destination->used - j);
}
else {
separator_prepend = F_true;
- total++;
+ ++total;
}
break;
if (destination->used > 0 && !i) {
if (destination->string[0] != 0 && destination->string[0] != f_path_separator_s[0]) {
separator_prepend = F_true;
- total++;
+ ++total;
}
}
}
- for (i = length - 1; i > 0; i--) {
+ for (i = length - 1; i > 0; --i) {
if (!source[i]) continue;
status = f_utf_is_control(source + i, length - i);
if (source[i] == f_path_separator_s[0]) {
if (!separator_prepend && destination->used > 0) {
- destination->used--;
+ --destination->used;
}
if (i - 1 > 0) {
- for (j = i - 1; j > 0; j--) {
+ for (j = i - 1; j > 0; --j) {
+
if (!source[j]) continue;
status = f_utf_is_control(source + j, length - j);
}
else {
separator_append = F_true;
- total++;
+ ++total;
}
break;
if (!i && source[0] != f_path_separator_s[0]) {
separator_append = F_true;
- total++;
+ ++total;
}
- for (i = 0; i < length_truncated; i++) {
+ for (i = 0; i < length_truncated; ++i) {
+
if (!source[i]) continue;
status = f_utf_is_control(source + i, length - i);
if (source[0] == f_path_separator_s[0]) {
if (i + 1 < length_truncated) {
- for (j = i + 1; j < length_truncated; j++) {
+ for (j = i + 1; j < length_truncated; ++j) {
+
if (!source[j]) continue;
status = f_utf_is_control(source + j, length - j);
if (separator_prepend) {
destination->string[destination->used] = f_path_separator_s[0];
- destination->used++;
- total--;
+ ++destination->used;
+ --total;
}
if (length_truncated - start > 0) {
*
* @return
* F_none on success.
+ *
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* @see fl_directory_clone()
*
* @return
* F_none on success.
+ *
* F_array_too_large (with error bit) if a buffer would exceed max length.
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
*
* @return
* F_none on success.
+ *
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* @see fl_directory_copy()
*
* @return
* F_none on success.
+ *
* F_array_too_large (with error bit) if a buffer would exceed max length.
* F_failure (with error bit) for any other failure, failures might be populated with individual status codes.
*
* @return
* F_none on success.
* F_data_not if directory is empty.
+ *
* F_directory_descriptor (with error bit) on directory file descriptor error.
* F_directory_open (with error bit) on directory open error.
* F_directory_stream (with error bit) on directory stream error.
* @return
* F_none on success.
* F_data_not if length 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.
*
if (F_status_is_error(status)) {
environment->array[environment->used].name.used = 0;
+
return status;
}
if (status == F_data_not || status == F_exist_not) {
environment->array[environment->used].name.used = 0;
+
return status;
}
- environment->used++;
+ ++environment->used;
return F_none;
}
if (F_status_is_error(status)) {
environment->array[environment->used].name.used = 0;
+
return status;
}
if (status == F_data_not || status == F_exist_not) {
environment->array[environment->used].name.used = 0;
+
continue;
}
- environment->used++;
+ ++environment->used;
} // for
return F_none;
if (F_status_is_error(status)) return status;
macro_f_string_dynamic_t_clear(paths->array[paths->used]);
- paths->used++;
+ ++paths->used;
return F_none;
}
f_array_length_t first = 0;
f_array_length_t total = 0;
- for (i = 0; i <= length; i++) {
+ for (i = 0; i <= length; ++i) {
if (i == length || path[i] == f_path_separator_variable_s[0]) {
macro_f_memory_structure_increment(status, (*paths), 1, f_memory_default_allocation_step, macro_f_string_dynamics_t_resize, F_array_too_large);
if (!i) {
macro_f_string_dynamic_t_clear(paths->array[paths->used]);
- paths->used++;
+ ++paths->used;
first = 1;
continue;
if (F_status_is_error(status)) return status;
macro_f_string_dynamic_t_clear(paths->array[paths->used]);
- paths->used++;
+ ++paths->used;
return F_none;
}
f_string_dynamic_t part = f_string_dynamic_t_initialize;
- for (i = 0; i <= path.used; i++) {
+ for (i = 0; i <= path.used; ++i) {
if (i == path.used || path.string[i] == f_path_separator_variable_s[0]) {
macro_f_memory_structure_increment(status, (*paths), 1, f_memory_default_allocation_step, macro_f_string_dynamics_t_resize, F_array_too_large);
if (!i) {
macro_f_string_dynamic_t_clear(paths->array[paths->used]);
- paths->used++;
+ ++paths->used;
first = 1;
continue;
macro_f_string_dynamic_t_resize(status, part, total)
if (F_status_is_error(status)) return status;
- for (j = 0; j < total; j++) {
+ for (j = 0; j < total; ++j) {
+
if (!path.string[first + j]) continue;
part.string[part.used] = path.string[first + j];
- part.used++;
+ ++part.used;
} // for
if (part.string[part.used - 1] != f_path_separator_s[0]) {
if (F_status_is_error(status)) return status;
part.string[part.used] = f_path_separator_s[0];
- part.used++;
+ ++part.used;
}
}
f_string_dynamic_t part = f_string_dynamic_t_initialize;
- for (; i > 0; i--) {
- j--;
+ // @fixme i is unsgned, it will never be less than 0!
+ for (; i > 0; --i, --j) {
if (!j || path[j] == f_path_separator_variable_s[0]) {
macro_f_memory_structure_increment(status, (*paths), 1, f_memory_default_allocation_step, macro_f_string_dynamics_t_resize, F_array_too_large);
f_status_t status = F_none;
if (!path.used) {
+
// When PATH is "", this is actually a valid search path for PWD.
// Therefore append an equivalent representation of PWD (string used length is 0).
macro_f_memory_structure_increment(status, (*paths), 1, f_memory_default_allocation_step, macro_f_string_dynamics_t_resize, F_array_too_large);
if (F_status_is_error(status)) return status;
macro_f_string_dynamic_t_clear(paths->array[paths->used]);
- paths->used++;
+ ++paths->used;
return F_none;
}
f_string_dynamic_t part = f_string_dynamic_t_initialize;
- for (; i > 0; i--) {
- j--;
+ // @fixme i is unsgned, it will never be less than 0!
+ for (; i > 0; --i, --j) {
if (!j || path.string[j] == f_path_separator_variable_s[0]) {
macro_f_memory_structure_increment(status, (*paths), 1, f_memory_default_allocation_step, macro_f_string_dynamics_t_resize, F_array_too_large);
macro_f_string_dynamic_t_resize(status, part, total)
if (F_status_is_error(status)) return status;
- for (k = 0; k < total; k++) {
+ for (k = 0; k < total; ++k) {
+
if (!path.string[i + k]) continue;
part.string[part.used] = path.string[i + k];
- part.used++;
+ ++part.used;
} // for
if (part.string[part.used - 1] != f_path_separator_s[0]) {
if (F_status_is_error(status)) return status;
part.string[part.used] = f_path_separator_s[0];
- part.used++;
+ ++part.used;
}
}
last = j;
}
else if (!j) {
+
// when j = 0, the total is actually the entire length to max.
total = last - j;
macro_f_string_dynamic_t_resize(status, part, total)
if (F_status_is_error(status)) return status;
- for (k = 0; k < total; k++) {
+ for (k = 0; k < total; ++k) {
if (!path.string[i + k]) continue;
part.string[part.used] = path.string[i + k];
- part.used++;
+ ++part.used;
} // for
if (part.string[part.used - 1] != f_path_separator_s[0]) {
*
* @return
* F_none on success.
+ *
* F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
+ *
* F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
+ *
* F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
+ *
* F_array_too_large (with error bit) if paths array is too large for further addressing.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
if (F_status_is_error(status)) return status;
if (status == F_none_eol) {
- range->start++;
+ ++range->start;
+
return FL_fss_found_content_not;
}
found->array[found->used].start = range->start;
- for (;; range->start++) {
+ for (;; ++range->start) {
status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
if (F_status_is_error(status_allocation)) {
destination->used = destination_used;
+
return status_allocation;
}
if (F_status_is_error(status2)) {
destination->used = destination_used;
+
return status2;
}
}
const f_array_length_t destination_used = destination->used;
- for (; range->start <= range->stop && range->start < content.used; range->start++) {
+ for (; range->start <= range->stop && range->start < content.used; ++range->start) {
if (content.string[range->start] == f_fss_eol) {
destination->used = destination_used;
+
return F_status_set_error(F_none_eol);
}
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_buffer_increment().
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_buffer_increment().
* F_none_stop on success after reaching the range stop.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
* F_none_stop on success after reaching the range stop.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
+ *
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
* F_parameter (with error bit) if a parameter is invalid.
if (status == F_none_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
}
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
break;
}
- slash_count++;
+ ++slash_count;
} // for
private_macro_fl_fss_object_return_on_overflow((buffer), (*range), (*found), (*delimits), delimits_used, F_data_not_eos, F_data_not_stop);
if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
- delimits->used++;
+ ++delimits->used;
}
- slash_count--;
+ --slash_count;
}
status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
} // while
}
range->start = start + 1;
+
return FL_fss_found_object_not;
}
}
if (F_status_is_error(status)) break;
delimits->array[delimits->used++] = slash_first;
- range->start++;
+ ++range->start;
}
else {
graph_first = F_false;
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
status = f_fss_seek_to_eol(buffer, range);
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
newline_last = range->start;
graph_first = 0x1;
- range->start++;
+ ++range->start;
+
continue;
}
slash_first = range->start;
slash_count = 1;
- for (range->start++; range->start <= range->stop && range->start < buffer.used; range->start++) {
+ for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
if (buffer.string[range->start] == f_fss_delimit_placeholder) {
continue;
break;
}
- slash_count++;
+ ++slash_count;
} // for
if (range->start > range->stop || range->start >= buffer.used) break;
if (buffer.string[range->start] == f_fss_basic_list_open) {
graph_first = 0x0;
- range->start++;
+ ++range->start;
while (range->start <= range->stop && range->start < buffer.used) {
delimits->array[delimits->used++] = range->start;
}
- slash_count--;
+ --slash_count;
}
status = f_utf_buffer_increment(buffer, range, 1);
else if (graph_first == 0x1 && buffer.string[range->start] == f_fss_comment) {
graph_first = 0x2;
comment_delimit = slash_first;
- range->start++;
+ ++range->start;
}
continue;
}
if (buffer.string[range->start] == f_fss_basic_list_open) {
- range->start++;
+ ++range->start;
graph_first = 0x0;
while (range->start <= range->stop && range->start < buffer.used) {
if (F_status_is_error(status)) break;
if (range->start > range->stop || range->start >= buffer.used) {
- range->start--;
+ --range->start;
}
else {
newline_last = range->start;
if (F_status_is_error(status)) {
delimits->used = delimits_used;
comments->used = comments_used;
+
return status;
}
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
break;
}
- slash_count++;
+ ++slash_count;
} // for
if (F_status_is_error(status)) break;
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = content.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_array_too_large (with error bit) if a buffer is too large.
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_array_too_large (with error bit) if a buffer is too large.
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_none_eos on success after reaching the end of the buffer.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
- * F_none_stop on success after reaching stopping point .
+ * F_none_stop on success after reaching stopping point.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_none_stop on success after reaching stopping point .
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
if (status == F_none_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
}
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
if (buffer.string[range->start] == f_fss_embedded_list_open) {
graph_first = F_false;
stop = range->start - 1;
- range->start++;
+ ++range->start;
while (range->start <= range->stop && range->start < buffer.used) {
if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
- delimits->used++;
+ ++delimits->used;
}
- slash_count--;
+ --slash_count;
}
status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
delimits->array[delimits->used++] = slash_first;
- range->start++;
+ ++range->start;
}
else {
graph_first = F_false;
found->stop = stop;
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object;
}
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
} // while
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
if (F_status_is_error(status)) break;
while (range->start <= range->stop && range->start < buffer.used && (buffer.string[range->start] == f_fss_delimit_placeholder || buffer.string[range->start] == f_fss_delimit_slash)) {
+
position_previous = range->start;
if (buffer.string[range->start] == f_fss_delimit_slash) {
delimits->array[delimits->used++] = range->start;
}
- slash_count--;
+ --slash_count;
}
// Delimit slashes and placeholders are required to be in the ASCII range.
// when slashes are even, the object is valid and needs to be processed.
if (is_object) {
- depth++;
+ ++depth;
if (depth > positions_start.size) {
macro_f_array_lengths_t_resize(status, positions_start, positions_start.size + f_fss_default_allocation_step);
return FL_fss_found_content;
}
- depth--;
+ --depth;
}
else {
if (F_status_is_error(status)) break;
if (range->start > range->stop || range->start >= buffer.used) {
- range->start--;
+ --range->start;
}
else {
if (graph_first == 0x2) {
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (object.string[range->start] == f_fss_delimit_slash) {
slash_count = 1;
- for (range->start++; range->start <= range->stop && range->start < object.used; range->start++) {
+ for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
if (object.string[range->start] == f_fss_delimit_placeholder) {
continue;
break;
}
- slash_count++;
+ ++slash_count;
} // for
if (F_status_is_error(status)) break;
status = f_string_dynamic_increase_by(slash_count, destination);
if (F_status_is_error(status)) break;
- while (slash_count--) {
+ while (--slash_count) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // while
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
destination->string[destination->used++] = content.string[range->start];
- for (range->start++; range->start <= range->stop && range->start < content.used; range->start++) {
+ for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
if (content.string[range->start] == f_fss_delimit_placeholder) continue;
if (content.string[range->start] != f_fss_delimit_slash) break;
destination->string[destination->used++] = f_fss_delimit_slash;
- slash_count++;
+ ++slash_count;
} // for
if (content.string[range->start] == f_fss_embedded_list_open || content.string[range->start] == f_fss_embedded_list_close) {
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_array_too_large (with error bit) if a buffer is too large.
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_array_too_large (with error bit) if a buffer is too large.
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_none_stop on success after reaching stopping point .
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
* F_none_eos on success after reaching the end of the buffer.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
- * F_none_stop on success after reaching stopping point .
+ * F_none_stop on success after reaching stopping point.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
if (status == FL_fss_found_object_not || status == F_data_not || status == F_data_not_eos || status == F_data_not_stop) {
delimits->used = delimits_used;
+
return status;
}
if (F_status_is_error(status_allocate)) {
delimits->used = delimits_used;
+
return status_allocate;
}
}
found->array[found->used] = content_partial;
- found->used++;
+ ++found->used;
if (quotes) {
quotes->array[quotes->used] = quoted;
}
else if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
} // while
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_buffer_increment().
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: f_utf_buffer_increment().
* F_none_stop on success after reaching the range stop.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
* F_none_stop on success after reaching the range stop.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
if (status == F_none_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
}
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
if (buffer.string[range->start] == f_fss_extended_list_open) {
graph_first = F_false;
stop = range->start - 1;
- range->start++;
+ ++range->start;
while (range->start <= range->stop && range->start < buffer.used) {
if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
- delimits->used++;
+ ++delimits->used;
}
- slash_count--;
+ --slash_count;
}
status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) break;
delimits->array[delimits->used++] = slash_first;
- range->start++;
+ ++range->start;
}
else {
graph_first = F_false;
found->stop = stop;
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object;
}
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
} // while
if (F_status_is_error(status)) {
delimits->used = delimits_used;
+
return status;
}
if (status == F_none_eol) {
newline_last = range->start;
- range->start++;
+ ++range->start;
+
continue;
}
slash_first = range->start;
slash_count = 1;
- for (range->start++; range->start <= range->stop && range->start < buffer.used; ++range->start) {
+ for (++range->start; range->start <= range->stop && range->start < buffer.used; ++range->start) {
if (buffer.string[range->start] == f_fss_delimit_placeholder) {
continue;
break;
}
- slash_count++;
+ ++slash_count;
} // for
if (range->start > range->stop || range->start >= buffer.used) break;
// For example '}' = valid close, '\}' represents '}', '\\}' represents '\}', '\\\}' represents '\\}', '\\\\}' represents '\\\}', and so on..
// With one or more slashes, even if delimited, this line may never designate a valid content close.
if (buffer.string[range->start] == f_fss_extended_list_close) {
- range->start++;
+ ++range->start;
while (range->start <= range->stop && range->start < buffer.used) {
}
if (buffer.string[range->start] == f_fss_extended_list_close) {
- range->start++;
+ ++range->start;
while (range->start <= range->stop && range->start < buffer.used) {
if (F_status_is_error(status)) break;
if (range->start > range->stop || range->start >= buffer.used) {
- range->start--;
+ --range->start;
}
else {
newline_last = range->start;
if (F_status_is_error(status)) {
delimits->used = delimits_used;
comments->used = comments_used;
+
return status;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (object.string[range->start] == f_fss_delimit_slash) {
slash_count = 1;
- for (range->start++; range->start <= range->stop && range->start < object.used; range->start++) {
+ for (++range->start; range->start <= range->stop && range->start < object.used; ++range->start) {
if (object.string[range->start] == f_fss_delimit_placeholder) {
continue;
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
destination->string[destination->used++] = content.string[range->start];
- for (range->start++; range->start <= range->stop && range->start < content.used; range->start++) {
+ for (++range->start; range->start <= range->stop && range->start < content.used; ++range->start) {
if (content.string[range->start] == f_fss_delimit_placeholder) continue;
if (content.string[range->start] != f_fss_delimit_slash) break;
destination->string[destination->used++] = f_fss_delimit_slash;
- slash_count++;
+ ++slash_count;
} // for
if (content.string[range->start] == f_fss_extended_list_close) {
if (ignore && ignore->used) {
- for (r = 0; r < ignore->used; r++) {
+ for (r = 0; r < ignore->used; ++r) {
if (start >= ignore->array[r].start && start <= ignore->array[r].stop) break;
} // for
destination->string[destination->used++] = content.string[start];
range->start = start + 1;
+
continue;
}
}
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = content.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_array_too_large (with error bit) if a buffer is too large.
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_array_too_large (with error bit) if a buffer is too large.
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_none_stop on success after reaching stopping point .
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_none_stop on success after reaching stopping point .
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
#if !defined(_di_fl_fss_basic_object_write_string_) || !defined(_di_fl_fss_extended_object_write_string_)
f_status_t private_fl_fss_basic_write_object_trim(const f_fss_quote_t quote, const f_array_length_t used_start, f_string_dynamic_t *destination) {
+
f_status_t status = F_none;
f_string_range_t destination_range = macro_f_string_range_t_initialize(destination->used);
f_array_length_t i = 0;
uint8_t width = 0;
// if there are any spaces, then this will be quoted so find the first non-placeholder character.
- for (; destination_range.start < destination->used; destination_range.start++) {
+ for (; destination_range.start < destination->used; ++destination_range.start) {
if (destination->string[destination_range.start] != f_fss_delimit_placeholder) break;
} // for
if (destination->string[destination_range.start] == quote) {
const f_array_length_t front = destination_range.start;
- for (destination_range.start++; destination_range.start < destination->used; destination_range.start++) {
+ for (++destination_range.start; destination_range.start < destination->used; ++destination_range.start) {
if (destination->string[destination_range.start] == f_fss_delimit_placeholder) {
continue;
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
width = macro_f_utf_byte_width(destination->string[destination_range.start]);
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination_range.start + i] = f_fss_delimit_placeholder;
} // for
} // for
// find the last quote.
for (destination_range.start = destination->used - 1; destination_range.start > front; destination_range.start--) {
+
if (destination->string[destination_range.start] == quote) {
destination_range.start--;
break;
width = macro_f_utf_byte_width(destination->string[destination_range.start]);
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination_range.start + i] = f_fss_delimit_placeholder;
} // for
} // for
// if there is no whitespace between the quotes, post-trimming, then remove the quotes.
- for (destination_range.start = front; destination_range.start < rear; destination_range.start++) {
+ for (destination_range.start = front; destination_range.start < rear; ++destination_range.start) {
status = f_fss_is_space(*destination, destination_range);
#if !defined(_di_fl_fss_basic_list_content_write_string_) || !defined(_di_fl_fss_extended_list_content_write_string_) || !defined(_di_fl_fss_embedded_list_content_write_string_)
f_status_t private_fl_fss_basic_list_write_add_until_end(const f_string_static_t buffer, f_string_range_t *range, f_string_dynamic_t *destination) {
+
f_status_t status = F_none;
- for (; range->start <= range->stop && range->start < buffer.used; range->start++) {
+ for (; range->start <= range->stop && range->start < buffer.used; ++range->start) {
if (buffer.string[range->start] == f_fss_delimit_placeholder) continue;
if (buffer.string[range->start] == f_fss_eol) break;
#if !defined(_di_fl_fss_basic_list_object_write_string_) || !defined(_di_fl_fss_extended_list_object_write_string_)
f_status_t private_fl_fss_basic_list_write_object_trim(const f_array_length_t used_start, f_string_dynamic_t *destination) {
+
f_status_t status = F_none;
f_string_range_t destination_range = macro_f_string_range_t_initialize(destination->used);
f_array_length_t i = 0;
uint8_t width = 0;
- for (; destination_range.start < destination->used; destination_range.start++) {
+ for (; destination_range.start < destination->used; ++destination_range.start) {
if (destination->string[destination_range.start] == f_fss_delimit_placeholder) {
continue;
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
width = macro_f_utf_byte_width(destination->string[destination_range.start]);
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination_range.start + i] = f_fss_delimit_placeholder;
} // for
} // for
for (destination_range.start = destination->used - 1; destination_range.start > 0; destination_range.start--) {
if (destination->string[destination_range.start] == f_fss_delimit_placeholder) {
- destination->used--;
+ --destination->used;
+
continue;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (status == F_none_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
if (object_as && buffer.string[range->start] == f_fss_comment) {
while (buffer.string[range->start] != f_fss_eol) {
- range->start++;
- if (range->start >= buffer.used) return F_data_not_eos;
- if (range->start > range->stop) return F_data_not_stop;
+ ++range->start;
+
+ if (range->start >= buffer.used) {
+ return F_data_not_eos;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
} // while
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
if (range->start >= buffer.used) {
found->stop = buffer.used - 1;
+
return F_none_eos;
}
if (range->start > range->stop) {
found->stop = range->stop;
+
return F_none_stop;
}
if (F_status_is_error(status)) return status;
delimits->array[delimits->used] = first_slash;
- delimits->used++;
+ ++delimits->used;
status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_content_not;
}
break;
}
- slash_count++;
+ ++slash_count;
status = f_utf_buffer_increment(buffer, range, 1);
if (F_status_is_error(status)) return status;
if (range->start >= buffer.used) {
found->stop = buffer.used - 1;
+
return F_terminated_not_group_eos;
}
if (range->start > range->stop) {
found->stop = range->stop;
+
return F_terminated_not_group_stop;
}
// check to see if there is a whitespace, EOS, or EOL after the quoted, if not, then this is not a closing quoted and delimits do not apply.
if (range->start + 1 <= range->stop && range->start + 1 < buffer.used) {
- range->start++;
+ ++range->start;
status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
if (range->start > range->stop || range->start >= buffer.used) {
+
// EOS or EOL was reached, so it is a valid closing quoted.
// (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?).
status = F_true;
}
}
else {
+
// EOS or EOL was reached, so it is a valid closing quoted.
// (for EOL, this is always TRUE, for EOS this could be false but there is no way to know this, so assume TRUE (@todo maybe none on stop?).
status = F_true;
if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
- delimits->used++;
+ ++delimits->used;
}
slash_count--;
range->start = location + 1;
while (buffer.string[range->start] == f_fss_delimit_placeholder) {
- range->start++;
+ ++range->start;
if (range->start >= buffer.used) return F_none_eos;
if (range->start > range->stop) return F_none_stop;
found->stop = location - 1;
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_content_not;
}
if (buffer.string[range->start] == f_fss_delimit_slash) {
if (slash_count % 2 == 1) {
delimits->array[delimits->used] = range->start;
- delimits->used++;
+ ++delimits->used;
}
slash_count--;
location = range->start;
if (range->start + 1 <= range->stop && range->start + 1 < buffer.used) {
- range->start++;
+ ++range->start;
status = f_fss_skip_past_delimit(buffer, range);
if (F_status_is_error(status)) return status;
if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_content_not;
}
if (range->start >= buffer.used) {
found->stop = buffer.used - 1;
+
return F_data_not_eos;
}
if (range->start > range->stop) {
found->stop = range->stop;
+
return F_data_not_stop;
}
if (range->start >= buffer.used) {
found->stop = buffer.used - 1;
+
return F_none_eos;
}
if (range->start > range->stop) {
found->stop = range->stop;
+
return F_none_stop;
}
}
else if (buffer.string[range->start] == f_fss_eol) {
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
if (range->start >= buffer.used) {
found->stop = buffer.used - 1;
+
return F_terminated_not_group_eos;
}
if (range->start > range->stop) {
found->stop = range->stop;
+
return F_terminated_not_group_stop;
}
}
if (F_status_is_error(status)) return status;
// move the start position to after the EOL.
- range->start++;
+ ++range->start;
return FL_fss_found_object_not;
}
item_first = range->start++;
item_total = 1;
- for (; range->start <= range->stop && range->start < object.used; range->start++) {
+ for (; range->start <= range->stop && range->start < object.used; ++range->start) {
if (object.string[range->start] == f_fss_delimit_slash) {
- item_total++;
+ ++item_total;
}
else if (object.string[range->start] != f_fss_delimit_placeholder) {
break;
status = f_string_dynamic_increase_by(item_total, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < item_total; i++) {
+ for (i = 0; i < item_total; ++i) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // for
}
status = f_string_dynamic_increase_by(item_total, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < item_total; i++) {
+ for (i = 0; i < item_total; ++i) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // for
status = f_string_dynamic_increase_by(item_total + 1, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < item_total; i++) {
+ for (i = 0; i < item_total; ++i) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // for
status = f_string_dynamic_increase_by(item_total, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < item_total; i++) {
+ for (i = 0; i < item_total; ++i) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // for
}
status = f_string_dynamic_increase_by(item_total + width + 1, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < item_total; i++) {
+ for (i = 0; i < item_total; ++i) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // for
destination->string[destination->used++] = quote;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
status = f_string_dynamic_increase_by(item_total + 1, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < item_total; i++) {
+ for (i = 0; i < item_total; ++i) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // for
destination->string[destination->used++] = object.string[range->start];
- range->start++;
+ ++range->start;
+
continue;
}
else {
if (F_status_is_error(status)) break;
// there is nothing to delimit, so all slashes should be printed as is.
- for (i = 0; i < item_total; i++) {
+ for (i = 0; i < item_total; ++i) {
destination->string[destination->used++] = f_fss_delimit_slash;
} // for
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
destination->string[destination->used++] = quote;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
status = f_string_dynamic_increase_by(width, destination);
if (F_status_is_error(status)) break;
- for (i = 0; i < width; i++) {
+ for (i = 0; i < width; ++i) {
destination->string[destination->used++] = object.string[range->start + i];
} // for
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
// The start quote may or may not need to be delimited in this case.
if (destination->string[input_start] == quote) {
- for (i = input_start + 1; i <= range->stop && i < object.used; i++) {
+ for (i = input_start + 1; i <= range->stop && i < object.used; ++i) {
if (object.string[i] != f_fss_delimit_placeholder) break;
} // for
if (F_status_is_error(status)) {
destination->used = used_start;
+
return status;
}
* F_data_not_stop no data found after reaching stopping point (essentially only comments are found).
* F_terminated_not_group_eos if EOS was reached before the a group termination was reached.
* F_terminated_not_group_stop if stop point was reached before the a group termination was reached.
+ *
* F_array_too_large (with error bit) if a buffer is too large.
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_none_stop on success after reaching the range stop.
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_none_eol (with error bit) after reaching an EOL, which is not supported by the standard.
#ifndef _di_fl_iki_read_
f_status_t 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) {
+ #ifndef _di_level_1_parameter_checking_
+ if (!buffer) return F_status_set_error(F_parameter);
+ if (!range) return F_status_set_error(F_parameter);
+ #endif // _di_level_1_parameter_checking_
+
f_status_t status = F_none;
do {
if (status == F_none_eos || status == F_none_stop) {
return status;
}
+
} while (range->start <= range->stop && range->start < buffer->used);
return F_none;
* F_none_eos on success and an IKI vocabulary name was found and end of string was reached.
* F_data_not_eos on success and EOS was reached, but there were no IKI vocabularie names found.
* F_data_not_stop on success and stop point was reached, but there were no IKI vocabularie names found.
+ *
* F_memory_not (with error bit) on out of memory.
* 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.
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string || !length) return F_data_not;
+ if (!string || !length) {
+ return F_data_not;
+ }
return private_fl_print_trim_except(output, string, 0, length, except);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used) return F_data_not;
+ if (!buffer.used) {
+ return F_data_not;
+ }
return private_fl_print_trim_except(output, buffer.string, 0, buffer.used, except);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string || !length) return F_data_not;
+ if (!string || !length) {
+ return F_data_not;
+ }
return private_fl_print_trim_except_utf(output, string, 0, length, except);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used) return F_data_not;
+ if (!buffer.used) {
+ return F_data_not;
+ }
return private_fl_print_trim_except_utf(output, buffer.string, 0, buffer.used, except);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string || !length) return F_data_not;
+ if (!string || !length) {
+ return F_data_not;
+ }
return private_fl_print_trim(output, string, length);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used) return F_data_not;
+ if (!buffer.used) {
+ return F_data_not;
+ }
return private_fl_print_trim(output, buffer.string, buffer.used);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string || !length) return F_data_not;
+ if (!string || !length) {
+ return F_data_not;
+ }
return private_fl_print_trim_utf(output, string, length);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used) return F_data_not;
+ if (!buffer.used) {
+ return F_data_not;
+ }
return private_fl_print_trim_utf(output, buffer.string, buffer.used);
}
if (!output) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used || range.start > range.stop || range.start >= buffer.used) return F_data_not;
+ if (!buffer.used || range.start > range.stop || range.start >= buffer.used) {
+ return F_data_not;
+ }
f_array_length_t length = (range.stop - range.start) + 1;
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
if (e < except.used && except.array[e] == i) {
i++;
+
continue;
}
if (e < except.used && except.array[e] == i) {
i++;
+
continue;
}
if (status == F_true) {
j = i + macro_f_utf_byte_width(string[i]);
- if (j == stop) return F_none;
+ if (j == stop) {
+ return F_none;
+ }
ej = e;
if (ej < except.used && except.array[ej] == j) {
j++;
+
continue;
}
// all whitespaces found so far must be printed when a non-whitespace is found.
if (status == F_false) {
for (; i < j; i++) {
+
if (!string[i]) continue;
for (; e < except.used && except.array[e] < i; ++e) {
if (e < except.used && except.array[e] == i) continue;
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
} // for
break;
if (status == F_true) break;
}
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
i += macro_f_utf_byte_width(string[i]);
} // while
} // for
for (; i < stop; ++i) {
+
if (!string[i]) continue;
for (; e < except.used && except.array[e] < i; ++e) {
if (status == F_true) {
j = i + 1;
- if (j == stop) return F_none;
+ if (j == stop) {
+ return F_none;
+ }
for (ej = e; j < stop; j++) {
// all whitespaces found so far must be printed when a non-whitespace is found.
if (status == F_false) {
for (; i < j; i++) {
+
if (!string[i]) continue;
for (; e < except.used && except.array[e] < i; ++e) {
if (e < except.used && except.array[e] == i) continue;
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
} // for
break;
if (status == F_true) break;
}
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
} // for
return F_none;
} // for
for (; i < length; i += macro_f_utf_byte_width(string[i])) {
+
if (!string[i]) continue;
width_max = (length - i) + 1;
if (status == F_true) {
j = i + macro_f_utf_byte_width(string[i]);
- if (j == length) return F_none;
+ if (j == length) {
+ return F_none;
+ }
for (; j < length; j += macro_f_utf_byte_width(string[j])) {
// all whitespaces found so far must be printed when a non-whitespace is found.
if (status == F_false) {
for (; i < j; i++) {
+
if (!string[i]) continue;
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
} // for
break;
if (status == F_true) break;
}
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
} // for
return F_none;
} // for
for (; i < length; i++) {
+
if (!string[i]) continue;
status = f_utf_character_is_whitespace(string[i]);
if (F_status_is_error(status)) {
- if (F_status_set_fine(status) == F_maybe) return F_status_set_error(F_utf);
+ if (F_status_set_fine(status) == F_maybe) {
+ return F_status_set_error(F_utf);
+ }
return status;
}
if (status == F_true) {
j = i + 1;
- if (j == length) return F_none;
+ if (j == length) {
+ return F_none;
+ }
for (; j < length; j++) {
// all whitespaces found so far must be printed when a non-whitespace is found.
if (status == F_false) {
for (; i < j; i++) {
+
if (!string[i]) continue;
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
} // for
break;
if (status == F_true) break;
}
- if (!fputc(string[i], output)) return F_status_set_error(F_output);
+ if (!fputc(string[i], output)) {
+ return F_status_set_error(F_output);
+ }
} // for
return F_none;
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not on success but there is nothing to print.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_output (with error bit) on error when printing to output.
* F_parameter (with error bit) if a parameter is invalid.
switch (unmasked_code) {
#ifndef _di_F_status_boolean_
case F_false:
- *string = FL_status_string_false; break;
+ *string = FL_status_string_false;
+ break;
case F_true:
*string = FL_status_string_true;
break;
default:
*string = 0;
+
return F_status_set_error(F_data);
}
*
* @return
* F_none on success.
+ *
* F_data (with error bit) if there status is unknown.
* F_parameter (with error bit) if a parameter is invalid.
*/
#if !defined(_di_fl_string_compare_) || !defined(_di_fl_string_dynamic_compare_) || !defined(_di_fl_string_dynamic_partial_compare_)
f_status_t private_fl_string_compare(const f_string_t string1, const f_string_t string2, const f_array_length_t offset1, const f_array_length_t offset2, const f_array_length_t stop1, const f_array_length_t stop2) {
+
f_array_length_t i1 = offset1;
f_array_length_t i2 = offset2;
#if !defined(_di_fl_string_compare_except_) || !defined(_di_fl_string_dynamic_compare_except_) || !defined(_di_fl_string_dynamic_partial_compare_except_)
f_status_t private_fl_string_compare_except(const f_string_t string1, const f_string_t string2, const f_array_length_t offset1, const f_array_length_t offset2, const f_array_length_t stop1, const f_array_length_t stop2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
f_array_length_t i1 = offset1;
f_array_length_t i2 = offset2;
while (e1 < except1.used && except1.array[e1] < i1) e1++;
if (e1 < except1.used && except1.array[e1] == i1) {
i1++;
+
continue;
}
while (e2 < except2.used && except2.array[e2] < i2) e2++;
if (e2 < except2.used && except2.array[e2] == i2) {
i2++;
+
continue;
}
- if (string1[i1] != string2[i2]) return F_equal_to_not;
+ if (string1[i1] != string2[i2]) {
+ return F_equal_to_not;
+ }
i1++;
i2++;
while (e1 < except1.used && except1.array[e1] < i1) e1++;
if (e1 < except1.used && except1.array[e1] == i1) continue;
- if (string1[i1] != 0) return F_equal_to_not;
+ if (string1[i1] != 0) {
+ return F_equal_to_not;
+ }
} // for
for (; i2 < stop2; i2++) {
while (e2 < except2.used && except2.array[e2] < i2) e2++;
if (e2 < except2.used && except2.array[e2] == i2) continue;
- if (string2[i2] != 0) return F_equal_to_not;
+ if (string2[i2] != 0) {
+ return F_equal_to_not;
+ }
} // for
return F_equal_to;
#if !defined(_di_fl_string_compare_except_trim_) || !defined(_di_fl_string_dynamic_compare_except_trim_) || !defined(_di_fl_string_dynamic_partial_compare_except_trim_)
f_status_t private_fl_string_compare_except_trim(const f_string_t string1, const f_string_t string2, const f_array_length_t offset1, const f_array_length_t offset2, const f_array_length_t stop1, const f_array_length_t stop2, const f_array_lengths_t except1, const f_array_lengths_t except2) {
+
f_array_length_t i1 = offset1;
f_array_length_t i2 = offset2;
while (e1 < except1.used && except1.array[e1] < i1) e1++;
if (e1 < except1.used && except1.array[e1] == i1) {
width = 1;
+
continue;
}
while (e2 < except2.used && except2.array[e2] < i2) e2++;
if (e2 < except2.used && except2.array[e2] == i2) {
width = 1;
+
continue;
}
// skip past except characters in string1.
while (ej < except1.used && except1.array[ej] < j) ej++;
+
if (ej < except1.used && except1.array[ej] == j) {
width = 1;
+
continue;
}
}
} // for
- if (size1 != size2) return F_equal_to_not;
+ if (size1 != size2) {
+ return F_equal_to_not;
+ }
}
while (i1 <= last1 && i2 <= last2) {
// skip past except characters in string1.
while (e1 < except1.used && except1.array[e1] < i1) e1++;
+
if (e1 < except1.used && except1.array[e1] == i1) {
i1++;
+
continue;
}
// skip past except characters in string2.
while (e2 < except2.used && except2.array[e2] < i2) e2++;
+
if (e2 < except2.used && except2.array[e2] == i2) {
i2++;
+
continue;
}
- if (string1[i1] != string2[i2]) return F_equal_to_not;
+ if (string1[i1] != string2[i2]) {
+ return F_equal_to_not;
+ }
i1++;
i2++;
#if !defined(_di_fl_string_compare_trim_) || !defined(_di_fl_string_dynamic_compare_trim_) || !defined(_di_fl_string_dynamic_partial_compare_trim_)
f_status_t private_fl_string_compare_trim(const f_string_t string1, const f_string_t string2, const f_array_length_t offset1, const f_array_length_t offset2, const f_array_length_t stop1, const f_array_length_t stop2) {
+
f_array_length_t i1 = offset1;
f_array_length_t i2 = offset2;
}
} // for
- if (size1 != size2) return F_equal_to_not;
+ if (size1 != size2) {
+ return F_equal_to_not;
+ }
}
for (; i1 < last1 && i2 < last2; i1++, i2++) {
while (i2 < last2 && !string2[i2]) i2++;
if (i2 == last2) break;
- if (string1[i1] != string2[i2]) return F_equal_to_not;
+ if (string1[i1] != string2[i2]) {
+ return F_equal_to_not;
+ }
} // for
// only return F_equal_to if all remaining characters are NULL.
while (i1 < last1) {
+
if (string1[i1] != 0) return F_equal_to_not;
i1++;
} // while
while (i2 < last2) {
+
if (string2[i2] != 0) return F_equal_to_not;
i2++;
} // while
#if !defined(_di_fl_string_rip_) || !defined(_di_fl_string_dynamic_rip_) || !defined(_di_fl_string_rip_nulless_) || !defined(_di_fl_string_dynamic_rip_nulless_)
f_status_t private_fl_string_rip_find_range(const f_string_t source, f_array_length_t *start, f_array_length_t *stop) {
+
const f_array_length_t stop_original = *stop;
f_status_t status = F_none;
return status;
}
- if (status == F_true) return F_data_not;
+ if (status == F_true) {
+ return F_data_not;
+ }
}
return F_none;
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_utf (with error bit) if a character is not valid UTF-8.
*
* Errors (with error bit) from: f_utf_is_whitespace().
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_utf (with error bit) if a character is not valid UTF-8.
*
* Errors (with error bit) from: f_utf_is_whitespace().
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
f_array_length_t begin = range.start;
f_array_length_t end = range.stop;
const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end);
- if (F_status_is_error(status)) return status;
- if (status == F_data_not) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (status == F_data_not) {
+ return status;
+ }
+
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return f_string_append(source.string + begin, (end - begin) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!source.used) return F_data_not_eos;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
f_array_length_t begin = range.start;
f_array_length_t end = range.stop;
const f_status_t status = private_fl_string_rip_find_range(source.string, &begin, &end);
- if (F_status_is_error(status)) return status;
- if (status == F_data_not) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (status == F_data_not) {
+ return status;
+ }
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return f_string_append_nulless(source.string + begin, (end - begin) + 1, destination);
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string) return F_data_not;
- if (range->start > range->stop) return F_data_not_stop;
+ if (!string) {
+ return F_data_not;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
const unsigned short seek_width = macro_f_utf_character_t_width(seek_to_this);
if (!width) {
width = 1;
- if (string[range->start] == f_string_eol_s[0]) return F_none_eol;
+ if (string[range->start] == f_string_eol_s[0]) {
+ return F_none_eol;
+ }
if (seek_width == width) {
- if (string[range->start] == seek_to_this) return F_none;
+ if (string[range->start] == seek_to_this) {
+ return F_none;
+ }
}
}
// Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_stop);
+ }
if (width == seek_width) {
f_utf_character_t character = 0;
status = f_utf_char_to_character(string + range->start, width_max, &character);
- if (F_status_is_error(status)) return status;
- if (character == seek_to_this) return F_none;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (character == seek_to_this) {
+ return F_none;
+ }
}
}
range->start += width;
- if (range->start >= range->stop) return F_none_stop;
+ if (range->start >= range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none_eos;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string) return F_data_not;
- if (range->start > range->stop) return F_data_not_stop;
+ if (!string) {
+ return F_data_not;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_status_t status = F_none;
unsigned short width = 0;
while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) {
- if (F_status_is_error(status)) return status;
- if (string[range->start] == f_string_eol_s[0]) return F_none_eol;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (string[range->start] == f_string_eol_s[0]) {
+ return F_none_eol;
+ }
width = macro_f_utf_byte_width_is(string[range->start]);
if (!width) {
width = 1;
}
- // Do not operate on UTF-8 fragments that are not the first byte of the character.
else if (width == 1) {
+
+ // Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_stop);
+ }
}
range->start += width;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string) return F_data_not;
- if (range->start > range->stop) return F_data_not_stop;
+ if (!string) {
+ return F_data_not;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_status_t status = F_none;
unsigned short width = 0;
f_array_length_t width_max = (range->stop - range->start) + 1;
while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) {
- if (F_status_is_error(status)) return status;
- if (string[range->start] == f_string_eol_s[0]) return F_none_eol;
+
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (string[range->start] == f_string_eol_s[0]) {
+ return F_none_eol;
+ }
width = macro_f_utf_byte_width_is(string[range->start]);
if (!width) {
width = 1;
}
- // Do not operate on UTF-8 fragments that are not the first byte of the character.
else if (width == 1) {
+
+ // Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_stop);
+ }
}
range->start += width;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!string) return F_data_not;
- if (range->start > range->stop) return F_data_not_stop;
+ if (!string) {
+ return F_data_not;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
const unsigned short seek_width = macro_f_utf_character_t_width(seek_to_this);
f_array_length_t width_max = 0;
while (range->start <= range->stop) {
+
width_max = (range->stop - range->start) + 1;
width = macro_f_utf_byte_width_is(string[range->start]);
width = 1;
if (seek_width == width) {
- if (string[range->start] == seek_to_this) return F_none;
+ if (string[range->start] == seek_to_this) {
+ return F_none;
+ }
}
}
// Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_stop);
+ }
if (width == seek_width) {
f_utf_character_t character = 0;
+
status = f_utf_char_to_character(string + range->start, width_max, &character);
- if (F_status_is_error(status)) return status;
- if (character == seek_to_this) return F_none;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (character == seek_to_this) {
+ return F_none;
+ }
}
}
range->start += width;
- if (range->start >= range->stop) return F_none_stop;
+ if (range->start >= range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none_eos;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
f_array_length_t begin = 0;
f_array_length_t end = length - 1;
const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end);
- if (F_status_is_error(status)) return status;
- if (status == F_data_not) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (status == F_data_not) {
+ return status;
+ }
return f_string_append(source + begin, (end - begin) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
f_array_length_t begin = 0;
f_array_length_t end = length - 1;
const f_status_t status = private_fl_string_rip_find_range(source, &begin, &end);
- if (F_status_is_error(status)) return status;
- if (status == F_data_not) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (status == F_data_not) {
+ return status;
+ }
return f_string_append_nulless(source + begin, (end - begin) + 1, destination);
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
const unsigned short seek_width = macro_f_utf_character_t_width(seek_to);
f_status_t status = F_none;
unsigned short width = 0;
-
f_array_length_t width_max = (range->stop - range->start) + 1;
for (; range->start <= range->stop; range->start += width) {
+
width_max = (range->stop - range->start) + 1;
width = macro_f_utf_byte_width_is(string[range->start]);
if (!width) {
width = 1;
- if (string[range->start] == f_string_eol_s[0]) return F_none_eol;
+ if (string[range->start] == f_string_eol_s[0]) {
+ return F_none_eol;
+ }
if (seek_width == width) {
- if (string[range->start] == seek_to) return F_none;
+ if (string[range->start] == seek_to) {
+ return F_none;
+ }
}
}
// Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_eos);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_eos);
+ }
if (width == seek_width) {
f_utf_character_t character = 0;
+
status = f_utf_char_to_character(string + range->start, width_max, &character);
- if (F_status_is_error(status)) return status;
- if (character == seek_to) return F_none;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (character == seek_to) {
+ return F_none;
+ }
}
}
} // for
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_status_t status = F_none;
unsigned short width = 0;
f_array_length_t width_max = (range->stop - range->start) + 1;
while (string[range->start] == placeholder || (status = f_utf_is_graph(string + range->start, width_max)) == F_false) {
- if (F_status_is_error(status)) return status;
- if (string[range->start] == f_string_eol_s[0]) return F_none_eol;
+
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (string[range->start] == f_string_eol_s[0]) {
+ return F_none_eol;
+ }
width = macro_f_utf_byte_width_is(string[range->start]);
if (!width) {
width = 1;
}
- // Do not operate on UTF-8 fragments that are not the first byte of the character.
else if (width == 1) {
+
+ // Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_stop);
+ }
}
range->start += width;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_status_t status = F_none;
unsigned short width = 0;
f_array_length_t width_max = (range->stop - range->start) + 1;
while (string[range->start] == placeholder || (status = f_utf_is_whitespace(string + range->start, width_max)) == F_false) {
+
if (F_status_is_error(status)) {
return status;
}
- if (string[range->start] == f_string_eol_s[0]) return F_none_eol;
+ if (string[range->start] == f_string_eol_s[0]) {
+ return F_none_eol;
+ }
width = macro_f_utf_byte_width_is(string[range->start]);
if (!width) {
width = 1;
}
- // Do not operate on UTF-8 fragments that are not the first byte of the character.
else if (width == 1) {
+
+ // Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_stop);
+ }
}
range->start += width;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
width_max = (range->stop - range->start) + 1;
} // while
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
const unsigned short seek_width = macro_f_utf_character_t_width(seek_to);
f_status_t status = F_none;
unsigned short width = 0;
-
f_array_length_t width_max = 0;
for (; range->start <= range->stop; range->start += width) {
+
width_max = (range->stop - range->start) + 1;
width = macro_f_utf_byte_width_is(string[range->start]);
width = 1;
if (seek_width == width) {
- if (string[range->start] == seek_to) return F_none;
+ if (string[range->start] == seek_to) {
+ return F_none;
+ }
}
}
// Do not operate on UTF-8 fragments that are not the first byte of the character.
return F_status_set_error(F_complete_not_utf);
}
else {
- if (range->start + width > range->stop) return F_status_set_error(F_complete_not_utf_stop);
+ if (range->start + width > range->stop) {
+ return F_status_set_error(F_complete_not_utf_stop);
+ }
if (width == seek_width) {
f_utf_character_t character = 0;
+
status = f_utf_char_to_character(string + range->start, width_max, &character);
- if (F_status_is_error(status)) return status;
- if (character == seek_to) return F_none;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (character == seek_to) {
+ return F_none;
+ }
}
}
} // for
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_compare_
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_compare_except_
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_compare_
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_compare_except_
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_partial_compare_
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_partial_compare_dynamic_
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_partial_compare_except_
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_partial_compare_except_dynamic_
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_partial_compare_except_string_
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_string_dynamic_partial_compare_string_
* @return
* F_equal_to when both strings equal.
* 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().
* @return
* F_equal_to when both strings equal.
* 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().
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*/
* F_none_stop on success, but stopped at end of range.
* F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
* F_none_stop on success, but stopped at end of range.
* F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_not (with error bit) on out of memory.
* F_none_stop on success, but stopped at end of range.
* F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_not (with error bit) on out of memory.
* F_none_stop on success, but stopped at end of range.
* F_data_not on success, but there was no string data to seek.
* F_data_not_stop on success, but the range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_data_not_stop if range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_data_not_stop if range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_not (with error bit) on out of memory.
* F_none_eol on success, but stopped at EOL.
* F_none_stop on success, but stopped stop location.
* F_data_not_stop if range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_not (with error bit) on out of memory.
* F_none on success.
* F_none_stop on success, but stopped stop location.
* F_data_not_stop if range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_parameter (with error bit) if a parameter is invalid.
#if !defined(_di_fl_utf_string_compare_) || !defined(_di_fl_utf_string_dynamic_compare_) || !defined(_di_fl_utf_string_dynamic_partial_compare_)
f_status_t private_fl_utf_string_compare(const f_utf_string_t string1, const f_utf_string_t string2, const f_array_length_t offset1, const f_array_length_t offset2, const f_array_length_t stop1, const f_array_length_t stop2) {
+
f_array_length_t i1 = offset1;
f_array_length_t i2 = offset2;
#if !defined(_di_fl_utf_string_compare_trim_) || !defined(_di_fl_utf_string_dynamic_compare_trim_) || !defined(_di_fl_utf_string_dynamic_partial_compare_trim_)
f_status_t private_fl_utf_string_compare_trim(const f_utf_string_t string1, const f_utf_string_t string2, const f_array_length_t offset1, const f_array_length_t offset2, const f_array_length_t stop1, const f_array_length_t stop2) {
+
f_array_length_t i1 = offset1;
f_array_length_t i2 = offset2;
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) {
return status;
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) {
return status;
// size1 and size2 are to represent to total number of characters after trim.
f_array_length_t size1 = 0;
f_array_length_t size2 = 0;
+ f_array_length_t j = 0;
// determine where the last non-whitespace is in string1.
- for (f_array_length_t j = i1; j < stop1; j++) {
+ for (j = i1; j < stop1; j++) {
// skip past NULL in string1.
while (j < stop1 && !string1[j]) j++;
} // for
// determine where the last non-whitespace is in string2.
- for (f_array_length_t j = i2; j < stop2; j++) {
+ for (j = i2; j < stop2; j++) {
// skip past NULL in string2.
while (j < stop2 && !string2[j]) j++;
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) {
return status;
}
} // for
- if (size1 != size2) return F_equal_to_not;
+ if (size1 != size2) {
+ return F_equal_to_not;
+ }
}
for (; i1 < last1 && i2 < last2; i1++, i2++) {
return status;
}
- if (status == F_true) return F_data_not;
+ if (status == F_true) {
+ return F_data_not;
+ }
}
return F_none;
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* @see fl_utf_string_compare()
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* @see fl_utf_string_compare_trim()
* @return
* F_none on success.
* F_data_not on success but only whitespace found.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return f_utf_string_append(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!source.used) return F_data_not_eos;
- if (range.start > range.stop) return F_data_not_stop;
+ if (!source.used) {
+ return F_data_not_eos;
+ }
+
+ if (range.start > range.stop) {
+ return F_data_not_stop;
+ }
return f_utf_string_append_nulless(source.string + range.start, (range.stop - range.start) + 1, destination);
}
if (buffer.used <= range->start) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
- if (range->start > range->stop) return F_data_not_stop;
+ if (!buffer.used) {
+ return F_data_not_eos;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_utf_character_t seek_to_character = seek_to_this << 24;
return F_status_set_error(F_utf);
}
- if (range->start >= buffer.used) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start >= buffer.used) {
+ return F_none_eos;
+ }
+
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
if (buffer.used <= range->start) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
- if (range->start > range->stop) return F_data_not_stop;
+ if (!buffer.used) {
+ return F_data_not_eos;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_status_t status = F_none;
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;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (buffer.string[range->start] == f_utf_character_t_eol) {
+ return F_none_eol;
+ }
range->start++;
return F_status_set_error(F_utf);
}
- if (range->start >= buffer.used) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start >= buffer.used) {
+ return F_none_eos;
+ }
+
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
if (buffer.used <= range->start) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!buffer.used) return F_data_not_eos;
- if (range->start > range->stop) return F_data_not_stop;
+ if (!buffer.used) {
+ return F_data_not_eos;
+ }
+
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_utf_character_t seek_to_character = seek_to_this << 24;
}
while (buffer.string[range->start] != seek_to_character) {
+
range->start++;
if (macro_f_utf_character_t_width_is(buffer.string[range->start]) == 1) {
return F_status_set_error(F_utf);
}
- if (range->start >= buffer.used) return F_none_eos;
- if (range->start > range->stop) return F_none_stop;
+ if (range->start >= buffer.used) {
+ return F_none_eos;
+ }
+
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
return F_none;
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
f_array_length_t begin = 0;
f_array_length_t end = length - 1;
f_status_t status = private_fl_utf_string_rip_find_range(source, &begin, &end);
- if (F_status_is_error(status)) return status;
- if (status == F_data_not) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (status == F_data_not) {
+ return status;
+ }
return f_utf_string_append(source + begin, (end - begin) + 1, destination);
}
if (!destination) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (!length) return F_data_not_eos;
+ if (!length) {
+ return F_data_not_eos;
+ }
f_array_length_t begin = 0;
f_array_length_t end = length - 1;
f_status_t status = private_fl_utf_string_rip_find_range(source, &begin, &end);
- if (F_status_is_error(status)) return status;
- if (status == F_data_not) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (status == F_data_not) {
+ return status;
+ }
return f_utf_string_append_nulless(source + begin, (end - begin) + 1, destination);
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_utf_character_t seek_to_character = seek_to_this << 24;
return F_status_set_error(F_utf);
}
- if (string[range->start] == f_utf_character_t_eol) return F_none_eol;
- if (string[range->start] == seek_to_character) return F_none;
+ if (string[range->start] == f_utf_character_t_eol) {
+ return F_none_eol;
+ }
+
+ if (string[range->start] == seek_to_character) {
+ return F_none;
+ }
} // for
return F_none_stop;
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_status_t status = F_none;
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_status_is_error(status)) {
+ return status;
+ }
+
+ if (string[range->start] == f_utf_character_t_eol) {
+ return F_none_eol;
+ }
range->start++;
return F_status_set_error(F_utf);
}
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
if (!range) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (range->start > range->stop) return F_data_not_stop;
+ if (range->start > range->stop) {
+ return F_data_not_stop;
+ }
f_status_t status = F_none;
- if (macro_f_utf_character_t_width_is(string[range->start]) == 1) return F_status_set_error(F_utf);
+ if (macro_f_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;
+ if (F_status_is_error(status)) {
+ return status;
+ }
+
+ if (string[range->start] == f_utf_character_t_eol) {
+ return F_none_eol;
+ }
range->start++;
return F_status_set_error(F_utf);
}
- if (range->start > range->stop) return F_none_stop;
+ if (range->start > range->stop) {
+ return F_none_stop;
+ }
} // while
- if (F_status_is_error(status)) return status;
+ if (F_status_is_error(status)) {
+ return status;
+ }
return F_none;
}
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_utf_string_compare_
* @return
* F_equal_to when both strings equal.
* 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_character_is_whitespace().
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
*/
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the string is an invalid UTF-8 character.
*
* @return
* F_equal_to when both strings equal.
* F_equal_to_not when both strings do not equal.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_fl_utf_string_dynamic_partial_compare_
* @return
* F_equal_to when both strings equal.
* 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_character_is_whitespace().
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* F_none on success.
* F_data_not_eos if source length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*/
* F_none_eos on success, but stopped at end of buffer.
* F_data_not_eos if buffer length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
* F_none_eos on success, but stopped at end of buffer.
* F_data_not_eos if buffer length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_parameter (with error bit) if a parameter is invalid
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*
* F_none_stop on success, but stopped stop location.
* F_data_not_eos if buffer length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*
* F_none_stop on success, but stopped stop location.
* F_data_not_eos if buffer length is 0.
* F_data_not_stop if range.start > range.stop.
+ *
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
* F_parameter (with error bit) if a parameter is invalid.
*/
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not_eos if source length is 0.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* F_none_eol on success, but stopped at EOL.
* F_none_eos on success, but stopped at end of buffer.
* F_data_not_stop if range.start > range.stop.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
*/
* F_none on success.
* F_none_eol on success, but stopped at EOL.
* F_data_not_stop if range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_not (with error bit) on out of memory.
* F_none_eol on success, but stopped at EOL.
* F_none_stop on success, but stopped stop location.
* F_data_not_stop if range.start > range.stop.
+ *
* F_complete_not_utf (with error bit) if character is an incomplete UTF-8 fragment.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_memory_not (with error bit) on out of memory.
* F_none on success.
* F_none_eos on success, but stopped at end of buffer.
* F_none_stop on success, but stopped stop location.
+ *
* F_data_not_stop if range.start > range.stop.
* F_parameter (with error bit) if a parameter is invalid.
* F_utf (with error bit) if a character in the buffer is an invalid UTF-8 character.
if (*written + write_size > write_max) {
write_size = write_max - *written;
}
+
} while (*written < write_max);
return F_none;
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_complete_not_utf_stop if max write was reached but was unable to completely write a given UTF-8 block (incomplete UTF-8 is not written, not even partially).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file_closed (with error bit) if file is not open.
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (file.id < 0) return F_status_set_error(F_file);
- if (!file.id) return F_status_set_error(F_file_closed);
+ if (file.id < 0) {
+ return F_status_set_error(F_file);
+ }
+
+ if (!file.id) {
+ return F_status_set_error(F_file_closed);
+ }
f_status_t status = F_none;
if (buffer->used > buffer->size) return F_status_set_error(F_parameter);
#endif // _di_level_1_parameter_checking_
- if (file.id < 0) return F_status_set_error(F_file);
- if (!file.id) return F_status_set_error(F_file_closed);
+ if (file.id < 0) {
+ return F_status_set_error(F_file);
+ }
+
+ if (!file.id) {
+ return F_status_set_error(F_file_closed);
+ }
f_status_t status = F_none;
if (buffer.used > buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id < 0) return F_status_set_error(F_file);
- if (!file.id) return F_status_set_error(F_file_closed);
+ if (file.id < 0) {
+ return F_status_set_error(F_file);
+ }
+
+ if (!file.id) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
*written = 0;
+
return F_data_not;
}
const f_status_t status = private_fl_utf_file_write_until(file, buffer.string, buffer.used, written);
if (F_status_is_error(status)) return F_status_set_error(status);
- if (status == F_none && *written == buffer.used) return F_none_eos;
+ if (status == F_none && *written == buffer.used) {
+ return F_none_eos;
+ }
return status;
}
if (buffer.used > buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id < 0) return F_status_set_error(F_file);
- if (!file.id) return F_status_set_error(F_file_closed);
+ if (file.id < 0) {
+ return F_status_set_error(F_file);
+ }
+
+ if (!file.id) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
*written = 0;
+
return F_data_not;
}
const f_status_t status = private_fl_utf_file_write_until(file, buffer.string, write_max, written);
if (F_status_is_error(status)) return F_status_set_error(status);
- if (status == F_none && *written == buffer.used) return F_none_eos;
+ if (status == F_none && *written == buffer.used) {
+ return F_none_eos;
+ }
return status;
}
if (buffer.used > buffer.size) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id < 0) return F_status_set_error(F_file);
- if (!file.id) return F_status_set_error(F_file_closed);
+ if (file.id < 0) {
+ return F_status_set_error(F_file);
+ }
+
+ if (!file.id) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used || !total) {
*written = 0;
+
return F_data_not;
}
const f_status_t status = private_fl_utf_file_write_until(file, buffer.string, write_max, written);
if (F_status_is_error(status)) return F_status_set_error(status);
- if (status == F_none && *written == buffer.used) return F_none_eos;
+ if (status == F_none && *written == buffer.used) {
+ return F_none_eos;
+ }
return status;
}
if (range.start >= buffer.used) return F_status_set_error(F_parameter);
#endif // _di_level_0_parameter_checking_
- if (file.id < 0) return F_status_set_error(F_file);
- if (!file.id) return F_status_set_error(F_file_closed);
+ if (file.id < 0) {
+ return F_status_set_error(F_file);
+ }
+
+ if (!file.id) {
+ return F_status_set_error(F_file_closed);
+ }
if (!buffer.used) {
*written = 0;
+
return F_data_not;
}
if (F_status_is_error(status)) return F_status_set_error(status);
if (status == F_none) {
- if (range.start + *written == total) return F_none_stop;
- if (range.start + *written == buffer.used) return F_none_eos;
+ if (range.start + *written == total) {
+ return F_none_stop;
+ }
+
+ if (range.start + *written == buffer.used) {
+ return F_none_eos;
+ }
}
return status;
* @return
* F_none on success.
* F_none_eof on success and EOF was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
* @return
* F_none on success.
* F_none_eof on success and EOF was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
* @return
* F_none on success.
* F_none_eof on success and EOF was reached.
+ *
* F_block (with error bit) if file descriptor is set to non-block and the read would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_complete_not_utf_stop if max write was reached but was unable to completely write a given UTF-8 block (incomplete UTF-8 is not written, not even partially).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_complete_not_utf_stop if max write was reached but was unable to completely write a given UTF-8 block (incomplete UTF-8 is not written, not even partially).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_complete_not_utf_stop if max write was reached but was unable to completely write a given UTF-8 block (incomplete UTF-8 is not written, not even partially).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
* F_none_eos on success but range.stop exceeded buffer.used (only wrote up to buffer.used).
* F_none_stop on success but no data was written (written == 0) (not an error and often happens if file type is not a regular file).
* F_complete_not_utf_stop if max write was reached but was unable to completely write a given UTF-8 block (incomplete UTF-8 is not written, not even partially).
+ *
* F_block (with error bit) if file descriptor is set to non-block and the write would result in a blocking operation.
* F_buffer (with error bit) if the buffer is invalid.
* F_file (with error bit) if file descriptor is in an error state.
*
* @return
* F_none on success.
+ *
* F_directory_not (with error bit) if control_group.path does not exist.
*
* Errors (with error bit) from: f_directory_exists().
if (F_status_is_error(status)) {
macro_f_string_dynamic_t_delete_simple(argument);
+
return status;
}
}
if (F_status_is_error(status)) {
macro_f_string_dynamic_t_delete_simple(argument);
+
return status;
}
close(descriptors[0]);
const f_status_t status = private_fll_execute_as_child(*as, parameter, (int *) result);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
const int code = direct ? execv(program, fixed_arguments) : execvp(program, fixed_arguments);
if (as) {
const f_status_t status = private_fll_execute_as_child(*as, parameter, (int *) result);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
}
const int code = direct ? execv(program, fixed_arguments) : execvp(program, fixed_arguments);
if (status == F_true) {
status = fl_directory_clone(source, destination, source_length, destination_length, F_true, recurse);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
status = f_directory_remove(source, recurse.depth_max, F_false);
}
else {
status = f_file_clone(source, destination, F_true, recurse.size_block, recurse.exclusive);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
status = f_file_remove(source);
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_mode (with error bit) if the current user does not have access to assign the file mode.
* F_directory (with error bit) on invalid directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_buffer (with error bit) if the buffer is invalid.
* F_busy (with error bit) if filesystem is too busy to perform write.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
* F_access_owner (with error bit) if the current user does not have access to assign the specified owner.
if (F_status_is_error(status)) {
macro_f_directory_listing_t_delete_simple(listing);
+
return status;
}
if (F_status_is_error(status)) {
macro_f_directory_listing_t_delete_simple(listing);
+
return status;
}
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_mode (with error bit) if the current user does not have access to assign the file mode.
* F_directory (with error bit) on invalid directory.
*
* @return
* F_none on success.
+ *
* F_access_denied (with error bit) on access denied.
* F_access_group (with error bit) if the current user does not have access to assign the specified group.
* F_access_owner (with error bit) if the current user does not have access to assign the specified owner.
* @return
* F_none on success
* FL_fss_header_not if no header is found.
+ *
* FL_fss_accepted_invalid (with warning bit) if header is technically invalid but can be identified.
+ *
* FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header.
*
* Errors (with error bit) from: fl_conversion_string_to_hexidecimal_unsigned().
* @return
* F_none on success.
* FL_fss_header_not if no header is found.
+ *
* FL_fss_accepted_invalid (with warning bit) if header is technically invalid but can be identified.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header.
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
* @return
* F_none on success.
* F_data_not when there is no buffer, objects or contents to process.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_string_compare_trim().
// If at least some valid object was found, then return F_none equivelents.
if (objects->used > initial_used) {
- if (status == F_data_not_eos) return F_none_eos;
- if (status == F_data_not_stop) return F_none_stop;
+ if (status == F_data_not_eos) {
+ return F_none_eos;
+ }
+
+ if (status == F_data_not_stop) {
+ return F_none_stop;
+ }
}
return status;
if (objects_quoted) {
objects_quoted->used++;
}
+
} while (range->start < f_array_length_t_size);
return F_status_is_error(F_number_overflow);
* F_data_not_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing).
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_number_overflow (with error bit) if the maximimum buffer size is reached.
* F_none_stop on success after reaching stopping point.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
contents->array[contents->used].used++;
objects->used++;
contents->used++;
+
return status;
}
else if (status == F_data_not_eos || status == F_data_not_stop) {
objects->used++;
contents->used++;
+
} while (range->start < f_array_length_t_size);
return F_status_is_error(F_number_overflow);
* F_data_not_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing).
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_number_overflow (with error bit) if the maximimum buffer size is reached.
* F_none_stop on success after reaching stopping point.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
found_data = F_true;
status = fl_fss_embedded_list_content_read(buffer, range, nest, contents_delimits ? contents_delimits : objects_delimits, comments);
-
break;
}
else if (status == FL_fss_found_object_content_not) {
found_data = F_true;
break;
}
+
} while (status == FL_fss_found_object_not);
if (status == F_none_eos || status == F_none_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 (status == F_data_not_stop) return F_none_stop;
+ if (status == F_data_not_eos) {
+ return F_none_eos;
+ }
+
+ if (status == F_data_not_stop) {
+ return F_none_stop;
+ }
}
return status;
// 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 (status == F_data_not_stop) return F_none_stop;
+ if (status == F_data_not_eos) {
+ return F_none_eos;
+ }
+
+ if (status == F_data_not_stop) {
+ return F_none_stop;
+ }
}
return status;
else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not) {
return status;
}
- // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
else if (range->start >= range->stop || range->start >= buffer.used) {
+
+ // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
if (range->start >= buffer.used) {
return F_none_eos;
}
return F_none_stop;
}
+
} while (range->start < f_array_length_t_size);
return F_status_is_error(F_number_overflow);
* F_data_not_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing).
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ * FL_fss_found_object_content_not on success and object was found but no content was found (start location is at end of object).
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_terminated_not_nest_stop (with error bit) if stop location is reached while inside a nested list before a closing bracket is found (object was found).
* F_terminated_not_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_embedded_list_content_read().
* Errors (with error bit) from: fl_fss_embedded_list_object_read().
* F_none_stop on success after reaching stopping point.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
f_fss_quotes_t *quoted_content = 0;
do {
-
if (objects->used == objects->size) {
macro_f_fss_objects_t_increase(status2, (*objects));
if (F_status_is_error(status2)) return status2;
}
do {
-
if (objects_quoted) {
quoted_object = &objects_quoted->array[objects_quoted->used];
}
}
status = fl_fss_extended_content_read(buffer, range, &contents->array[contents->used], quoted_content, contents_delimits ? contents_delimits : objects_delimits);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
break;
}
// If at least some valid object was found, then return F_none equivelents.
if (objects->used > initial_used) {
- if (status == F_data_not_eos) return F_none_eos;
- if (status == F_data_not_stop) return F_none_stop;
+ if (status == F_data_not_eos) {
+ return F_none_eos;
+ }
+
+ if (status == F_data_not_stop) {
+ return F_none_stop;
+ }
}
return status;
else if (status != FL_fss_found_object && status != FL_fss_found_content && status != FL_fss_found_content_not && status != FL_fss_found_object_content_not && status != F_terminated_not_group) {
return status;
}
- // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
else if (range->start >= range->stop || range->start >= buffer.used) {
+
+ // When content is found, the range->start is incremented, if content is found at range->stop, then range->start will be > range.stop.
if (status == FL_fss_found_object || status == FL_fss_found_content || status == FL_fss_found_content_not || status == FL_fss_found_object_content_not || status == F_terminated_not_group) {
objects->used++;
contents->used++;
}
if (range->start >= buffer.used) {
- if (status == F_terminated_not_group) return F_terminated_not_group_eos;
+ if (status == F_terminated_not_group) {
+ return F_terminated_not_group_eos;
+ }
return F_none_eos;
}
- if (status == F_terminated_not_group) return F_terminated_not_group_stop;
+ if (status == F_terminated_not_group) {
+ return F_terminated_not_group_stop;
+ }
return F_none_stop;
}
if (contents_quoted) {
contents_quoted->used++;
}
+
} while (range->start < f_array_length_t_size);
return F_status_is_error(F_number_overflow);
}
status = fl_fss_extended_content_write_string(contents.array[i], quote, complete, &range, destination);
-
- if (F_status_is_error(status)) {
- return status;
- }
+ if (F_status_is_error(status)) return status;
} // for
}
* F_data_not_stop no data to write due start location being greater than stop location.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing).
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_utf (with error bit) is returned on failure to read/process a UTF-8 character.
* F_memory_not (with error bit) on out of memory.
* F_none_stop on success after reaching stopping point.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
contents->array[contents->used].used++;
objects->used++;
contents->used++;
+
return status;
}
else if (status == F_data_not_eos || status == F_data_not_stop) {
objects->used++;
contents->used++;
+
} while (range->start < f_array_length_t_size);
return F_status_is_error(F_number_overflow);
* F_data_not_eol if there is no data to write and EOL was reached (@todo: review related code and detemine what this is doing).
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ * FL_fss_found_object_content_not on success and object was found but no content was found (start location is at end of object).
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_complete_not_utf_eos (with error bit) if the end of buffer is reached before the complete UTF-8 character can be processed.
* F_complete_not_utf_stop (with error bit) if the stop location is reached before the complete UTF-8 character can be processed.
* F_terminated_not_nest_stop (with error bit) if stop location is reached while inside a nested list before a closing bracket is found (object was found).
* F_terminated_not_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().
* F_none_stop on success after reaching stopping point.
* F_data_not_eos no data to write due start location being greater than or equal to buffer size.
* F_data_not_stop no data to write due start location being greater than stop location.
+ *
* F_complete_not_utf (with error bit) is returned on failure to read/process a UTF-8 character due to the character being potentially incomplete.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
}
// Numbers are not valid status code strings.
- if ((status = f_conversion_character_is_decimal(string[0])) == F_true) {
+ status = f_conversion_character_is_decimal(string[0]);
+
+ if (status == F_true) {
return F_status_set_error(F_data);
}
#ifndef _di_fll_fss_status_error_
if (fl_string_compare(string, fll_fss_status_string_format, length, fll_fss_status_string_format_length) == F_equal_to) {
*code = FL_fss_format;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_format_eos, length, fll_fss_status_string_format_eos_length) == F_equal_to) {
*code = FL_fss_format_eos;
+
return F_none;
}
#endif // _di_fll_fss_status_error_
#ifndef _di_fll_fss_status_warning_
if (fl_string_compare(string, fll_fss_status_string_header_not, length, fll_fss_status_string_header_not_length) == F_equal_to) {
*code = FL_fss_header_not;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_accepted_invalid, length, fll_fss_status_string_accepted_invalid_length) == F_equal_to) {
*code = FL_fss_accepted_invalid;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_header_not_eos, length, fll_fss_status_string_header_not_eos_length) == F_equal_to) {
*code = FL_fss_header_not_eos;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_accepted_invalid_eos, length, fll_fss_status_string_accepted_invalid_eos_length) == F_equal_to) {
*code = FL_fss_accepted_invalid_eos;
+
return F_none;
}
#endif // _di_fll_fss_status_warning_
#ifndef _di_fll_fss_status_success_
if (fl_string_compare(string, fll_fss_status_string_found_object, length, fll_fss_status_string_found_object_length) == F_equal_to) {
*code = FL_fss_found_object;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_found_content, length, fll_fss_status_string_found_content_length) == F_equal_to) {
*code = FL_fss_found_content;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_found_object_not, length, fll_fss_status_string_found_object_not_length) == F_equal_to) {
*code = FL_fss_found_object_not;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_found_content_not, length, fll_fss_status_string_found_content_not_length) == F_equal_to) {
*code = FL_fss_found_content_not;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_found_object_content_not, length, fll_fss_status_string_found_object_content_not_length) == F_equal_to) {
*code = FL_fss_found_object_content_not;
+
return F_none;
}
#endif // _di_fll_fss_status_success_
#ifndef _di_fll_fss_status_codes_
if (fl_string_compare(string, fll_fss_status_string_found_comment, length, fll_fss_status_string_found_comment_length) == F_equal_to) {
*code = FL_fss_found_object;
+
return F_none;
}
#endif // _di_fll_fss_status_codes_
if (fl_string_compare(string, fll_fss_status_string_status_code_first, length, fll_fss_status_string_status_code_first_length) == F_equal_to) {
*code = FL_fss_status_code_first;
+
return F_none;
}
if (fl_string_compare(string, fll_fss_status_string_status_code_last, length, fll_fss_status_string_status_code_last_length) == F_equal_to) {
*code = FL_fss_status_code_last;
+
return F_none;
}
* @return
* F_none on success.
* 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.
*
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: fl_status_to_string().
#if !defined(_di_fll_fss_identify_) || !defined(_di_fll_fss_identify_file_)
f_status_t private_fll_fss_identify(const f_string_static_t buffer, f_fss_header_t *header) {
+
register f_array_length_t i = 0;
if (buffer.used < 10) {
+
// "# fss-0000" is always at least 10 characters.
return FL_fss_header_not;
}
i++;
if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) {
+
// @todo this needs to be changed to support sub-headers (maybe something like FL_fss_accepted_additional).
i++;
* @return
* F_none on success
* FL_fss_header_not if no header is found.
+ *
* FL_fss_accepted_invalid (with warning bit) if header is technically invalid but can be identified.
+ *
* FL_fss_header_not (with error bit) if the an error occurred prior to identifying a valid header.
*
* Errors (with error bit) from: fl_conversion_string_to_hexidecimal_unsigned().
}
#endif // _di_fll_iki_content_partial_escape_
-#ifndef _di_fll_iki_content_escape_un_
- f_status_t fll_iki_content_escape_un(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped) {
+#ifndef _di_fll_iki_content_partial_unescape_
+ f_status_t fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) {
#ifndef _di_level_2_parameter_checking_
if (content.used > content.size) return F_status_set_error(F_parameter);
+ if (range.start > range.stop) return F_status_set_error(F_parameter);
+ if (range.start >= content.used) return F_status_set_error(F_parameter);
if (quote != f_iki_syntax_quote_single && quote != f_iki_syntax_quote_double) return F_status_set_error(F_parameter);
if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- const f_string_range_t range = macro_f_string_range_t_initialize(content.used);
-
- return private_fll_iki_content_partial_escape_un(content, range, quote, unescaped);
+ return private_fll_iki_content_partial_unescape(content, range, quote, unescaped);
}
-#endif // _di_fll_iki_content_escape_un_
+#endif // _di_fll_iki_content_partial_unescape_
-#ifndef _di_fll_iki_content_partial_escape_un_
- f_status_t fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) {
+#ifndef _di_fll_iki_content_unescape_
+ f_status_t fll_iki_content_unescape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped) {
#ifndef _di_level_2_parameter_checking_
if (content.used > content.size) return F_status_set_error(F_parameter);
- if (range.start > range.stop) return F_status_set_error(F_parameter);
- if (range.start >= content.used) return F_status_set_error(F_parameter);
if (quote != f_iki_syntax_quote_single && quote != f_iki_syntax_quote_double) return F_status_set_error(F_parameter);
if (unescaped->used > unescaped->size) return F_status_set_error(F_parameter);
#endif // _di_level_2_parameter_checking_
- return private_fll_iki_content_partial_escape_un(content, range, quote, unescaped);
+ const f_string_range_t range = macro_f_string_range_t_initialize(content.used);
+
+ return private_fll_iki_content_partial_unescape(content, range, quote, unescaped);
}
-#endif // _di_fll_iki_content_partial_escape_un_
+#endif // _di_fll_iki_content_unescape_
#ifdef __cplusplus
} // extern "C"
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: macro_f_string_dynamic_t_resize().
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: macro_f_string_dynamic_t_resize().
#endif // _di_fll_iki_content_partial_escape_
/**
- * Unescape a string from IKI content to allow it to be used normally.
+ * Unescape a string, found within the given range, from IKI content to allow it to be used normally.
*
* This does not copy NULL characters.
*
* @param content
* The string to escape.
+ * @param range
+ * The range within the buffer that represents the content.
* @param quote
* The quote character in use.
* This must be either a single (') or double (") quote.
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote.
*
* Errors (with error bit) from: macro_f_string_dynamic_t_resize().
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
-#ifndef _di_fll_iki_content_escape_un_
- extern f_status_t fll_iki_content_escape_un(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped);
-#endif // _di_fll_iki_content_escape_un_
+#ifndef _di_fll_iki_content_partial_unescape_
+ extern f_status_t fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped);
+#endif // _di_fll_iki_content_partial_unescape_
/**
- * Unescape a string, found within the given range, from IKI content to allow it to be used normally.
+ * Unescape a string from IKI content to allow it to be used normally.
*
* This does not copy NULL characters.
*
* @param content
* The string to escape.
- * @param range
- * The range within the buffer that represents the content.
* @param quote
* The quote character in use.
* This must be either a single (') or double (") quote.
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote.
*
* Errors (with error bit) from: macro_f_string_dynamic_t_resize().
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
-#ifndef _di_fll_iki_content_partial_escape_un_
- extern f_status_t fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped);
-#endif // _di_fll_iki_content_partial_escape_un_
+#ifndef _di_fll_iki_content_unescape_
+ extern f_status_t fll_iki_content_unescape(const f_string_static_t content, const uint8_t quote, f_string_dynamic_t *unescaped);
+#endif // _di_fll_iki_content_unescape_
#ifdef __cplusplus
} // extern "C"
}
#endif // !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
-#if !defined(_di_fll_iki_content_escape_un_) || !defined(_di_fll_iki_content_partial_escape_un_)
- f_status_t private_fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) {
+#if !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
+ f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) {
f_status_t status = F_none;
// ensure escaped is at least the same size as content.
return F_none;
}
-#endif // !defined(_di_fll_iki_content_escape_un_) || !defined(_di_fll_iki_content_partial_escape_un_)
+#endif // !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
#ifdef __cplusplus
} // extern "C"
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
*
* Errors (with error bit) from: macro_f_string_dynamic_t_resize().
#endif // !defined(_di_fll_iki_content_escape_) || !defined(_di_fll_iki_content_partial_escape_)
/**
- * Private implementation of fll_iki_content_escape_un().
+ * Private implementation of fll_iki_content_unescape().
*
* Intended to be shared to each of the different implementation variations.
*
*
* @return
* F_none on success.
+ *
* F_parameter (with error bit) if a parameter is invalid.
* F_syntax (with error bit) if the given string is invalid, such as having an undelimited quote.
*
* Errors (with error bit) from: macro_f_string_dynamic_t_resize().
* Errors (with error bit) from: f_string_dynamic_increase_by().
*/
-#if !defined(_di_fll_iki_content_escape_un_) || !defined(_di_fll_iki_content_partial_escape_un_)
- extern f_status_t private_fll_iki_content_partial_escape_un(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) f_attribute_visibility_internal;
-#endif // !defined(_di_fll_iki_content_escape_un_) || !defined(_di_fll_iki_content_partial_escape_un_)
+#if !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
+ extern f_status_t private_fll_iki_content_partial_unescape(const f_string_static_t content, const f_string_range_t range, const uint8_t quote, f_string_dynamic_t *unescaped) f_attribute_visibility_internal;
+#endif // !defined(_di_fll_iki_content_unescape_) || !defined(_di_fll_iki_content_partial_unescape_)
#ifdef __cplusplus
} // extern "C"
if (!path[0]) {
return F_none;
}
+
at = 0;
}
if (!previous_1 || previous_1 == f_path_separator_s[0]) {
previous_1 = f_path_separator_current_s[0];
previous_2 = 0;
+
continue;
}
if (previous_1 == f_path_separator_s[0]) {
size_chunk = 0;
position = 0;
+
continue;
}
* @return
* F_none on success.
* F_data_not if "values" parameters were expected but not found.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
+ *
* F_array_too_large (with error bit) if a buffer would exceed max length.
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
*
* @return
* F_none on success.
* F_data_not if nothing to rip, no allocations or reallocations are performed.
+ *
* F_memory_not (with error bit) on out of memory.
* F_parameter (with error bit) if a parameter is invalid.
* F_string_too_large (with error bit) if the combined string is too large.
#ifndef _di_F_status_boolean_
if (fl_string_compare(string, FL_status_string_false, length, FL_status_string_false_length) == F_equal_to) {
*code = F_false;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_true, length, FL_status_string_true_length) == F_equal_to) {
*code = F_true;
+
return F_none;
}
#endif // _di_F_status_boolean_
#ifndef _di_F_status_signal_
if (fl_string_compare(string, FL_status_string_signal_hangup, length, FL_status_string_signal_hangup_length) == F_equal_to) {
*code = F_signal_hangup;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_interrupt, length, FL_status_string_signal_interrupt_length) == F_equal_to) {
*code = F_signal_interrupt;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_quit, length, FL_status_string_signal_quit_length) == F_equal_to) {
*code = F_signal_quit;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_illegal, length, FL_status_string_signal_illegal_length) == F_equal_to) {
*code = F_signal_illegal;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_trap, length, FL_status_string_signal_trap_length) == F_equal_to) {
*code = F_signal_trap;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_abort, length, FL_status_string_signal_abort_length) == F_equal_to) {
*code = F_signal_abort;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_bus_error, length, FL_status_string_signal_bus_error_length) == F_equal_to) {
*code = F_signal_bus_error;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_floating_point_error, length, FL_status_string_signal_floating_point_error_length) == F_equal_to) {
*code = F_signal_floating_point_error;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_kill, length, FL_status_string_signal_kill_length) == F_equal_to) {
*code = F_signal_kill;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_user_1, length, FL_status_string_signal_user_1_length) == F_equal_to) {
*code = F_signal_user_1;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_segmentation_fault, length, FL_status_string_signal_segmentation_fault_length) == F_equal_to) {
*code = F_signal_segmentation_fault;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_user_2, length, FL_status_string_signal_user_2_length) == F_equal_to) {
*code = F_signal_user_2;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_broken_pipe, length, FL_status_string_signal_broken_pipe_length) == F_equal_to) {
*code = F_signal_broken_pipe;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_alarm_clock, length, FL_status_string_signal_alarm_clock_length) == F_equal_to) {
*code = F_signal_alarm_clock;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_termination, length, FL_status_string_signal_termination_length) == F_equal_to) {
*code = F_signal_termination;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_stack_fault, length, FL_status_string_signal_stack_fault_length) == F_equal_to) {
*code = F_signal_stack_fault;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_child, length, FL_status_string_signal_child_length) == F_equal_to) {
*code = F_signal_child;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_continue, length, FL_status_string_signal_continue_length) == F_equal_to) {
*code = F_signal_continue;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_stop, length, FL_status_string_signal_stop_length) == F_equal_to) {
*code = F_signal_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_keyboard_stop, length, FL_status_string_signal_keyboard_stop_length) == F_equal_to) {
*code = F_signal_keyboard_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_tty_in, length, FL_status_string_signal_tty_in_length) == F_equal_to) {
*code = F_signal_tty_in;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_tty_out, length, FL_status_string_signal_tty_out_length) == F_equal_to) {
*code = F_signal_tty_out;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_urgent, length, FL_status_string_signal_urgent_length) == F_equal_to) {
*code = F_signal_urgent;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_cpu_limit, length, FL_status_string_signal_cpu_limit_length) == F_equal_to) {
*code = F_signal_cpu_limit;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_file_size_limit, length, FL_status_string_signal_file_size_limit_length) == F_equal_to) {
*code = F_signal_file_size_limit;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_virtual_alarm_clock, length, FL_status_string_signal_virtual_alarm_clock_length) == F_equal_to) {
*code = F_signal_virtual_alarm_clock;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_profile_alarm_clock, length, FL_status_string_signal_profile_alarm_clock_length) == F_equal_to) {
*code = F_signal_profile_alarm_clock;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_window_size_change, length, FL_status_string_signal_window_size_change_length) == F_equal_to) {
*code = F_signal_window_size_change;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_pollable_event, length, FL_status_string_signal_pollable_event_length) == F_equal_to) {
*code = F_signal_pollable_event;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_power_failure, length, FL_status_string_signal_power_failure_length) == F_equal_to) {
*code = F_signal_power_failure;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_bad_system_call, length, FL_status_string_signal_bad_system_call_length) == F_equal_to) {
*code = F_signal_bad_system_call;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_32, length, FL_status_string_signal_reserved_32_length) == F_equal_to) {
*code = F_signal_reserved_32;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_33, length, FL_status_string_signal_reserved_33_length) == F_equal_to) {
*code = F_signal_reserved_33;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_34, length, FL_status_string_signal_reserved_34_length) == F_equal_to) {
*code = F_signal_reserved_34;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_35, length, FL_status_string_signal_reserved_35_length) == F_equal_to) {
*code = F_signal_reserved_35;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_36, length, FL_status_string_signal_reserved_36_length) == F_equal_to) {
*code = F_signal_reserved_36;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_37, length, FL_status_string_signal_reserved_37_length) == F_equal_to) {
*code = F_signal_reserved_37;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_38, length, FL_status_string_signal_reserved_38_length) == F_equal_to) {
*code = F_signal_reserved_38;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_39, length, FL_status_string_signal_reserved_39_length) == F_equal_to) {
*code = F_signal_reserved_39;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_40, length, FL_status_string_signal_reserved_40_length) == F_equal_to) {
*code = F_signal_reserved_40;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_41, length, FL_status_string_signal_reserved_41_length) == F_equal_to) {
*code = F_signal_reserved_41;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_42, length, FL_status_string_signal_reserved_42_length) == F_equal_to) {
*code = F_signal_reserved_42;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_43, length, FL_status_string_signal_reserved_43_length) == F_equal_to) {
*code = F_signal_reserved_43;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_44, length, FL_status_string_signal_reserved_44_length) == F_equal_to) {
*code = F_signal_reserved_44;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_45, length, FL_status_string_signal_reserved_45_length) == F_equal_to) {
*code = F_signal_reserved_45;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_46, length, FL_status_string_signal_reserved_46_length) == F_equal_to) {
*code = F_signal_reserved_46;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_47, length, FL_status_string_signal_reserved_47_length) == F_equal_to) {
*code = F_signal_reserved_47;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_48, length, FL_status_string_signal_reserved_48_length) == F_equal_to) {
*code = F_signal_reserved_48;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_49, length, FL_status_string_signal_reserved_49_length) == F_equal_to) {
*code = F_signal_reserved_49;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_50, length, FL_status_string_signal_reserved_50_length) == F_equal_to) {
*code = F_signal_reserved_50;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_51, length, FL_status_string_signal_reserved_51_length) == F_equal_to) {
*code = F_signal_reserved_51;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_52, length, FL_status_string_signal_reserved_52_length) == F_equal_to) {
*code = F_signal_reserved_52;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_53, length, FL_status_string_signal_reserved_53_length) == F_equal_to) {
*code = F_signal_reserved_53;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_54, length, FL_status_string_signal_reserved_54_length) == F_equal_to) {
*code = F_signal_reserved_54;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_55, length, FL_status_string_signal_reserved_55_length) == F_equal_to) {
*code = F_signal_reserved_55;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_56, length, FL_status_string_signal_reserved_56_length) == F_equal_to) {
*code = F_signal_reserved_56;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_57, length, FL_status_string_signal_reserved_57_length) == F_equal_to) {
*code = F_signal_reserved_57;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_58, length, FL_status_string_signal_reserved_58_length) == F_equal_to) {
*code = F_signal_reserved_58;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_59, length, FL_status_string_signal_reserved_59_length) == F_equal_to) {
*code = F_signal_reserved_59;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_60, length, FL_status_string_signal_reserved_60_length) == F_equal_to) {
*code = F_signal_reserved_60;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_61, length, FL_status_string_signal_reserved_61_length) == F_equal_to) {
*code = F_signal_reserved_61;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_62, length, FL_status_string_signal_reserved_62_length) == F_equal_to) {
*code = F_signal_reserved_62;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_63, length, FL_status_string_signal_reserved_63_length) == F_equal_to) {
*code = F_signal_reserved_63;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_reserved_64, length, FL_status_string_signal_reserved_64_length) == F_equal_to) {
*code = F_signal_reserved_64;
+
return F_none;
}
#endif // _di_F_status_signal_
#ifndef _di_F_status_basic_
if (fl_string_compare(string, FL_status_string_none, length, FL_status_string_none_length) == F_equal_to) {
*code = F_none;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_absolute, length, FL_status_string_absolute_length) == F_equal_to) {
*code = F_absolute;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_absolute_not, length, FL_status_string_absolute_not_length) == F_equal_to) {
*code = F_absolute_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_address, length, FL_status_string_address_length) == F_equal_to) {
*code = F_address;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_address_not, length, FL_status_string_address_not_length) == F_equal_to) {
*code = F_address_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_block, length, FL_status_string_block_length) == F_equal_to) {
*code = F_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_block_not, length, FL_status_string_block_not_length) == F_equal_to) {
*code = F_block_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_bound, length, FL_status_string_bound_length) == F_equal_to) {
*code = F_bound;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_bound_not, length, FL_status_string_bound_not_length) == F_equal_to) {
*code = F_bound_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_capability, length, FL_status_string_capability_length) == F_equal_to) {
*code = F_capability;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_capability_not, length, FL_status_string_capability_not_length) == F_equal_to) {
*code = F_capability_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_child, length, FL_status_string_child_length) == F_equal_to) {
*code = F_child;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_child_not, length, FL_status_string_child_not_length) == F_equal_to) {
*code = F_child_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete, length, FL_status_string_complete_length) == F_equal_to) {
*code = F_complete;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not, length, FL_status_string_complete_not_length) == F_equal_to) {
*code = F_complete_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_connected, length, FL_status_string_connected_length) == F_equal_to) {
*code = F_connected;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_connected_not, length, FL_status_string_connected_not_length) == F_equal_to) {
*code = F_connected_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_container, length, FL_status_string_container_length) == F_equal_to) {
*code = F_container;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_container_not, length, FL_status_string_container_not_length) == F_equal_to) {
*code = F_container_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_control, length, FL_status_string_control_length) == F_equal_to) {
*code = F_control;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_control_not, length, FL_status_string_control_not_length) == F_equal_to) {
*code = F_control_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_control_group, length, FL_status_string_control_group_length) == F_equal_to) {
*code = F_control_group;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_control_group_not, length, FL_status_string_control_group_not_length) == F_equal_to) {
*code = F_control_group_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_critical, length, FL_status_string_critical_length) == F_equal_to) {
*code = F_critical;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_critical_not, length, FL_status_string_critical_not_length) == F_equal_to) {
*code = F_critical_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_dead, length, FL_status_string_dead_length) == F_equal_to) {
*code = F_dead;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_dead_not, length, FL_status_string_dead_not_length) == F_equal_to) {
*code = F_dead_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_deadlock, length, FL_status_string_deadlock_length) == F_equal_to) {
*code = F_deadlock;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_deadlock_not, length, FL_status_string_deadlock_not_length) == F_equal_to) {
*code = F_deadlock_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_descriptor, length, FL_status_string_descriptor_length) == F_equal_to) {
*code = F_descriptor;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_descriptor_not, length, FL_status_string_descriptor_not_length) == F_equal_to) {
*code = F_descriptor_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_device, length, FL_status_string_device_length) == F_equal_to) {
*code = F_device;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_device_not, length, FL_status_string_device_not_length) == F_equal_to) {
*code = F_device_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_done, length, FL_status_string_done_length) == F_equal_to) {
*code = F_done;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_done_not, length, FL_status_string_done_not_length) == F_equal_to) {
*code = F_done_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_dummy, length, FL_status_string_dummy_length) == F_equal_to) {
*code = F_dummy;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_dummy_not, length, FL_status_string_dummy_not_length) == F_equal_to) {
*code = F_dummy_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_empty, length, FL_status_string_empty_length) == F_equal_to) {
*code = F_empty;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_empty_not, length, FL_status_string_empty_not_length) == F_equal_to) {
*code = F_empty_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_encoding, length, FL_status_string_encoding_length) == F_equal_to) {
*code = F_encoding;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_encoding_not, length, FL_status_string_encoding_not_length) == F_equal_to) {
*code = F_encoding_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eoa, length, FL_status_string_eoa_length) == F_equal_to) {
*code = F_eoa;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eoa_not, length, FL_status_string_eoa_not_length) == F_equal_to) {
*code = F_eoa_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eof, length, FL_status_string_eof_length) == F_equal_to) {
*code = F_eof;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eof_not, length, FL_status_string_eof_not_length) == F_equal_to) {
*code = F_eof_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eol, length, FL_status_string_eol_length) == F_equal_to) {
*code = F_eol;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eol_not, length, FL_status_string_eol_not_length) == F_equal_to) {
*code = F_eol_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eos, length, FL_status_string_eos_length) == F_equal_to) {
*code = F_eos;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_eos_not, length, FL_status_string_eos_not_length) == F_equal_to) {
*code = F_eos_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_execute, length, FL_status_string_execute_length) == F_equal_to) {
*code = F_execute;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_execute_not, length, FL_status_string_execute_not_length) == F_equal_to) {
*code = F_execute_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_exist, length, FL_status_string_exist_length) == F_equal_to) {
*code = F_exist;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_exist_not, length, FL_status_string_exist_not_length) == F_equal_to) {
*code = F_exist_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_failure, length, FL_status_string_failure_length) == F_equal_to) {
*code = F_failure;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_failure_not, length, FL_status_string_failure_not_length) == F_equal_to) {
*code = F_failure_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_fork, length, FL_status_string_fork_length) == F_equal_to) {
*code = F_fork;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_fork_not, length, FL_status_string_fork_not_length) == F_equal_to) {
*code = F_fork_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_found, length, FL_status_string_found_length) == F_equal_to) {
*code = F_found;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_found_not, length, FL_status_string_found_not_length) == F_equal_to) {
*code = F_found_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_full, length, FL_status_string_full_length) == F_equal_to) {
*code = F_full;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_full_not, length, FL_status_string_full_not_length) == F_equal_to) {
*code = F_full_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_group, length, FL_status_string_group_length) == F_equal_to) {
*code = F_group;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_group_not, length, FL_status_string_group_not_length) == F_equal_to) {
*code = F_group_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_ignore, length, FL_status_string_ignore_length) == F_equal_to) {
*code = F_ignore;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_ignore_not, length, FL_status_string_ignore_not_length) == F_equal_to) {
*code = F_ignore_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_implemented, length, FL_status_string_implemented_length) == F_equal_to) {
*code = F_implemented;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_implemented_not, length, FL_status_string_implemented_not_length) == F_equal_to) {
*code = F_implemented_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_input, length, FL_status_string_input_length) == F_equal_to) {
*code = F_input;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_input_not, length, FL_status_string_input_not_length) == F_equal_to) {
*code = F_input_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_input_output, length, FL_status_string_input_output_length) == F_equal_to) {
*code = F_input_output;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_interrupt, length, FL_status_string_interrupt_length) == F_equal_to) {
*code = F_interrupt;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_interrupt_not, length, FL_status_string_interrupt_not_length) == F_equal_to) {
*code = F_interrupt_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_known, length, FL_status_string_known_length) == F_equal_to) {
*code = F_known;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_known_not, length, FL_status_string_known_not_length) == F_equal_to) {
*code = F_known_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_limit, length, FL_status_string_limit_length) == F_equal_to) {
*code = F_limit;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_limit_not, length, FL_status_string_limit_not_length) == F_equal_to) {
*code = F_limit_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_link, length, FL_status_string_link_length) == F_equal_to) {
*code = F_link;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_link_not, length, FL_status_string_link_not_length) == F_equal_to) {
*code = F_link_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_live, length, FL_status_string_live_length) == F_equal_to) {
*code = F_live;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_live_not, length, FL_status_string_live_not_length) == F_equal_to) {
*code = F_live_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_lock, length, FL_status_string_lock_length) == F_equal_to) {
*code = F_lock;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_lock_not, length, FL_status_string_lock_not_length) == F_equal_to) {
*code = F_lock_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_loop, length, FL_status_string_loop_length) == F_equal_to) {
*code = F_loop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_loop_not, length, FL_status_string_loop_not_length) == F_equal_to) {
*code = F_loop_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_maybe, length, FL_status_string_maybe_length) == F_equal_to) {
*code = F_maybe;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_maybe_not, length, FL_status_string_maybe_not_length) == F_equal_to) {
*code = F_maybe_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_memory, length, FL_status_string_memory_length) == F_equal_to) {
*code = F_memory;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_memory_not, length, FL_status_string_memory_not_length) == F_equal_to) {
*code = F_memory_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_minor, length, FL_status_string_minor_length) == F_equal_to) {
*code = F_minor;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_minor_not, length, FL_status_string_minor_not_length) == F_equal_to) {
*code = F_minor_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_moderate, length, FL_status_string_moderate_length) == F_equal_to) {
*code = F_moderate;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_moderate_not, length, FL_status_string_moderate_not_length) == F_equal_to) {
*code = F_moderate_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_mount, length, FL_status_string_mount_length) == F_equal_to) {
*code = F_mount;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_mount_not, length, FL_status_string_mount_not_length) == F_equal_to) {
*code = F_mount_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_name, length, FL_status_string_name_length) == F_equal_to) {
*code = F_name;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_name_not, length, FL_status_string_name_not_length) == F_equal_to) {
*code = F_name_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_nice, length, FL_status_string_nice_length) == F_equal_to) {
*code = F_nice;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_nice_not, length, FL_status_string_nice_not_length) == F_equal_to) {
*code = F_nice_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_optional, length, FL_status_string_optional_length) == F_equal_to) {
*code = F_optional;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_optional_not, length, FL_status_string_optional_not_length) == F_equal_to) {
*code = F_optional_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_output, length, FL_status_string_output_length) == F_equal_to) {
*code = F_output;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_output_not, length, FL_status_string_output_not_length) == F_equal_to) {
*code = F_output_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_parameter, length, FL_status_string_parameter_length) == F_equal_to) {
*code = F_parameter;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_parameter_not, length, FL_status_string_parameter_not_length) == F_equal_to) {
*code = F_parameter_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_parent, length, FL_status_string_parent_length) == F_equal_to) {
*code = F_parent;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_parent_not, length, FL_status_string_parent_not_length) == F_equal_to) {
*code = F_parent_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_pipe, length, FL_status_string_pipe_length) == F_equal_to) {
*code = F_pipe;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_pipe_not, length, FL_status_string_pipe_not_length) == F_equal_to) {
*code = F_pipe_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_port, length, FL_status_string_port_length) == F_equal_to) {
*code = F_port;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_port_not, length, FL_status_string_port_not_length) == F_equal_to) {
*code = F_port_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_processor, length, FL_status_string_processor_length) == F_equal_to) {
*code = F_processor;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_processor_not, length, FL_status_string_processor_not_length) == F_equal_to) {
*code = F_processor_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_prohibited, length, FL_status_string_prohibited_length) == F_equal_to) {
*code = F_prohibited;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_prohibited_not, length, FL_status_string_prohibited_not_length) == F_equal_to) {
*code = F_prohibited_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_range, length, FL_status_string_range_length) == F_equal_to) {
*code = F_range;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_range_not, length, FL_status_string_range_not_length) == F_equal_to) {
*code = F_range_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_read, length, FL_status_string_read_length) == F_equal_to) {
*code = F_read;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_read_not, length, FL_status_string_read_not_length) == F_equal_to) {
*code = F_read_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_read_only, length, FL_status_string_read_only_length) == F_equal_to) {
*code = F_read_only;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_ready, length, FL_status_string_ready_length) == F_equal_to) {
*code = F_ready;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_ready_not, length, FL_status_string_ready_not_length) == F_equal_to) {
*code = F_ready_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_recover, length, FL_status_string_recover_length) == F_equal_to) {
*code = F_recover;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_recover_not, length, FL_status_string_recover_not_length) == F_equal_to) {
*code = F_recover_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_recurse, length, FL_status_string_recurse_length) == F_equal_to) {
*code = F_recurse;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_recurse_not, length, FL_status_string_recurse_not_length) == F_equal_to) {
*code = F_recurse_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_relative, length, FL_status_string_relative_length) == F_equal_to) {
*code = F_relative;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_relative_not, length, FL_status_string_relative_not_length) == F_equal_to) {
*code = F_relative_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_require, length, FL_status_string_require_length) == F_equal_to) {
*code = F_require;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_require_not, length, FL_status_string_require_not_length) == F_equal_to) {
*code = F_require_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_resource, length, FL_status_string_resource_length) == F_equal_to) {
*code = F_resource;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_resource_not, length, FL_status_string_resource_not_length) == F_equal_to) {
*code = F_resource_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_search, length, FL_status_string_search_length) == F_equal_to) {
*code = F_search;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_search_not, length, FL_status_string_search_not_length) == F_equal_to) {
*code = F_search_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_schedule, length, FL_status_string_schedule_length) == F_equal_to) {
*code = F_schedule;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_schedule_not, length, FL_status_string_schedule_not_length) == F_equal_to) {
*code = F_schedule_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal, length, FL_status_string_signal_length) == F_equal_to) {
*code = F_signal;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_signal_not, length, FL_status_string_signal_not_length) == F_equal_to) {
*code = F_signal_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_space, length, FL_status_string_space_length) == F_equal_to) {
*code = F_space;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_space_not, length, FL_status_string_space_not_length) == F_equal_to) {
*code = F_space_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_stop, length, FL_status_string_stop_length) == F_equal_to) {
*code = F_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_stop_not, length, FL_status_string_stop_not_length) == F_equal_to) {
*code = F_stop_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_string, length, FL_status_string_string_length) == F_equal_to) {
*code = F_string;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_string_not, length, FL_status_string_string_not_length) == F_equal_to) {
*code = F_string_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_string_too_large, length, FL_status_string_string_too_large_length) == F_equal_to) {
*code = F_string_too_large;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_string_too_small, length, FL_status_string_string_too_small_length) == F_equal_to) {
*code = F_string_too_small;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_supported, length, FL_status_string_supported_length) == F_equal_to) {
*code = F_supported;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_supported_not, length, FL_status_string_supported_not_length) == F_equal_to) {
*code = F_supported_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_syntax, length, FL_status_string_syntax_length) == F_equal_to) {
*code = F_syntax;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_syntax_not, length, FL_status_string_syntax_not_length) == F_equal_to) {
*code = F_syntax_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_thread, length, FL_status_string_thread_length) == F_equal_to) {
*code = F_thread;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_thread_not, length, FL_status_string_thread_not_length) == F_equal_to) {
*code = F_thread_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_time, length, FL_status_string_time_length) == F_equal_to) {
*code = F_time;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_time_not, length, FL_status_string_time_not_length) == F_equal_to) {
*code = F_time_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_user, length, FL_status_string_user_length) == F_equal_to) {
*code = F_user;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_user_not, length, FL_status_string_user_not_length) == F_equal_to) {
*code = F_user_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_utf, length, FL_status_string_utf_length) == F_equal_to) {
*code = F_utf;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_utf_not, length, FL_status_string_utf_not_length) == F_equal_to) {
*code = F_utf_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_valid, length, FL_status_string_valid_length) == F_equal_to) {
*code = F_valid;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_valid_not, length, FL_status_string_valid_not_length) == F_equal_to) {
*code = F_valid_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_value, length, FL_status_string_value_length) == F_equal_to) {
*code = F_value;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_value_not, length, FL_status_string_value_not_length) == F_equal_to) {
*code = F_value_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_wait, length, FL_status_string_wait_length) == F_equal_to) {
*code = F_wait;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_wait_not, length, FL_status_string_wait_not_length) == F_equal_to) {
*code = F_wait_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_warn, length, FL_status_string_warn_length) == F_equal_to) {
*code = F_warn;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_warn_not, length, FL_status_string_warn_not_length) == F_equal_to) {
*code = F_warn_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_world, length, FL_status_string_world_length) == F_equal_to) {
*code = F_world;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_world_not, length, FL_status_string_world_not_length) == F_equal_to) {
*code = F_world_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_write, length, FL_status_string_write_length) == F_equal_to) {
*code = F_write;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_write_not, length, FL_status_string_write_not_length) == F_equal_to) {
*code = F_write_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_write_only, length, FL_status_string_write_only_length) == F_equal_to) {
*code = F_write_only;
+
return F_none;
}
#endif // _di_F_status_basic_
#ifndef _di_F_status_array_
if (fl_string_compare(string, FL_status_string_array, length, FL_status_string_array_length) == F_equal_to) {
*code = F_array;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_array_not, length, FL_status_string_array_not_length) == F_equal_to) {
*code = F_array_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_array_too_large, length, FL_status_string_array_too_large_length) == F_equal_to) {
*code = F_array_too_large;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_array_too_small, length, FL_status_string_array_too_small_length) == F_equal_to) {
*code = F_array_too_small;
+
return F_none;
}
#endif // _di_F_status_array_
#ifndef _di_F_status_available_
if (fl_string_compare(string, FL_status_string_available, length, FL_status_string_available_length) == F_equal_to) {
*code = F_available;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not, length, FL_status_string_available_not_length) == F_equal_to) {
*code = F_available_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not_address, length, FL_status_string_available_not_address_length) == F_equal_to) {
*code = F_available_not_address;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not_buffer, length, FL_status_string_available_not_buffer_length) == F_equal_to) {
*code = F_available_not_buffer;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not_device, length, FL_status_string_available_not_device_length) == F_equal_to) {
*code = F_available_not_device;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not_pipe, length, FL_status_string_available_not_pipe_length) == F_equal_to) {
*code = F_available_not_pipe;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not_port, length, FL_status_string_available_not_port_length) == F_equal_to) {
*code = F_available_not_port;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not_process, length, FL_status_string_available_not_process_length) == F_equal_to) {
*code = F_available_not_process;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_available_not_socket, length, FL_status_string_available_not_socket_length) == F_equal_to) {
*code = F_available_not_socket;
+
return F_none;
}
#endif // _di_F_status_available_
#ifndef _di_F_status_busy_
if (fl_string_compare(string, FL_status_string_busy, length, FL_status_string_busy_length) == F_equal_to) {
*code = F_busy;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_address, length, FL_status_string_busy_address_length) == F_equal_to) {
*code = F_busy_address;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_buffer, length, FL_status_string_busy_buffer_length) == F_equal_to) {
*code = F_busy_buffer;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_device, length, FL_status_string_busy_device_length) == F_equal_to) {
*code = F_busy_device;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_not, length, FL_status_string_busy_not_length) == F_equal_to) {
*code = F_busy_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_pipe, length, FL_status_string_busy_pipe_length) == F_equal_to) {
*code = F_busy_pipe;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_port, length, FL_status_string_busy_port_length) == F_equal_to) {
*code = F_busy_port;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_process, length, FL_status_string_busy_process_length) == F_equal_to) {
*code = F_busy_process;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_busy_socket, length, FL_status_string_busy_socket_length) == F_equal_to) {
*code = F_busy_socket;
+
return F_none;
}
#endif // _di_F_status_busy_
#ifndef _di_F_status_number_
if (fl_string_compare(string, FL_status_string_number, length, FL_status_string_number_length) == F_equal_to) {
*code = F_number;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_decimal, length, FL_status_string_number_decimal_length) == F_equal_to) {
*code = F_number_decimal;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_decimal_not, length, FL_status_string_number_decimal_not_length) == F_equal_to) {
*code = F_number_decimal_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_divide_by_zero, length, FL_status_string_number_divide_by_zero_length) == F_equal_to) {
*code = F_number_divide_by_zero;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_negative, length, FL_status_string_number_negative_length) == F_equal_to) {
*code = F_number_negative;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_negative_not, length, FL_status_string_number_negative_not_length) == F_equal_to) {
*code = F_number_negative_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_not, length, FL_status_string_number_not_length) == F_equal_to) {
*code = F_number_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_overflow, length, FL_status_string_number_overflow_length) == F_equal_to) {
*code = F_number_overflow;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_positive, length, FL_status_string_number_positive_length) == F_equal_to) {
*code = F_number_positive;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_positive_not, length, FL_status_string_number_positive_not_length) == F_equal_to) {
*code = F_number_positive_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_too_large, length, FL_status_string_number_too_large_length) == F_equal_to) {
*code = F_number_too_large;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_too_small, length, FL_status_string_number_too_small_length) == F_equal_to) {
*code = F_number_too_small;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_underflow, length, FL_status_string_number_underflow_length) == F_equal_to) {
*code = F_number_underflow;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_whole, length, FL_status_string_number_whole_length) == F_equal_to) {
*code = F_number_whole;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_whole_not, length, FL_status_string_number_whole_not_length) == F_equal_to) {
*code = F_number_whole_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_zero, length, FL_status_string_number_zero_length) == F_equal_to) {
*code = F_number_zero;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_number_zero_not, length, FL_status_string_number_zero_not_length) == F_equal_to) {
*code = F_number_zero_not;
+
return F_none;
}
#endif // _di_F_status_number_
#ifndef _di_F_status_buffer_
if (fl_string_compare(string, FL_status_string_buffer, length, FL_status_string_buffer_length) == F_equal_to) {
*code = F_buffer;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_buffer_not, length, FL_status_string_buffer_not_length) == F_equal_to) {
*code = F_buffer_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_buffer_too_large, length, FL_status_string_buffer_too_large_length) == F_equal_to) {
*code = F_buffer_too_large;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_buffer_too_small, length, FL_status_string_buffer_too_small_length) == F_equal_to) {
*code = F_buffer_too_small;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not_utf, length, FL_status_string_complete_not_utf_length) == F_equal_to) {
*code = F_complete_not_utf;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not_utf_block, length, FL_status_string_complete_not_utf_block_length) == F_equal_to) {
*code = F_complete_not_utf_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not_utf_eoa, length, FL_status_string_complete_not_utf_eoa_length) == F_equal_to) {
*code = F_complete_not_utf_eoa;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not_utf_eof, length, FL_status_string_complete_not_utf_eof_length) == F_equal_to) {
*code = F_complete_not_utf_eof;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not_utf_eol, length, FL_status_string_complete_not_utf_eol_length) == F_equal_to) {
*code = F_complete_not_utf_eol;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not_utf_eos, length, FL_status_string_complete_not_utf_eos_length) == F_equal_to) {
*code = F_complete_not_utf_eos;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_complete_not_utf_stop, length, FL_status_string_complete_not_utf_stop_length) == F_equal_to) {
*code = F_complete_not_utf_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_none_block, length, FL_status_string_none_block_length) == F_equal_to) {
*code = F_none_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_none_eoa, length, FL_status_string_none_eoa_length) == F_equal_to) {
*code = F_none_eoa;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_none_eof, length, FL_status_string_none_eof_length) == F_equal_to) {
*code = F_none_eof;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_none_eol, length, FL_status_string_none_eol_length) == F_equal_to) {
*code = F_none_eol;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_none_eos, length, FL_status_string_none_eos_length) == F_equal_to) {
*code = F_none_eos;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_none_stop, length, FL_status_string_none_stop_length) == F_equal_to) {
*code = F_none_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data, length, FL_status_string_data_length) == F_equal_to) {
*code = F_data;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data_not, length, FL_status_string_data_not_length) == F_equal_to) {
*code = F_data_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data_not_block, length, FL_status_string_data_not_block_length) == F_equal_to) {
*code = F_data_not_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data_not_eoa, length, FL_status_string_data_not_eoa_length) == F_equal_to) {
*code = F_data_not_eoa;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data_not_eof, length, FL_status_string_data_not_eof_length) == F_equal_to) {
*code = F_data_not_eof;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data_not_eol, length, FL_status_string_data_not_eol_length) == F_equal_to) {
*code = F_data_not_eol;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data_not_eos, length, FL_status_string_data_not_eos_length) == F_equal_to) {
*code = F_data_not_eos;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_data_not_stop, length, FL_status_string_data_not_stop_length) == F_equal_to) {
*code = F_data_not_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated, length, FL_status_string_terminated_length) == F_equal_to) {
*code = F_terminated;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not, length, FL_status_string_terminated_not_length) == F_equal_to) {
*code = F_terminated_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_block, length, FL_status_string_terminated_not_block_length) == F_equal_to) {
*code = F_terminated_not_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_eoa, length, FL_status_string_terminated_not_eoa_length) == F_equal_to) {
*code = F_terminated_not_eoa;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_eof, length, FL_status_string_terminated_not_eof_length) == F_equal_to) {
*code = F_terminated_not_eof;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_eol, length, FL_status_string_terminated_not_eol_length) == F_equal_to) {
*code = F_terminated_not_eol;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_eos, length, FL_status_string_terminated_not_eos_length) == F_equal_to) {
*code = F_terminated_not_eos;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_group, length, FL_status_string_terminated_not_group_length) == F_equal_to) {
*code = F_terminated_not_group;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_group_block, length, FL_status_string_terminated_not_group_block_length) == F_equal_to) {
*code = F_terminated_not_group_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_group_eoa, length, FL_status_string_terminated_not_group_eoa_length) == F_equal_to) {
*code = F_terminated_not_group_eoa;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_group_eof, length, FL_status_string_terminated_not_group_eof_length) == F_equal_to) {
*code = F_terminated_not_group_eof;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_group_eol, length, FL_status_string_terminated_not_group_eol_length) == F_equal_to) {
*code = F_terminated_not_group_eol;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_group_eos, length, FL_status_string_terminated_not_group_eos_length) == F_equal_to) {
*code = F_terminated_not_group_eos;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_group_stop, length, FL_status_string_terminated_not_group_stop_length) == F_equal_to) {
*code = F_terminated_not_group_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_nest, length, FL_status_string_terminated_not_nest_length) == F_equal_to) {
*code = F_terminated_not_nest;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_nest_block, length, FL_status_string_terminated_not_nest_block_length) == F_equal_to) {
*code = F_terminated_not_nest_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_nest_eoa, length, FL_status_string_terminated_not_nest_eoa_length) == F_equal_to) {
*code = F_terminated_not_nest_eoa;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_nest_eof, length, FL_status_string_terminated_not_nest_eof_length) == F_equal_to) {
*code = F_terminated_not_nest_eof;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_nest_eol, length, FL_status_string_terminated_not_nest_eol_length) == F_equal_to) {
*code = F_terminated_not_nest_eol;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_nest_eos, length, FL_status_string_terminated_not_nest_eos_length) == F_equal_to) {
*code = F_terminated_not_nest_eos;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_nest_stop, length, FL_status_string_terminated_not_nest_stop_length) == F_equal_to) {
*code = F_terminated_not_nest_stop;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_terminated_not_stop, length, FL_status_string_terminated_not_stop_length) == F_equal_to) {
*code = F_terminated_not_stop;
+
return F_none;
}
#endif // _di_F_status_buffer_
#ifndef _di_F_status_process_
if (fl_string_compare(string, FL_status_string_process, length, FL_status_string_process_length) == F_equal_to) {
*code = F_process;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_process_not, length, FL_status_string_process_not_length) == F_equal_to) {
*code = F_process_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_process_too_many, length, FL_status_string_process_too_many_length) == F_equal_to) {
*code = F_process_too_many;
+
return F_none;
}
#endif // _di_F_status_process_
#ifndef _di_F_status_file_
if (fl_string_compare(string, FL_status_string_file, length, FL_status_string_file_length) == F_equal_to) {
*code = F_file;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_close, length, FL_status_string_file_close_length) == F_equal_to) {
*code = F_file_close;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_closed, length, FL_status_string_file_closed_length) == F_equal_to) {
*code = F_file_closed;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_descriptor, length, FL_status_string_file_descriptor_length) == F_equal_to) {
*code = F_file_descriptor;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_descriptor_max, length, FL_status_string_file_descriptor_max_length) == F_equal_to) {
*code = F_file_descriptor_max;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_descriptor_not, length, FL_status_string_file_descriptor_not_length) == F_equal_to) {
*code = F_file_descriptor_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_empty, length, FL_status_string_file_empty_length) == F_equal_to) {
*code = F_file_empty;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_flush, length, FL_status_string_file_flush_length) == F_equal_to) {
*code = F_file_flush;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_found, length, FL_status_string_file_found_length) == F_equal_to) {
*code = F_file_found;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_found_not, length, FL_status_string_file_found_not_length) == F_equal_to) {
*code = F_file_found_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_not, length, FL_status_string_file_not_length) == F_equal_to) {
*code = F_file_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_open, length, FL_status_string_file_open_length) == F_equal_to) {
*code = F_file_open;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_open_max, length, FL_status_string_file_open_max_length) == F_equal_to) {
*code = F_file_open_max;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_opened, length, FL_status_string_file_opened_length) == F_equal_to) {
*code = F_file_opened;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_overflow, length, FL_status_string_file_overflow_length) == F_equal_to) {
*code = F_file_overflow;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_purge, length, FL_status_string_file_purge_length) == F_equal_to) {
*code = F_file_purge;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_read, length, FL_status_string_file_read_length) == F_equal_to) {
*code = F_file_read;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_reallocation, length, FL_status_string_file_reallocation_length) == F_equal_to) {
*code = F_file_reallocation;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_seek, length, FL_status_string_file_seek_length) == F_equal_to) {
*code = F_file_seek;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_stat, length, FL_status_string_file_stat_length) == F_equal_to) {
*code = F_file_stat;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_synchronize, length, FL_status_string_file_synchronize_length) == F_equal_to) {
*code = F_file_synchronize;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_block, length, FL_status_string_file_type_block_length) == F_equal_to) {
*code = F_file_type_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_character, length, FL_status_string_file_type_character_length) == F_equal_to) {
*code = F_file_type_character;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_directory, length, FL_status_string_file_type_directory_length) == F_equal_to) {
*code = F_file_type_directory;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_link, length, FL_status_string_file_type_link_length) == F_equal_to) {
*code = F_file_type_link;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_block, length, FL_status_string_file_type_not_block_length) == F_equal_to) {
*code = F_file_type_not_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_character, length, FL_status_string_file_type_not_character_length) == F_equal_to) {
*code = F_file_type_not_character;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_directory, length, FL_status_string_file_type_not_directory_length) == F_equal_to) {
*code = F_file_type_not_directory;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_fifo, length, FL_status_string_file_type_not_fifo_length) == F_equal_to) {
*code = F_file_type_not_fifo;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_link, length, FL_status_string_file_type_not_link_length) == F_equal_to) {
*code = F_file_type_not_link;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_pipe, length, FL_status_string_file_type_not_pipe_length) == F_equal_to) {
*code = F_file_type_not_pipe;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_regular, length, FL_status_string_file_type_not_regular_length) == F_equal_to) {
*code = F_file_type_not_regular;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_socket, length, FL_status_string_file_type_not_socket_length) == F_equal_to) {
*code = F_file_type_not_socket;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_not_unknown, length, FL_status_string_file_type_not_unknown_length) == F_equal_to) {
*code = F_file_type_not_unknown;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_pipe, length, FL_status_string_file_type_pipe_length) == F_equal_to) {
*code = F_file_type_pipe;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_regular, length, FL_status_string_file_type_regular_length) == F_equal_to) {
*code = F_file_type_regular;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_socket, length, FL_status_string_file_type_socket_length) == F_equal_to) {
*code = F_file_type_socket;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_type_unknown, length, FL_status_string_file_type_unknown_length) == F_equal_to) {
*code = F_file_type_unknown;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_underflow, length, FL_status_string_file_underflow_length) == F_equal_to) {
*code = F_file_underflow;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_utf, length, FL_status_string_file_utf_length) == F_equal_to) {
*code = F_file_utf;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_utf_not, length, FL_status_string_file_utf_not_length) == F_equal_to) {
*code = F_file_utf_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_file_write, length, FL_status_string_file_write_length) == F_equal_to) {
*code = F_file_write;
+
return F_none;
}
#endif // _di_F_status_file_
#ifndef _di_F_status_filesystem_
if (fl_string_compare(string, FL_status_string_filesystem, length, FL_status_string_filesystem_length) == F_equal_to) {
*code = F_filesystem;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_filesystem_not, length, FL_status_string_filesystem_not_length) == F_equal_to) {
*code = F_filesystem_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_filesystem_quota_block, length, FL_status_string_filesystem_quota_block_length) == F_equal_to) {
*code = F_filesystem_quota_block;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_filesystem_quota_reached, length, FL_status_string_filesystem_quota_reached_length) == F_equal_to) {
*code = F_filesystem_quota_reached;
+
return F_none;
}
#endif // _di_F_status_filesystem_
#ifndef _di_F_status_directory_
if (fl_string_compare(string, FL_status_string_directory, length, FL_status_string_directory_length) == F_equal_to) {
*code = F_directory;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_close, length, FL_status_string_directory_close_length) == F_equal_to) {
*code = F_directory_close;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_closed, length, FL_status_string_directory_closed_length) == F_equal_to) {
*code = F_directory_closed;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_descriptor, length, FL_status_string_directory_descriptor_length) == F_equal_to) {
*code = F_directory_descriptor;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_empty, length, FL_status_string_directory_empty_length) == F_equal_to) {
*code = F_directory_empty;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_empty_not, length, FL_status_string_directory_empty_not_length) == F_equal_to) {
*code = F_directory_empty_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_found, length, FL_status_string_directory_found_length) == F_equal_to) {
*code = F_directory_found;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_found_not, length, FL_status_string_directory_found_not_length) == F_equal_to) {
*code = F_directory_found_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_flush, length, FL_status_string_directory_flush_length) == F_equal_to) {
*code = F_directory_flush;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_link_max, length, FL_status_string_directory_link_max_length) == F_equal_to) {
*code = F_directory_link_max;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_not, length, FL_status_string_directory_not_length) == F_equal_to) {
*code = F_directory_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_open, length, FL_status_string_directory_open_length) == F_equal_to) {
*code = F_directory_open;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_purge, length, FL_status_string_directory_purge_length) == F_equal_to) {
*code = F_directory_purge;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_read, length, FL_status_string_directory_read_length) == F_equal_to) {
*code = F_directory_read;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_stream, length, FL_status_string_directory_stream_length) == F_equal_to) {
*code = F_directory_stream;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_supported_not, length, FL_status_string_directory_supported_not_length) == F_equal_to) {
*code = F_directory_supported_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_synchronize, length, FL_status_string_directory_synchronize_length) == F_equal_to) {
*code = F_directory_synchronize;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_utf, length, FL_status_string_directory_utf_length) == F_equal_to) {
*code = F_directory_utf;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_utf_not, length, FL_status_string_directory_utf_not_length) == F_equal_to) {
*code = F_directory_utf_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_directory_write, length, FL_status_string_directory_write_length) == F_equal_to) {
*code = F_directory_write;
+
return F_none;
}
#endif // _di_F_status_directory_
#ifndef _di_F_status_socket_
if (fl_string_compare(string, FL_status_string_socket, length, FL_status_string_socket_length) == F_equal_to) {
*code = F_socket;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_socket_client, length, FL_status_string_socket_client_length) == F_equal_to) {
*code = F_socket_client;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_socket_not, length, FL_status_string_socket_not_length) == F_equal_to) {
*code = F_socket_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_socket_receive, length, FL_status_string_socket_receive_length) == F_equal_to) {
*code = F_socket_receive;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_socket_send, length, FL_status_string_socket_send_length) == F_equal_to) {
*code = F_socket_send;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_socket_target, length, FL_status_string_socket_target_length) == F_equal_to) {
*code = F_socket_target;
+
return F_none;
}
#endif // _di_F_status_socket_
#ifndef _di_F_status_compare_
if (fl_string_compare(string, FL_status_string_equal_to, length, FL_status_string_equal_to_length) == F_equal_to) {
*code = F_equal_to;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_equal_to_not, length, FL_status_string_equal_to_not_length) == F_equal_to) {
*code = F_equal_to_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_than_greater, length, FL_status_string_than_greater_length) == F_equal_to) {
*code = F_than_greater;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_than_less, length, FL_status_string_than_less_length) == F_equal_to) {
*code = F_than_less;
+
return F_none;
}
#endif // _di_F_status_compare_
#ifndef _di_F_status_access_
if (fl_string_compare(string, FL_status_string_access, length, FL_status_string_access_length) == F_equal_to) {
*code = F_access;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied, length, FL_status_string_access_denied_length) == F_equal_to) {
*code = F_access_denied;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied_user, length, FL_status_string_access_denied_user_length) == F_equal_to) {
*code = F_access_denied_user;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied_group, length, FL_status_string_access_denied_group_length) == F_equal_to) {
*code = F_access_denied_group;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied_world, length, FL_status_string_access_denied_world_length) == F_equal_to) {
*code = F_access_denied_world;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied_read, length, FL_status_string_access_denied_read_length) == F_equal_to) {
*code = F_access_denied_read;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied_write, length, FL_status_string_access_denied_write_length) == F_equal_to) {
*code = F_access_denied_write;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied_execute, length, FL_status_string_access_denied_execute_length) == F_equal_to) {
*code = F_access_denied_execute;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_denied_super, length, FL_status_string_access_denied_super_length) == F_equal_to) {
*code = F_access_denied_super;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted, length, FL_status_string_access_granted_length) == F_equal_to) {
*code = F_access_granted;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted_user, length, FL_status_string_access_granted_user_length) == F_equal_to) {
*code = F_access_granted_user;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted_group, length, FL_status_string_access_granted_group_length) == F_equal_to) {
*code = F_access_granted_group;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted_world, length, FL_status_string_access_granted_world_length) == F_equal_to) {
*code = F_access_granted_world;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted_read, length, FL_status_string_access_granted_read_length) == F_equal_to) {
*code = F_access_granted_read;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted_write, length, FL_status_string_access_granted_write_length) == F_equal_to) {
*code = F_access_granted_write;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted_execute, length, FL_status_string_access_granted_execute_length) == F_equal_to) {
*code = F_access_granted_execute;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_granted_super, length, FL_status_string_access_granted_super_length) == F_equal_to) {
*code = F_access_granted_super;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_group, length, FL_status_string_access_group_length) == F_equal_to) {
*code = F_access_mode;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_mode, length, FL_status_string_access_mode_length) == F_equal_to) {
*code = F_access_group;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_not, length, FL_status_string_access_not_length) == F_equal_to) {
*code = F_access_not;
+
return F_none;
}
if (fl_string_compare(string, FL_status_string_access_owner, length, FL_status_string_access_owner_length) == F_equal_to) {
*code = F_access_owner;
+
return F_none;
}
#endif // _di_F_status_access_
* @return
* F_none on success.
* 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.
*