From 3d712ac27717192c8e42f61270a6b4efdd56862e Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Mon, 7 Feb 2022 18:56:30 -0600 Subject: [PATCH] Update: Add F_buffer_overflow and F_buffer_underflow status codes. I am rather surprised that I don't already have at least F_buffer_overflow. --- level_0/f_status/c/status.h | 2 ++ level_0/f_status_string/c/status_string.c | 10 ++++++++++ level_0/f_status_string/c/status_string.h | 6 ++++++ level_2/fll_status_string/c/status_string.c | 12 ++++++++++++ 4 files changed, 30 insertions(+) diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 12529ae..d9f3a78 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -484,8 +484,10 @@ extern "C" { #ifndef _di_F_status_buffer_ F_buffer, F_buffer_not, + F_buffer_overflow, F_buffer_too_large, F_buffer_too_small, + F_buffer_underflow, F_complete_not_utf, F_complete_not_utf_block, F_complete_not_utf_eoa, diff --git a/level_0/f_status_string/c/status_string.c b/level_0/f_status_string/c/status_string.c index f28264a..f4dd1ac 100644 --- a/level_0/f_status_string/c/status_string.c +++ b/level_0/f_status_string/c/status_string.c @@ -402,8 +402,10 @@ extern "C" { #ifndef _di_F_status_buffer_ const f_string_static_t f_status_buffer_s = macro_f_string_static_t_initialize(F_status_buffer_s, 0, F_status_buffer_s_length); const f_string_static_t f_status_buffer_not_s = macro_f_string_static_t_initialize(F_status_buffer_not_s, 0, F_status_buffer_not_s_length); + const f_string_static_t f_status_buffer_overflow_s = macro_f_string_static_t_initialize(F_status_buffer_overflow_s, 0, F_status_buffer_overflow_s_length); const f_string_static_t f_status_buffer_too_large_s = macro_f_string_static_t_initialize(F_status_buffer_too_large_s, 0, F_status_buffer_too_large_s_length); const f_string_static_t f_status_buffer_too_small_s = macro_f_string_static_t_initialize(F_status_buffer_too_small_s, 0, F_status_buffer_too_small_s_length); + const f_string_static_t f_status_buffer_underflow_s = macro_f_string_static_t_initialize(F_status_buffer_underflow_s, 0, F_status_buffer_underflow_s_length); const f_string_static_t f_status_complete_not_utf_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_s, 0, F_status_complete_not_utf_s_length); const f_string_static_t f_status_complete_not_utf_block_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_block_s, 0, F_status_complete_not_utf_block_s_length); const f_string_static_t f_status_complete_not_utf_eoa_s = macro_f_string_static_t_initialize(F_status_complete_not_utf_eoa_s, 0, F_status_complete_not_utf_eoa_s_length); @@ -2100,6 +2102,10 @@ extern "C" { *name = f_status_buffer_not_s; break; + case F_buffer_overflow: + *name = f_status_buffer_overflow_s; + break; + case F_buffer_too_large: *name = f_status_buffer_too_large_s; break; @@ -2108,6 +2114,10 @@ extern "C" { *name = f_status_buffer_too_small_s; break; + case F_buffer_underflow: + *name = f_status_buffer_underflow_s; + break; + case F_complete_not_utf_block: *name = f_status_complete_not_utf_block_s; break; diff --git a/level_0/f_status_string/c/status_string.h b/level_0/f_status_string/c/status_string.h index fa45810..822e929 100644 --- a/level_0/f_status_string/c/status_string.h +++ b/level_0/f_status_string/c/status_string.h @@ -1175,8 +1175,10 @@ extern "C" { #ifndef _di_F_status_buffer_ #define F_status_buffer_s "F_buffer" #define F_status_buffer_not_s "F_buffer_not" + #define F_status_buffer_overflow_s "F_buffer_overflow" #define F_status_buffer_too_large_s "F_buffer_too_large" #define F_status_buffer_too_small_s "F_buffer_too_small" + #define F_status_buffer_underflow_s "F_buffer_underflow" #define F_status_complete_not_utf_s "F_complete_not_utf" #define F_status_complete_not_utf_block_s "F_complete_not_utf_block" #define F_status_complete_not_utf_eoa_s "F_complete_not_utf_eoa" @@ -1224,8 +1226,10 @@ extern "C" { #define F_status_buffer_s_length 8 #define F_status_buffer_not_s_length 12 + #define F_status_buffer_overflow_s_length 17 #define F_status_buffer_too_large_s_length 18 #define F_status_buffer_too_small_s_length 18 + #define F_status_buffer_underflow_s_length 18 #define F_status_complete_not_utf_s_length 18 #define F_status_complete_not_utf_block_s_length 24 #define F_status_complete_not_utf_eoa_s_length 22 @@ -1273,8 +1277,10 @@ extern "C" { extern const f_string_static_t f_status_buffer_s; extern const f_string_static_t f_status_buffer_not_s; + extern const f_string_static_t f_status_buffer_overflow_s; extern const f_string_static_t f_status_buffer_too_large_s; extern const f_string_static_t f_status_buffer_too_small_s; + extern const f_string_static_t f_status_buffer_underflow_s; extern const f_string_static_t f_status_complete_not_utf_s; extern const f_string_static_t f_status_complete_not_utf_block_s; extern const f_string_static_t f_status_complete_not_utf_eoa_s; diff --git a/level_2/fll_status_string/c/status_string.c b/level_2/fll_status_string/c/status_string.c index 7e3979a..2a30e4b 100644 --- a/level_2/fll_status_string/c/status_string.c +++ b/level_2/fll_status_string/c/status_string.c @@ -2274,6 +2274,12 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_buffer_overflow_s) == F_equal_to) { + *code = F_buffer_overflow; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_buffer_too_large_s) == F_equal_to) { *code = F_buffer_too_large; @@ -2286,6 +2292,12 @@ extern "C" { return F_none; } + if (fl_string_dynamic_compare(name, f_status_buffer_underflow_s) == F_equal_to) { + *code = F_buffer_underflow; + + return F_none; + } + if (fl_string_dynamic_compare(name, f_status_complete_not_utf_s) == F_equal_to) { *code = F_complete_not_utf; -- 1.8.3.1