From: Kevin Day Date: Sun, 4 Oct 2026 00:51:17 +0000 (-0500) Subject: Progress: Various changes and fixes. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=c71a8497157f7e0d2391240c5cdbc607d61f4a95;p=fll Progress: Various changes and fixes. I decided that I needed to expand the `f_fss_skip_past_space()` into `f_fss_skip_past_space_previous()` to expose the `previous` position variable to the caller. I must avoid breaking the **API**/**ABI**, so `f_fss_skip_past_space()` is not changed. This should simplify the embedded read functions. Fix documentation, adding "Must not be NULL." where it is missing. The man pages will need to be re-generated more than likely. Just copy the `f_fss_skip_past_space()` man page and update it manually for now. Add missing `_di_f_utf_is_zero_width_` check on `private_f_utf_character_is_joiner()`. --- diff --git a/build/disable/level_0/f_fss.h b/build/disable/level_0/f_fss.h index 85066c34a..287ed0578 100644 --- a/build/disable/level_0/f_fss.h +++ b/build/disable/level_0/f_fss.h @@ -102,6 +102,7 @@ #define _di_f_fss_skip_past_combining_ #define _di_f_fss_skip_past_delimit_ #define _di_f_fss_skip_past_space_ +#define _di_f_fss_skip_past_space_previous_ #define _di_f_fss_state_flag_e_ #define _di_f_fss_status_code_e_ #define _di_f_fss_type_s_ diff --git a/build/level_0/settings b/build/level_0/settings index 06355780e..15bd1d9a8 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -107,6 +107,7 @@ build_sources_library environment.c build_sources_library execute.c build_sources_library file.c private-file.c file/common.c file/stream.c build_sources_library fss.c fss/common.c fss/item.c fss/named.c fss/nest.c fss/payload.c fss/quote.c fss/set.c fss/set_quote.c fss/simple_packet.c +build_sources_library private-fss.c build_sources_library iki.c iki/common.c iki/data.c iki/eki.c private-iki.c iki/private-data.c iki/private-eki.c build_sources_library limit.c limit/set.c limit/value.c build_sources_library memory.c memory/array.c memory/arrays.c diff --git a/build/monolithic/settings b/build/monolithic/settings index 4438c0978..9fac4ba8d 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -129,6 +129,7 @@ build_sources_library level_0/environment.c build_sources_library level_0/execute.c build_sources_library level_0/file.c level_0/private-file.c level_0/file/common.c level_0/file/stream.c build_sources_library level_0/fss.c level_0/fss/common.c level_0/fss/item.c level_0/fss/named.c level_0/fss/nest.c level_0/fss/payload.c level_0/fss/quote.c level_0/fss/set.c level_0/fss/set_quote.c level_0/fss/simple_packet.c +build_sources_library level_0/private-fss.c build_sources_library level_0/iki.c level_0/iki/common.c level_0/iki/data.c level_0/iki/eki.c level_0/private-iki.c level_0/iki/private-data.c level_0/iki/private-eki.c build_sources_library level_0/limit.c level_0/limit/set.c level_0/limit/value.c build_sources_library level_0/memory.c level_0/memory/array.c level_0/memory/arrays.c diff --git a/build/stand_alone/fake.config.h b/build/stand_alone/fake.config.h index f7929b22f..4664af0e7 100644 --- a/build/stand_alone/fake.config.h +++ b/build/stand_alone/fake.config.h @@ -660,6 +660,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fake.settings b/build/stand_alone/fake.settings index 7a96f19da..b8f7f9678 100644 --- a/build/stand_alone/fake.settings +++ b/build/stand_alone/fake.settings @@ -54,6 +54,7 @@ build_sources_program fll/level_0/environment.c build_sources_program fll/level_0/execute.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/iki.c fll/level_0/private-iki.c fll/level_0/iki/common.c fll/level_0/iki/private-data.c fll/level_0/iki/private-eki.c fll/level_0/iki/data.c fll/level_0/iki/eki.c build_sources_program fll/level_0/limit.c fll/level_0/limit/set.c fll/level_0/limit/value.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c diff --git a/build/stand_alone/fss_identify.config.h b/build/stand_alone/fss_identify.config.h index c5ec66144..d67fb67b5 100644 --- a/build/stand_alone/fss_identify.config.h +++ b/build/stand_alone/fss_identify.config.h @@ -513,6 +513,7 @@ #define _di_f_fss_skip_past_combining_ #define _di_f_fss_skip_past_delimit_ #define _di_f_fss_skip_past_space_ +#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ #define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_identify.settings b/build/stand_alone/fss_identify.settings index eba85c76f..750257340 100644 --- a/build/stand_alone/fss_identify.settings +++ b/build/stand_alone/fss_identify.settings @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_read.config.fss_basic.h b/build/stand_alone/fss_read.config.fss_basic.h index c13faf7e4..a9277040b 100644 --- a/build/stand_alone/fss_read.config.fss_basic.h +++ b/build/stand_alone/fss_read.config.fss_basic.h @@ -570,6 +570,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_read.config.fss_basic_list.h b/build/stand_alone/fss_read.config.fss_basic_list.h index a9c09672b..bfcb03b39 100644 --- a/build/stand_alone/fss_read.config.fss_basic_list.h +++ b/build/stand_alone/fss_read.config.fss_basic_list.h @@ -570,6 +570,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_read.config.fss_embedded_list.h b/build/stand_alone/fss_read.config.fss_embedded_list.h index 76d4432d8..f961cdebe 100644 --- a/build/stand_alone/fss_read.config.fss_embedded_list.h +++ b/build/stand_alone/fss_read.config.fss_embedded_list.h @@ -570,6 +570,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_read.config.fss_extended.h b/build/stand_alone/fss_read.config.fss_extended.h index 4afaa2f39..20590656e 100644 --- a/build/stand_alone/fss_read.config.fss_extended.h +++ b/build/stand_alone/fss_read.config.fss_extended.h @@ -570,6 +570,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_read.config.fss_extended_list.h b/build/stand_alone/fss_read.config.fss_extended_list.h index f20d0b8a7..9275671f0 100644 --- a/build/stand_alone/fss_read.config.fss_extended_list.h +++ b/build/stand_alone/fss_read.config.fss_extended_list.h @@ -570,6 +570,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_read.config.fss_payload.h b/build/stand_alone/fss_read.config.fss_payload.h index fe4e52a70..7dd5fde10 100644 --- a/build/stand_alone/fss_read.config.fss_payload.h +++ b/build/stand_alone/fss_read.config.fss_payload.h @@ -570,6 +570,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_read.config.h b/build/stand_alone/fss_read.config.h index 454818307..da6dea24e 100644 --- a/build/stand_alone/fss_read.config.h +++ b/build/stand_alone/fss_read.config.h @@ -570,6 +570,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_read.settings b/build/stand_alone/fss_read.settings index d47ec96dc..8c46c6e78 100644 --- a/build/stand_alone/fss_read.settings +++ b/build/stand_alone/fss_read.settings @@ -48,6 +48,7 @@ build_sources_program fll/level_0/directory.c fll/level_0/directory/common.c fll build_sources_program fll/level_0/private-directory.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_read.settings.fss_basic b/build/stand_alone/fss_read.settings.fss_basic index f319bf0a3..cd72e0405 100644 --- a/build/stand_alone/fss_read.settings.fss_basic +++ b/build/stand_alone/fss_read.settings.fss_basic @@ -48,6 +48,7 @@ build_sources_program fll/level_0/directory.c fll/level_0/directory/common.c fll build_sources_program fll/level_0/private-directory.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_read.settings.fss_basic_list b/build/stand_alone/fss_read.settings.fss_basic_list index 4f465b594..c920d4187 100644 --- a/build/stand_alone/fss_read.settings.fss_basic_list +++ b/build/stand_alone/fss_read.settings.fss_basic_list @@ -48,6 +48,7 @@ build_sources_program fll/level_0/directory.c fll/level_0/directory/common.c fll build_sources_program fll/level_0/private-directory.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_read.settings.fss_embedded_list b/build/stand_alone/fss_read.settings.fss_embedded_list index 6c1af8f91..53d5da50c 100644 --- a/build/stand_alone/fss_read.settings.fss_embedded_list +++ b/build/stand_alone/fss_read.settings.fss_embedded_list @@ -48,6 +48,7 @@ build_sources_program fll/level_0/directory.c fll/level_0/directory/common.c fll build_sources_program fll/level_0/private-directory.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_read.settings.fss_extended b/build/stand_alone/fss_read.settings.fss_extended index 17eaa0501..a4d0c3645 100644 --- a/build/stand_alone/fss_read.settings.fss_extended +++ b/build/stand_alone/fss_read.settings.fss_extended @@ -48,6 +48,7 @@ build_sources_program fll/level_0/directory.c fll/level_0/directory/common.c fll build_sources_program fll/level_0/private-directory.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_read.settings.fss_extended_list b/build/stand_alone/fss_read.settings.fss_extended_list index 7d75d88f9..d62be4cdb 100644 --- a/build/stand_alone/fss_read.settings.fss_extended_list +++ b/build/stand_alone/fss_read.settings.fss_extended_list @@ -48,6 +48,7 @@ build_sources_program fll/level_0/directory.c fll/level_0/directory/common.c fll build_sources_program fll/level_0/private-directory.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_read.settings.fss_payload b/build/stand_alone/fss_read.settings.fss_payload index 002983a3f..c4eeba2ed 100644 --- a/build/stand_alone/fss_read.settings.fss_payload +++ b/build/stand_alone/fss_read.settings.fss_payload @@ -48,6 +48,7 @@ build_sources_program fll/level_0/directory.c fll/level_0/directory/common.c fll build_sources_program fll/level_0/private-directory.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_write.config.fss_basic.h b/build/stand_alone/fss_write.config.fss_basic.h index 8a08814bd..f5a8a965d 100644 --- a/build/stand_alone/fss_write.config.fss_basic.h +++ b/build/stand_alone/fss_write.config.fss_basic.h @@ -513,6 +513,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_write.config.fss_basic_list.h b/build/stand_alone/fss_write.config.fss_basic_list.h index dd8ca1d55..73b9f5104 100644 --- a/build/stand_alone/fss_write.config.fss_basic_list.h +++ b/build/stand_alone/fss_write.config.fss_basic_list.h @@ -513,6 +513,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_write.config.fss_embedded_list.h b/build/stand_alone/fss_write.config.fss_embedded_list.h index e75dcc953..db29a22a8 100644 --- a/build/stand_alone/fss_write.config.fss_embedded_list.h +++ b/build/stand_alone/fss_write.config.fss_embedded_list.h @@ -513,6 +513,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_write.config.fss_extended.h b/build/stand_alone/fss_write.config.fss_extended.h index 1df9742f3..101cb9b12 100644 --- a/build/stand_alone/fss_write.config.fss_extended.h +++ b/build/stand_alone/fss_write.config.fss_extended.h @@ -513,6 +513,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_write.config.fss_extended_list.h b/build/stand_alone/fss_write.config.fss_extended_list.h index 7115d1ab7..17e6eea91 100644 --- a/build/stand_alone/fss_write.config.fss_extended_list.h +++ b/build/stand_alone/fss_write.config.fss_extended_list.h @@ -513,6 +513,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_write.config.fss_payload.h b/build/stand_alone/fss_write.config.fss_payload.h index 8a0154dcd..d3499ca28 100644 --- a/build/stand_alone/fss_write.config.fss_payload.h +++ b/build/stand_alone/fss_write.config.fss_payload.h @@ -513,6 +513,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_write.config.h b/build/stand_alone/fss_write.config.h index 35818b99d..8421653ae 100644 --- a/build/stand_alone/fss_write.config.h +++ b/build/stand_alone/fss_write.config.h @@ -513,6 +513,7 @@ //#define _di_f_fss_skip_past_combining_ //#define _di_f_fss_skip_past_delimit_ //#define _di_f_fss_skip_past_space_ +//#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/fss_write.settings b/build/stand_alone/fss_write.settings index b46ec2d0c..11b94a9e4 100644 --- a/build/stand_alone/fss_write.settings +++ b/build/stand_alone/fss_write.settings @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_write.settings.fss_basic b/build/stand_alone/fss_write.settings.fss_basic index eb432d2b0..13c650c18 100644 --- a/build/stand_alone/fss_write.settings.fss_basic +++ b/build/stand_alone/fss_write.settings.fss_basic @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_write.settings.fss_basic_list b/build/stand_alone/fss_write.settings.fss_basic_list index 4670764cb..66ecdcf88 100644 --- a/build/stand_alone/fss_write.settings.fss_basic_list +++ b/build/stand_alone/fss_write.settings.fss_basic_list @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_write.settings.fss_embedded_list b/build/stand_alone/fss_write.settings.fss_embedded_list index 11b8cffcc..53fb614e5 100644 --- a/build/stand_alone/fss_write.settings.fss_embedded_list +++ b/build/stand_alone/fss_write.settings.fss_embedded_list @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_write.settings.fss_extended b/build/stand_alone/fss_write.settings.fss_extended index 8820bac5f..eb45958d3 100644 --- a/build/stand_alone/fss_write.settings.fss_extended +++ b/build/stand_alone/fss_write.settings.fss_extended @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_write.settings.fss_extended_list b/build/stand_alone/fss_write.settings.fss_extended_list index f4475097a..160f2e45f 100644 --- a/build/stand_alone/fss_write.settings.fss_extended_list +++ b/build/stand_alone/fss_write.settings.fss_extended_list @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/fss_write.settings.fss_payload b/build/stand_alone/fss_write.settings.fss_payload index 987472ad6..28305e052 100644 --- a/build/stand_alone/fss_write.settings.fss_payload +++ b/build/stand_alone/fss_write.settings.fss_payload @@ -46,6 +46,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/parse.c fll/level_0/parse/utf.c diff --git a/build/stand_alone/status_code.config.fss.h b/build/stand_alone/status_code.config.fss.h index 006894472..1c40e66dd 100644 --- a/build/stand_alone/status_code.config.fss.h +++ b/build/stand_alone/status_code.config.fss.h @@ -513,6 +513,7 @@ #define _di_f_fss_skip_past_combining_ #define _di_f_fss_skip_past_delimit_ #define _di_f_fss_skip_past_space_ +#define _di_f_fss_skip_past_space_previous_ //#define _di_f_fss_state_flag_e_ //#define _di_f_fss_status_code_e_ //#define _di_f_fss_type_s_ diff --git a/build/stand_alone/status_code.settings.fss b/build/stand_alone/status_code.settings.fss index affed562a..233f90ee1 100644 --- a/build/stand_alone/status_code.settings.fss +++ b/build/stand_alone/status_code.settings.fss @@ -45,6 +45,7 @@ build_sources_program fll/level_0/console.c fll/level_0/console/common.c fll/lev build_sources_program fll/level_0/conversion.c fll/level_0/private-conversion.c fll/level_0/conversion/common.c build_sources_program fll/level_0/file.c fll/level_0/private-file.c fll/level_0/file/common.c fll/level_0/file/stream.c build_sources_program fll/level_0/fss.c fll/level_0/fss/common.c fll/level_0/fss/item.c fll/level_0/fss/named.c fll/level_0/fss/nest.c fll/level_0/fss/payload.c fll/level_0/fss/quote.c fll/level_0/fss/set.c fll/level_0/fss/set_quote.c fll/level_0/fss/simple_packet.c +build_sources_program fll/level_0/private-fss.c build_sources_program fll/level_0/memory.c fll/level_0/memory/array.c fll/level_0/memory/arrays.c build_sources_program fll/level_0/private-memory.c fll/level_0/memory/private-array.c build_sources_program fll/level_0/pipe.c diff --git a/level_0/f_console/c/console.h b/level_0/f_console/c/console.h index 4c68ae324..a1f2570b2 100644 --- a/level_0/f_console/c/console.h +++ b/level_0/f_console/c/console.h @@ -162,6 +162,8 @@ extern "C" { * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not if argc is 0, argv is a NULL pointer, or if argv[0] is NULL. diff --git a/level_0/f_fss/c/fss.c b/level_0/f_fss/c/fss.c index f00cf385d..e7342db2a 100644 --- a/level_0/f_fss/c/fss.c +++ b/level_0/f_fss/c/fss.c @@ -1,4 +1,5 @@ #include "fss.h" +#include "private-fss.h" #ifdef __cplusplus extern "C" { @@ -647,177 +648,33 @@ extern "C" { return; } - // Skip past initial place holders. - for (;; ++range->start) { - - if (state->interrupt) { - state->interrupt((void *) state, 0); - if (F_status_set_fine(state->status) == F_interrupt) return; - } - - if (range->start >= buffer.used) { - state->status = F_okay_eos; - - return; - } - - if (range->start > range->stop) { - state->status = F_okay_stop; - - return; - } - - if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) break; - } // for - f_number_unsigned_t previous = range->start; - if (macro_f_utf_byte_width_is(buffer.string[range->start])) { - if (range->start + macro_f_utf_byte_width(buffer.string[range->start]) > buffer.used) { - state->status = F_status_set_error(F_complete_not_utf_eos); - - f_fss_fail_utf(state); - - return; - } + private_f_fss_skip_past_space_previous(buffer, range, state, &previous); + } +#endif // _di_f_fss_skip_past_space_ - if (range->start + (macro_f_utf_byte_width(buffer.string[range->start]) - 1) > range->stop) { - state->status = F_status_set_error(F_complete_not_utf_stop); +#ifndef _di_f_fss_skip_past_space_previous_ + void f_fss_skip_past_space_previous(const f_string_static_t buffer, f_range_t * const range, f_state_t * const state, f_number_unsigned_t * const previous) { + #ifndef _di_level_0_parameter_checking_ + if (!state) return; - f_fss_fail_utf(state); + if (!range || !previous) { + state->status = F_status_set_error(F_parameter); return; } - } - - // Check that the first character is not a combining character or a joiner character. - state->status = f_utf_is_combining_joiner( - buffer.string + previous, - (range->stop - previous) + 1 > buffer.used - previous - ? buffer.used - previous - : (range->stop - previous) + 1 - ); - - f_fss_fail_utf_to_false(state); - - if (F_status_is_error(state->status)) return; + #endif // _di_level_0_parameter_checking_ - if (state->status == F_true) { - state->status = F_status_set_error(F_complete_not_utf_start); + if (!buffer.used || range->start > range->stop || range->start >= buffer.used) { + state->status = F_data_not; return; } - for (;;) { - - if (state->interrupt) { - state->interrupt((void *) state, 0); - if (F_status_set_fine(state->status) == F_interrupt) return; - } - - if (range->start >= buffer.used) { - state->status = F_okay_eos; - - return; - } - - if (range->start > range->stop) { - state->status = F_okay_stop; - - return; - } - - if (buffer.string[range->start] == f_fss_eol_s.string[0]) { - state->status = F_okay_eol; - - return; - } - - if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { - ++range->start; - - continue; - } - - state->status = f_utf_is_whitespace( - buffer.string + range->start, - (range->stop - range->start) + 1 > buffer.used - range->start - ? buffer.used - range->start - : (range->stop - range->start) + 1, - F_false - ); - - f_fss_fail_utf_to_false(state); - - if (state->status == F_false) { - state->status = f_utf_is_combining_joiner( - buffer.string + range->start, - (range->stop - range->start) + 1 > buffer.used - range->start - ? buffer.used - range->start - : (range->stop - range->start) + 1 - ); - - f_fss_fail_utf_to_false(state); - - // This is combining, so any previous white space is no longer considered white space as such. - if (state->status == F_true) { - range->start = previous; - - break; - } - - if (state->status == F_false) { - state->status = f_utf_is_control( - buffer.string + range->start, - (range->stop - range->start) + 1 > buffer.used - range->start - ? buffer.used - range->start - : (range->stop - range->start) + 1 - ); - - f_fss_fail_utf_to_false(state); - - if (state->status == F_false) { - state->status = f_utf_is_zero_width( - buffer.string + range->start, - (range->stop - range->start) + 1 > buffer.used - range->start - ? buffer.used - range->start - : (range->stop - range->start) + 1 - ); - - f_fss_fail_utf_to_false(state); - if (state->status == F_false) break; - } - } - } - - if (F_status_is_error(state->status)) return; - - previous = range->start; - - if (macro_f_utf_byte_width_is(buffer.string[previous])) { - if (previous + macro_f_utf_byte_width(buffer.string[previous]) >= buffer.used) { - state->status = F_status_set_error(F_complete_not_utf_eos); - - f_fss_fail_utf(state); - - return; - } - - if (previous + macro_f_utf_byte_width(buffer.string[previous]) > range->stop) { - state->status = F_status_set_error(F_complete_not_utf_stop); - - f_fss_fail_utf(state); - - return; - } - } - - range->start += macro_f_utf_byte_width(buffer.string[previous]); - } // for - - state->status = F_okay; + private_f_fss_skip_past_space_previous(buffer, range, state, previous); } -#endif // _di_f_fss_skip_past_space_ +#endif // _di_f_fss_skip_past_space_previous_ #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_fss/c/fss.h b/level_0/f_fss/c/fss.h index 4e52900c4..3fb6010d3 100644 --- a/level_0/f_fss/c/fss.h +++ b/level_0/f_fss/c/fss.h @@ -45,9 +45,13 @@ extern "C" { * An array of locations containing the delimits to apply within the buffer. * @param buffer * The string to process. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not on success but buffer.used is 0. @@ -70,9 +74,13 @@ extern "C" { * The range in which to restrict which delimits to apply. * @param buffer * The string to process. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not on success but buffer.used is 0. @@ -99,9 +107,13 @@ extern "C" { * The total lines found leading up to but not including before. * This value is not reset and only additions are performed. * When F_data_not is returned, this value is not altered. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not on success but buffer.used is 0 (line is set to 0). @@ -128,9 +140,13 @@ extern "C" { * The total lines found leading up to but not including before. * This value is not reset and only additions are performed. * When F_data_not is returned, this value is not altered. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not on success but the range.start is greater than buffer.used or buffer.used is 0 (line is set to 0). @@ -153,6 +169,8 @@ extern "C" { * - F_utf_fragment * - F_utf_not * + * Must not be NULL. + * * @param state * A state for providing flags and handling interrupts during long running operations. * @@ -174,6 +192,8 @@ extern "C" { * - F_utf_fragment * - F_utf_not * + * Must not be NULL. + * * @param state * A state for providing flags and handling interrupts during long running operations. * @@ -203,6 +223,8 @@ extern "C" { * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_combarudoo character in the buffer is a combining character (future versions will provide a more accurate status, like F_combine). * F_data_not on success but nothing is processed. @@ -243,6 +265,8 @@ extern "C" { * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_bound character in the buffer is a joiner character (future versions will provide a more accurate status, like F_join). * F_combarudoo character in the buffer is a combining character (future versions will provide a more accurate status, like F_combine). @@ -279,6 +303,8 @@ extern "C" { * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_data_not on success but nothing is processed. * F_false if the character in the buffer is not a graph character. @@ -319,6 +345,8 @@ extern "C" { * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_bound character in the buffer is a joiner character (future versions will provide a more accurate status, like F_join). * F_data_not on success but nothing is processed. @@ -352,6 +380,8 @@ extern "C" { * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_data_not on success but nothing is processed. * F_false if the character in the buffer is not a space character. @@ -395,6 +425,8 @@ extern "C" { * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_data_not on success but nothing is processed. * F_false if the character in the buffer is not a zero-width character. @@ -429,9 +461,13 @@ extern "C" { * @param range * The start and stop positions in the buffer being processed. * This increments range->start. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not on success but buffer.used is 0, initial range.start is greater than range.stop, or initial range.start is greater than or equal to buffer.used. @@ -459,9 +495,13 @@ extern "C" { * @param range * The start and stop positions in the buffer being processed. * This increments range->start. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success and last skipped (if any) character is neither a combining character nor a joiner character. * F_bound on success and last skipped character is a joiner character (future versions will provide a more accurate status, like F_join). @@ -493,9 +533,13 @@ extern "C" { * @param range * The start and stop positions in the buffer being processed. * This increments range->start. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not on success but buffer.used is 0, initial range.start is greater than range.stop, or initial range.start is greater than or equal to buffer.used. @@ -528,9 +572,13 @@ extern "C" { * @param range * The start and stop positions in the buffer being processed. * This increments range->start. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_data_not on success but buffer.used is 0, initial range.start is greater than range.stop, or initial range.start is greater than or equal to buffer.used. @@ -558,6 +606,65 @@ extern "C" { extern void f_fss_skip_past_space(const f_string_static_t buffer, f_range_t * const range, f_state_t * const state); #endif // _di_f_fss_skip_past_space_ +/** + * Skip past all white space, control characters, and zero-width characters, except newline '\n' (U+000A), exposing the previous position to the caller. + * + * If the first character in the given range is a combining character, then this will not skip past anything. + * This is because combining characters apply from right to left. + * The caller should check the return status and handle accordingly in this situation. + * + * White space is checked for combining characters after the white space. + * If there is a combining character after, then the white space is not consider as such. + * + * This skips past place holders. + * + * This stops on end of line. + * + * This does not initializes previous. + * This is left to the caller. + * + * @param buffer + * The string to process. + * @param range + * The start and stop positions in the buffer being processed. + * This increments range->start. + * @param state + * A state for providing flags and handling interrupts during long running operations. + * + * Must not be NULL. + * + * This alters state.status: + * F_okay on success. + * F_data_not on success but buffer.used is 0, initial range.start is greater than range.stop, or initial range.start is greater than or equal to buffer.used. + * F_okay_eol on success and EOL was reached. + * F_okay_eos on success and EOS was reached. + * F_okay_stop on success and stop point was reached. + * + * F_complete_not_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS. + * F_complete_not_utf_start (with error bit) if the first character is a combining or a joiner character. + * F_complete_not_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. + * F_interrupt (with error bit) if stopping due to an interrupt. + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_utf_is_combining_joiner(). + * Errors (with error bit) from: f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_zero_width(). + * + * @param previous + * The previous position before + * + * Must not be NULL. + * + * @see f_utf_is_combining_joiner() + * @see f_utf_is_control() + * @see f_utf_is_whitespace() + * @see f_utf_is_zero_width() + */ +#ifndef _di_f_fss_skip_past_space_previous_ + extern void f_fss_skip_past_space_previous(const f_string_static_t buffer, f_range_t * const range, f_state_t * const state, f_number_unsigned_t * const previous); +#endif // _di_f_fss_skip_past_space_previous_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_0/f_fss/c/private-fss.c b/level_0/f_fss/c/private-fss.c new file mode 100644 index 000000000..bc326fceb --- /dev/null +++ b/level_0/f_fss/c/private-fss.c @@ -0,0 +1,183 @@ +#include "fss.h" +#include "private-fss.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_f_fss_skip_past_space_) || !defined(_di_f_fss_skip_past_space_previous_) + void private_f_fss_skip_past_space_previous(const f_string_static_t buffer, f_range_t * const range, f_state_t * const state, f_number_unsigned_t * const previous) { + + // Skip past initial place holders. + for (;; ++range->start) { + + if (state->interrupt) { + state->interrupt((void *) state, 0); + if (F_status_set_fine(state->status) == F_interrupt) return; + } + + if (range->start >= buffer.used) { + state->status = F_okay_eos; + + return; + } + + if (range->start > range->stop) { + state->status = F_okay_stop; + + return; + } + + if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) break; + } // for + + if (macro_f_utf_byte_width_is(buffer.string[range->start])) { + if (range->start + macro_f_utf_byte_width(buffer.string[range->start]) > buffer.used) { + state->status = F_status_set_error(F_complete_not_utf_eos); + + f_fss_fail_utf(state); + + return; + } + + if (range->start + (macro_f_utf_byte_width(buffer.string[range->start]) - 1) > range->stop) { + state->status = F_status_set_error(F_complete_not_utf_stop); + + f_fss_fail_utf(state); + + return; + } + } + + // Check that the first character is not a combining character or a joiner character. + state->status = f_utf_is_combining_joiner( + buffer.string + *previous, + (range->stop - *previous) + 1 > buffer.used - *previous + ? buffer.used - *previous + : (range->stop - *previous) + 1 + ); + + f_fss_fail_utf_to_false(state); + + if (F_status_is_error(state->status)) return; + + if (state->status == F_true) { + state->status = F_status_set_error(F_complete_not_utf_start); + + return; + } + + for (;;) { + + if (state->interrupt) { + state->interrupt((void *) state, 0); + if (F_status_set_fine(state->status) == F_interrupt) return; + } + + if (range->start >= buffer.used) { + state->status = F_okay_eos; + + return; + } + + if (range->start > range->stop) { + state->status = F_okay_stop; + + return; + } + + if (buffer.string[range->start] == f_fss_eol_s.string[0]) { + state->status = F_okay_eol; + + return; + } + + if (buffer.string[range->start] == f_fss_placeholder_s.string[0]) { + ++range->start; + + continue; + } + + state->status = f_utf_is_whitespace( + buffer.string + range->start, + (range->stop - range->start) + 1 > buffer.used - range->start + ? buffer.used - range->start + : (range->stop - range->start) + 1, + F_false + ); + + f_fss_fail_utf_to_false(state); + + if (state->status == F_false) { + state->status = f_utf_is_combining_joiner( + buffer.string + range->start, + (range->stop - range->start) + 1 > buffer.used - range->start + ? buffer.used - range->start + : (range->stop - range->start) + 1 + ); + + f_fss_fail_utf_to_false(state); + + // This is combining, so any previous white space is no longer considered white space as such. + if (state->status == F_true) { + range->start = *previous; + + break; + } + + if (state->status == F_false) { + state->status = f_utf_is_control( + buffer.string + range->start, + (range->stop - range->start) + 1 > buffer.used - range->start + ? buffer.used - range->start + : (range->stop - range->start) + 1 + ); + + f_fss_fail_utf_to_false(state); + + if (state->status == F_false) { + state->status = f_utf_is_zero_width( + buffer.string + range->start, + (range->stop - range->start) + 1 > buffer.used - range->start + ? buffer.used - range->start + : (range->stop - range->start) + 1 + ); + + f_fss_fail_utf_to_false(state); + if (state->status == F_false) break; + } + } + } + + if (F_status_is_error(state->status)) return; + + *previous = range->start; + + if (macro_f_utf_byte_width_is(buffer.string[*previous])) { + if (*previous + macro_f_utf_byte_width(buffer.string[*previous]) >= buffer.used) { + state->status = F_status_set_error(F_complete_not_utf_eos); + + f_fss_fail_utf(state); + + return; + } + + if (*previous + macro_f_utf_byte_width(buffer.string[*previous]) > range->stop) { + state->status = F_status_set_error(F_complete_not_utf_stop); + + f_fss_fail_utf(state); + + return; + } + } + + range->start += macro_f_utf_byte_width(buffer.string[*previous]); + } // for + + state->status = F_okay; + } +#endif // !defined(_di_f_fss_skip_past_space_) || !defined(_di_f_fss_skip_past_space_previous_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_fss/c/private-fss.h b/level_0/f_fss/c/private-fss.h new file mode 100644 index 000000000..8a4a9d568 --- /dev/null +++ b/level_0/f_fss/c/private-fss.h @@ -0,0 +1,65 @@ +/** + * FLL - Level 0 + * + * Project: File + * API Version: 0.8 + * Licenses: clarified_1_0_or_later-lgpl_2_1_or_later + * + * Provides structures and data types for a file I/O. + * Provides operations for opening/closing files. + */ +#ifndef _PRIVATE_F_fss_h +#define _PRIVATE_F_fss_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Private implementation of f_fss_skip_past_space_previous(). + * + * Intended to be shared to each of the different implementation variations. + * + * @param buffer + * The string to process. + * @param range + * The start and stop positions in the buffer being processed. + * This increments range->start. + * @param state + * A state for providing flags and handling interrupts during long running operations. + * + * This alters state.status: + * F_okay on success. + * F_data_not on success but buffer.used is 0, initial range.start is greater than range.stop, or initial range.start is greater than or equal to buffer.used. + * F_okay_eol on success and EOL was reached. + * F_okay_eos on success and EOS was reached. + * F_okay_stop on success and stop point was reached. + * + * F_complete_not_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS. + * F_complete_not_utf_start (with error bit) if the first character is a combining or a joiner character. + * F_complete_not_utf_stop (with error bit) if unable to get entire UTF-8 sequence due to stop point reached. + * F_interrupt (with error bit) if stopping due to an interrupt. + * F_parameter (with error bit) if a parameter is invalid. + * + * Errors (with error bit) from: f_utf_is_combining_joiner(). + * Errors (with error bit) from: f_utf_is_control(). + * Errors (with error bit) from: f_utf_is_whitespace(). + * Errors (with error bit) from: f_utf_is_zero_width(). + * + * @see f_utf_is_combining_joiner() + * @see f_utf_is_control() + * @see f_utf_is_whitespace() + * @see f_utf_is_zero_width() + * + * @see f_fss_skip_past_space() + * @see f_fss_skip_past_space_previous() + */ +#if !defined(_di_f_fss_skip_past_space_) || !defined(_di_f_fss_skip_past_space_previous_) + extern void private_f_fss_skip_past_space_previous(const f_string_static_t buffer, f_range_t * const range, f_state_t * const state, f_number_unsigned_t * const previous) F_attribute_visibility_internal_d; +#endif // !defined(_di_f_fss_skip_past_space_) || !defined(_di_f_fss_skip_past_space_previous_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _PRIVATE_F_fss_h diff --git a/level_0/f_fss/data/build/settings b/level_0/f_fss/data/build/settings index ce8230227..9614421a1 100644 --- a/level_0/f_fss/data/build/settings +++ b/level_0/f_fss/data/build/settings @@ -44,6 +44,7 @@ build_libraries_static-individual -l:libf_memory.a -l:libf_string.a -l:libf_type build_sources_headers fss.h fss/common.h fss/item.h fss/named.h fss/nest.h fss/payload.h fss/quote.h fss/set.h fss/set_quote.h fss/simple_packet.h build_sources_library fss.c fss/common.c fss/item.c fss/named.c fss/nest.c fss/payload.c fss/quote.c fss/set.c fss/set_quote.c fss/simple_packet.c +build_sources_library private-fss.c build_sources_library config.c diff --git a/level_0/f_fss/data/build/settings-mocks b/level_0/f_fss/data/build/settings-mocks index d1d865134..0cb90bfc8 100644 --- a/level_0/f_fss/data/build/settings-mocks +++ b/level_0/f_fss/data/build/settings-mocks @@ -33,6 +33,7 @@ build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf build_sources_headers fss.h fss/common.h fss/item.h fss/named.h fss/nest.h fss/payload.h fss/quote.h fss/set.h fss/set_quote.h fss/simple_packet.h build_sources_library fss.c fss/common.c fss/item.c fss/named.c fss/nest.c fss/payload.c fss/quote.c fss/set.c fss/set_quote.c fss/simple_packet.c +build_sources_library private-fss.c build_sources_library ../../tests/unit/c/mock-fss.c build_static no diff --git a/level_0/f_fss/data/build/settings-tests b/level_0/f_fss/data/build/settings-tests index 2a032c55f..fb9145026 100644 --- a/level_0/f_fss/data/build/settings-tests +++ b/level_0/f_fss/data/build/settings-tests @@ -25,7 +25,7 @@ build_language c build_libraries -lc -lcmocka build_libraries-individual -lf_memory -lf_string -lf_type_array -lf_utf -lf_fss -build_sources_program test-fss-apply_delimit.c test-fss-apply_delimit_range.c test-fss-count_lines.c test-fss-count_lines_range.c test-fss-fail_utf.c test-fss-fail_utf_to_false.c test-fss-is_combining.c test-fss-is_graph.c test-fss-is_space.c test-fss-is_zero_width.c test-fss-seek_to_eol.c test-fss-skip_past_combining_joiner.c test-fss-skip_past_delimit.c test-fss-skip_past_space.c +build_sources_program test-fss-apply_delimit.c test-fss-apply_delimit_range.c test-fss-count_lines.c test-fss-count_lines_range.c test-fss-fail_utf.c test-fss-fail_utf_to_false.c test-fss-is_combining.c test-fss-is_graph.c test-fss-is_space.c test-fss-is_zero_width.c test-fss-seek_to_eol.c test-fss-skip_past_combining_joiner.c test-fss-skip_past_delimit.c test-fss-skip_past_space.c test-fss-skip_past_space_previous.c build_sources_program test-fss-item_delete.c test-fss-item_destroy.c build_sources_program test-fss-items_delete_callback.c test-fss-items_destroy_callback.c test-fss-itemss_delete_callback.c test-fss-itemss_destroy_callback.c build_sources_program test-fss-named_delete.c test-fss-named_destroy.c diff --git a/level_0/f_fss/data/documentation/man/man3/f_fss_skip_past_space_previous.3 b/level_0/f_fss/data/documentation/man/man3/f_fss_skip_past_space_previous.3 new file mode 100644 index 000000000..82d1687d1 --- /dev/null +++ b/level_0/f_fss/data/documentation/man/man3/f_fss_skip_past_space_previous.3 @@ -0,0 +1,97 @@ +.TH f_fss_skip_past_space_previous "3" "January 2026" "FLL - Featureless Linux Library 0.8.2 - Level 0" "Library Functions" +.SH "NAME" +f_fss_skip_past_space_previous \- +.SH SYNOPSIS +.nf +.B #include +.sp +\fBvoid f_fss_skip_past_space_previous\fP( + \fBconst f_string_static_t \fP\fIbuffer\fP, + \fBf_range_t *const \fP\fIrange\fP, + \fBf_state_t *const \fP\fIstate\fP +); +.fi +.SH DESCRIPTION +.PP +Skip past all white space, control characters, and zero-width characters, except newline ' +.PP +' (U+000A), exposing the previous position to the caller. +.PP +If the first character in the given range is a combining character, then this will not skip past anything. This is because combining characters apply from right to left. +.PP +This alters state.status: F_okay on success. F_data_not on success but buffer.used is 0, initial range.start is greater than range.stop, or initial range.start is greater than or equal to buffer.used. F_okay_eol on success and EOL was reached. F_okay_eos on success and EOS was reached. F_okay_stop on success and stop point was reached. +.PP +F_complete_not_utf_eos (with error bit) if unable to get entire UTF-8 sequence due to EOS. F_complete_not_utf_start (with error bit) if the first character is a combining character. F_complete_not_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. +.PP +Errors (with error bit) from: f_utf_is_combining(). Errors (with error bit) from: f_utf_is_control(). Errors (with error bit) from: f_utf_is_whitespace(). Errors (with error bit) from: f_utf_is_zero_width(). +.SH PARAMETERS +.TP +.B buffer +The string to process. + +.TP +.B range +The start and stop positions in the buffer being processed. This increments range->start. + +.TP +.B state +A state for providing flags and handling interrupts during long running operations. + +.SH STRUCTURES +.SS "" +.PP +.sp +.PP +A string that is analogous to f_string_dynamic_t but intended for static-only uses. +.PP +The f_string_static_t type should always have size set to 0 to represent that it is a static string. This allows for easier integration with f_string_dynamic_t. +.PP +If size is set to some value other than 0 for a static string, then take special care not to intermix it with f_string_dynamic_t. +.PP +A special macro_f_string_static_t_initialize_1() is provided to easily initialize a static string. A special macro_f_string_static_t_initialize_2() is provided to easily initialize a static string with an identical used and size. +.PP +size: Total amount of space available. +.sp +.RS +.nf +\fB +struct f_string_static_t { + f_string_t \fIstring\fP; + f_number_unsigned_t \fIused\fP; + f_number_unsigned_t \fIsize\fP; +}; +\fP +.fi +.RE +.SS "" +.PP +.sp +.PP +A structure designating a start and stop range for some string. +.PP +In general, this project uses the start and stop position inclusively, meaning that a range of 0 to 1 would include positions 0 and position 1. Therefore, a range from 0 to 0 would be include position 0. Set start to some value larger than stop to designate that there is no range (such as start = 1, stop = 0). +.PP +stop: The inclusive stop position. +.sp +.RS +.nf +\fB +struct f_range_t { + f_number_unsigned_t \fIstart\fP; + f_number_unsigned_t \fIstop\fP; +}; +\fP +.fi +.RE +.SH SEE ALSO +.PP +.nh +.ad l +\fIfss.h\fP(3), \fIf_fss_apply_delimit\fP(3), \fIf_fss_apply_delimit_range\fP(3), \fIf_fss_count_lines\fP(3), \fIf_fss_count_lines_range\fP(3), \fIf_fss_fail_utf\fP(3), \fIf_fss_fail_utf_to_false\fP(3), \fIf_fss_is_combining\fP(3), \fIf_fss_is_graph\fP(3), \fIf_fss_is_space\fP(3), \fIf_fss_is_zero_width\fP(3), \fIf_fss_seek_to_eol\fP(3), \fIf_fss_skip_past_delimit\fP(3), \fIf_fss_skip_past_space_previous\fP(3), \fIf_utf_is_combining()\fP, \fIf_utf_is_control()\fP, \fIf_utf_is_whitespace()\fP, \fIf_utf_is_zero_width()\fP, \fIf_utf_is_combining()\fP, \fIf_utf_is_control()\fP, \fIf_utf_is_whitespace()\fP, \fIf_utf_is_zero_width()\fP +.ad +.hy +.SH AUTHOR +Written by Kevin Day. +.SH COPYRIGHT +.PP +Copyright \(co 2007-2026 Kevin Day, GNU LGPL Version 2.1 or later. diff --git a/level_0/f_fss/tests/unit/c/test-fss-skip_past_space_previous.c b/level_0/f_fss/tests/unit/c/test-fss-skip_past_space_previous.c new file mode 100644 index 000000000..e62531f79 --- /dev/null +++ b/level_0/f_fss/tests/unit/c/test-fss-skip_past_space_previous.c @@ -0,0 +1,156 @@ +#include "test-fss.h" +#include "test-fss-skip_past_space_previous.h" + +#ifdef __cplusplus +extern "C" { +#endif + +void test__f_fss_skip_past_space_previous__parameter_checking(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 4, 0); + f_state_t state_data = f_state_t_initialize; + + { + f_fss_skip_past_space_previous(test, 0, &state_data, 0); + + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); + } + + { + f_number_unsigned_t previous = 0; + + f_fss_skip_past_space_previous(test, 0, &state_data, &previous); + + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); + } + + { + f_range_t range = f_range_t_initialize; + + f_fss_skip_past_space_previous(test, &range, &state_data, 0); + + assert_int_equal(state_data.status, F_status_set_error(F_parameter)); + } +} + +void test__f_fss_skip_past_space_previous__returns_data_not(void **state) { + + const f_string_static_t test = macro_f_string_static_t_initialize_1("test", 4, 0); + f_state_t state_data = f_state_t_initialize; + f_number_unsigned_t previous = 0; + + { + f_range_t range = f_range_t_initialize; + + f_fss_skip_past_space_previous(f_string_empty_s, &range, &state_data, &previous); + + assert_int_equal(state_data.status, F_data_not); + } + + { + f_range_t range = f_range_t_initialize; + + f_fss_skip_past_space_previous(test, &range, &state_data, &previous); + + assert_int_equal(state_data.status, F_data_not); + } + + { + f_range_t range = macro_f_range_t_initialize_1(0, test.used - 1); + + f_fss_skip_past_space_previous(f_string_empty_s, &range, &state_data, &previous); + + assert_int_equal(state_data.status, F_data_not); + } + + { + f_range_t range = macro_f_range_t_initialize_1(test.used, test.used + 2); + + f_fss_skip_past_space_previous(test, &range, &state_data, &previous); + + assert_int_equal(state_data.status, F_data_not); + } +} + +void test__f_fss_skip_past_space_previous__works(void **state) { + + f_state_t state_data = f_state_t_initialize; + + // Space followed by a zero-width joiner and a joined character with NULLs before joiner (U+0020 \0 \0 U+200D U+1F9D4). + char space_null_join[] = { 0x20, 0x0, 0x0, 0xe2, 0x80, 0x8d, 0xf0, 0x9f, 0xa7, 0x94 }; + + f_string_static_t tests[] = { + macro_f_string_static_t_initialize_1("test", 4, 0), + macro_f_string_static_t_initialize_1(" test", 5, 0), + macro_f_string_static_t_initialize_1(" test", 7, 0), + macro_f_string_static_t_initialize_1(" \0test ", 9, 0), + macro_f_string_static_t_initialize_1(" \t\atest ", 9, 0), + macro_f_string_static_t_initialize_1("\a\t $test ", 10, 0), + macro_f_string_static_t_initialize_1(" ́test", 7, 0), // Space followed by a combining character (U+0020 U+0301). + macro_f_string_static_t_initialize_1("​test", 7, 0), // Starts with zero-width space (U+200B). + macro_f_string_static_t_initialize_1(" ‍🧔test", 12, 0), // Space followed by a zero-width joiner and a joined character (U+0020 U+200D U+1F9D4). + macro_f_string_static_t_initialize_1(" ⁠test", 8, 0), // Space followed by a word joiner and a joined character (U+0020 U+2060 U+0062). + macro_f_string_static_t_initialize_1("́⁠test", 6, 0), // Starts with combining character (U+0301). + macro_f_string_static_t_initialize_1("‍́test", 6, 0), // Starts with joiner character (U+2060). + macro_f_string_static_t_initialize_1(" ‍\0\0🧔test", 14, 0), // Space followed by a zero-width joiner and a joined character with NULLs after joiner (U+0020 U+200D \0 \0 U+1F9D4). + macro_f_string_static_t_initialize_1(space_null_join, 14, 0), + }; + + uint16_t statuss[] = { + F_okay, + F_okay, + F_okay, + F_okay, + F_okay, + F_okay, + F_okay, + F_okay, + F_okay, + F_okay, + F_status_set_error(F_complete_not_utf_start), + F_status_set_error(F_complete_not_utf_start), + F_okay, + F_okay, + }; + + f_number_unsigned_t ranges[] = { + 0, + 1, + 3, + 3, + 3, + 3, + 0, + 3, + 0, + 0, + 0, + 0, + 0, + 0, + }; + + for (uint8_t i = 0; i < 14; ++i) { + + f_range_t range = macro_f_range_t_initialize_1(0, tests[i].used - 1); + f_number_unsigned_t previous = 0; + + f_fss_skip_past_space_previous(tests[i], &range, &state_data, &previous); + + if (state_data.status != statuss[i]) { + printf("[ -------> ] --- [00] Expected %u in state.status but got %u at index %d for string '%s'.\n", statuss[i], state_data.status, i, tests[i].used ? tests[i].string : ""); + } + + assert_int_equal(state_data.status, statuss[i]); + + if (range.start != ranges[i]) { + printf("[ -------> ] --- [01] Expected %lu in range.start but got %lu at index %d for string '%s'.\n", ranges[i], range.start, i, tests[i].used ? tests[i].string : ""); + } + + assert_int_equal(range.start, ranges[i]); + } // for +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_0/f_fss/tests/unit/c/test-fss-skip_past_space_previous.h b/level_0/f_fss/tests/unit/c/test-fss-skip_past_space_previous.h new file mode 100644 index 000000000..db76dce6f --- /dev/null +++ b/level_0/f_fss/tests/unit/c/test-fss-skip_past_space_previous.h @@ -0,0 +1,34 @@ +/** + * FLL - Level 0 + * + * Project: FSS + * API Version: 0.8 + * Licenses: clarified_1_0_or_later-lgpl_2_1_or_later + * + * Test skip past space previous in the fss project. + */ +#ifndef _TEST__F_fss__skip_past_space_previous +#define _TEST__F_fss__skip_past_space_previous + +/** + * Test that the function correctly fails on invalid parameter. + * + * @see f_fss_skip_past_space_previous() + */ +extern void test__f_fss_skip_past_space_previous__parameter_checking(void **state); + +/** + * Test that the function returns F_data_not. + * + * @see f_fss_skip_past_space_previous() + */ +extern void test__f_fss_skip_past_space_previous__returns_data_not(void **state); + +/** + * Test that the function works. + * + * @see f_fss_skip_past_space_previous() + */ +extern void test__f_fss_skip_past_space_previous__works(void **state); + +#endif // _TEST__F_fss__skip_past_space_previous diff --git a/level_0/f_fss/tests/unit/c/test-fss.c b/level_0/f_fss/tests/unit/c/test-fss.c index 95f7030a9..823e15ab2 100644 --- a/level_0/f_fss/tests/unit/c/test-fss.c +++ b/level_0/f_fss/tests/unit/c/test-fss.c @@ -27,6 +27,7 @@ int main(void) { cmocka_unit_test(test__f_fss_skip_past_combining_joiner__returns_data_not), cmocka_unit_test(test__f_fss_skip_past_delimit__returns_data_not), cmocka_unit_test(test__f_fss_skip_past_space__returns_data_not), + cmocka_unit_test(test__f_fss_skip_past_space_previous__returns_data_not), cmocka_unit_test(test__f_fss_apply_delimit__works), cmocka_unit_test(test__f_fss_apply_delimit_range__works), @@ -40,6 +41,7 @@ int main(void) { cmocka_unit_test(test__f_fss_skip_past_combining_joiner__works), cmocka_unit_test(test__f_fss_skip_past_delimit__works), cmocka_unit_test(test__f_fss_skip_past_space__works), + cmocka_unit_test(test__f_fss_skip_past_space_previous__works), cmocka_unit_test(test__f_fss_fail_utf__works_for_error), cmocka_unit_test(test__f_fss_fail_utf_to_false__works_for_error), @@ -157,6 +159,7 @@ int main(void) { cmocka_unit_test(test__f_fss_skip_past_combining_joiner__parameter_checking), cmocka_unit_test(test__f_fss_skip_past_delimit__parameter_checking), cmocka_unit_test(test__f_fss_skip_past_space__parameter_checking), + cmocka_unit_test(test__f_fss_skip_past_space_previous__parameter_checking), cmocka_unit_test(test__f_fss_item_delete__parameter_checking), cmocka_unit_test(test__f_fss_item_destroy__parameter_checking), diff --git a/level_0/f_fss/tests/unit/c/test-fss.h b/level_0/f_fss/tests/unit/c/test-fss.h index c04294430..451ac6fe5 100644 --- a/level_0/f_fss/tests/unit/c/test-fss.h +++ b/level_0/f_fss/tests/unit/c/test-fss.h @@ -79,6 +79,7 @@ #include "test-fss-skip_past_combining_joiner.h" #include "test-fss-skip_past_delimit.h" #include "test-fss-skip_past_space.h" +#include "test-fss-skip_past_space_previous.h" #ifdef __cplusplus extern "C" { diff --git a/level_0/f_utf/c/private-utf_joiner.c b/level_0/f_utf/c/private-utf_joiner.c index c525c28ff..1c577f682 100644 --- a/level_0/f_utf/c/private-utf_joiner.c +++ b/level_0/f_utf/c/private-utf_joiner.c @@ -6,7 +6,7 @@ extern "C" { #endif -#if !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_combining_joiner_) || !defined(_di_f_utf_is_joiner_) +#if !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_combining_joiner_) || !defined(_di_f_utf_is_joiner_) || !defined( _di_f_utf_is_zero_width_) f_status_t private_f_utf_character_is_joiner(const f_utf_char_t sequence) { if (macro_f_utf_char_t_width_is(sequence) == 3) { @@ -22,7 +22,7 @@ extern "C" { return F_false; } -#endif // !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_combining_joiner_) || !defined(_di_f_utf_is_joiner_) +#endif // !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_combining_joiner_) || !defined(_di_f_utf_is_joiner_) || !defined( _di_f_utf_is_zero_width_) #ifdef __cplusplus } // extern "C" diff --git a/level_0/f_utf/c/private-utf_joiner.h b/level_0/f_utf/c/private-utf_joiner.h index f945301d4..dabca435f 100644 --- a/level_0/f_utf/c/private-utf_joiner.h +++ b/level_0/f_utf/c/private-utf_joiner.h @@ -44,10 +44,11 @@ extern "C" { * @see f_utf_is_alphabetic_numeric() * @see f_utf_is_combining_joiner() * @see f_utf_is_joiner() + * @see f_utf_is_zero_width() */ -#if !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_joiner_) +#if !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_joiner_) || !defined( _di_f_utf_is_zero_width_) extern f_status_t private_f_utf_character_is_joiner(const f_utf_char_t sequence) F_attribute_visibility_internal_d; -#endif // !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_joiner_) +#endif // !defined(_di_f_utf_character_is_alphabetic_) || !defined(_di_f_utf_character_is_alphabetic_digit_) || !defined(_di_f_utf_character_is_alphabetic_numeric_) || !defined(_di_f_utf_character_is_combining_joiner_) || !defined(_di_f_utf_character_is_joiner_) || !defined(_di_f_utf_is_alphabetic_) || !defined(_di_f_utf_is_alphabetic_digit_) || !defined(_di_f_utf_is_alphabetic_numeric_) || !defined(_di_f_utf_is_joiner_) || !defined( _di_f_utf_is_zero_width_) #ifdef __cplusplus } // extern "C" diff --git a/level_1/fl_fss/c/fss/embedded_list.c b/level_1/fl_fss/c/fss/embedded_list.c index 4ab5d8dd2..6f9e86a73 100644 --- a/level_1/fl_fss/c/fss/embedded_list.c +++ b/level_1/fl_fss/c/fss/embedded_list.c @@ -123,7 +123,7 @@ extern "C" { } } // for - if (F_status_is_error(state->status) || state->status == F_interrupt || range->start >= buffer.used || range->start > range->stop) break; + if (F_status_is_error(state->status) || range->start >= buffer.used || range->start > range->stop) break; // All slashes for an open are delimited (because it could represent a slash in the object name). // For example 'object {' = valid open, name 'object', 'object \{' represents 'object {', 'object \\{' = valid open, name 'object \', 'object \\\{' represents 'object \{', etc.. @@ -154,29 +154,13 @@ extern "C" { position_previous = range->start++; - while (range->start <= range->stop && range->start < buffer.used) { - - if (state->interrupt) { - state->interrupt((void *) state, 0); - if (F_status_set_fine(state->status) == F_interrupt) break; - } + f_fss_skip_past_space_previous(buffer, range, state, &position_previous); - if (buffer.string[range->start] == f_fss_eol_s.string[0]) break; - - if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) { - if (f_fss_is_space(buffer, *range, state) == F_false) break; - } - - position_previous = range->start; - - f_utf_buffer_increment(buffer, range, 1); - if (F_status_is_error(state->status)) break; - } // while - - if (F_status_is_error(state->status) || state->status == F_interrupt || range->start >= buffer.used || range->start > range->stop) break; + if (F_status_is_error(state->status)) break; + if (range->start > range->stop || range->start >= buffer.used) break; // This is a valid object open/close that has been delimited, save the slash delimit positions. - if (buffer.string[range->start] == f_fss_eol_s.string[0]) { + if (state->status == F_okay_eol) { newline_last = range->start; line_start = newline_last + 1; @@ -275,33 +259,14 @@ extern "C" { else if (buffer.string[range->start] == f_fss_embedded_list_open_s.string[0]) { flag_fl &= ~___fl_flag_has_graph_first___; before_list_open = position_previous; - position_previous = range->start; + position_previous = range->start++; // TODO: needs combining/joiner check. - state->status = f_utf_buffer_increment(buffer, range, 1); - if (F_status_is_error(state->status)) break; - - while (range->start <= range->stop && range->start < buffer.used) { - - if (state->interrupt) { - state->interrupt((void *) state, 0); - if (F_status_set_fine(state->status) == F_interrupt) break; - } - - if (buffer.string[range->start] == f_fss_eol_s.string[0]) break; - - if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) { - if (f_fss_is_space(buffer, *range, state) == F_false) break; - } - - position_previous = range->start; - - f_utf_buffer_increment(buffer, range, 1); - if (F_status_is_error(state->status)) break; - } // while + f_fss_skip_past_space_previous(buffer, range, state, &position_previous); - if (F_status_is_error(state->status) || state->status == F_interrupt || range->start >= buffer.used || range->start > range->stop) break; + if (F_status_is_error(state->status)) break; + if (range->start > range->stop || range->start >= buffer.used) break; if (buffer.string[range->start] == f_fss_eol_s.string[0]) { if (++depth >= cache->objects->size) { @@ -373,24 +338,10 @@ extern "C" { // TODO: needs combining/joiner check. - while (range->start <= range->stop && range->start < buffer.used) { + f_fss_skip_past_space_previous(buffer, range, state, &position_previous); - if (state->interrupt) { - state->interrupt((void *) state, 0); - if (F_status_set_fine(state->status) == F_interrupt) break; - } - - position_previous = range->start; - - state->status = f_utf_buffer_increment(buffer, range, 1); - if (F_status_is_error(state->status) || buffer.string[range->start] == f_fss_eol_s.string[0]) break; - - if (buffer.string[range->start] != f_fss_placeholder_s.string[0]) { - if (f_fss_is_space(buffer, *range, state) == F_false || F_status_is_error(state->status)) break; - } - } // while - - if (F_status_is_error(state->status) || state->status == F_interrupt || range->start >= buffer.used || range->start > range->stop) break; + if (F_status_is_error(state->status)) break; + if (range->start > range->stop || range->start >= buffer.used) break; if (buffer.string[range->start] == f_fss_eol_s.string[0]) { if (depth >= found->used) { @@ -510,7 +461,7 @@ extern "C" { if (F_status_is_error(state->status)) break; } // while - if (F_status_is_error(state->status) || state->status == F_interrupt) break; + if (F_status_is_error(state->status)) break; } } else if (buffer.string[range->start] == f_fss_comment_s.string[0] && (flag_fl & ___fl_flag_has_graph_first___)) { diff --git a/level_1/fl_fss/c/fss/extended_list.c b/level_1/fl_fss/c/fss/extended_list.c index f6f3aefbb..b2b132af5 100644 --- a/level_1/fl_fss/c/fss/extended_list.c +++ b/level_1/fl_fss/c/fss/extended_list.c @@ -132,7 +132,7 @@ extern "C" { if (F_status_is_error(state->status)) break; if (range->start > range->stop || range->start >= buffer.used) break; - if (buffer.string[range->start] == f_fss_eol_s.string[0]) { + if (state->status == F_okay_eol) { newline_last = range->start; line_start = range->start + 1; @@ -186,7 +186,7 @@ extern "C" { if (range->start > range->stop || range->start >= buffer.used) break; // Found a valid content close, set stop point to last newline. - if (buffer.string[range->start] == f_fss_eol_s.string[0]) { + if (state->status == F_okay_eol) { close->start = line_start; close->stop = range->start - 1; diff --git a/level_1/fl_fss/c/fss/private-payload-helper.h b/level_1/fl_fss/c/fss/private-payload-helper.h index 9c0ded726..2b9509e0a 100644 --- a/level_1/fl_fss/c/fss/private-payload-helper.h +++ b/level_1/fl_fss/c/fss/private-payload-helper.h @@ -25,13 +25,13 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: private_fl_fss_basic_write(). * Errors (with error bit) from: f_string_dynamic_strip_null(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * The internal.range is modified. @@ -65,14 +65,14 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: private_fl_fss_basic_write(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_strip_null(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * The internal.range is modified. @@ -109,14 +109,14 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: private_fl_fss_basic_write(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_append_assure(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * The internal.range is modified. @@ -153,14 +153,14 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: private_fl_fss_basic_write(). * Errors (with error bit) from: f_string_dynamic_append(). * Errors (with error bit) from: f_string_dynamic_append_assure(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * The internal.range is modified. diff --git a/level_1/fl_fss/c/fss/private-payload.h b/level_1/fl_fss/c/fss/private-payload.h index ced906722..ca63323a1 100644 --- a/level_1/fl_fss/c/fss/private-payload.h +++ b/level_1/fl_fss/c/fss/private-payload.h @@ -30,6 +30,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -39,8 +41,6 @@ extern "C" { * Errors (with error bit) from: f_string_dynamic_strip_null(). * * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -85,14 +85,14 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -136,14 +136,14 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -187,14 +187,14 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -238,14 +238,14 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: f_memory_array_increase_by(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -293,13 +293,13 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: f_conversion_number_signed_to_string(). * Errors (with error bit) from: f_string_dynamic_append_assure(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -337,13 +337,13 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * * Errors (with error bit) from: f_conversion_number_unsigned_to_string(). * Errors (with error bit) from: f_string_dynamic_append_assure(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -381,6 +381,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -389,8 +391,6 @@ extern "C" { * Errors (with error bit) from: f_string_dynamic_append_assure(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -436,6 +436,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -444,8 +446,6 @@ extern "C" { * Errors (with error bit) from: private_fl_fss_basic_write(). * Errors (with error bit) from: private_fl_payload_header_map_number_unsigned(). * Errors (with error bit) from: private_fl_payload_helper_header_map_destination_write_buffer(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -491,6 +491,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -499,8 +501,6 @@ extern "C" { * Errors (with error bit) from: f_string_dynamic_append_assure(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -546,6 +546,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -554,8 +556,6 @@ extern "C" { * Errors (with error bit) from: private_fl_fss_basic_write(). * Errors (with error bit) from: private_fl_payload_header_map_number_unsigned(). * Errors (with error bit) from: private_fl_payload_helper_header_map_destination_write_buffer(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -601,6 +601,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -609,8 +611,6 @@ extern "C" { * Errors (with error bit) from: f_string_dynamic_append_assure(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -658,6 +658,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -666,8 +668,6 @@ extern "C" { * Errors (with error bit) from: f_string_dynamic_append_assure(). * Errors (with error bit) from: f_string_dynamic_strip_null(). * Errors (with error bit) from: private_fl_fss_basic_write(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * @@ -713,6 +713,8 @@ extern "C" { * @param state * The state passed directly from the fl_fss_payload_header_map() parameters. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -721,8 +723,6 @@ extern "C" { * Errors (with error bit) from: private_fl_fss_basic_write(). * Errors (with error bit) from: private_fl_payload_header_map_number_unsigned(). * Errors (with error bit) from: private_fl_payload_helper_header_map_destination_write_buffer(). - * - * Must not be NULL. * @param internal * The internal state, fl_fss_payload_header_internal_t, created inside of fl_fss_payload_header_map(). * diff --git a/level_1/fl_fss/c/private-fss-list.h b/level_1/fl_fss/c/private-fss-list.h index 0077e2677..480e7ea78 100644 --- a/level_1/fl_fss/c/private-fss-list.h +++ b/level_1/fl_fss/c/private-fss-list.h @@ -99,8 +99,12 @@ extern "C" { * The buffer to seek through. * @param range * The start/stop location within the buffer string to process. + * + * Must not be NULL. * @param destination * The buffer where the bytes are written to. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * There is no state.handle(). @@ -111,6 +115,8 @@ extern "C" { * Error bit designates an error but must be passed along with F_interrupt. * All other statuses are ignored. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * @@ -134,6 +140,8 @@ extern "C" { * The destination.used value before any operations were performed. * @param destination * The buffer where the object is written to. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * There is no state.handle(). @@ -144,6 +152,8 @@ extern "C" { * Error bit designates an error but must be passed along with F_interrupt. * All other statuses are ignored. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * diff --git a/level_1/fl_fss/c/private-fss.h b/level_1/fl_fss/c/private-fss.h index 87a971ec0..39813228f 100644 --- a/level_1/fl_fss/c/private-fss.h +++ b/level_1/fl_fss/c/private-fss.h @@ -33,8 +33,12 @@ extern "C" { * 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. + * + * Must not be NULL. * @param found * A set of all locations where a valid object was found. + * + * Must not be NULL. * @param quote * (optional) This will store the quote type representing the character to use (from the f_fss_quote_type_*_e). * @@ -42,6 +46,8 @@ extern "C" { * @param delimits * An array of delimits detected during processing. * The caller is expected to decide if and when to process them. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * There is no state.handle(). @@ -79,6 +85,8 @@ extern "C" { * Errors (with error bit) from: f_utf_buffer_increment(). * Errors (with error bit) from: f_utf_is_combining_joiner(). * + * Must not be NULL. + * * @see f_memory_array_increase() * @see f_memory_array_increase_by() * @see f_fss_is_combining_joiner() @@ -113,13 +121,19 @@ extern "C" { * As Content, this does nothing special in regards to a leading '#'. * @param object * The string to write as (does not stop at NULLS, they are ignored and not written). + * + * Must not be NULL. * @param quote - * If 0, then double quotes are auto-inserted, when required. + * If NULL, then double quotes are auto-inserted, when required. * Otherwise, this is quote character to wrap the object in when writing. * @param range * The start/stop location within the object string to write as an object. + * + * Must not be NULL. * @param destination * The buffer where the object is written to. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * There is no state.handle(). @@ -130,6 +144,8 @@ extern "C" { * Error bit designates an error but must be passed along with F_interrupt. * All other statuses are ignored. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. * F_okay_eos on success after reaching the end of the buffer. @@ -182,6 +198,8 @@ extern "C" { * The destination.used value before any operations were perfomed. * @param destination * The buffer where the object is written to. + * + * Must not be NULL. * @param state * A state for providing flags and handling interrupts during long running operations. * There is no state.handle(). @@ -192,6 +210,8 @@ extern "C" { * Error bit designates an error but must be passed along with F_interrupt. * All other statuses are ignored. * + * Must not be NULL. + * * This alters state.status: * F_okay on success. *