Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Macros | |
#define | RZ_NSEC_PER_SEC 1000000000ULL |
#define | RZ_NSEC_PER_MSEC 1000000ULL |
#define | RZ_USEC_PER_SEC 1000000ULL |
#define | RZ_NSEC_PER_USEC 1000ULL |
#define | RZ_USEC_PER_MSEC 1000ULL |
#define | ASCTIME_BUF_MINLEN 26 |
#define | rz_time_date_unix_to_string rz_time_stamp_to_str |
#define | RZ_TIME_PROFILE_ENABLED 0 |
#define | RZ_TIME_PROFILE_BEGIN |
#define | RZ_TIME_PROFILE_END |
Functions | |
RZ_API int | rz_time_gettimeofday (struct timeval *p, struct timezone *tz) |
Get the system current time and the current time zone. More... | |
RZ_API ut64 | rz_time_now (void) |
Returns the current time in microseconds. More... | |
RZ_API ut64 | rz_time_now_mono (void) |
Returns the current time in microseconds, using the monotonic clock. More... | |
RZ_API RZ_OWN char * | rz_time_stamp_to_str (ut32 timestamp) |
Converts an unix epoch timestamp to string. More... | |
RZ_API ut32 | rz_time_dos_time_stamp_to_posix (ut32 timestamp) |
Converts dos timestamp to posix timestamp. More... | |
RZ_API bool | rz_time_stamp_is_dos_format (const ut32 certainPosixTimeStamp, const ut32 possiblePosixOrDosTimeStamp) |
Verifies that the timestamp is in dos format. More... | |
RZ_API RZ_OWN char * | rz_time_date_dos_to_string (ut32 timestamp) |
Converts a dos date (ut32) and returns the timestamp in string format. More... | |
RZ_API RZ_OWN char * | rz_time_date_hfs_to_string (ut32 timestamp) |
Converts a Mac HFS+ date (ut32) and returns the timestamp in string format. More... | |
RZ_API RZ_OWN char * | rz_time_date_w32_to_string (ut64 timestamp) |
Converts a Win32 date (ut64) and returns the timestamp in string format. More... | |
RZ_API RZ_OWN char * | rz_time_date_now_to_string (void) |
Returns the timestamp in string format of the current time (now) More... | |
RZ_API char * | rz_asctime_r (RZ_NONNULL const struct tm *tm, RZ_NONNULL char *buf) |
RZ_API char * | rz_ctime_r (RZ_NONNULL const time_t *timer, RZ_NONNULL char *buf) |
RZ_API struct tm * | rz_localtime_r (RZ_NONNULL const time_t *time, RZ_NONNULL struct tm *res) |
RZ_API struct tm * | rz_gmtime_r (RZ_NONNULL const time_t *time, RZ_NONNULL struct tm *res) |
#define rz_time_date_unix_to_string rz_time_stamp_to_str |
RZ_API char* rz_asctime_r | ( | RZ_NONNULL const struct tm * | tm, |
RZ_NONNULL char * | buf | ||
) |
Definition at line 304 of file time.c.
References ASCTIME_BUF_MINLEN, err, NULL, and rz_return_val_if_fail.
Referenced by file_fmttime(), and rz_type_format_time().
RZ_API char* rz_ctime_r | ( | RZ_NONNULL const time_t * | timer, |
RZ_NONNULL char * | buf | ||
) |
Definition at line 314 of file time.c.
References ASCTIME_BUF_MINLEN, err, NULL, and rz_return_val_if_fail.
Referenced by file_fmttime(), and rz_time_stamp_to_str().
RZ_API struct tm* rz_gmtime_r | ( | RZ_NONNULL const time_t * | time, |
RZ_NONNULL struct tm * | res | ||
) |
Definition at line 294 of file time.c.
References err, NULL, rz_return_val_if_fail, and time.
Referenced by file_fmttime(), rz_time_stamp_to_str(), and rz_type_format_time().
RZ_API struct tm* rz_localtime_r | ( | RZ_NONNULL const time_t * | time, |
RZ_NONNULL struct tm * | res | ||
) |
Definition at line 284 of file time.c.
References err, NULL, rz_return_val_if_fail, and time.
Referenced by file_fmttime(), and rz_time_stamp_to_str().
Converts a dos date (ut32) and returns the timestamp in string format.
timestamp | The number to convert to string |
Definition at line 239 of file time.c.
References rz_time_dos_time_stamp_to_posix(), and rz_time_stamp_to_str().
Referenced by rz_cmd_print_timestamp_dos_handler().
Converts a Mac HFS+ date (ut32) and returns the timestamp in string format.
timestamp | The number to convert to string |
Definition at line 250 of file time.c.
References rz_time_stamp_to_str(), and TIME_HFS_SINCE_1970.
Referenced by rz_cmd_print_timestamp_hfs_handler().
Returns the timestamp in string format of the current time (now)
Definition at line 278 of file time.c.
References rz_time_now(), rz_time_stamp_to_str(), RZ_USEC_PER_SEC, and ut64().
Referenced by rz_cmd_debug(), rz_cmd_print_timestamp_current_handler(), rz_diff_unified_json(), and rz_diff_unified_text().
Converts a Win32 date (ut64) and returns the timestamp in string format.
timestamp | The number to convert to string |
Definition at line 261 of file time.c.
References rz_time_stamp_to_str(), and TIME_W32_SINCE_1970.
Referenced by rz_cmd_print_timestamp_ntfs_handler().
Converts dos timestamp to posix timestamp.
timestamp | The timestamp in dos format to convert |
Definition at line 190 of file time.c.
References time.
Referenced by _parse_resource_directory(), and rz_time_date_dos_to_string().
Get the system current time and the current time zone.
See https://man7.org/linux/man-pages/man2/gettimeofday.2.html for more information.
p | Pointer to a timeval structure that will be filled by this function |
tz | Pointer to a timezone structure that will be filled by this function |
Definition at line 78 of file time.c.
References gettimeofday, and p.
Referenced by rz_time_now().
Returns the current time in microseconds.
Definition at line 88 of file time.c.
References NULL, rz_time_gettimeofday(), RZ_USEC_PER_SEC, timeval::tv_sec, timeval::tv_usec, and ut64().
Referenced by hex_add_to_pkt(), hex_add_to_stale_pkt(), hex_get_instr_at_addr(), hex_to_new_pkt(), make_next_packet_valid(), rz_debug_trace_add(), rz_file_temp(), rz_num_irand(), rz_time_date_now_to_string(), sdb_now(), w32_dbg_wait(), and windbg_wait().
Returns the current time in microseconds, using the monotonic clock.
Definition at line 102 of file time.c.
References f, RZ_NSEC_PER_USEC, RZ_USEC_PER_SEC, timespec::tv_nsec, timespec::tv_sec, ut64(), and v.
Referenced by rz_cmd_help(), rz_cons_break_timeout(), rz_cons_is_breaked(), rz_core_esil_step(), rz_core_file_open(), rz_core_loadlibs(), rz_core_loadlibs_init(), rz_test_main(), rz_test_run_test(), search_collisions(), and subprocess_wait().
RZ_API bool rz_time_stamp_is_dos_format | ( | const ut32 | certainPosixTimeStamp, |
const ut32 | possiblePosixOrDosTimeStamp | ||
) |
Verifies that the timestamp is in dos format.
certainPosixTimeStamp | Certain posix timestamp |
possiblePosixOrDosTimeStamp | Possible posix or dos timestamp to test |
Definition at line 225 of file time.c.
Referenced by _parse_resource_directory().
Converts an unix epoch timestamp to string.
timestamp | The unix epoch timestamp |
Definition at line 143 of file time.c.
References ASCTIME_BUF_MINLEN, err, get_seconds_since_12am31Dec1969(), long, rz_ctime_r(), rz_gmtime_r(), rz_localtime_r(), rz_str_newf(), and rz_str_trim().
Referenced by _parse_resource_directory(), bin_pe_init_hdr(), rz_time_date_dos_to_string(), rz_time_date_hfs_to_string(), rz_time_date_now_to_string(), and rz_time_date_w32_to_string().