From 76d07062026ae844fd6d69008d2bf9ecb9a1d084 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Sun, 2 May 2021 18:36:48 -0500 Subject: [PATCH] Feature: Add F_success and F_success_not status codes. After some consideration I have decided to support the compliment of F_failure and F_failure_not. --- level_0/f_status/c/status.h | 2 ++ level_1/fl_status/c/status.c | 6 ++++++ level_1/fl_status/c/status.h | 4 ++++ level_2/fll_status/c/status.c | 12 ++++++++++++ 4 files changed, 24 insertions(+) diff --git a/level_0/f_status/c/status.h b/level_0/f_status/c/status.h index 1f77a2c..f5b33a3 100644 --- a/level_0/f_status/c/status.h +++ b/level_0/f_status/c/status.h @@ -289,6 +289,8 @@ extern "C" { F_string_not, F_string_too_large, F_string_too_small, + F_success, + F_success_not, F_supported, F_supported_not, F_syntax, diff --git a/level_1/fl_status/c/status.c b/level_1/fl_status/c/status.c index 09e52fb..e35feff 100644 --- a/level_1/fl_status/c/status.c +++ b/level_1/fl_status/c/status.c @@ -669,6 +669,12 @@ extern "C" { case F_known_not: *string = FL_status_string_known_not; break; + case F_success: + *string = FL_status_string_success; + break; + case F_success_not: + *string = FL_status_string_success_not; + break; case F_supported: *string = FL_status_string_supported; break; diff --git a/level_1/fl_status/c/status.h b/level_1/fl_status/c/status.h index 55578a6..69839ff 100644 --- a/level_1/fl_status/c/status.h +++ b/level_1/fl_status/c/status.h @@ -315,6 +315,8 @@ extern "C" { #define FL_status_string_thread_not "F_thread_not" #define FL_status_string_time "F_time" #define FL_status_string_time_not "F_time_not" + #define FL_status_string_success "F_success" + #define FL_status_string_success_not "F_success_not" #define FL_status_string_supported "F_supported" #define FL_status_string_supported_not "F_supported_not" #define FL_status_string_user "F_user" @@ -480,6 +482,8 @@ extern "C" { #define FL_status_string_string_not_length 12 #define FL_status_string_string_too_large_length 18 #define FL_status_string_string_too_small_length 18 + #define FL_status_string_success_length 9 + #define FL_status_string_success_not_length 13 #define FL_status_string_supported_length 11 #define FL_status_string_supported_not_length 15 #define FL_status_string_syntax_length 8 diff --git a/level_2/fll_status/c/status.c b/level_2/fll_status/c/status.c index 5a8f874..ca38ce0 100644 --- a/level_2/fll_status/c/status.c +++ b/level_2/fll_status/c/status.c @@ -1297,6 +1297,18 @@ extern "C" { return F_none; } + if (fl_string_compare(string, FL_status_string_success, length, FL_status_string_success_length) == F_equal_to) { + *code = F_success; + + return F_none; + } + + if (fl_string_compare(string, FL_status_string_success_not, length, FL_status_string_success_not_length) == F_equal_to) { + *code = F_success_not; + + return F_none; + } + if (fl_string_compare(string, FL_status_string_supported, length, FL_status_string_supported_length) == F_equal_to) { *code = F_supported; -- 1.8.3.1