Use the newer naming practices.
These kinds of changes will be performed as I notice them.
f_utf_character character_argument_utf = 0;
f_utf_character character_console_utf = 0;
- unsigned short max_width = string_length - sub_location;
+ unsigned short width_max = string_length - sub_location;
- status = f_utf_char_to_character(arguments.argv[location] + sub_location, max_width, &character_argument_utf);
+ status = f_utf_char_to_character(arguments.argv[location] + sub_location, width_max, &character_argument_utf);
if (status != f_none) {
f_macro_string_lengths_delete_simple(needs_additional);
return status;
}
- max_width = strlen(parameters.parameter[parameter_counter].symbol_short);
+ width_max = strlen(parameters.parameter[parameter_counter].symbol_short);
- status = f_utf_char_to_character((f_string) parameters.parameter[parameter_counter].symbol_short, max_width, &character_console_utf);
+ status = f_utf_char_to_character((f_string) parameters.parameter[parameter_counter].symbol_short, width_max, &character_console_utf);
if (status != f_none) {
f_macro_string_lengths_delete_simple(needs_additional);
#endif // _di_f_utf_character_is_zero_width_
#ifndef _di_f_utf_character_to_char_
- f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, uint8_t *max_width) {
+ f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, uint8_t *width_max) {
#ifndef _di_level_0_parameter_checking_
if (utf_character == 0) return f_status_set_error(f_invalid_parameter);
- if (max_width == 0 && *character != 0) return f_status_set_error(f_invalid_parameter);
- if (max_width != 0 && *character == 0) return f_status_set_error(f_invalid_parameter);
- if (max_width != 0 && *max_width > 4) return f_status_set_error(f_invalid_parameter);
+ if (width_max == 0 && *character != 0) return f_status_set_error(f_invalid_parameter);
+ if (width_max != 0 && *character == 0) return f_status_set_error(f_invalid_parameter);
+ if (width_max != 0 && *width_max > 4) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
f_status status = f_none;
unsigned short width = f_macro_utf_character_width_is(utf_character);
- if (max_width == 0) {
+ if (width_max == 0) {
f_macro_string_new(status, *character, width);
if (f_status_is_error(status)) return status;
width = 1;
- *max_width = 1;
+ *width_max = 1;
}
else if (width == 1) {
return f_status_is_error(f_invalid_utf);
}
- else if (width > *max_width) {
+ else if (width > *width_max) {
return f_status_set_error(f_failure);
}
- *max_width = width;
+ *width_max = width;
if (f_utf_is_big_endian()) {
memcpy(*character, &utf_character, width);
#endif // _di_f_utf_is_big_endian_
#ifndef _di_f_utf_is_
- f_return_status f_utf_is(const f_string character, const uint8_t max_width) {
+ f_return_status f_utf_is(const f_string character, const uint8_t width_max) {
#ifndef _di_level_0_parameter_checking_
- if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ if (width_max < 1) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
uint8_t width = f_macro_utf_byte_width_is(*character);
#endif // _di_f_utf_is_
#ifndef _di_f_utf_is_control_
- f_return_status f_utf_is_control(const f_string character, const uint8_t max_width) {
+ f_return_status f_utf_is_control(const f_string character, const uint8_t width_max) {
#ifndef _di_level_0_parameter_checking_
- if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ if (width_max < 1) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
uint8_t width = f_macro_utf_byte_width_is(*character);
f_utf_character character_utf = 0;
f_status status = 0;
- status = f_utf_char_to_character(character, max_width, &character_utf);
+ status = f_utf_char_to_character(character, width_max, &character_utf);
if (status != f_none) return status;
#endif // _di_f_utf_is_control_
#ifndef _di_f_utf_is_control_picture_
- f_return_status f_utf_is_control_picture(const f_string character, const uint8_t max_width) {
+ f_return_status f_utf_is_control_picture(const f_string character, const uint8_t width_max) {
#ifndef _di_level_0_parameter_checking_
- if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ if (width_max < 1) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
uint8_t width = f_macro_utf_byte_width_is(*character);
f_utf_character character_utf = 0;
f_status status = 0;
- status = f_utf_char_to_character(character, max_width, &character_utf);
+ status = f_utf_char_to_character(character, width_max, &character_utf);
if (status != f_none) return status;
#endif // _di_f_utf_is_control_picture_
#ifndef _di_f_utf_is_graph_
- f_return_status f_utf_is_graph(const f_string character, const uint8_t max_width) {
+ f_return_status f_utf_is_graph(const f_string character, const uint8_t width_max) {
#ifndef _di_level_0_parameter_checking_
- if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ if (width_max < 1) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
uint8_t width = f_macro_utf_byte_width_is(*character);
f_utf_character character_utf = 0;
f_status status = 0;
- status = f_utf_char_to_character(character, max_width, &character_utf);
+ status = f_utf_char_to_character(character, width_max, &character_utf);
if (status != f_none) return status;
#endif // _di_f_utf_is_graph_
#ifndef _di_f_utf_is_whitespace_
- f_return_status f_utf_is_whitespace(const f_string character, const uint8_t max_width) {
+ f_return_status f_utf_is_whitespace(const f_string character, const uint8_t width_max) {
#ifndef _di_level_0_parameter_checking_
- if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ if (width_max < 1) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
uint8_t width = f_macro_utf_byte_width_is(*character);
f_utf_character character_utf = 0;
f_status status = 0;
- status = f_utf_char_to_character(character, max_width, &character_utf);
+ status = f_utf_char_to_character(character, width_max, &character_utf);
if (status != f_none) return status;
#endif // _di_f_utf_is_whitespace_
#ifndef _di_f_utf_is_zero_width_
- f_return_status f_utf_is_zero_width(const f_string character, const uint8_t max_width) {
+ f_return_status f_utf_is_zero_width(const f_string character, const uint8_t width_max) {
#ifndef _di_level_0_parameter_checking_
- if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ if (width_max < 1) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
uint8_t width = f_macro_utf_byte_width_is(*character);
f_utf_character character_utf = 0;
f_status status = 0;
- status = f_utf_char_to_character(character, max_width, &character_utf);
+ status = f_utf_char_to_character(character, width_max, &character_utf);
if (status != f_none) return status;
#endif // _di_f_utf_is_zero_width_
#ifndef _di_f_utf_char_to_character_
- f_return_status f_utf_char_to_character(const f_string character, const uint8_t max_width, f_utf_character *character_utf) {
+ f_return_status f_utf_char_to_character(const f_string character, const uint8_t width_max, f_utf_character *character_utf) {
#ifndef _di_level_0_parameter_checking_
- if (max_width < 1) return f_status_set_error(f_invalid_parameter);
+ if (width_max < 1) return f_status_set_error(f_invalid_parameter);
if (character_utf == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_0_parameter_checking_
return f_status_is_error(f_invalid_utf);
}
- if (width > max_width) {
+ if (width > width_max) {
return f_status_set_error(f_failure);
}
* The UTF-8 characterr to convert from.
* @param character
* A int8_t representation of the UTF-8 character, stored as a string of width bytes.
- * If max_width is 0, then this should not be allocated (set the pointer address to 0).
- * @param max_width
+ * If width_max is 0, then this should not be allocated (set the pointer address to 0).
+ * @param width_max
* The number of bytes the generated character represents.
* If this is set to 0, then the character will be allocated and this will be set to the width of the utf_character.
* If this is set to some value greater than 0 (up to 4), then this represents the size of the character array (no allocations are performed).
* f_failure (with error bit) if width is not long enough to convert.
*/
#ifndef _di_f_utf_character_to_char_
- extern f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, uint8_t *max_width);
+ extern f_return_status f_utf_character_to_char(const f_utf_character utf_character, f_string *character, uint8_t *width_max);
#endif // _di_f_utf_character_to_char_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is()
*/
#ifndef _di_f_utf_is_
- extern f_return_status f_utf_is(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is_control()
*/
#ifndef _di_f_utf_is_control_
- extern f_return_status f_utf_is_control(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is_control(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_control_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is_control_picture()
*/
#ifndef _di_f_utf_is_control_picture_
- extern f_return_status f_utf_is_control_picture(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is_control_picture(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_control_picture_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is_fragment()
*/
#ifndef _di_f_utf_is_fragment_
- extern f_return_status f_utf_is_fragment(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is_fragment(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_fragment_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is_graph()
*/
#ifndef _di_f_utf_is_graph_
- extern f_return_status f_utf_is_graph(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is_graph(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_graph_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is_valid()
*/
#ifndef _di_f_utf_is_valid_
- extern f_return_status f_utf_is_valid(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is_valid(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_valid_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is_whitespace()
*/
#ifndef _di_f_utf_is_whitespace_
- extern f_return_status f_utf_is_whitespace(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is_whitespace(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_whitespace_
/**
*
* @param character
* The character to validate.
- * There must be enough space allocated to compare against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to compare against, as limited by width_max.
+ * @param width_max
* The maximum width available for checking.
* Can be anything greater than 0.
*
* @see f_utf_character_is_zero_width()
*/
#ifndef _di_f_utf_is_zero_width_
- extern f_return_status f_utf_is_zero_width(const f_string character, const uint8_t max_width);
+ extern f_return_status f_utf_is_zero_width(const f_string character, const uint8_t width_max);
#endif // _di_f_utf_is_zero_width_
/**
*
* @param character
* The character string to be converted to the f_utf_character type.
- * There must be enough space allocated to convert against, as limited by max_width.
- * @param max_width
+ * There must be enough space allocated to convert against, as limited by width_max.
+ * @param width_max
* The maximum width available for converting.
* Can be anything greater than 0.
* @param character_utf
* f_invalid_parameter (with error bit) if a parameter is invalid.
*/
#ifndef _di_f_utf_char_to_character_
- extern f_return_status f_utf_char_to_character(const f_string character, const uint8_t max_width, f_utf_character *character_utf);
+ extern f_return_status f_utf_char_to_character(const f_string character, const uint8_t width_max, f_utf_character *character_utf);
#endif // _di_f_utf_char_to_character_
#ifdef __cplusplus
unsigned short width = 0;
- f_string_length max_width = 0;
+ f_string_length width_max = 0;
while (location->start < buffer.used) {
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
- if (max_width > buffer.used - location->start) {
- max_width = buffer.used - location->start;
+ if (width_max > buffer.used - location->start) {
+ width_max = buffer.used - location->start;
}
width = f_macro_utf_byte_width_is(buffer.string[location->start]);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(buffer.string + location->start, max_width, &character);
+ status = f_utf_char_to_character(buffer.string + location->start, width_max, &character);
if (f_status_is_error(status)) {
return status;
f_status status = f_none;
unsigned short width = 0;
- f_string_length max_width = (location->stop - location->start) + 1;
+ f_string_length width_max = (location->stop - location->start) + 1;
- if (max_width > buffer.used - location->start) {
- max_width = buffer.used - location->start;
+ if (width_max > buffer.used - location->start) {
+ width_max = buffer.used - location->start;
}
- while (buffer.string[location->start] == placeholder || (status = f_utf_is_graph(buffer.string + location->start, max_width)) == f_false) {
+ while (buffer.string[location->start] == placeholder || (status = f_utf_is_graph(buffer.string + location->start, width_max)) == f_false) {
if (f_status_is_error(status)) {
return status;
}
if (location->start >= buffer.used) return f_none_on_eos;
if (location->start > location->stop) return f_none_on_stop;
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
- if (max_width > buffer.used - location->start) {
- max_width = buffer.used - location->start;
+ if (width_max > buffer.used - location->start) {
+ width_max = buffer.used - location->start;
}
} // while
f_status status = f_none;
unsigned short width = 0;
- f_string_length max_width = (location->stop - location->start) + 1;
+ f_string_length width_max = (location->stop - location->start) + 1;
- if (max_width > buffer.used - location->start) {
- max_width = buffer.used - location->start;
+ if (width_max > buffer.used - location->start) {
+ width_max = buffer.used - location->start;
}
- while (buffer.string[location->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + location->start, max_width)) == f_false) {
+ while (buffer.string[location->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + location->start, width_max)) == f_false) {
if (f_status_is_error(status)) {
return status;
}
if (location->start >= buffer.used) return f_none_on_eos;
if (location->start > location->stop) return f_none_on_stop;
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
- if (max_width > buffer.used - location->start) {
- max_width = buffer.used - location->start;
+ if (width_max > buffer.used - location->start) {
+ width_max = buffer.used - location->start;
}
} // while
unsigned short width = 0;
- f_string_length max_width = 0;
+ f_string_length width_max = 0;
while (location->start < buffer.used) {
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
- if (max_width > buffer.used - location->start) {
- max_width = buffer.used - location->start;
+ if (width_max > buffer.used - location->start) {
+ width_max = buffer.used - location->start;
}
width = f_macro_utf_byte_width_is(buffer.string[location->start]);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(buffer.string + location->start, max_width, &character);
+ status = f_utf_char_to_character(buffer.string + location->start, width_max, &character);
if (f_status_is_error(status)) {
return status;
unsigned short width = 0;
- f_string_length max_width = (location->stop - location->start) + 1;
+ f_string_length width_max = (location->stop - location->start) + 1;
for (; location->start <= location->stop; location->start += width) {
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
width = f_macro_utf_byte_width_is(string[location->start]);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(string + location->start, max_width, &character);
+ status = f_utf_char_to_character(string + location->start, width_max, &character);
if (f_status_is_error(status)) {
return status;
f_status status = f_none;
unsigned short width = 0;
- f_string_length max_width = (location->stop - location->start) + 1;
+ f_string_length width_max = (location->stop - location->start) + 1;
- while (string[location->start] == placeholder || (status = f_utf_is_graph(string + location->start, max_width)) == f_false) {
+ while (string[location->start] == placeholder || (status = f_utf_is_graph(string + location->start, width_max)) == f_false) {
if (f_status_is_error(status)) {
return status;
}
if (location->start > location->stop) return f_none_on_stop;
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
} // while
if (f_status_is_error(status)) {
f_status status = f_none;
unsigned short width = 0;
- f_string_length max_width = (location->stop - location->start) + 1;
+ f_string_length width_max = (location->stop - location->start) + 1;
- while (string[location->start] == placeholder || (status = f_utf_is_whitespace(string + location->start, max_width)) == f_false) {
+ while (string[location->start] == placeholder || (status = f_utf_is_whitespace(string + location->start, width_max)) == f_false) {
if (f_status_is_error(status)) {
return status;
}
if (location->start > location->stop) return f_none_on_stop;
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
} // while
if (f_status_is_error(status)) {
unsigned short width = 0;
- f_string_length max_width = 0;
+ f_string_length width_max = 0;
for (; location->start <= location->stop; location->start += width) {
- max_width = (location->stop - location->start) + 1;
+ width_max = (location->stop - location->start) + 1;
width = f_macro_utf_byte_width_is(string[location->start]);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(string + location->start, max_width, &character);
+ status = f_utf_char_to_character(string + location->start, width_max, &character);
if (f_status_is_error(status)) {
return status;