From: Kevin Day Date: Tue, 9 Jun 2020 03:23:06 +0000 (-0500) Subject: Update: Move common fl_fss functions to f_fss where possible, also add private-fss... X-Git-Tag: 0.5.0~171 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=02298ed7d5a54d327253ec11c151950dbfe526fb;p=fll Update: Move common fl_fss functions to f_fss where possible, also add private-fss.{c,h}. Some of the fl_fss functions can be moved to f_fss, now that f_utf is considered an exception-case core library. Some of the fl_fss functions are being used within itself. Use private functions to do this. --- diff --git a/build/level_0/settings b/build/level_0/settings index df39f43..610a2e7 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -20,7 +20,7 @@ build_language c build_linker ar build_libraries -lc build_libraries-level -build_sources_library console.c conversion.c directory.c private-directory.c environment.c private-environment.c file.c private-file.c memory.c path.c pipe.c print.c serialize.c private-serialize.c socket.c utf.c private-utf.c +build_sources_library console.c conversion.c directory.c private-directory.c environment.c private-environment.c file.c private-file.c fss.c memory.c path.c pipe.c print.c serialize.c private-serialize.c socket.c utf.c private-utf.c build_sources_program build_sources_headers color.h console.h conversion.h directory.h directory_type.h environment.h file.h fss.h memory.h path.h pipe.h print.h serialize.h socket.h status.h status_array.h string.h type.h type_array.h utf.h build_sources_script diff --git a/build/level_1/settings b/build/level_1/settings index 097479e..99caa30 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -20,7 +20,7 @@ build_language c build_linker ar build_libraries -lc build_libraries-level -lfll_0 -build_sources_library color.c console.c directory.c private-directory.c fss.c fss_basic.c fss_basic_list.c fss_extended.c fss_extended_list.c print.c status.c string.c private-string.c utf.c private-utf.c utf_file.c private-utf_file.c +build_sources_library color.c console.c directory.c private-directory.c fss.c private-fss.c fss_basic.c fss_basic_list.c fss_extended.c fss_extended_list.c print.c status.c string.c private-string.c utf.c private-utf.c utf_file.c private-utf_file.c build_sources_program build_sources_headers color.h console.h directory.h fss.h fss_basic.h fss_basic_list.h fss_extended.h fss_extended_list.h fss_macro.h fss_status.h print.h status.h string.h utf.h utf_file.h build_sources_script diff --git a/build/monolithic/settings b/build/monolithic/settings index 9875047..7fa7426 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -20,7 +20,7 @@ build_language c build_linker ar build_libraries -lc build_libraries-monolithic -build_sources_library level_0/console.c level_0/conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/file.c level_0/private-file.c level_0/memory.c level_0/path.c level_0/pipe.c level_0/print.c level_0/serialize.c level_0/private-serialize.c level_0/socket.c level_0/utf.c level_0/private-utf.c level_1/color.c level_1/console.c level_1/directory.c level_1/private-directory.c level_1/fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/print.c level_1/status.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/directory.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_status.c level_2/program.c level_2/status.c +build_sources_library level_0/console.c level_0/conversion.c level_0/directory.c level_0/private-directory.c level_0/environment.c level_0/private-environment.c level_0/file.c level_0/private-file.c level_0/fss.c level_0/memory.c level_0/path.c level_0/pipe.c level_0/print.c level_0/serialize.c level_0/private-serialize.c level_0/socket.c level_0/utf.c level_0/private-utf.c level_1/color.c level_1/console.c level_1/directory.c level_1/private-directory.c level_1/fss.c level_1/private-fss.c level_1/fss_basic.c level_1/fss_basic_list.c level_1/fss_extended.c level_1/fss_extended_list.c level_1/print.c level_1/status.c level_1/string.c level_1/private-string.c level_1/utf.c level_1/private-utf.c level_1/utf_file.c level_1/private-utf_file.c level_2/directory.c level_2/execute.c level_2/private-execute.c level_2/file.c level_2/fss.c level_2/fss_basic.c level_2/fss_basic_list.c level_2/fss_extended.c level_2/fss_extended_list.c level_2/fss_status.c level_2/program.c level_2/status.c build_sources_program build_sources_headers level_0/color.h level_0/console.h level_0/conversion.h level_0/directory.h level_0/directory_type.h level_0/environment.h level_0/file.h level_0/fss.h level_0/memory.h level_0/path.h level_0/pipe.h level_0/print.h level_0/serialize.h level_0/socket.h level_0/status.h level_0/status_array.h level_0/string.h level_0/type.h level_0/type_array.h level_0/utf.h level_1/color.h level_1/console.h level_1/directory.h level_1/fss.h level_1/fss_basic.h level_1/fss_basic_list.h level_1/fss_extended.h level_1/fss_extended_list.h level_1/fss_macro.h level_1/fss_status.h level_1/print.h level_1/status.h level_1/string.h level_1/utf.h level_1/utf_file.h level_2/directory.h level_2/execute.h level_2/file.h level_2/fss.h level_2/fss_basic.h level_2/fss_basic_list.h level_2/fss_extended.h level_2/fss_extended_list.h level_2/fss_status.h level_2/program.h level_2/status.h build_sources_script diff --git a/level_0/f_fss/c/fss.c b/level_0/f_fss/c/fss.c new file mode 100644 index 0000000..27acd7e --- /dev/null +++ b/level_0/f_fss/c/fss.c @@ -0,0 +1,393 @@ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_f_fss_decrement_buffer_ + f_return_status f_fss_decrement_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) { + #ifndef _di_level_0_parameter_checking_ + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (location->start >= buffer.used) return F_status_set_error(F_parameter); + if (step < 1) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + if (location->start < 1) return F_none_eos; + + f_string_length i = 0; + unsigned short width = 0; + + do { + width = f_macro_utf_byte_width(buffer.string[location->start - 1]); + + if (width > location->start) { + if (width > 1) { + return F_status_set_error(F_incomplete_utf_eos); + } + + return F_none_eos; + } + + i++; + location->start -= width; + } while (i < step); + + return F_none; + } +#endif // _di_f_fss_decrement_buffer_ + +#ifndef _di_f_fss_increment_buffer_ + f_return_status f_fss_increment_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) { + #ifndef _di_level_0_parameter_checking_ + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (location->start < 0) return F_status_set_error(F_parameter); + if (location->stop < location->start) return F_status_set_error(F_parameter); + if (location->start >= buffer.used) return F_status_set_error(F_parameter); + if (step < 1) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_string_length i = 0; + unsigned short width = 0; + + do { + width = f_macro_utf_byte_width(buffer.string[location->start]); + + if (location->start + width > location->stop) { + if (width > 1) { + return F_status_set_error(F_incomplete_utf_stop); + } + + location->start += width; + return F_none_stop; + } + else if (location->start + width >= buffer.used) { + if (width > 1) { + return F_status_set_error(F_incomplete_utf_eos); + } + + location->start += width; + return F_none_eos; + } + + i++; + location->start += width; + } while (i < step); + + return F_none; + } +#endif // _di_f_fss_increment_buffer_ + +#ifndef _di_f_fss_is_graph_ + f_return_status f_fss_is_graph(const f_string_static buffer, const f_string_range range) { + #ifndef _di_level_0_parameter_checking_ + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_string_length width_max = (range.stop - range.start) + 1; + + if (width_max > buffer.used - range.start) { + width_max = buffer.used - range.start; + } + + return f_utf_is_graph(buffer.string + range.start, width_max); + } +#endif // _di_f_fss_is_graph_ + +#ifndef _di_f_fss_is_space_ + f_return_status f_fss_is_space(const f_string_static buffer, const f_string_range range) { + #ifndef _di_level_0_parameter_checking_ + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer.used) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_string_length width_max = (range.stop - range.start) + 1; + + if (width_max > buffer.used - range.start) { + width_max = buffer.used - range.start; + } + + return f_utf_is_whitespace(buffer.string + range.start, width_max); + } +#endif // _di_f_fss_is_space_ + +#ifndef _di_f_fss_shift_delimiters_ + f_return_status f_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range) { + #ifndef _di_level_0_parameter_checking_ + if (buffer->used <= 0) return F_status_set_error(F_parameter); + if (range.start < 0) return F_status_set_error(F_parameter); + if (range.stop < range.start) return F_status_set_error(F_parameter); + if (range.start >= buffer->used) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_string_length position = 0; + f_string_length distance = 0; + unsigned short utf_width = 0; + unsigned short i = 0; + + position = range.start; + + while (position < buffer->used && position <= range.stop) { + if (buffer->string[position] == f_fss_delimit_placeholder) { + distance++; + } + + // do not waste time trying to process what is only going to be replaced with a delimit placeholder + if (position + distance >= buffer->used || position + distance > range.stop) { + break; + } + + utf_width = f_macro_utf_byte_width_is(buffer->string[position]); + if (utf_width > 1) { + // not enough space in buffer or in range range to process UTF-8 character. + if (position + utf_width >= buffer->used || position + utf_width > range.stop) { + return F_status_set_error(F_utf); + } + + if (distance > 0) { + while (utf_width > 0) { + buffer->string[position] = buffer->string[position + distance]; + utf_width--; + position++; + } + } + } + else { + // shift everything down one for each placeholder found + if (distance > 0) { + buffer->string[position] = buffer->string[position + distance]; + } + + position++; + } + } + + if (distance > 0) { + while (position < buffer->used + distance && position <= range.stop) { + buffer->string[position] = f_fss_delimit_placeholder; + position++; + } + } + + return F_none; + } +#endif // _di_f_fss_shift_delimiters_ + +#ifndef _di_f_fss_skip_past_space_ + f_return_status f_fss_skip_past_space(const f_string_static buffer, f_string_range *range) { + #ifndef _di_level_0_parameter_checking_ + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (range->start < 0) return F_status_set_error(F_parameter); + if (range->stop < range->start) return F_status_set_error(F_parameter); + if (range->start >= buffer.used) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_status status = F_none; + unsigned short width = 0; + + f_string_length width_max = (range->stop - range->start) + 1; + + if (width_max > buffer.used - range->start) { + width_max = buffer.used - range->start; + } + + for (;;) { + if (buffer.string[range->start] != f_fss_delimit_placeholder) { + status = f_utf_is_whitespace(buffer.string + range->start, width_max); + + if (status == F_false) { + status = f_utf_is_control(buffer.string + range->start, width_max); + + if (status == F_false) { + status = f_utf_is_zero_width(buffer.string + range->start, width_max); + + if (status == F_true) { + f_string_length next_width_max = 0; + + for (f_string_length next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { + next_width_max = (range->stop - next) + 1; + + status = f_utf_is_whitespace(buffer.string + next, width_max); + if (status == F_true) { + // treat zero-width before a space like a space. + break; + } + else if (status == F_false) { + status = f_utf_is_control(buffer.string + next, width_max); + + if (status == F_true) { + // treat zero-width before a control character like a space. + break; + } + else if (status == F_false) { + status = f_utf_is_zero_width(buffer.string + next, width_max); + + if (status == F_true) { + // seek until a non-zero-width is reached. + continue; + } + else if (status == F_false) { + // treat zero-width as a non-whitespace non-control character when preceding a non-whitespace non-control character. + return F_none; + } + } + else if (F_status_is_error(status)) return status; + } + else if (F_status_is_error(status)) return status; + } // for + } + else if (status == F_false) { + // treat zero-width as a graph when preceding a non-whitespace non-control (that is not a zero-width). + return F_none; + } + else if (F_status_is_error(status)) return status; + } + else if (F_status_is_error(status)) return status; + } + else if (F_status_is_error(status)) return status; + } + + if (buffer.string[range->start] == f_string_eol[0]) return F_none_eol; + + width = f_macro_utf_byte_width_is(buffer.string[range->start]); + + if (width == 0) { + width = 1; + } + // Do not operate on UTF-8 fragments that are not the first byte of the character. + else if (width == 1) { + return F_status_set_error(F_incomplete_utf); + } + else { + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); + } + + range->start += width; + + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; + + width_max = (range->stop - range->start) + 1; + + if (width_max > buffer.used - range->start) { + width_max = buffer.used - range->start; + } + } // for + + if (F_status_is_error(status)) return status; + + return F_none; + } +#endif // _di_f_fss_skip_past_space_ + +#ifndef _di_f_fss_skip_past_non_graph_ + f_return_status f_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range) { + #ifndef _di_level_0_parameter_checking_ + if (buffer.used <= 0) return F_status_set_error(F_parameter); + if (range == 0) return F_status_set_error(F_parameter); + if (range->start < 0) return F_status_set_error(F_parameter); + if (range->stop < range->start) return F_status_set_error(F_parameter); + if (range->start >= buffer.used) return F_status_set_error(F_parameter); + #endif // _di_level_0_parameter_checking_ + + f_status status = F_none; + unsigned short width = 0; + + f_string_length width_max = (range->stop - range->start) + 1; + + if (width_max > buffer.used - range->start) { + width_max = buffer.used - range->start; + } + + for (;;) { + if (buffer.string[range->start] != f_fss_delimit_placeholder) { + status = f_utf_is_graph(buffer.string + range->start, width_max); + + if (status == F_true) { + // stop at a graph. + break; + } + else if (status == F_false) { + status = f_utf_is_zero_width(buffer.string + range->start, width_max); + + if (status == F_true) { + f_string_length next_width_max = 0; + + for (f_string_length next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { + next_width_max = (range->stop - next) + 1; + + status = f_utf_is_graph(buffer.string + next, width_max); + if (status == F_true) { + // treat zero-width as a graph when preceding a graph. + return F_none; + } + else if (status == F_false) { + status = f_utf_is_zero_width(buffer.string + next, width_max); + + if (status == F_true) { + // seek until a non-zero-width is reached. + continue; + } + else if (status == F_false) { + // treat zero-width as a non-graph when preceding a non-graph (that is not a zero-width). + break; + } + else if (F_status_is_error(status)) return status; + } + else if (F_status_is_error(status)) return status; + } // for + } + else if (status == F_false) { + // continue on when non-graph and non-zero-width. + break; + } + else if (F_status_is_error(status)) return status; + } + else if (F_status_is_error(status)) return status; + } + + if (F_status_is_error(status)) return status; + + width = f_macro_utf_byte_width_is(buffer.string[range->start]); + + if (width == 0) { + width = 1; + } + // Do not operate on UTF-8 fragments that are not the first byte of the character. + else if (width == 1) { + return F_status_set_error(F_incomplete_utf); + } + else { + if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); + if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); + } + + range->start += width; + + if (range->start >= buffer.used) return F_none_eos; + if (range->start > range->stop) return F_none_stop; + + width_max = (range->stop - range->start) + 1; + + if (width_max > buffer.used - range->start) { + width_max = buffer.used - range->start; + } + } // for + + if (F_status_is_error(status)) return status; + + return F_none; + } +#endif // _di_f_fss_skip_past_non_graph_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 03cebe2..46ea974 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -14,10 +14,11 @@ #define _F_fss_h // fll-0 includes +#include #include #include #include -#include +#include #ifdef __cplusplus extern "C" { @@ -957,6 +958,196 @@ extern "C" { } #endif // _di_fss_nests_ +/** + * Continue to the previous character, based on step and character width. + * + * The start position must be at the start of a valid UTF-8 block. + * + * @param buffer + * The string to process. + * @param range + * The start and stop positions to be incremented. + * The start position will be incremented by step. + * @param step + * The number of steps to decrement the start position. + * The steps refer to characters and not integers. + * Essentially this number is considered against the width of every character found. + * (For ASCII each step would be (sizeof(int8_t), which is 1). + * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)). + * + * @return + * F_none on success. + * 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_incomplete_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. + */ +#ifndef _di_f_fss_decrement_buffer_ + extern f_return_status f_fss_decrement_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step); +#endif // _di_f_fss_decrement_buffer_ + +/** + * Continue to the next character, based on step and character width. + * + * The start position must be at the start of a valid UTF-8 block. + * + * @param buffer + * The string to process. + * @param range + * The start and stop positions to be incremented. + * The start position will be incremented by step. + * @param step + * The number of steps to increment the start position. + * The steps refer to characters and not integers. + * Essentially this number is considered against the width of every character found. + * (For ASCII each step would be (sizeof(int8_t), which is 1). + * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)). + * + * @return + * F_none on success. + * 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_incomplete_utf_stop (with error bit) if the stop range is reached before the complete UTF-8 character can be processed. + * F_incomplete_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. + */ +#ifndef _di_f_fss_increment_buffer_ + extern f_return_status f_fss_increment_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step); +#endif // _di_f_fss_increment_buffer_ + +/** + * Identify whether or not a character in the buffer is a graph (ASCII or UTF-8) character. + * + * @param buffer + * The string to process. + * @param range + * The character at the start position will be checked against the graph. + * @param header + * The header data to populate with results of this function. + * + * @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 from (with error bit): f_utf_is_graph(). + * + * @see f_utf_is_graph() + */ +#ifndef _di_f_fss_is_graph_ + extern f_return_status f_fss_is_graph(const f_string_static buffer, const f_string_range range); +#endif // _di_f_fss_is_graph_ + +/** + * Identify whether or not a character in the buffer is a space (ASCII or UTF-8) character. + * + * @param buffer + * The string to process. + * @param range + * The character at the start position will be checked against the graph. + * @param header + * The header data to populate with results of this function. + * + * @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 from (with error bit): f_utf_is_space(). + * + * @see f_utf_is_space() + */ +#ifndef _di_f_fss_is_space_ + extern f_return_status f_fss_is_space(const f_string_static buffer, const f_string_range range); +#endif // _di_f_fss_is_space_ + +/** + * Shift all of the delimiters to the end of the used buffer. + * + * This allows one to do a printf on the dynamic string without the delimiters arbitrarily stopping the output. + * No reallocations are performed, this will only shift characters. + * + * @param buffer + * The string to process. + * This gets updated. + * @param range + * A restriction on where within the buffer the shifting happens. + * + * @return + * F_none on success. + * F_utf (with error bit) if UTF-8 cannot be fully processed (buffer or range range not long enough). + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_f_fss_shift_delimiters_ + extern f_return_status f_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range); +#endif // _di_f_fss_shift_delimiters_ + +/** + * Skip past all whitespace and control characters, except newline. + * + * Zero-width characters are not skipped because they might be part of a graph character, such as combining characters. + * @todo needs consideration on how to handle zero-width before space/control vs zero-width before graph. + * + * @param buffer + * The string to process. + * @param range + * The start and stop positions in the buffer being processed. + * This increments range->start. + * + * @return + * F_none on success. + * 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_incomplete_utf (with error bit) if an incomplete UTF-8 fragment was found. + * F_incomplete_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS. + * F_incomplete_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors from (with error bit): f_utf_is_control(). + * Errors from (with error bit): f_utf_is_whitespace(). + * Errors from (with error bit): f_utf_is_zero_width(). + * + * @see f_utf_is_control() + * @see f_utf_is_whitespace() + * @see f_utf_is_zero_width() + */ +#ifndef _di_f_fss_skip_past_space_ + extern f_return_status f_fss_skip_past_space(const f_string_static buffer, f_string_range *range); +#endif // _di_f_fss_skip_past_space_ + +/** + * Skip past all non-graph and non-zero-width characters (whitespace and control characters). + * + * Zero-width characters are not skipped because they might be part of a graph character, such as combining characters. + * @todo needs consideration on how to handle zero-width before space/control vs zero-width before graph. + * + * @param buffer + * The string to process. + * @param range + * The start and stop positions in the buffer being processed. + * This increments range->start. + * + * @return + * F_none on success. + * 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_incomplete_utf (with error bit) if an incomplete UTF-8 fragment was found. + * F_incomplete_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS. + * F_incomplete_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors from (with error bit): f_utf_is_graph(). + * Errors from (with error bit): f_utf_is_zero_width(). + * + * @see f_utf_is_graph() + * @see f_utf_is_zero_width() + */ +#ifndef _di_f_fss_skip_past_non_graph_ + extern f_return_status f_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range); +#endif // _di_f_fss_skip_past_non_graph_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_fss/data/build/dependencies b/level_0/f_fss/data/build/dependencies index d8175f5..13b45c7 100644 --- a/level_0/f_fss/data/build/dependencies +++ b/level_0/f_fss/data/build/dependencies @@ -2,3 +2,4 @@ f_type f_status f_memory f_string +f_utf diff --git a/level_0/f_fss/data/build/settings b/level_0/f_fss/data/build/settings index f036d4a..f582d7f 100644 --- a/level_0/f_fss/data/build/settings +++ b/level_0/f_fss/data/build/settings @@ -19,8 +19,8 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lf_memory -build_sources_library +build_libraries-individual -lf_utf -lf_memory +build_sources_library fss.c build_sources_program build_sources_headers fss.h build_sources_script diff --git a/level_0/f_serialize/data/build/settings b/level_0/f_serialize/data/build/settings index d779b3e..fc7659d 100644 --- a/level_0/f_serialize/data/build/settings +++ b/level_0/f_serialize/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lf_memory +build_libraries-individual -lf_utf -lf_memory build_sources_library serialize.c private-serialize.c build_sources_program build_sources_headers serialize.h diff --git a/level_0/f_utf/c/private-utf.h b/level_0/f_utf/c/private-utf.h index b696eb1..ff175c6 100644 --- a/level_0/f_utf/c/private-utf.h +++ b/level_0/f_utf/c/private-utf.h @@ -10,8 +10,8 @@ * These are provided for internal reduction in redundant code. * These should not be exposed/used outside of this project. */ -#ifndef _PRIVATE_FL_utf_h -#define _PRIVATE_FL_utf_h +#ifndef _PRIVATE_F_utf_h +#define _PRIVATE_F_utf_h #ifdef __cplusplus extern "C" { @@ -28,8 +28,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -51,8 +51,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -74,8 +74,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -95,8 +95,8 @@ extern "C" { * The character to validate. * * @return - * F_true if a UTF-8 control picture character. * F_false if not a UTF-8 control picture character. + * F_true if 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() @@ -117,8 +117,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -182,8 +182,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -205,8 +205,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_true if a UTF-8 control character. * F_false if not a UTF-8 control character. + * F_true if a UTF-8 control character. * F_utf (with error bit) if character is an invalid UTF-8 character. * * @see iscntrl() @@ -228,8 +228,8 @@ extern "C" { * The number of bytes repesenting the character width. * * @return - * F_false if not a UTF-8 control character. * 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() @@ -264,4 +264,4 @@ extern "C" { } // extern "C" #endif -#endif // _PRIVATE_FL_utf_h +#endif // _PRIVATE_F_utf_h diff --git a/level_1/fl_fss/c/fss.c b/level_1/fl_fss/c/fss.c index 0942ff5..a213be8 100644 --- a/level_1/fl_fss/c/fss.c +++ b/level_1/fl_fss/c/fss.c @@ -1,43 +1,10 @@ #include +#include "private-fss.h" #ifdef __cplusplus extern "C" { #endif -#ifndef _di_fl_fss_decrement_buffer_ - f_return_status fl_fss_decrement_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) { - #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return F_status_set_error(F_parameter); - if (location->start < 0) return F_status_set_error(F_parameter); - if (location->stop < location->start) return F_status_set_error(F_parameter); - if (location->start >= buffer.used) return F_status_set_error(F_parameter); - if (step < 1) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - if (location->start < 1) return F_none_eos; - - f_string_length i = 0; - unsigned short width = 0; - - do { - width = f_macro_utf_byte_width(buffer.string[location->start - 1]); - - if (width > location->start) { - if (width > 1) { - return F_status_set_error(F_incomplete_utf_eos); - } - - return F_none_eos; - } - - i++; - location->start -= width; - } while (i < step); - - return F_none; - } -#endif // _di_fl_fss_decrement_buffer_ - #ifndef _di_fl_fss_identify_ f_return_status fl_fss_identify(const f_string_static buffer, f_fss_header *header) { #ifndef _di_level_1_parameter_checking_ @@ -45,127 +12,7 @@ extern "C" { if (buffer.used <= 0) return F_status_set_error(F_parameter); #endif // _di_level_1_parameter_checking_ - register f_string_length i = 0; - - if (buffer.used < 10) { - // "# fss-0000" is always at least 10 characters. - return FL_fss_header_not; - } - - // If this correctly follows the FSS specification, then this should be all that needs to be done (as well as atoh for ascii to hex). - // All characters used in the identifier are only in the ascii equivalents of the characters, any similarly looking character or number representing in UTF-8 is considered invalid. - if (buffer.string[i] == f_fss_type_header_open) { - i++; - - if (buffer.string[i] == f_fss_type_header_part1) { - i++; - - if (buffer.string[i] == f_fss_type_header_part2) { - i++; - - if (buffer.string[i] == f_fss_type_header_part3) { - i++; - - if (buffer.string[i] == f_fss_type_header_part4) { - i++; - - if (buffer.string[i] == f_fss_type_header_part5) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - f_string_range range = f_string_range_initialize; - - range.start = i - 4; - range.stop = i; - - // 1: A possibly valid header type was found, now convert it into its proper format and save the header type. - const f_status status = f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); - if (F_status_is_error(status)) return status; - - if (status == F_none) { - // 2: At this point, we can still know the proper format for the file and still have a invalid header, handle accordingly. - if (buffer.string[i] == f_fss_type_header_close) { - header->length = i + 1; - - return F_none; - } - else { - // if "# fss-0000" is there, regardless of whats next, we can guess this to be of fss-0000, even if its fss-00001 (this is a guess afterall). - header->length = i + 1; - - return F_status_is_warning(FL_fss_accepted_invalid); - } - } - } - } - } - } - } - } - } - } - } - // people can miss spaces, so lets accept in an attempt to interpret the file anyway, but return values at this point are to be flagged as invalid. - else if (buffer.string[i] == f_fss_type_header_part2) { - i++; - - if (buffer.string[i] == f_fss_type_header_part3) { - i++; - - if (buffer.string[i] == f_fss_type_header_part4) { - i++; - - if (buffer.string[i] == f_fss_type_header_part5) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { - i++; - - f_string_range range = f_string_range_initialize; - - range.start = i - 4; - range.stop = i; - - const f_status status = f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); - if (F_status_is_error(status)) return status; - - header->length = i + 1; - - return F_status_is_warning(FL_fss_accepted_invalid); - } - } - } - } - } - } - } - } - } - - // @todo At some point add checksum and compressions checks here, but the above statements will have to be adjusted accordingly. - // 3: eventually this will be processing the checksum and 4: will be processing the compression. - - return FL_fss_header_not; + return private_fl_fss_identify(buffer, header); } #endif // _di_fl_fss_identify_ @@ -194,362 +41,10 @@ extern "C" { status = f_file_read_until(*file, &buffer, f_fss_max_header_length + 1); if (F_status_is_error(status)) return status; - return fl_fss_identify(buffer, header); + return private_fl_fss_identify(buffer, header); } #endif // _di_fl_fss_identify_file_ -#ifndef _di_fl_fss_increment_buffer_ - f_return_status fl_fss_increment_buffer(const f_string_static buffer, f_string_range *location, const f_string_length step) { - #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return F_status_set_error(F_parameter); - if (location->start < 0) return F_status_set_error(F_parameter); - if (location->stop < location->start) return F_status_set_error(F_parameter); - if (location->start >= buffer.used) return F_status_set_error(F_parameter); - if (step < 1) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_string_length i = 0; - unsigned short width = 0; - - do { - width = f_macro_utf_byte_width(buffer.string[location->start]); - - if (location->start + width > location->stop) { - if (width > 1) { - return F_status_set_error(F_incomplete_utf_stop); - } - - location->start += width; - return F_none_stop; - } - else if (location->start + width >= buffer.used) { - if (width > 1) { - return F_status_set_error(F_incomplete_utf_eos); - } - - location->start += width; - return F_none_eos; - } - - i++; - location->start += width; - } while (i < step); - - return F_none; - } -#endif // _di_fl_fss_increment_buffer_ - -#ifndef _di_fl_fss_is_graph_ - f_return_status fl_fss_is_graph(const f_string_static buffer, const f_string_range range) { - #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return F_status_set_error(F_parameter); - if (range.start < 0) return F_status_set_error(F_parameter); - if (range.stop < range.start) return F_status_set_error(F_parameter); - if (range.start >= buffer.used) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_string_length width_max = (range.stop - range.start) + 1; - - if (width_max > buffer.used - range.start) { - width_max = buffer.used - range.start; - } - - return f_utf_is_graph(buffer.string + range.start, width_max); - } -#endif // _di_fl_fss_is_graph_ - -#ifndef _di_fl_fss_is_space_ - f_return_status fl_fss_is_space(const f_string_static buffer, const f_string_range range) { - #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return F_status_set_error(F_parameter); - if (range.start < 0) return F_status_set_error(F_parameter); - if (range.stop < range.start) return F_status_set_error(F_parameter); - if (range.start >= buffer.used) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_string_length width_max = (range.stop - range.start) + 1; - - if (width_max > buffer.used - range.start) { - width_max = buffer.used - range.start; - } - - return f_utf_is_whitespace(buffer.string + range.start, width_max); - } -#endif // _di_fl_fss_is_space_ - -#ifndef _di_fl_fss_shift_delimiters_ - f_return_status fl_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range) { - #ifndef _di_level_1_parameter_checking_ - if (buffer->used <= 0) return F_status_set_error(F_parameter); - if (range.start < 0) return F_status_set_error(F_parameter); - if (range.stop < range.start) return F_status_set_error(F_parameter); - if (range.start >= buffer->used) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_string_length position = 0; - f_string_length distance = 0; - unsigned short utf_width = 0; - unsigned short i = 0; - - position = range.start; - - while (position < buffer->used && position <= range.stop) { - if (buffer->string[position] == f_fss_delimit_placeholder) { - distance++; - } - - // do not waste time trying to process what is only going to be replaced with a delimit placeholder - if (position + distance >= buffer->used || position + distance > range.stop) { - break; - } - - utf_width = f_macro_utf_byte_width_is(buffer->string[position]); - if (utf_width > 1) { - // not enough space in buffer or in range range to process UTF-8 character. - if (position + utf_width >= buffer->used || position + utf_width > range.stop) { - return F_status_set_error(F_utf); - } - - if (distance > 0) { - while (utf_width > 0) { - buffer->string[position] = buffer->string[position + distance]; - utf_width--; - position++; - } - } - } - else { - // shift everything down one for each placeholder found - if (distance > 0) { - buffer->string[position] = buffer->string[position + distance]; - } - - position++; - } - } - - if (distance > 0) { - while (position < buffer->used + distance && position <= range.stop) { - buffer->string[position] = f_fss_delimit_placeholder; - position++; - } - } - - return F_none; - } -#endif // _di_fl_fss_shift_delimiters_ - -#ifndef _di_fl_fss_skip_past_space_ - f_return_status fl_fss_skip_past_space(const f_string_static buffer, f_string_range *range) { - #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return F_status_set_error(F_parameter); - if (range == 0) return F_status_set_error(F_parameter); - if (range->start < 0) return F_status_set_error(F_parameter); - if (range->stop < range->start) return F_status_set_error(F_parameter); - if (range->start >= buffer.used) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status status = F_none; - unsigned short width = 0; - - f_string_length width_max = (range->stop - range->start) + 1; - - if (width_max > buffer.used - range->start) { - width_max = buffer.used - range->start; - } - - for (;;) { - if (buffer.string[range->start] != f_fss_delimit_placeholder) { - status = f_utf_is_whitespace(buffer.string + range->start, width_max); - - if (status == F_false) { - status = f_utf_is_control(buffer.string + range->start, width_max); - - if (status == F_false) { - status = f_utf_is_zero_width(buffer.string + range->start, width_max); - - if (status == F_true) { - f_string_length next_width_max = 0; - - for (f_string_length next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { - next_width_max = (range->stop - next) + 1; - - status = f_utf_is_whitespace(buffer.string + next, width_max); - if (status == F_true) { - // treat zero-width before a space like a space. - break; - } - else if (status == F_false) { - status = f_utf_is_control(buffer.string + next, width_max); - - if (status == F_true) { - // treat zero-width before a control character like a space. - break; - } - else if (status == F_false) { - status = f_utf_is_zero_width(buffer.string + next, width_max); - - if (status == F_true) { - // seek until a non-zero-width is reached. - continue; - } - else if (status == F_false) { - // treat zero-width as a non-whitespace non-control character when preceding a non-whitespace non-control character. - return F_none; - } - } - else if (F_status_is_error(status)) return status; - } - else if (F_status_is_error(status)) return status; - } // for - } - else if (status == F_false) { - // treat zero-width as a graph when preceding a non-whitespace non-control (that is not a zero-width). - return F_none; - } - else if (F_status_is_error(status)) return status; - } - else if (F_status_is_error(status)) return status; - } - else if (F_status_is_error(status)) return status; - } - - if (buffer.string[range->start] == f_string_eol[0]) return F_none_eol; - - width = f_macro_utf_byte_width_is(buffer.string[range->start]); - - if (width == 0) { - width = 1; - } - // Do not operate on UTF-8 fragments that are not the first byte of the character. - else if (width == 1) { - return F_status_set_error(F_incomplete_utf); - } - else { - if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); - if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); - } - - range->start += width; - - if (range->start >= buffer.used) return F_none_eos; - if (range->start > range->stop) return F_none_stop; - - width_max = (range->stop - range->start) + 1; - - if (width_max > buffer.used - range->start) { - width_max = buffer.used - range->start; - } - } // for - - if (F_status_is_error(status)) return status; - - return F_none; - } -#endif // _di_fl_fss_skip_past_space_ - -#ifndef _di_fl_fss_skip_past_non_graph_ - f_return_status fl_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range) { - #ifndef _di_level_1_parameter_checking_ - if (buffer.used <= 0) return F_status_set_error(F_parameter); - if (range == 0) return F_status_set_error(F_parameter); - if (range->start < 0) return F_status_set_error(F_parameter); - if (range->stop < range->start) return F_status_set_error(F_parameter); - if (range->start >= buffer.used) return F_status_set_error(F_parameter); - #endif // _di_level_1_parameter_checking_ - - f_status status = F_none; - unsigned short width = 0; - - f_string_length width_max = (range->stop - range->start) + 1; - - if (width_max > buffer.used - range->start) { - width_max = buffer.used - range->start; - } - - for (;;) { - if (buffer.string[range->start] != f_fss_delimit_placeholder) { - status = f_utf_is_graph(buffer.string + range->start, width_max); - - if (status == F_true) { - // stop at a graph. - break; - } - else if (status == F_false) { - status = f_utf_is_zero_width(buffer.string + range->start, width_max); - - if (status == F_true) { - f_string_length next_width_max = 0; - - for (f_string_length next = range->start + 1; next < buffer.used && next <= range->stop; next += f_macro_utf_byte_width_is(buffer.string[next])) { - next_width_max = (range->stop - next) + 1; - - status = f_utf_is_graph(buffer.string + next, width_max); - if (status == F_true) { - // treat zero-width as a graph when preceding a graph. - return F_none; - } - else if (status == F_false) { - status = f_utf_is_zero_width(buffer.string + next, width_max); - - if (status == F_true) { - // seek until a non-zero-width is reached. - continue; - } - else if (status == F_false) { - // treat zero-width as a non-graph when preceding a non-graph (that is not a zero-width). - break; - } - else if (F_status_is_error(status)) return status; - } - else if (F_status_is_error(status)) return status; - } // for - } - else if (status == F_false) { - // continue on when non-graph and non-zero-width. - break; - } - else if (F_status_is_error(status)) return status; - } - else if (F_status_is_error(status)) return status; - } - - if (F_status_is_error(status)) return status; - - width = f_macro_utf_byte_width_is(buffer.string[range->start]); - - if (width == 0) { - width = 1; - } - // Do not operate on UTF-8 fragments that are not the first byte of the character. - else if (width == 1) { - return F_status_set_error(F_incomplete_utf); - } - else { - if (range->start + width >= buffer.used) return F_status_set_error(F_incomplete_utf_eos); - if (range->start + width > range->stop) return F_status_set_error(F_incomplete_utf_stop); - } - - range->start += width; - - if (range->start >= buffer.used) return F_none_eos; - if (range->start > range->stop) return F_none_stop; - - width_max = (range->stop - range->start) + 1; - - if (width_max > buffer.used - range->start) { - width_max = buffer.used - range->start; - } - } // for - - if (F_status_is_error(status)) { - return status; - } - - return F_none; - } -#endif // _di_fl_fss_skip_past_non_graph_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_1/fl_fss/c/fss.h b/level_1/fl_fss/c/fss.h index d37ee9e..8658ec8 100644 --- a/level_1/fl_fss/c/fss.h +++ b/level_1/fl_fss/c/fss.h @@ -29,34 +29,6 @@ extern "C" { #endif /** - * Continue to the previous character, based on step and character width. - * - * The start position must be at the start of a valid UTF-8 block. - * - * @param buffer - * The string to process. - * @param range - * The start and stop positions to be incremented. - * The start position will be incremented by step. - * @param step - * The number of steps to decrement the start position. - * The steps refer to characters and not integers. - * Essentially this number is considered against the width of every character found. - * (For ASCII each step would be (sizeof(int8_t), which is 1). - * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)). - * - * @return - * F_none on success. - * 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_incomplete_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. - */ -#ifndef _di_fl_fss_decrement_buffer_ - extern f_return_status fl_fss_decrement_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step); -#endif // _di_fl_fss_decrement_buffer_ - -/** * Identify FSS type from a buffered string. * * @param buffer @@ -86,12 +58,15 @@ extern "C" { * * @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_reallocation (with error bit) on memory reallocation error. * 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. * + * Errors from (with error bit): f_conversion_string_to_hexidecimal_unsigned(). * Errors from (with error bit): f_file_read_until(). * Errors from (with error bit): f_file_seek(). - * Errors from (with error bit): fl_fss_identify() * * @see f_file_read_until() * @see fl_fss_identify() @@ -100,157 +75,6 @@ extern "C" { extern f_return_status fl_fss_identify_file(f_file *file, f_fss_header *header); #endif // _di_fl_fss_identify_file_ -/** - * Continue to the next character, based on step and character width. - * - * The start position must be at the start of a valid UTF-8 block. - * - * @param buffer - * The string to process. - * @param range - * The start and stop positions to be incremented. - * The start position will be incremented by step. - * @param step - * The number of steps to increment the start position. - * The steps refer to characters and not integers. - * Essentially this number is considered against the width of every character found. - * (For ASCII each step would be (sizeof(int8_t), which is 1). - * (For UTF-8 character of width 3, each step would be (3 * sizeof(int8_t)). - * - * @return - * F_none on success. - * 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_incomplete_utf_stop (with error bit) if the stop range is reached before the complete UTF-8 character can be processed. - * F_incomplete_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. - */ -#ifndef _di_fl_fss_increment_buffer_ - extern f_return_status fl_fss_increment_buffer(const f_string_static buffer, f_string_range *range, const f_string_length step); -#endif // _di_fl_fss_increment_buffer_ - -/** - * Identify whether or not a character in the buffer is a graph (ASCII or UTF-8) character. - * - * @param buffer - * The string to process. - * @param range - * The character at the start position will be checked against the graph. - * @param header - * The header data to populate with results of this function. - * - * @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 from (with error bit): f_utf_is_graph(). - */ -#ifndef _di_fl_fss_is_graph_ - extern f_return_status fl_fss_is_graph(const f_string_static buffer, const f_string_range range); -#endif // _di_fl_fss_is_graph_ - -/** - * Identify whether or not a character in the buffer is a space (ASCII or UTF-8) character. - * - * @param buffer - * The string to process. - * @param range - * The character at the start position will be checked against the graph. - * @param header - * The header data to populate with results of this function. - * - * @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 from (with error bit): f_utf_is_space(). - */ -#ifndef _di_fl_fss_is_space_ - extern f_return_status fl_fss_is_space(const f_string_static buffer, const f_string_range range); -#endif // _di_fl_fss_is_space_ - -/** - * Shift all of the delimiters to the end of the used buffer. - * - * This allows one to do a printf on the dynamic string without the delimiters arbitrarily stopping the output. - * No reallocations are performed, this will only shift characters. - * - * @param buffer - * The string to process. - * This gets updated. - * @param range - * A restriction on where within the buffer the shifting happens. - * - * @return - * F_none on success. - * F_utf (with error bit) if UTF-8 cannot be fully processed (buffer or range range not long enough). - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fl_fss_shift_delimiters_ - extern f_return_status fl_fss_shift_delimiters(f_string_dynamic *buffer, const f_string_range range); -#endif // _di_fl_fss_shift_delimiters_ - -/** - * Skip past all whitespace and control characters, except newline. - * - * Zero-width characters are not skipped because they might be part of a graph character, such as combining characters. - * @todo needs consideration on how to handle zero-width before space/control vs zero-width before graph. - * - * @param buffer - * The string to process. - * @param range - * The start and stop positions in the buffer being processed. - * This increments range->start. - * - * @return - * F_none on success. - * 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_incomplete_utf (with error bit) if an incomplete UTF-8 fragment was found. - * F_incomplete_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS. - * F_incomplete_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors from (with error bit): f_utf_is_control(). - * Errors from (with error bit): f_utf_is_whitespace(). - * Errors from (with error bit): f_utf_is_zero_width(). - */ -#ifndef _di_fl_fss_skip_past_space_ - extern f_return_status fl_fss_skip_past_space(const f_string_static buffer, f_string_range *range); -#endif // _di_fl_fss_skip_past_space_ - -/** - * Skip past all non-graph and non-zero-width characters (whitespace and control characters). - * - * Zero-width characters are not skipped because they might be part of a graph character, such as combining characters. - * @todo needs consideration on how to handle zero-width before space/control vs zero-width before graph. - * - * @param buffer - * The string to process. - * @param range - * The start and stop positions in the buffer being processed. - * This increments range->start. - * - * @return - * F_none on success. - * 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_incomplete_utf (with error bit) if an incomplete UTF-8 fragment was found. - * F_incomplete_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS. - * F_incomplete_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors from (with error bit): f_utf_is_graph(). - * Errors from (with error bit): f_utf_is_zero_width(). - */ -#ifndef _di_fl_fss_skip_past_non_graph_ - extern f_return_status fl_fss_skip_past_non_graph(const f_string_static buffer, f_string_range *range); -#endif // _di_fl_fss_skip_past_non_graph_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 69b8cbc..a23db51 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -21,14 +21,14 @@ extern "C" { // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; - status = fl_fss_skip_past_space(*buffer, location); + status = f_fss_skip_past_space(*buffer, location); if (F_status_is_error(status)) return status; fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) // return found nothing if this line only contains whitespace and delimit placeholders if (buffer->string[location->start] == f_fss_basic_close) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -45,7 +45,7 @@ extern "C" { if (buffer->string[location->start] == f_fss_comment) { fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -58,23 +58,23 @@ extern "C" { if (buffer->string[location->start] == f_fss_delimit_slash) { f_string_length last_slash = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; } else { - status = fl_fss_is_graph(*buffer, *location); + status = f_fss_is_graph(*buffer, *location); if (status == F_false) { found->stop = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -89,7 +89,7 @@ extern "C" { last_slash = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -108,14 +108,14 @@ extern "C" { delimits.array[delimits.used] = last_slash; delimits.used++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } } else if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { quoted = buffer->string[location->start]; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; found->start = location->start; @@ -124,8 +124,8 @@ extern "C" { // identify where the object ends if (quoted == 0) { status = F_none; - while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_space(*buffer, *location)) == F_false) { - status = fl_fss_increment_buffer(*buffer, location, 1); + while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = f_fss_is_space(*buffer, *location)) == F_false) { + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) @@ -133,7 +133,7 @@ extern "C" { if (F_status_is_error(status)) return status; - status = fl_fss_is_space(*buffer, *location); + status = f_fss_is_space(*buffer, *location); if (status == F_true) { found->stop = location->start - 1; @@ -144,7 +144,7 @@ extern "C" { return FL_fss_found_object_content_not; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -159,14 +159,14 @@ extern "C" { f_string_length first_slash = location->start; f_string_length slash_count = 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -177,7 +177,7 @@ extern "C" { slash_count++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -208,7 +208,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -217,9 +217,9 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) - if ((status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if ((status = f_fss_is_graph(*buffer, *location)) == F_true) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -227,7 +227,7 @@ extern "C" { f_macro_string_lengths_delete_simple(delimits); - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -247,7 +247,7 @@ extern "C" { found->stop = length - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -272,7 +272,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -283,7 +283,7 @@ extern "C" { else if (buffer->string[location->start] == quoted) { found->stop = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { @@ -293,10 +293,10 @@ extern "C" { location->start++; return FL_fss_found_object_content_not; } - else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { + else if ((status = f_fss_is_space(*buffer, *location)) == F_true) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -307,7 +307,7 @@ extern "C" { else if (buffer->string[location->start] != f_fss_delimit_placeholder) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -316,13 +316,13 @@ extern "C" { f_macro_string_lengths_delete_simple(delimits); - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -335,7 +335,7 @@ extern "C" { return FL_fss_found_object_not; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -344,7 +344,7 @@ extern "C" { // seek to the end of the line when no valid object is found while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -352,7 +352,7 @@ extern "C" { f_macro_string_lengths_delete_simple(delimits); - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -376,7 +376,7 @@ extern "C" { // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; - fl_fss_skip_past_space(*buffer, location); + f_fss_skip_past_space(*buffer, location); if (F_status_is_error(status)) return status; fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) @@ -404,7 +404,7 @@ extern "C" { found->array[found->used].stop = location->start - 1; found->used++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_content; @@ -445,7 +445,7 @@ extern "C" { if (object.string[location->start] == f_fss_delimit_slash) { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -457,7 +457,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -473,7 +473,7 @@ extern "C" { buffer->string[buffer_position.stop + 1] = object.string[location->start]; buffer_position.stop += 2; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } } @@ -490,7 +490,7 @@ extern "C" { buffer->string[buffer_position.stop + 1] = object.string[location->start]; buffer_position.stop += 2; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } else if (object.string[location->start] == f_fss_comment) { @@ -499,7 +499,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -515,7 +515,7 @@ extern "C" { return F_none_eol; } - else if ((status = fl_fss_is_space(*buffer, *location)) == F_true || quoted) { + else if ((status = f_fss_is_space(*buffer, *location)) == F_true || quoted) { pre_allocate_size++; if (pre_allocate_size > buffer->size) { @@ -532,7 +532,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -556,7 +556,7 @@ extern "C" { buffer_position.stop++; slash_count++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; fl_macro_fss_skip_past_delimit_placeholders(object, (*location)); @@ -601,7 +601,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; buffer_position.stop++; @@ -618,7 +618,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; buffer_position.stop++; @@ -676,7 +676,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while diff --git a/level_1/fl_fss/c/fss_basic.h b/level_1/fl_fss/c/fss_basic.h index 4f387b6..b4255b4 100644 --- a/level_1/fl_fss/c/fss_basic.h +++ b/level_1/fl_fss/c/fss_basic.h @@ -64,10 +64,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_object_read_ extern f_return_status fl_fss_basic_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -106,10 +106,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_content_read_ extern f_return_status fl_fss_basic_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found); @@ -141,7 +141,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_basic_object_write_ extern f_return_status fl_fss_basic_object_write(f_string_dynamic *buffer, const f_string_static object, f_string_range *location); @@ -172,7 +172,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_basic_content_write_ extern f_return_status fl_fss_basic_content_write(f_string_dynamic *buffer, const f_string_static content, f_string_range *location); diff --git a/level_1/fl_fss/c/fss_basic_list.c b/level_1/fl_fss/c/fss_basic_list.c index a5990a8..4216c67 100644 --- a/level_1/fl_fss/c/fss_basic_list.c +++ b/level_1/fl_fss/c/fss_basic_list.c @@ -21,7 +21,7 @@ extern "C" { // delimits must only be applied once a valid object is found. f_string_lengths delimits = f_string_lengths_initialize; - fl_fss_skip_past_space(*buffer, location); + f_fss_skip_past_space(*buffer, location); fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) // return found nothing if this line only contains whitespace and delimit placeholders. @@ -37,7 +37,7 @@ extern "C" { if (buffer->string[location->start] == f_fss_comment) { fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -49,7 +49,7 @@ extern "C" { f_string_length first_slash = location->start; f_string_length slash_count = 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop && (buffer->string[location->start] == f_fss_delimit_placeholder || buffer->string[location->start] == f_fss_delimit_slash)) { @@ -57,7 +57,7 @@ extern "C" { slash_count++; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -66,17 +66,17 @@ extern "C" { if (buffer->string[location->start] == f_fss_basic_list_open) { f_string_length stop_point = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if (buffer->string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(*buffer, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -107,7 +107,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -129,17 +129,17 @@ extern "C" { else if (buffer->string[location->start] == f_fss_basic_list_open) { f_string_length stop_point = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if (buffer->string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(*buffer, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -150,7 +150,7 @@ extern "C" { found->stop = stop_point; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -159,19 +159,19 @@ extern "C" { continue; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while // seek to the end of the line when no valid object is found. while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -210,7 +210,7 @@ extern "C" { found_newline = F_true; last_newline = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) @@ -222,7 +222,7 @@ extern "C" { f_string_length first_slash = location->start; f_string_length slash_count = 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop && (buffer->string[location->start] == f_fss_delimit_placeholder || buffer->string[location->start] == f_fss_delimit_slash)) { @@ -230,7 +230,7 @@ extern "C" { slash_count++; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -244,17 +244,17 @@ extern "C" { if (buffer->string[location->start] == f_fss_basic_list_open) { f_string_length stop_point = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if (buffer->string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(*buffer, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -303,7 +303,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -315,17 +315,17 @@ extern "C" { continue; } else if (buffer->string[location->start] == f_fss_basic_list_open) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if (buffer->string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(*buffer, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -357,7 +357,7 @@ extern "C" { continue; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -415,7 +415,7 @@ extern "C" { // comments are not allowed and this format has no way of "wrapping" a comment. return F_status_set_error(FL_fss_found_comment); } - else if ((status = fl_fss_is_graph(object, *location)) == F_true) { + else if ((status = f_fss_is_graph(object, *location)) == F_true) { break; } else if (F_status_is_error(status)) { @@ -427,7 +427,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; } // while @@ -438,12 +438,12 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; continue; @@ -454,7 +454,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; slash_count++; @@ -490,7 +490,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; } // while @@ -546,12 +546,12 @@ extern "C" { buffer_position.stop++; has_graph = F_true; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; continue; @@ -563,7 +563,7 @@ extern "C" { buffer->string[buffer_position.stop] = content.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; slash_count++; @@ -572,17 +572,17 @@ extern "C" { if (content.string[location->start] == f_fss_basic_list_open) { f_string_length start = location->start; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(content, *location)) == F_true) { + if (content.string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(content, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; } // while @@ -617,17 +617,17 @@ extern "C" { has_graph = F_true; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(content, *location)) == F_true) { + if (content.string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(content, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; } // while @@ -657,7 +657,7 @@ extern "C" { has_graph = F_false; is_comment = F_false; } - else if ((status = fl_fss_is_graph(content, *location)) == F_true) { + else if ((status = f_fss_is_graph(content, *location)) == F_true) { has_graph = F_true; } else if (F_status_is_error(status)) { @@ -669,7 +669,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; } // while diff --git a/level_1/fl_fss/c/fss_basic_list.h b/level_1/fl_fss/c/fss_basic_list.h index 833f00f..7ef2007 100644 --- a/level_1/fl_fss/c/fss_basic_list.h +++ b/level_1/fl_fss/c/fss_basic_list.h @@ -65,10 +65,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_list_object_read_ extern f_return_status fl_fss_basic_list_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -107,10 +107,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_basic_list_content_read_ extern f_return_status fl_fss_basic_list_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found); @@ -142,7 +142,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_basic_list_object_write_ extern f_return_status fl_fss_basic_list_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer); @@ -173,7 +173,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_basic_list_content_write_ extern f_return_status fl_fss_basic_list_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer); diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index 3241144..a3d5621 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -21,12 +21,12 @@ extern "C" { // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; - fl_fss_skip_past_space(*buffer, location); + f_fss_skip_past_space(*buffer, location); fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) // return found nothing if this line only contains whitespace and delimit placeholders if (buffer->string[location->start] == f_fss_extended_close) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -43,7 +43,7 @@ extern "C" { if (buffer->string[location->start] == f_fss_comment) { fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -56,20 +56,20 @@ extern "C" { if (buffer->string[location->start] == f_fss_delimit_slash) { f_string_length last_slash = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; } - else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { + else if ((status = f_fss_is_space(*buffer, *location)) == F_true) { found->stop = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -83,7 +83,7 @@ extern "C" { last_slash = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -102,14 +102,14 @@ extern "C" { delimits.array[delimits.used] = last_slash; delimits.used++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } } else if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { quoted = buffer->string[location->start]; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; found->start = location->start; @@ -118,8 +118,8 @@ extern "C" { // identify where the object ends if (quoted == 0) { status = F_none; - while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { - status = fl_fss_increment_buffer(*buffer, location, 1); + while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = f_fss_is_graph(*buffer, *location)) == F_true) { + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; fl_macro_fss_object_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) @@ -127,7 +127,7 @@ extern "C" { if (F_status_is_error(status)) return status; - if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { + if ((status = f_fss_is_space(*buffer, *location)) == F_true) { found->stop = location->start - 1; fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); @@ -137,7 +137,7 @@ extern "C" { return FL_fss_found_object_content_not; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -152,12 +152,12 @@ extern "C" { f_string_length first_slash = location->start; f_string_length slash_count = 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -168,7 +168,7 @@ extern "C" { slash_count++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -199,7 +199,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -208,15 +208,15 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) - if ((status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if ((status = f_fss_is_graph(*buffer, *location)) == F_true) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -236,7 +236,7 @@ extern "C" { found->stop = length - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -261,7 +261,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -272,7 +272,7 @@ extern "C" { else if (buffer->string[location->start] == quoted) { found->stop = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { @@ -282,10 +282,10 @@ extern "C" { location->start++; return FL_fss_found_object_content_not; } - else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { + else if ((status = f_fss_is_space(*buffer, *location)) == F_true) { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -295,19 +295,19 @@ extern "C" { } else if (buffer->string[location->start] != f_fss_delimit_placeholder) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -318,7 +318,7 @@ extern "C" { return FL_fss_found_object_not; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -327,13 +327,13 @@ extern "C" { // seek to the end of the line when no valid object is found while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -357,12 +357,12 @@ extern "C" { // delimits must only be applied once a valid object is found f_string_lengths delimits = f_string_lengths_initialize; - fl_fss_skip_past_space(*buffer, location); + f_fss_skip_past_space(*buffer, location); fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) // return found nothing if this line only contains whitespace and delimit placeholders if (buffer->string[location->start] == f_fss_extended_close) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_content_not; @@ -396,21 +396,21 @@ extern "C" { if (buffer->string[location->start] == f_fss_delimit_slash) { f_string_length last_slash = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; } - else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { + else if ((status = f_fss_is_space(*buffer, *location)) == F_true) { found->array[found->used].stop = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; found->used++; @@ -432,7 +432,7 @@ extern "C" { last_slash = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -456,14 +456,14 @@ extern "C" { delimits.array[delimits.used] = last_slash; delimits.used++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } } else if (buffer->string[location->start] == f_fss_delimit_single_quote || buffer->string[location->start] == f_fss_delimit_double_quote) { quoted = buffer->string[location->start]; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; found->array[found->used].start = location->start; @@ -472,8 +472,8 @@ extern "C" { // identify where the content ends if (quoted == 0) { status = F_none; - while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { - status = fl_fss_increment_buffer(*buffer, location, 1); + while (buffer->string[location->start] == f_fss_delimit_placeholder || (status = f_fss_is_graph(*buffer, *location)) == F_true) { + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) @@ -481,7 +481,7 @@ extern "C" { if (F_status_is_error(status)) return status; - if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { + if ((status = f_fss_is_space(*buffer, *location)) == F_true) { found->array[found->used].stop = location->start - 1; found->used++; @@ -492,7 +492,7 @@ extern "C" { return FL_fss_found_content; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -507,12 +507,12 @@ extern "C" { f_string_length first_slash = location->start; f_string_length slash_count = 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { if (buffer->string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -523,7 +523,7 @@ extern "C" { slash_count++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -553,7 +553,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -562,15 +562,15 @@ extern "C" { fl_macro_fss_skip_past_delimit_placeholders((*buffer), (*location)) fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) - if ((status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if ((status = f_fss_is_graph(*buffer, *location)) == F_true) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return F_status_is_warning(F_unterminated_group); @@ -590,7 +590,7 @@ extern "C" { found->array[found->used].stop = length - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; found->used++; @@ -616,7 +616,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -626,7 +626,7 @@ extern "C" { } else if (buffer->string[location->start] == quoted) { found->array[found->used].stop = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < buffer->used) { @@ -637,8 +637,8 @@ extern "C" { found->used++; return FL_fss_found_content; } - else if ((status = fl_fss_is_space(*buffer, *location)) == F_true) { - status = fl_fss_increment_buffer(*buffer, location, 1); + else if ((status = f_fss_is_space(*buffer, *location)) == F_true) { + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; found->used++; @@ -650,19 +650,19 @@ extern "C" { } else if (buffer->string[location->start] != f_fss_delimit_placeholder) { while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_content_return_on_overflow((*buffer), (*location), (*found), delimits, F_status_is_warning(F_unterminated_group_eos), F_status_is_warning(F_unterminated_group_stop)) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return F_status_is_warning(F_unterminated_group); } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -681,7 +681,7 @@ extern "C" { found->array[found->used].stop = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; found->used++; @@ -690,7 +690,7 @@ extern "C" { } } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -709,14 +709,14 @@ extern "C" { // seek to the end of the line when no valid content is found while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_content_delimited_return_on_overflow((*buffer), (*location), (*found), delimits, F_none_eos, F_none_stop) if (found->used == already_used) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_content_not; @@ -724,7 +724,7 @@ extern "C" { fl_macro_fss_apply_delimit_placeholders((*buffer), delimits); - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_content; @@ -765,7 +765,7 @@ extern "C" { if (object.string[location->start] == f_fss_delimit_slash) { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -776,7 +776,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -793,7 +793,7 @@ extern "C" { buffer->string[buffer_position.stop + 1] = object.string[location->start]; buffer_position.stop += 2; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } } @@ -809,7 +809,7 @@ extern "C" { buffer->string[buffer_position.stop + 1] = object.string[location->start]; buffer_position.stop += 2; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } else if (object.string[location->start] == f_fss_comment) { @@ -818,7 +818,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -834,15 +834,15 @@ extern "C" { return F_none_eol; } - else if ((status = fl_fss_is_space(*buffer, *location)) == F_true || quoted) { + else if ((status = f_fss_is_space(*buffer, *location)) == F_true || quoted) { f_string_length first_space = location->start; if (!quoted) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < object.used && isspace(object.string[location->start])) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -870,7 +870,7 @@ extern "C" { while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -895,7 +895,7 @@ extern "C" { buffer_position.stop++; slash_count++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; fl_macro_fss_skip_past_delimit_placeholders(object, (*location)); @@ -940,7 +940,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; buffer_position.stop++; @@ -957,7 +957,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; buffer_position.stop++; @@ -1011,12 +1011,12 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer_position.stop++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -1029,7 +1029,7 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer_position.stop++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -1056,7 +1056,7 @@ extern "C" { buffer->string[buffer_position.stop + 1] = content.string[location->start]; buffer_position.stop += 2; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } } @@ -1072,7 +1072,7 @@ extern "C" { buffer->string[buffer_position.stop + 1] = content.string[location->start]; buffer_position.stop += 2; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } @@ -1083,7 +1083,7 @@ extern "C" { return F_none_eol; } - if (content.string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_true) { + if (content.string[location->start] != f_fss_delimit_placeholder && (status = f_fss_is_space(*buffer, *location)) == F_true) { quoted = f_fss_delimit_double_quote; pre_allocate_size += 2; @@ -1106,7 +1106,7 @@ extern "C" { buffer->string[buffer_position.stop] = content.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -1118,12 +1118,12 @@ extern "C" { buffer->string[buffer_position.stop] = f_fss_delimit_slash; buffer_position.stop++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; continue; @@ -1137,7 +1137,7 @@ extern "C" { buffer_position.stop++; slash_count++; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -1191,7 +1191,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while diff --git a/level_1/fl_fss/c/fss_extended.h b/level_1/fl_fss/c/fss_extended.h index 3d949fa..6b548ab 100644 --- a/level_1/fl_fss/c/fss_extended.h +++ b/level_1/fl_fss/c/fss_extended.h @@ -64,10 +64,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_object_read_ extern f_return_status fl_fss_extended_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -106,10 +106,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_content_read_ extern f_return_status fl_fss_extended_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_content *found); @@ -141,7 +141,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_extended_object_write_ extern f_return_status fl_fss_extended_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer); @@ -172,7 +172,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_extended_content_write_ extern f_return_status fl_fss_extended_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer); diff --git a/level_1/fl_fss/c/fss_extended_list.c b/level_1/fl_fss/c/fss_extended_list.c index bb33519..daf5e21 100644 --- a/level_1/fl_fss/c/fss_extended_list.c +++ b/level_1/fl_fss/c/fss_extended_list.c @@ -21,12 +21,12 @@ extern "C" { // delimits must only be applied once a valid object is found. f_string_lengths delimits = f_string_lengths_initialize; - fl_fss_skip_past_space(*buffer, location); + f_fss_skip_past_space(*buffer, location); fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) // return found nothing if this line only contains whitespace and delimit placeholders. if (buffer->string[location->start] == f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -39,7 +39,7 @@ extern "C" { if (buffer->string[location->start] == f_fss_comment) { fl_macro_fss_object_seek_till_newline((*buffer), (*location), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -51,7 +51,7 @@ extern "C" { f_string_length first_slash = location->start; f_string_length slash_count = 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop && (buffer->string[location->start] == f_fss_delimit_placeholder || buffer->string[location->start] == f_fss_delimit_slash)) { @@ -59,7 +59,7 @@ extern "C" { slash_count++; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -68,17 +68,17 @@ extern "C" { if (buffer->string[location->start] == f_fss_extended_list_open) { f_string_length stop_point = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if (buffer->string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(*buffer, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -109,7 +109,7 @@ extern "C" { slash_count--; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -131,17 +131,17 @@ extern "C" { else if (buffer->string[location->start] == f_fss_extended_list_open) { f_string_length stop_point = location->start - 1; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; while (location->start < buffer->used && location->start <= location->stop) { - if (buffer->string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(*buffer, *location)) == F_true) { + if (buffer->string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(*buffer, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while @@ -152,7 +152,7 @@ extern "C" { found->stop = stop_point; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object; @@ -161,19 +161,19 @@ extern "C" { continue; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while // seek to the end of the line when no valid object is found. while (location->start < buffer->used && location->start <= location->stop && buffer->string[location->start] != f_string_eol[0]) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; } // while fl_macro_fss_object_return_on_overflow((*buffer), (*location), (*found), delimits, F_data_not_eos, F_data_not_stop) - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) return status; return FL_fss_found_object_not; @@ -259,7 +259,7 @@ extern "C" { f_string_length slash_count = 1; position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -276,7 +276,7 @@ extern "C" { slash_count++; } - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -322,7 +322,7 @@ extern "C" { break; } - if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_false) { + if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = f_fss_is_space(*buffer, *location)) == F_false) { break; } @@ -335,7 +335,7 @@ extern "C" { } position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -451,7 +451,7 @@ extern "C" { f_string_length before_list_open = position_previous; position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -466,7 +466,7 @@ extern "C" { break; } - if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_false) { + if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = f_fss_is_space(*buffer, *location)) == F_false) { break; } @@ -479,7 +479,7 @@ extern "C" { } position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -543,7 +543,7 @@ extern "C" { } position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -564,7 +564,7 @@ extern "C" { else if (buffer->string[location->start] == f_fss_extended_list_close) { while (location->start < buffer->used && location->start <= location->stop) { position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -577,7 +577,7 @@ extern "C" { break; } - if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = fl_fss_is_space(*buffer, *location)) == F_false) { + if (buffer->string[location->start] != f_fss_delimit_placeholder && (status = f_fss_is_space(*buffer, *location)) == F_false) { break; } @@ -658,7 +658,7 @@ extern "C" { line_start = location->start + 1; if (depth == 0) { - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -689,7 +689,7 @@ extern "C" { } position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -709,7 +709,7 @@ extern "C" { } else if (buffer->string[location->start] != f_string_eol[0]) { position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -726,7 +726,7 @@ extern "C" { } position_previous = location->start; - status = fl_fss_increment_buffer(*buffer, location, 1); + status = f_fss_increment_buffer(*buffer, location, 1); if (F_status_is_error(status)) { f_macro_string_lengths_delete_simple(delimits); f_macro_string_lengths_delete_simple(positions_start); @@ -789,7 +789,7 @@ extern "C" { // comments are not allowed and this format has no way of "wrapping" a comment. return F_status_set_error(FL_fss_found_comment); } - else if ((status = fl_fss_is_graph(object, *location)) == F_true) { + else if ((status = f_fss_is_graph(object, *location)) == F_true) { break; } else if (F_status_is_error(status)) { @@ -801,7 +801,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; } // while @@ -812,12 +812,12 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < object.used) { if (object.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; continue; @@ -828,7 +828,7 @@ extern "C" { buffer->string[buffer_position.stop] = object.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; slash_count++; @@ -862,7 +862,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(object, location, 1); + status = f_fss_increment_buffer(object, location, 1); if (F_status_is_error(status)) return status; } // while @@ -919,12 +919,12 @@ extern "C" { buffer_position.stop++; has_graph = F_true; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; while (location->start <= location->stop && location->start < content.used) { if (content.string[location->start] == f_fss_delimit_placeholder) { - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; continue; @@ -936,7 +936,7 @@ extern "C" { buffer->string[buffer_position.stop] = content.string[location->start]; buffer_position.stop++; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; slash_count++; @@ -945,17 +945,17 @@ extern "C" { if (content.string[location->start] == f_fss_extended_list_open) { f_string_length start = location->start; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(content, *location)) == F_true) { + if (content.string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(content, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; } // while @@ -990,17 +990,17 @@ extern "C" { has_graph = F_true; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; while (location->start < content.used && location->start <= location->stop) { - if (content.string[location->start] == f_string_eol[0] || (status = fl_fss_is_graph(content, *location)) == F_true) { + if (content.string[location->start] == f_string_eol[0] || (status = f_fss_is_graph(content, *location)) == F_true) { break; } if (F_status_is_error(status)) return status; - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; } // while @@ -1031,7 +1031,7 @@ extern "C" { has_graph = F_false; is_comment = F_false; } - else if ((status = fl_fss_is_graph(content, *location)) == F_true) { + else if ((status = f_fss_is_graph(content, *location)) == F_true) { has_graph = F_true; } else if (F_status_is_error(status)) { @@ -1043,7 +1043,7 @@ extern "C" { buffer_position.stop++; } - status = fl_fss_increment_buffer(content, location, 1); + status = f_fss_increment_buffer(content, location, 1); if (F_status_is_error(status)) return status; } // while diff --git a/level_1/fl_fss/c/fss_extended_list.h b/level_1/fl_fss/c/fss_extended_list.h index cd3708d..d0e58f1 100644 --- a/level_1/fl_fss/c/fss_extended_list.h +++ b/level_1/fl_fss/c/fss_extended_list.h @@ -65,10 +65,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_list_object_read_ extern f_return_status fl_fss_extended_list_object_read(f_string_dynamic *buffer, f_string_range *location, f_fss_object *found); @@ -111,10 +111,10 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). - * Errors from (with error bit): fl_fss_is_graph(). - * Errors from (with error bit): fl_fss_is_space(). - * Errors from (with error bit): fl_fss_skip_past_space(). + * Errors from (with error bit): f_fss_increment_buffer(). + * Errors from (with error bit): f_fss_is_graph(). + * Errors from (with error bit): f_fss_is_space(). + * Errors from (with error bit): f_fss_skip_past_space(). */ #ifndef _di_fl_fss_extended_list_content_read_ extern f_return_status fl_fss_extended_list_content_read(f_string_dynamic *buffer, f_string_range *location, f_fss_nest *found); @@ -146,7 +146,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_extended_list_object_write_ extern f_return_status fl_fss_extended_list_object_write(const f_string_static object, f_string_range *location, f_string_dynamic *buffer); @@ -177,7 +177,7 @@ extern "C" { * F_parameter (with error bit) if a parameter is invalid. * F_utf (with error bit) is returned on failure to read/process a UTF-8 character. * - * Errors from (with error bit): fl_fss_increment_buffer(). + * Errors from (with error bit): f_fss_increment_buffer(). */ #ifndef _di_fl_fss_extended_list_content_write_ extern f_return_status fl_fss_extended_list_content_write(const f_string_static content, f_string_range *location, f_string_dynamic *buffer); diff --git a/level_1/fl_fss/c/private-fss.c b/level_1/fl_fss/c/private-fss.c new file mode 100644 index 0000000..51f1863 --- /dev/null +++ b/level_1/fl_fss/c/private-fss.c @@ -0,0 +1,136 @@ +#include +#include "private-fss.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_fl_fss_identify_) || !defined(_di_fl_fss_identify_file_) + f_return_status private_fl_fss_identify(const f_string_static buffer, f_fss_header *header) { + register f_string_length i = 0; + + if (buffer.used < 10) { + // "# fss-0000" is always at least 10 characters. + return FL_fss_header_not; + } + + // If this correctly follows the FSS specification, then this should be all that needs to be done (as well as atoh for ascii to hex). + // All characters used in the identifier are only in the ascii equivalents of the characters, any similarly looking character or number representing in UTF-8 is considered invalid. + if (buffer.string[i] == f_fss_type_header_open) { + i++; + + if (buffer.string[i] == f_fss_type_header_part1) { + i++; + + if (buffer.string[i] == f_fss_type_header_part2) { + i++; + + if (buffer.string[i] == f_fss_type_header_part3) { + i++; + + if (buffer.string[i] == f_fss_type_header_part4) { + i++; + + if (buffer.string[i] == f_fss_type_header_part5) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + f_string_range range = f_string_range_initialize; + + range.start = i - 4; + range.stop = i; + + // 1: A possibly valid header type was found, now convert it into its proper format and save the header type. + const f_status status = f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); + if (F_status_is_error(status)) return status; + + if (status == F_none) { + // 2: At this point, we can still know the proper format for the file and still have a invalid header, handle accordingly. + if (buffer.string[i] == f_fss_type_header_close) { + header->length = i + 1; + + return F_none; + } + else { + // if "# fss-0000" is there, regardless of whats next, we can guess this to be of fss-0000, even if its fss-00001 (this is a guess afterall). + header->length = i + 1; + + return F_status_is_warning(FL_fss_accepted_invalid); + } + } + } + } + } + } + } + } + } + } + } + // people can miss spaces, so lets accept in an attempt to interpret the file anyway, but return values at this point are to be flagged as invalid. + else if (buffer.string[i] == f_fss_type_header_part2) { + i++; + + if (buffer.string[i] == f_fss_type_header_part3) { + i++; + + if (buffer.string[i] == f_fss_type_header_part4) { + i++; + + if (buffer.string[i] == f_fss_type_header_part5) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + if (f_conversion_character_is_hexidecimal(buffer.string[i]) == F_true) { + i++; + + f_string_range range = f_string_range_initialize; + + range.start = i - 4; + range.stop = i; + + const f_status status = f_conversion_string_to_hexidecimal_unsigned(buffer.string, &header->type, range); + if (F_status_is_error(status)) return status; + + header->length = i + 1; + + return F_status_is_warning(FL_fss_accepted_invalid); + } + } + } + } + } + } + } + } + } + + // @todo At some point add checksum and compressions checks here, but the above statements will have to be adjusted accordingly. + // 3: eventually this will be processing the checksum and 4: will be processing the compression. + + return FL_fss_header_not; + } +#endif // !defined(_di_fl_fss_identify_) || !defined(_di_fl_fss_identify_file_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_1/fl_fss/c/private-fss.h b/level_1/fl_fss/c/private-fss.h new file mode 100644 index 0000000..f81be10 --- /dev/null +++ b/level_1/fl_fss/c/private-fss.h @@ -0,0 +1,47 @@ +/** + * FLL - Level 1 + * + * Project: FSS + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * These are provided for internal reduction in redundant code. + * These should not be exposed/used outside of this project. + */ +#ifndef _PRIVATE_FL_fss_h +#define _PRIVATE_FL_fss_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Private implementation of fl_fss_identify(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param buffer + * The string to process. + * @param header + * The header data to populate with results of this function. + * + * @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 from (with error bit): f_conversion_string_to_hexidecimal_unsigned(). + * + * @see fl_fss_identify() + * @see fl_fss_identify_file() + */ +#if !defined(_di_fl_fss_identify_) || !defined(_di_fl_fss_identify_file_) + extern f_return_status private_fl_fss_identify(const f_string_static buffer, f_fss_header *header) f_gcc_attribute_visibility_internal; +#endif // !defined(_di_fl_fss_identify_) || !defined(_di_fl_fss_identify_file_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_FL_fss_h diff --git a/level_1/fl_fss/data/build/dependencies b/level_1/fl_fss/data/build/dependencies index 65666d6..30ef68e 100644 --- a/level_1/fl_fss/data/build/dependencies +++ b/level_1/fl_fss/data/build/dependencies @@ -2,7 +2,7 @@ f_type f_status f_memory f_string +f_utf f_conversion f_file f_fss -f_utf diff --git a/level_1/fl_fss/data/build/settings b/level_1/fl_fss/data/build/settings index c1d01b1..8e3ab21 100644 --- a/level_1/fl_fss/data/build/settings +++ b/level_1/fl_fss/data/build/settings @@ -19,8 +19,8 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lf_file -lf_conversion -lf_utf -lf_memory -build_sources_library fss.c fss_basic.c fss_basic_list.c fss_extended.c fss_extended_list.c +build_libraries-individual -lf_fss -lf_file -lf_conversion -lf_utf -lf_memory +build_sources_library fss.c private-fss.c fss_basic.c fss_basic_list.c fss_extended.c fss_extended_list.c build_sources_program build_sources_headers fss.h fss_basic.h fss_basic_list.h fss_extended.h fss_extended_list.h fss_macro.h fss_status.h build_sources_script diff --git a/level_2/fll_fss/data/build/settings b/level_2/fll_fss/data/build/settings index 7a215eb..a8cfaf5 100644 --- a/level_2/fll_fss/data/build/settings +++ b/level_2/fll_fss/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfl_string -lfl_status -lfl_fss -lf_file -lf_conversion -lf_utf -lf_memory +build_libraries-individual -lfl_string -lfl_status -lfl_fss -lf_file -lf_fss -lf_conversion -lf_utf -lf_memory build_sources_library fss.c fss_basic.c fss_basic_list.c fss_extended.c fss_extended_list.c fss_status.c build_sources_program build_sources_headers fss.h fss_basic.h fss_basic_list.h fss_extended.h fss_extended_list.h fss_status.h diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index e616b6d..090e911 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_execute -lfll_fss -lfl_utf -lfl_string -lfl_status -lfl_fss -lfl_directory -lfl_console -lfl_color -lf_print -lf_path -lf_file -lf_environment -lf_directory -lf_conversion -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_execute -lfll_fss -lfl_utf -lfl_string -lfl_status -lfl_fss -lfl_directory -lfl_console -lfl_color -lf_print -lf_path -lf_file -lf_fss -lf_environment -lf_directory -lf_conversion -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fake.c private-fake.c private-clean.c private-build.c private-make.c private-print.c private-skeleton.c diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 131be72..4fe7316 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_path -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_execute -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_path -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library firewall.c private-firewall.c diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index 42fc337..18b8913 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_list_read.c private-fss_basic_list_read.c diff --git a/level_3/fss_basic_list_write/data/build/settings b/level_3/fss_basic_list_write/data/build/settings index e8819b3..d1a5406 100644 --- a/level_3/fss_basic_list_write/data/build/settings +++ b/level_3/fss_basic_list_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_list_write.c diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index f9c2dc0..19061df 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_read.c private-fss_basic_read.c diff --git a/level_3/fss_basic_write/data/build/settings b/level_3/fss_basic_write/data/build/settings index 5d51be6..b64b0fa 100644 --- a/level_3/fss_basic_write/data/build/settings +++ b/level_3/fss_basic_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_basic_write.c diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index 01a177a..a6a1003 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_list_read.c private-fss_extended_list_read.c diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 75e56dd..0139814 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_print -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_read.c private-fss_extended_read.c diff --git a/level_3/fss_extended_write/data/build/settings b/level_3/fss_extended_write/data/build/settings index a80fd49..c30b05f 100644 --- a/level_3/fss_extended_write/data/build/settings +++ b/level_3/fss_extended_write/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_extended_write.c diff --git a/level_3/fss_status_code/data/build/settings b/level_3/fss_status_code/data/build/settings index afe80a6..ee1b6f4 100644 --- a/level_3/fss_status_code/data/build/settings +++ b/level_3/fss_status_code/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_status -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_utf -lfl_string -lfl_status -lfl_fss -lfl_console -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_conversion -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_status -lfll_program -lfll_fss -lfll_file -lfll_execute -lf_path -lfl_utf -lfl_string -lfl_status -lfl_fss -lfl_console -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_conversion -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library fss_status_code.c private-fss_status_code.c diff --git a/level_3/init/data/build/settings b/level_3/init/data/build/settings index e6a6cdd..aa92144 100644 --- a/level_3/init/data/build/settings +++ b/level_3/init/data/build/settings @@ -19,7 +19,7 @@ build_compiler gcc build_language c build_linker ar build_libraries -lc -build_libraries-individual -lfll_program -lfll_fss -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory +build_libraries-individual -lfll_program -lfll_fss -lfll_execute -lf_path -lfl_string -lfl_status -lfl_fss -lfl_console -lf_conversion -lfl_color -lf_print -lf_pipe -lf_fss -lf_file -lf_environment -lf_directory -lf_console -lf_utf -lf_memory build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll build_sources_library init.c private-init.c