Ruby: internal/time.h Source File

Ruby 3.4.5p51 (2025-07-16 revision 20cda200d3ce092571d0b5d342dadca69636cb0f)

time.h
1#ifndef INTERNAL_TIME_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_TIME_H
11#include "ruby/internal/config.h" /* for SIGNEDNESS_OF_TIME_T */
12#include "internal/bits.h" /* for SIGNED_INTEGER_MAX */
13#include "ruby/ruby.h" /* for VALUE */
14
15#if SIGNEDNESS_OF_TIME_T < 0 /* signed */
16# define TIMET_MAX SIGNED_INTEGER_MAX(time_t)
17# define TIMET_MIN SIGNED_INTEGER_MIN(time_t)
18#elif SIGNEDNESS_OF_TIME_T > 0 /* unsigned */
19# define TIMET_MAX UNSIGNED_INTEGER_MAX(time_t)
20# define TIMET_MIN ((time_t)0)
21#endif
22
23struct timeval; /* <- in <sys/time.h> or <winsock2.h> */
24
25/* time.c */
26struct timeval rb_time_timeval(VALUE);
27
28RUBY_SYMBOL_EXPORT_BEGIN
29/* time.c (export) */
30void ruby_reset_leap_second_info(void);
31#ifdef RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY
32RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY()
33#endif
34void ruby_reset_timezone(const char *);
35RUBY_SYMBOL_EXPORT_END
36
37#endif /* INTERNAL_TIME_H */
rb_time_timeval
struct timeval rb_time_timeval(VALUE time)
Converts an instance of rb_cTime to a struct timeval that represents the identical point of time.
Definition time.c:2941
ruby.h
timeval
Definition missing.h:63
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40