From: Kevin Day Date: Mon, 22 Jun 2020 03:01:52 +0000 (-0500) Subject: Feature: add fl_iki project. X-Git-Tag: 0.5.0~140 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=7bef03dc98479d2d2db00c43d297ab23fb4c7348;p=fll Feature: add fl_iki project. This provides fl_iki_read, a function for identifying all iki within a given range. Whereas the f_iki_read function will only identify the first valid iki variable found within the given range. --- diff --git a/level_1/fl_iki/c/iki.c b/level_1/fl_iki/c/iki.c new file mode 100644 index 0000000..c9c4ea4 --- /dev/null +++ b/level_1/fl_iki/c/iki.c @@ -0,0 +1,30 @@ +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _di_fl_iki_read_ + f_return_status fl_iki_read(f_string_static *buffer, f_string_range *range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content) { + f_status status = F_none; + + for (;;) { + status = f_iki_read(buffer, range, variable, vocabulary, content); + if (F_status_is_error(status)) return status; + + if (status == F_data_not_eos || status == F_data_not_stop) { + return status; + } + + if (status == F_none_eos || status == F_none_stop) { + return status; + } + } // for + + return F_none; + } +#endif // _di_fl_iki_read_ + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_1/fl_iki/c/iki.h b/level_1/fl_iki/c/iki.h new file mode 100644 index 0000000..e4937ee --- /dev/null +++ b/level_1/fl_iki/c/iki.h @@ -0,0 +1,70 @@ +/** + * FLL - Level 1 + * + * Project: Iki + * API Version: 0.5 + * Licenses: lgplv2.1 + * + * Provides a Wiki-Like syntax meant to be much simpler. + * + * This simpler Wiki-Like syntax, called Iki, focuses just on simply adding context. + * The context itself is not explicitly defined but a few common standards are provided. + */ +#ifndef _FL_iki_h +#define _FL_iki_h + +// libc includes +#include +#include + +// fll-0 includes +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Read all iki Vocabulary and Content in the given range of the given buffer. + * + * This does not verify if any vocabulary name is known. + * This only finds complete vocabulary names and their respective content. + * + * @param buffer + * The string to process. + * @param range + * The start/stop location within the buffer to be processed. + * The start location will be updated as the buffer is being processed. + * The start location will represent where the read stopped on return. + * A start location past the stop location or buffer used means that the entire range was processed. + * @param variable + * The entire vocabulary name, content, and syntax. + * @param vocabulary + * The vocabulary name list to store the found vocabulary names. + * @param content + * The content list to store the content associated with the found vocabulary names. + * + * @return + * F_none on success and an IKI vocabulary name was found. + * F_none_stop on success and an IKI vocabulary name was found and stop point was reached. + * F_none_eos on success and an IKI vocabulary name was found and end of string was reached. + * F_data_not_eos on success and EOS was reached, but there were no IKI vocabularie names found. + * F_data_not_stop on success and stop point was reached, but there were no IKI vocabularie names found. + * F_memory_reallocation (with error bit) on memory reallocation error. + * F_parameter (with error bit) if a parameter is invalid. + * F_string_too_large (with error bit) if a string length is too large to store in the buffer. + */ +#ifndef _di_fl_iki_read_ + extern f_return_status fl_iki_read(f_string_static *buffer, f_string_range *range, f_iki_variable *variable, f_iki_vocabulary *vocabulary, f_iki_content *content); +#endif // _di_fl_iki_read_ + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _FL_iki_h diff --git a/level_1/fl_iki/data/build/defines b/level_1/fl_iki/data/build/defines new file mode 100644 index 0000000..c665317 --- /dev/null +++ b/level_1/fl_iki/data/build/defines @@ -0,0 +1,2 @@ +# fss-0000 + diff --git a/level_1/fl_iki/data/build/dependencies b/level_1/fl_iki/data/build/dependencies new file mode 100644 index 0000000..7fa938f --- /dev/null +++ b/level_1/fl_iki/data/build/dependencies @@ -0,0 +1,6 @@ +f_type +f_status +f_memory +f_string +f_utf +f_iki diff --git a/level_1/fl_iki/data/build/settings b/level_1/fl_iki/data/build/settings new file mode 100644 index 0000000..f909138 --- /dev/null +++ b/level_1/fl_iki/data/build/settings @@ -0,0 +1,52 @@ +# fss-0001 + +project_name fl_iki + +version_major 0 +version_minor 5 +version_micro 0 +version_target major + +environment + +process_pre +process_post + +modes individual +modes_default individual + +build_compiler gcc +build_language c +build_linker ar +build_libraries -lc +build_libraries-individual -lf_iki -lf_utf -lf_memory +build_sources_library iki.c +build_sources_program +build_sources_headers iki.h +build_sources_script +build_sources_setting +build_script yes +build_shared yes +build_static yes + +path_headers level_0 +path_library_script script +path_library_shared shared +path_library_static static +path_program_script script +path_program_shared shared +path_program_static static + +search_exclusive yes +search_shared yes +search_static yes + +defines_all +defines_static +defines_shared + +flags_all -z now -g +flags_shared +flags_static +flags_library -fPIC +flags_program -fPIE