From: Kevin Day Date: Sun, 16 Jan 2022 22:52:25 +0000 (-0600) Subject: Cleanup: Add additional initializer for f_string_static_t to allow initializing all... X-Git-Tag: 0.5.8~104 X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=2cdb03d14d5e21fd5c87f6c8de6d5c6a9d7e53f0;p=fll Cleanup: Add additional initializer for f_string_static_t to allow initializing all parts. Another acceptable practice is to set the used to some value greater than zero and size to zero to better designate that this is a static string and is not dynamically allocated. --- diff --git a/level_0/f_string/c/string_dynamic.h b/level_0/f_string/c/string_dynamic.h index 78c95a1..15830c3 100644 --- a/level_0/f_string/c/string_dynamic.h +++ b/level_0/f_string/c/string_dynamic.h @@ -24,7 +24,8 @@ extern "C" { * * The f_string_static_t type should never be directly allocated or deallocated. * - * A special macro_f_string_static_t_initialize() is provided for the special purpose of easily initialize a static string. + * A special macro_f_string_static_t_initialize() is provided for the special purpose of easily initialize a static string with an identical used and size. + * A special macro_f_string_static_t_initialize2() is provided for the special purpose of easily initialize a static string. * * string: The string. * size: Total amount of space available. @@ -46,6 +47,7 @@ extern "C" { string_static.used = 0; #define macro_f_string_static_t_initialize(string, length) { string, length, length } + #define macro_f_string_static_t_initialize2(string, size, used) { string, size, used } #endif // _di_f_string_static_t_ /**