From: Kevin Day Date: Sat, 13 Jul 2024 03:04:57 +0000 (-0500) Subject: Update: Add initialize macros for time.h structures and fix initializer for f_date_t. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=02db2c0771d39285b99f74a1cba69afde7f308e2;p=fll Update: Add initialize macros for time.h structures and fix initializer for f_date_t. --- diff --git a/level_0/f_type/c/type/time.h b/level_0/f_type/c/type/time.h index 0b957bf..6e97ef1 100644 --- a/level_0/f_type/c/type/time.h +++ b/level_0/f_type/c/type/time.h @@ -62,6 +62,8 @@ extern "C" { typedef struct timespec f_time_spec_t; #define f_time_spec_t_initialize { 0 } + + #define macro_f_time_spec_t_initialize_1(seconds, nanoseconds) { .tv_sec = seconds, .tv_nsec = nanoseconds }; #endif // _di_f_time_spec_t_ /** @@ -71,6 +73,8 @@ extern "C" { typedef struct timeval f_time_value_t; #define f_time_value_t_initialize { 0 } + + #define macro_f_time_value_t_initialize_1(seconds, nanoseconds) { .tv_sec = seconds, .tv_usec = nanoseconds }; #endif // _di_f_time_value_t_ /** @@ -90,6 +94,8 @@ extern "C" { } f_time_simple_t; #define f_time_simple_t_initialize { f_time_t_initialize, f_time_t_initialize } + + #define macro_f_time_simple_t_initialize_1(seconds, nanoseconds) { .seconds = seconds, .seconds_nano = nanoseconds }; #endif // _di_f_time_simple_t_ /** @@ -115,7 +121,9 @@ extern "C" { f_time_t time; } f_date_t; - #define f_date_t_initialize { f_time_t_initialize, f_time_t_initialize } + #define f_date_t_initialize { f_number_signed_t_initialize, f_time_t_initialize } + + #define macro_f_date_t_initialize_1(year, time) { .year = year, .time = time }; #endif // _di_f_date_t_ /** @@ -136,6 +144,8 @@ extern "C" { } f_date_simple_t; #define f_date_simple_t_initialize { f_time_t_initialize, f_time_simple_t_initialize } + + #define macro_f_date_simple_t_initialize_1(year, time) { .year = year, .time = time }; #endif // _di_f_date_simple_t_ #ifdef __cplusplus