#include <vppinfra/time_range.h>
-void
+__clib_export void
clib_timebase_init (clib_timebase_t * tb, i32 timezone_offset_in_hours,
- clib_timebase_daylight_time_t daylight_type)
+ clib_timebase_daylight_time_t daylight_type,
+ clib_time_t * clib_time)
{
clib_memset (tb, 0, sizeof (*tb));
- clib_time_init (&tb->clib_time);
- tb->time_zero = unix_time_now ();
+ if (clib_time == 0)
+ {
+ tb->clib_time = clib_mem_alloc_aligned
+ (sizeof (*clib_time), CLIB_CACHE_LINE_BYTES);
+ memset (tb->clib_time, 0, sizeof (*clib_time));
+ clib_time_init (tb->clib_time);
+ }
+ else
+ tb->clib_time = clib_time;
tb->timezone_offset = ((f64) (timezone_offset_in_hours)) * 3600.0;
tb->daylight_time_type = daylight_type;
};
-void
+__clib_export void
clib_timebase_time_to_components (f64 now, clib_timebase_component_t * cp)
{
u32 year, month, hours, minutes, seconds, nanoseconds;
cp->fractional_seconds = now;
}
-f64
+__clib_export f64
clib_timebase_components_to_time (clib_timebase_component_t * cp)
{
f64 now = 0;
return (now);
}
-f64
+__clib_export f64
clib_timebase_find_sunday_midnight (f64 start_time)
{
clib_timebase_component_t _c, *cp = &_c;
}
-u8 *
+__clib_export u8 *
format_clib_timebase_time (u8 * s, va_list * args)
{
f64 now = va_arg (*args, f64);
return 1;
}
-uword
+__clib_export uword
unformat_clib_timebase_range_vector (unformat_input_t * input, va_list * args)
{
clib_timebase_range_t **rpp = va_arg (*args, clib_timebase_range_t **);
}
}
-f64
+__clib_export f64
clib_timebase_summer_offset (clib_timebase_t * tb, f64 now)
{
clib_timebase_component_t _c, *cp = &_c;