The word 'range' seems more appropriate than 'location'.
#endif // _di_fl_string_dynamic_rip_nulless_
#ifndef _di_fl_string_dynamic_seek_line_to_
- f_return_status fl_string_dynamic_seek_line_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_string_dynamic_seek_line_to(const f_string_dynamic buffer, f_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- while (buffer.string[location->start] != seek_to_this) {
- if (buffer.string[location->start] == f_string_eol) return f_none_on_eol;
+ while (buffer.string[range->start] != seek_to_this) {
+ if (buffer.string[range->start] == f_string_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_string_dynamic_seek_line_to_
#ifndef _di_fl_string_dynamic_seek_line_to_utf_character_
- f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_dynamic buffer, f_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_dynamic buffer, f_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
f_string_length width_max = 0;
- while (location->start < buffer.used) {
- width_max = (location->stop - location->start) + 1;
+ while (range->start < buffer.used) {
+ width_max = (range->stop - range->start) + 1;
- if (width_max > buffer.used - location->start) {
- width_max = buffer.used - location->start;
+ if (width_max > buffer.used - range->start) {
+ width_max = buffer.used - range->start;
}
- width = f_macro_utf_byte_width_is(buffer.string[location->start]);
+ width = f_macro_utf_byte_width_is(buffer.string[range->start]);
if (width == 0) {
width = 1;
- if (buffer.string[location->start] == f_string_eol) return f_none_on_eol;
+ if (buffer.string[range->start] == f_string_eol) return f_none_on_eol;
if (seek_width == width) {
- if (buffer.string[location->start] == seek_to_this) return f_none;
+ if (buffer.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_incomplete_utf);
}
else {
- if (location->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_stop);
+ if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(buffer.string + location->start, width_max, &character);
+ status = f_utf_char_to_character(buffer.string + range->start, width_max, &character);
if (f_status_is_error(status)) return status;
if (character == seek_to_this) return f_none;
}
}
- location->start += width;
+ range->start += width;
- if (location->start >= location->stop) return f_none_on_stop;
+ if (range->start >= range->stop) return f_none_on_stop;
} // while
return f_none_on_eos;
#endif // _di_fl_string_dynamic_seek_line_to_utf_character_
#ifndef _di_fl_string_dynamic_seek_line_until_graph_
- f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder) {
+ f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *range, const int8_t placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
unsigned short width = 0;
- f_string_length width_max = (location->stop - location->start) + 1;
+ f_string_length width_max = (range->stop - range->start) + 1;
- if (width_max > buffer.used - location->start) {
- width_max = buffer.used - location->start;
+ if (width_max > buffer.used - range->start) {
+ width_max = buffer.used - range->start;
}
- while (buffer.string[location->start] == placeholder || (status = f_utf_is_graph(buffer.string + location->start, width_max)) == f_false) {
+ while (buffer.string[range->start] == placeholder || (status = f_utf_is_graph(buffer.string + range->start, width_max)) == f_false) {
if (f_status_is_error(status)) return status;
- if (buffer.string[location->start] == f_string_eol) return f_none_on_eol;
+ if (buffer.string[range->start] == f_string_eol) return f_none_on_eol;
- width = f_macro_utf_byte_width_is(buffer.string[location->start]);
+ width = f_macro_utf_byte_width_is(buffer.string[range->start]);
if (width == 0) {
width = 1;
return f_status_set_error(f_incomplete_utf);
}
else {
- if (location->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_stop);
+ if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop);
}
- location->start += width;
+ range->start += width;
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
- width_max = (location->stop - location->start) + 1;
+ width_max = (range->stop - range->start) + 1;
- if (width_max > buffer.used - location->start) {
- width_max = buffer.used - location->start;
+ if (width_max > buffer.used - range->start) {
+ width_max = buffer.used - range->start;
}
} // while
#endif // _di_fl_string_dynamic_seek_line_until_graph_
#ifndef _di_fl_string_dynamic_seek_line_until_non_graph_
- f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder) {
+ f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *range, const int8_t placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
unsigned short width = 0;
- f_string_length width_max = (location->stop - location->start) + 1;
+ f_string_length width_max = (range->stop - range->start) + 1;
- if (width_max > buffer.used - location->start) {
- width_max = buffer.used - location->start;
+ if (width_max > buffer.used - range->start) {
+ width_max = buffer.used - range->start;
}
- while (buffer.string[location->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + location->start, width_max)) == f_false) {
+ while (buffer.string[range->start] == placeholder || (status = f_utf_is_whitespace(buffer.string + range->start, width_max)) == f_false) {
if (f_status_is_error(status)) return status;
- if (buffer.string[location->start] == f_string_eol) return f_none_on_eol;
+ if (buffer.string[range->start] == f_string_eol) return f_none_on_eol;
- width = f_macro_utf_byte_width_is(buffer.string[location->start]);
+ width = f_macro_utf_byte_width_is(buffer.string[range->start]);
if (width == 0) {
width = 1;
return f_status_set_error(f_incomplete_utf);
}
else {
- if (location->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_stop);
+ if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop);
}
- location->start += width;
+ range->start += width;
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
- width_max = (location->stop - location->start) + 1;
+ width_max = (range->stop - range->start) + 1;
- if (width_max > buffer.used - location->start) {
- width_max = buffer.used - location->start;
+ if (width_max > buffer.used - range->start) {
+ width_max = buffer.used - range->start;
}
} // while
#endif // _di_fl_string_dynamic_seek_line_until_non_graph_
#ifndef _di_fl_string_dynamic_seek_to_
- f_return_status fl_string_dynamic_seek_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_string_dynamic_seek_to(const f_string_dynamic buffer, f_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- while (buffer.string[location->start] != seek_to_this) {
- location->start++;
+ while (buffer.string[range->start] != seek_to_this) {
+ range->start++;
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_string_dynamic_seek_to_
#ifndef _di_fl_string_dynamic_seek_to_utf_character_
- f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_dynamic buffer, f_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_dynamic buffer, f_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
f_string_length width_max = 0;
- while (location->start < buffer.used) {
- width_max = (location->stop - location->start) + 1;
+ while (range->start < buffer.used) {
+ width_max = (range->stop - range->start) + 1;
- if (width_max > buffer.used - location->start) {
- width_max = buffer.used - location->start;
+ if (width_max > buffer.used - range->start) {
+ width_max = buffer.used - range->start;
}
- width = f_macro_utf_byte_width_is(buffer.string[location->start]);
+ width = f_macro_utf_byte_width_is(buffer.string[range->start]);
if (width == 0) {
width = 1;
if (seek_width == width) {
- if (buffer.string[location->start] == seek_to_this) return f_none;
+ if (buffer.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_incomplete_utf);
}
else {
- if (location->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_stop);
+ if (range->start + width >= buffer.used) return f_status_set_error(f_incomplete_utf_on_eos);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(buffer.string + location->start, width_max, &character);
+ status = f_utf_char_to_character(buffer.string + range->start, width_max, &character);
if (f_status_is_error(status)) return status;
if (character == seek_to_this) return f_none;
}
}
- location->start += width;
+ range->start += width;
- if (location->start >= location->stop) return f_none_on_stop;
+ if (range->start >= range->stop) return f_none_on_stop;
} // while
return f_none_on_eos;
#endif // _di_fl_string_rip_nulless_
#ifndef _di_fl_string_seek_line_to_
- f_return_status fl_string_seek_line_to(const f_string string, f_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_string_seek_line_to(const f_string string, f_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- while (string[location->start] != seek_to_this) {
- if (string[location->start] == f_string_eol) return f_none_on_eol;
+ while (string[range->start] != seek_to_this) {
+ if (string[range->start] == f_string_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_string_seek_line_to_
#ifndef _di_fl_string_seek_line_to_utf_character_
- f_return_status fl_string_seek_line_to_utf_character(const f_string string, f_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_string_seek_line_to_utf_character(const f_string string, f_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
unsigned short width = 0;
- f_string_length width_max = (location->stop - location->start) + 1;
+ f_string_length width_max = (range->stop - range->start) + 1;
- for (; location->start <= location->stop; location->start += width) {
- width_max = (location->stop - location->start) + 1;
+ for (; range->start <= range->stop; range->start += width) {
+ width_max = (range->stop - range->start) + 1;
- width = f_macro_utf_byte_width_is(string[location->start]);
+ width = f_macro_utf_byte_width_is(string[range->start]);
if (width == 0) {
width = 1;
- if (string[location->start] == f_string_eol) return f_none_on_eol;
+ if (string[range->start] == f_string_eol) return f_none_on_eol;
if (seek_width == width) {
- if (string[location->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_incomplete_utf);
}
else {
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_eos);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_eos);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(string + location->start, width_max, &character);
+ 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;
#endif // _di_fl_string_seek_line_to_utf_character_
#ifndef _di_fl_string_seek_line_until_graph_
- f_return_status fl_string_seek_line_until_graph(const f_string string, f_string_location *location, const int8_t placeholder) {
+ f_return_status fl_string_seek_line_until_graph(const f_string string, f_string_location *range, const int8_t placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
unsigned short width = 0;
- f_string_length width_max = (location->stop - location->start) + 1;
+ f_string_length width_max = (range->stop - range->start) + 1;
- while (string[location->start] == placeholder || (status = f_utf_is_graph(string + location->start, width_max)) == f_false) {
+ 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[location->start] == f_string_eol) return f_none_on_eol;
+ if (string[range->start] == f_string_eol) return f_none_on_eol;
- width = f_macro_utf_byte_width_is(string[location->start]);
+ width = f_macro_utf_byte_width_is(string[range->start]);
if (width == 0) {
width = 1;
return f_status_set_error(f_incomplete_utf);
}
else {
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_stop);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop);
}
- location->start += width;
+ range->start += width;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- width_max = (location->stop - location->start) + 1;
+ width_max = (range->stop - range->start) + 1;
} // while
if (f_status_is_error(status)) return status;
#endif // _di_fl_string_seek_line_until_graph_
#ifndef _di_fl_string_seek_line_until_non_graph_
- f_return_status fl_string_seek_line_until_non_graph(const f_string string, f_string_location *location, const int8_t placeholder) {
+ f_return_status fl_string_seek_line_until_non_graph(const f_string string, f_string_location *range, const int8_t placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
unsigned short width = 0;
- f_string_length width_max = (location->stop - location->start) + 1;
+ f_string_length width_max = (range->stop - range->start) + 1;
- while (string[location->start] == placeholder || (status = f_utf_is_whitespace(string + location->start, width_max)) == f_false) {
+ 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[location->start] == f_string_eol) return f_none_on_eol;
+ if (string[range->start] == f_string_eol) return f_none_on_eol;
- width = f_macro_utf_byte_width_is(string[location->start]);
+ width = f_macro_utf_byte_width_is(string[range->start]);
if (width == 0) {
width = 1;
return f_status_set_error(f_incomplete_utf);
}
else {
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_stop);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop);
}
- location->start += width;
+ range->start += width;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- width_max = (location->stop - location->start) + 1;
+ width_max = (range->stop - range->start) + 1;
} // while
if (f_status_is_error(status)) return status;
#endif // _di_fl_string_seek_line_until_non_graph_
#ifndef _di_fl_string_seek_to_
- f_return_status fl_string_seek_to(const f_string string, f_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_string_seek_to(const f_string string, f_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- while (string[location->start] != seek_to_this) {
- location->start++;
+ while (string[range->start] != seek_to_this) {
+ range->start++;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_string_seek_to_
#ifndef _di_fl_string_seek_to_utf_character_
- f_return_status fl_string_seek_to_utf_character(const f_string string, f_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_string_seek_to_utf_character(const f_string string, f_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
const unsigned short seek_width = f_macro_utf_character_width(seek_to_this);
f_string_length width_max = 0;
- for (; location->start <= location->stop; location->start += width) {
- width_max = (location->stop - location->start) + 1;
+ for (; range->start <= range->stop; range->start += width) {
+ width_max = (range->stop - range->start) + 1;
- width = f_macro_utf_byte_width_is(string[location->start]);
+ width = f_macro_utf_byte_width_is(string[range->start]);
if (width == 0) {
width = 1;
if (seek_width == width) {
- if (string[location->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_incomplete_utf);
}
else {
- if (location->start + width > location->stop) return f_status_set_error(f_incomplete_utf_on_stop);
+ if (range->start + width > range->stop) return f_status_set_error(f_incomplete_utf_on_stop);
if (width == seek_width) {
f_utf_character character = 0;
- status = f_utf_char_to_character(string + location->start, width_max, &character);
+ 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;
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_line_to_utf_character()
*/
#ifndef _di_fl_string_dynamic_seek_line_to_
- extern f_return_status fl_string_dynamic_seek_line_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_string_dynamic_seek_line_to(const f_string_dynamic buffer, f_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_string_dynamic_seek_line_to_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_line_to()
*/
#ifndef _di_fl_string_dynamic_seek_line_to_utf_character_
- extern f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_dynamic buffer, f_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_string_dynamic_seek_line_to_utf_character(const f_string_dynamic buffer, f_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_string_dynamic_seek_line_to_utf_character_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* @param placeholder
* A single-width character representing a placeholder to ignore (may be NULL).
* @see fl_string_seek_line_until_graph()
*/
#ifndef _di_fl_string_dynamic_seek_line_until_graph_
- extern f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder);
+ extern f_return_status fl_string_dynamic_seek_line_until_graph(const f_string_dynamic buffer, f_string_location *range, const int8_t placeholder);
#endif // _di_fl_string_dynamic_seek_line_until_graph_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* @param placeholder
* A single-width character representing a placeholder to ignore (may be NULL).
* @see fl_string_seek_line_until_non_graph()
*/
#ifndef _di_fl_string_dynamic_seek_line_until_non_graph_
- extern f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *location, const int8_t placeholder);
+ extern f_return_status fl_string_dynamic_seek_line_until_non_graph(const f_string_dynamic buffer, f_string_location *range, const int8_t placeholder);
#endif // _di_fl_string_dynamic_seek_line_until_non_graph_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_to_utf_character()
*/
#ifndef _di_fl_string_dynamic_seek_to_
- extern f_return_status fl_string_dynamic_seek_to(const f_string_dynamic buffer, f_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_string_dynamic_seek_to(const f_string_dynamic buffer, f_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_string_dynamic_seek_to_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_to_character()
*/
#ifndef _di_fl_string_dynamic_seek_to_utf_character_
- extern f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_dynamic buffer, f_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_string_dynamic_seek_to_utf_character(const f_string_dynamic buffer, f_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_string_dynamic_seek_to_utf_character_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_line_to_utf_character()
*/
#ifndef _di_fl_string_seek_line_to_
- extern f_return_status fl_string_seek_line_to(const f_string string, f_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_string_seek_line_to(const f_string string, f_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_string_seek_line_to_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_line_to()
*/
#ifndef _di_fl_string_seek_line_to_utf_character_
- extern f_return_status fl_string_seek_line_to_utf_character(const f_string string, f_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_string_seek_line_to_utf_character(const f_string string, f_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_string_seek_line_to_utf_character_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param placeholder
* @see fl_string_dynamic_seek_line_until_graph()
*/
#ifndef _di_fl_string_seek_line_until_graph_
- extern f_return_status fl_string_seek_line_until_graph(const f_string string, f_string_location *location, const int8_t placeholder);
+ extern f_return_status fl_string_seek_line_until_graph(const f_string string, f_string_location *range, const int8_t placeholder);
#endif // _di_fl_string_seek_line_until_graph_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param placeholder
* @see fl_string_dynamic_seek_line_until_non_graph()
*/
#ifndef _di_fl_string_seek_line_until_non_graph_
- extern f_return_status fl_string_seek_line_until_non_graph(const f_string string, f_string_location *location, const int8_t placeholder);
+ extern f_return_status fl_string_seek_line_until_non_graph(const f_string string, f_string_location *range, const int8_t placeholder);
#endif // _di_fl_string_seek_line_until_non_graph_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_to_utf_character()
*/
#ifndef _di_fl_string_seek_to_
- extern f_return_status fl_string_seek_to(const f_string string, f_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_string_seek_to(const f_string string, f_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_string_seek_to_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_string_seek_to()
*/
#ifndef _di_fl_string_seek_to_utf_character_
- extern f_return_status fl_string_seek_to_utf_character(const f_string string, f_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_string_seek_to_utf_character(const f_string string, f_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_string_seek_to_utf_character_
#ifdef __cplusplus
#endif // _di_fl_utf_string_dynamic_rip_nulless_
#ifndef _di_fl_utf_string_dynamic_seek_line_to_
- f_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (buffer.string[location->start] != seek_to_this) {
- if (buffer.string[location->start] == f_utf_character_eol) return f_none_on_eol;
+ while (buffer.string[range->start] != seek_to_this) {
+ if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_utf_string_dynamic_seek_line_to_
#ifndef _di_fl_utf_string_dynamic_seek_line_to_char_
- f_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_utf_character seek_to_character = seek_to_this << 24;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (buffer.string[location->start] != seek_to_character) {
- if (buffer.string[location->start] == f_utf_character_eol) return f_none_on_eol;
+ while (buffer.string[range->start] != seek_to_character) {
+ if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_utf_string_dynamic_seek_line_to_character_
#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_
- f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character placeholder) {
+ f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (buffer.string[location->start] == placeholder || (status = f_utf_character_is_graph(buffer.string[location->start])) == f_false) {
+ 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[location->start] == f_utf_character_eol) return f_none_on_eol;
+ if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
if (f_status_is_error(status)) {
#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_
#ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_
- f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character placeholder) {
+ f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (buffer.string[location->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[location->start])) == f_false) {
+ while (buffer.string[range->start] == placeholder || (status = f_utf_character_is_whitespace(buffer.string[range->start])) == f_false) {
if (f_status_is_error(status)) {
return status;
}
- if (buffer.string[location->start] == f_utf_character_eol) return f_none_on_eol;
+ if (buffer.string[range->start] == f_utf_character_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
if (f_status_is_error(status)) {
#endif // _di_fl_utf_string_dynamic_seek_line_until_non_graph_
#ifndef _di_fl_utf_string_dynamic_seek_to_
- f_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (buffer.string[location->start] != seek_to_this) {
- location->start++;
+ while (buffer.string[range->start] != seek_to_this) {
+ range->start++;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_utf_string_dynamic_seek_to_
#ifndef _di_fl_utf_string_dynamic_seek_to_char_
- f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->start) return f_status_set_error(f_invalid_parameter);
- if (buffer.used <= location->stop) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->start) return f_status_set_error(f_invalid_parameter);
+ if (buffer.used <= range->stop) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
if (buffer.used == 0) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_utf_character seek_to_character = seek_to_this << 24;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (buffer.string[location->start] != seek_to_character) {
- location->start++;
+ while (buffer.string[range->start] != seek_to_character) {
+ range->start++;
- if (f_macro_utf_character_width_is(buffer.string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(buffer.string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start >= buffer.used) return f_none_on_eos;
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start >= buffer.used) return f_none_on_eos;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_utf_string_rip_nulless_
#ifndef _di_fl_utf_string_seek_line_to_
- f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (string[location->start] != seek_to_this) {
- if (string[location->start] == f_utf_character_eol) return f_none_on_eol;
+ while (string[range->start] != seek_to_this) {
+ if (string[range->start] == f_utf_character_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_utf_string_seek_line_to_
#ifndef _di_fl_utf_string_seek_line_to_char_
- f_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_utf_character seek_to_character = seek_to_this << 24;
f_status status = f_none;
- for (; location->start <= location->stop; location->start++) {
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ for (; range->start <= range->stop; range->start++) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (string[location->start] == f_utf_character_eol) return f_none_on_eol;
- if (string[location->start] == seek_to_character) return f_none;
+ if (string[range->start] == f_utf_character_eol) return f_none_on_eol;
+ if (string[range->start] == seek_to_character) return f_none;
} // for
return f_none_on_stop;
#endif // _di_fl_utf_string_seek_line_to_char_
#ifndef _di_fl_utf_string_seek_line_until_graph_
- f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_location *location, const f_utf_character placeholder) {
+ f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_location *range, const f_utf_character placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (string[location->start] == placeholder || (status = f_utf_character_is_graph(string[location->start])) == f_false) {
+ 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[location->start] == f_utf_character_eol) return f_none_on_eol;
+ if (string[range->start] == f_utf_character_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
if (f_status_is_error(status)) {
#endif // _di_fl_utf_string_seek_line_until_graph_
#ifndef _di_fl_utf_string_seek_line_until_non_graph_
- f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_location *location, const f_utf_character placeholder) {
+ f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_location *range, const f_utf_character placeholder) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_status status = f_none;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (string[location->start] == placeholder || (status = f_utf_character_is_whitespace(string[location->start])) == f_false) {
+ while (string[range->start] == placeholder || (status = f_utf_character_is_whitespace(string[range->start])) == f_false) {
if (f_status_is_error(status)) {
return status;
}
- if (string[location->start] == f_utf_character_eol) return f_none_on_eol;
+ if (string[range->start] == f_utf_character_eol) return f_none_on_eol;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
if (f_status_is_error(status)) {
#endif // _di_fl_utf_string_seek_line_until_non_graph_
#ifndef _di_fl_utf_string_seek_to_
- f_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_location *location, const f_utf_character seek_to_this) {
+ f_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_location *range, const f_utf_character seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- while (string[location->start] != seek_to_this) {
- location->start++;
+ while (string[range->start] != seek_to_this) {
+ range->start++;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
} // while
return f_none;
#endif // _di_fl_utf_string_seek_to_
#ifndef _di_fl_utf_string_seek_to_char_
- f_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_location *location, const int8_t seek_to_this) {
+ f_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_location *range, const int8_t seek_to_this) {
#ifndef _di_level_1_parameter_checking_
- if (location == 0) return f_status_set_error(f_invalid_parameter);
+ if (range == 0) return f_status_set_error(f_invalid_parameter);
#endif // _di_level_1_parameter_checking_
- if (location->start > location->stop) return f_none_on_stop;
+ if (range->start > range->stop) return f_none_on_stop;
f_utf_character seek_to_character = seek_to_this << 24;
return f_status_set_error(f_invalid_utf);
}
- while (location->start <= location->stop) {
- if (string[location->start] == seek_to_character) return f_none;
+ while (range->start <= range->stop) {
+ if (string[range->start] == seek_to_character) return f_none;
- location->start++;
+ range->start++;
- if (f_macro_utf_character_width_is(string[location->start]) == 1) {
+ if (f_macro_utf_character_width_is(string[range->start]) == 1) {
return f_status_set_error(f_invalid_utf);
}
} // while
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_line_to_char()
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_to_
- extern f_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_utf_string_dynamic_seek_line_to(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_line_to_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_line_to()
*/
#ifndef _di_fl_utf_string_seek_line_to_char_
- extern f_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_utf_string_dynamic_seek_line_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_utf_string_seek_line_to_char_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* @param placeholder
* A UTF-8 character representing a placeholder to ignore (may be NULL).
* @see fl_utf_string_seek_line_until_graph()
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_until_graph_
- extern f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character placeholder);
+ extern f_return_status fl_utf_string_dynamic_seek_line_until_graph(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character placeholder);
#endif // _di_fl_utf_string_dynamic_seek_line_until_graph_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* @param placeholder
* A single-width character representing a placeholder to ignore (may be NULL).
* @see fl_utf_string_seek_line_until_non_graph()
*/
#ifndef _di_fl_utf_string_dynamic_seek_line_until_non_graph_
- extern f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character placeholder);
+ extern f_return_status fl_utf_string_dynamic_seek_line_until_non_graph(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character placeholder);
#endif // _di_fl_utf_string_dynamic_seek_line_until_non_graph_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_to_char()
*/
#ifndef _di_fl_utf_string_dynamic_seek_to_
- extern f_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_utf_string_dynamic_seek_to(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_to_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_to_char()
*/
#ifndef _di_fl_utf_string_dynamic_seek_to_char_
- extern f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_utf_string_dynamic_seek_to_char(const f_utf_string_dynamic buffer, f_utf_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_to_char_
/**
*
* @param buffer
* The buffer to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_to_character()
*/
#ifndef _di_fl_utf_string_dynamic_seek_to_utf_character_
- extern f_return_status fl_utf_string_dynamic_seek_to_utf_character(const f_utf_string_dynamic buffer, f_utf_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_utf_string_dynamic_seek_to_utf_character(const f_utf_string_dynamic buffer, f_utf_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_utf_string_dynamic_seek_to_utf_character_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_line_to_char()
*/
#ifndef _di_fl_utf_string_seek_line_to_
- extern f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_utf_string_seek_line_to(const f_utf_string string, f_utf_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_utf_string_seek_line_to_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_line_to()
*/
#ifndef _di_fl_utf_string_seek_line_to_char_
- extern f_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_utf_string_seek_line_to_char(const f_utf_string string, f_utf_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_utf_string_seek_line_to_char_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param placeholder
* @see fl_utf_string_dynamic_seek_line_until_graph()
*/
#ifndef _di_fl_utf_string_seek_line_until_graph_
- extern f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_location *location, const f_utf_character placeholder);
+ extern f_return_status fl_utf_string_seek_line_until_graph(const f_utf_string string, f_utf_string_location *range, const f_utf_character placeholder);
#endif // _di_fl_utf_string_seek_line_until_graph_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param placeholder
* @see fl_utf_string_dynamic_seek_line_until_non_graph()
*/
#ifndef _di_fl_utf_string_seek_line_until_non_graph_
- extern f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_location *location, const f_utf_character placeholder);
+ extern f_return_status fl_utf_string_seek_line_until_non_graph(const f_utf_string string, f_utf_string_location *range, const f_utf_character placeholder);
#endif // _di_fl_utf_string_seek_line_until_non_graph_
/**
*
* @param string
* The sting to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_to_char()
*/
#ifndef _di_fl_utf_string_seek_to_
- extern f_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_location *location, const f_utf_character seek_to_this);
+ extern f_return_status fl_utf_string_seek_to(const f_utf_string string, f_utf_string_location *range, const f_utf_character seek_to_this);
#endif // _di_fl_utf_string_seek_to_
/**
*
* @param string
* The string to traverse.
- * @param location
+ * @param range
* A range within the buffer representing the start and stop locations.
* The start location will be incremented by seek.
* @param seek_to_this
* @see fl_utf_string_seek_to()
*/
#ifndef _di_fl_utf_string_seek_to_character_
- extern f_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_location *location, const int8_t seek_to_this);
+ extern f_return_status fl_utf_string_seek_to_char(const f_utf_string string, f_utf_string_location *range, const int8_t seek_to_this);
#endif // _di_fl_utf_string__seek_to_character_
#ifdef __cplusplus