From 02db2c0771d39285b99f74a1cba69afde7f308e2 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Fri, 12 Jul 2024 22:04:57 -0500 Subject: [PATCH] Update: Add initialize macros for time.h structures and fix initializer for f_date_t. --- level_0/f_type/c/type/time.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- 1.8.3.1