diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 19:47:20 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-18 19:47:20 +0000 |
commit | 74c2948c2299773fd3816af43e06e3bdf714ba3a (patch) | |
tree | 540f82bac3e6105b6fc34cd4b4613c1756a7512b /include/asterisk/localtime.h | |
parent | fd471b4a0cbb2abd7b4c8f30fee850cedefedaa1 (diff) |
Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75706 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/localtime.h')
-rw-r--r-- | include/asterisk/localtime.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/asterisk/localtime.h b/include/asterisk/localtime.h index e03c8b5b4..cf2256ee6 100644 --- a/include/asterisk/localtime.h +++ b/include/asterisk/localtime.h @@ -24,11 +24,27 @@ #ifndef _ASTERISK_LOCALTIME_H #define _ASTERISK_LOCALTIME_H +struct ast_tm { + int tm_sec; /* Seconds. [0-60] (1 leap second) */ + int tm_min; /* Minutes. [0-59] */ + int tm_hour; /* Hours. [0-23] */ + int tm_mday; /* Day. [1-31] */ + int tm_mon; /* Month. [0-11] */ + int tm_year; /* Year - 1900. */ + int tm_wday; /* Day of week. [0-6] */ + int tm_yday; /* Days in year.[0-365] */ + int tm_isdst; /* DST. [-1/0/1]*/ + long int tm_gmtoff; /* Seconds east of UTC. */ + char *tm_zone; /* Timezone abbreviation. */ + /* NOTE: do NOT reorder this final item. The order needs to remain compatible with struct tm */ + int tm_usec; /* microseconds */ +}; + int ast_tzsetwall(void); void ast_tzset(const char *name); -struct tm *ast_localtime(const time_t *timep, struct tm *p_tm, const char *zone); -time_t ast_mktime(struct tm * const tmp, const char *zone); -char *ast_ctime(const time_t * const timep); -char *ast_ctime_r(const time_t * const timep, char *buf); +struct ast_tm *ast_localtime(const struct timeval *timep, struct ast_tm *p_tm, const char *zone); +time_t ast_mktime(struct ast_tm * const tmp, const char *zone); +char *ast_ctime(const struct timeval * const timep, char *buf); +int ast_strftime(char *buf, size_t len, const char *format, const struct ast_tm *tm); #endif /* _ASTERISK_LOCALTIME_H */ |