#include <time.h>
Functions | |
time_t | internal_get_time (void) |
int | internal_set_time (time_t t) |
int | internal_get_dst (time_t tick) |
int | internal_get_utc_offset (time_t tick, int dst) |
int | internal_set_tz (const char *tz) |
void | internal_tz_set (char **old, const char *tz) |
void | internal_tz_res (char **old) |
time_t | internal_mktime_in (struct tm *tm, const char *tz) |
struct tm * | internal_localtime_r_in (struct tm *utc_tm, struct tm *result, const char *tz) |
int | internal_setenv_tz (const char *tzname) |
int | internal_tz_cmp (const char *firstTZName, const char *secondTZName) |
int | internal_check_timezone (const char *zone) |
Copyright (C) 2008 Nokia. All rights reserved.
time_t internal_get_time | ( | void | ) |
Get current time. Returns system (in product mode) or fake (if macro USE_FAKE_TIME is enabled) time.
Referenced by dump_date(), handle_alarm(), handle_csd_net_time_change(), internal_get_dst(), internal_tz_cmp(), and server_get_time_cb().
int internal_set_time | ( | time_t | t | ) |
Set current time. Update system (in product mode) or fake (if macro USE_FAKE_TIME is enabled) time. It does not update system time in fake mode but clockd can't see it.
t | count of ticks from Epoch to be set as current time |
t | count of ticks from Epoch to be set as current time |
Referenced by server_set_time().
int internal_get_dst | ( | time_t | tick | ) |
Get daylight state
tick | Current time, 0 if not known |
Referenced by dump_date(), handle_alarm(), internal_get_utc_offset(), server_init(), and server_send_time_change_indication().
int internal_get_utc_offset | ( | time_t | tick, | |
int | dst | |||
) |
Get UTC offset
tick | Current time, 0 if not known | |
dst | nonzero if daylight is counted in |
Referenced by dump_date().
int internal_set_tz | ( | const char * | tz | ) |
Set system timezone
tz | Timezone |
Referenced by server_init(), and server_set_tz_cb().
void internal_tz_set | ( | char ** | old, | |
const char * | tz | |||
) |
Utility function used to set timezone temporarily. It is needed to calculate time in timezone different from system one. It is used in pair with internal_tz_res which restores previous timezone.
old | Pointer to store current timezone name until internal_tz_res called Note: the memory is allocated for this purpose. It will be freed automatically inside internal_tz_res. | |
tz | Temporal timezone |
Referenced by handle_csd_net_time_change(), internal_localtime_r_in(), and internal_mktime_in().
void internal_tz_res | ( | char ** | old | ) |
Utility function used to restore previous timezone changed by internal_tz_set.
old | Pointer to timezone name which was provided by internal_tz_set Note: the memory allocated to store the name is freed after call of internal_tz_res the pointer becomes 0 at the end. |
old | Pointer to timezone name which was provided by internal_tz_set Note: the memory allocated to store the name is freed after call of internal_tz_res. the pointer becomes 0 at the end. |
Referenced by handle_csd_net_time_change(), internal_localtime_r_in(), and internal_mktime_in().
time_t internal_mktime_in | ( | struct tm * | tm, | |
const char * | tz | |||
) |
Make time_t from struct tm. Like mktime() but timezone can be given.
tm | See mktime | |
tz | Time zone variable. All formats that glibc supports can be given. NULL if current zone is used. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html |
Referenced by handle_csd_net_time_change(), and internal_localtime_r_in().
struct tm* internal_localtime_r_in | ( | struct tm * | utc_tm, | |
struct tm * | result, | |||
const char * | tz | |||
) | [read] |
Converts UTC time into local time for given timezone
utc_tm | UTC time in tm structure | |
result | pointer to tm structure to place result | |
tz | Time zone variable. All formats that glibc supports can be given. NULL if current zone is used. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html |
Referenced by internal_tz_cmp(), and mcc_tz_find_tz_in_country_tz_list().
int internal_setenv_tz | ( | const char * | tzname | ) |
Set TZ environment variable and re-init time module of glibc to use given timezone. If required it converts timezone from internal clockd fromat to known by glibc.
tzname | Time zone variable |
Referenced by handle_csd_net_time_change(), internal_tz_res(), internal_tz_set(), server_init(), and server_set_tz_cb().
int internal_tz_cmp | ( | const char * | firstTZName, | |
const char * | secondTZName | |||
) |
Helper function used to compare TZs
firstTZName | First TZ Name | |
secondTZName | Second TZ Name |
Referenced by handle_csd_net_time_change(), and tz_name_compare().
int internal_check_timezone | ( | const char * | zone | ) |
Checks if timezone name is valid for glibc. See http://www.gnu.org/software/libtool/manual/libc/TZ-Variable.html
zone | Tested timezone name |
Referenced by server_set_tz_cb().