diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 21:50:40 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-06-14 21:50:40 +0000 |
commit | a45f0ce8a0fded7acff845122856b8b92e8a1e00 (patch) | |
tree | 970b4536445781a1e3046fb0f2fc3c1d10eab080 /main/say.c | |
parent | eaff648d9b225be366870aade0617c6d8ca2a121 (diff) |
use ast_localtime() in every place localtime_r() was being used
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@69392 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/say.c')
-rw-r--r-- | main/say.c | 73 |
1 files changed, 45 insertions, 28 deletions
diff --git a/main/say.c b/main/say.c index 4d05848d0..2c3937c76 100644 --- a/main/say.c +++ b/main/say.c @@ -2924,8 +2924,8 @@ int ast_say_date_pt(struct ast_channel *chan, time_t t, const char *ints, const struct tm tm; char fn[256]; int res = 0; - ast_localtime(&t,&tm,NULL); - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); if (!res) res = wait_file(chan, ints, fn, lang); @@ -5480,7 +5480,8 @@ int ast_say_time_en(struct ast_channel *chan, time_t t, const char *ints, const struct tm tm; int res = 0; int hour, pm=0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); hour = tm.tm_hour; if (!hour) hour = 12; @@ -5526,7 +5527,8 @@ int ast_say_time_de(struct ast_channel *chan, time_t t, const char *ints, const { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); if (!res) res = ast_say_number(chan, tm.tm_hour, ints, lang, "n"); if (!res) @@ -5544,7 +5546,8 @@ int ast_say_time_fr(struct ast_channel *chan, time_t t, const char *ints, const { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); res = ast_say_number(chan, tm.tm_hour, ints, lang, "f"); if (!res) @@ -5561,7 +5564,8 @@ int ast_say_time_nl(struct ast_channel *chan, time_t t, const char *ints, const { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); if (!res) res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL); if (!res) @@ -5580,7 +5584,8 @@ int ast_say_time_pt(struct ast_channel *chan, time_t t, const char *ints, const struct tm tm; int res = 0; int hour; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); hour = tm.tm_hour; if (!res) res = ast_say_number(chan, hour, ints, lang, "f"); @@ -5606,7 +5611,8 @@ int ast_say_time_pt_BR(struct ast_channel *chan, time_t t, const char *ints, con { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); res = ast_say_number(chan, tm.tm_hour, ints, lang, "f"); if (!res) { @@ -5635,7 +5641,8 @@ int ast_say_time_tw(struct ast_channel *chan, time_t t, const char *ints, const struct tm tm; int res = 0; int hour, pm=0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); hour = tm.tm_hour; if (!hour) hour = 12; @@ -5702,7 +5709,8 @@ int ast_say_datetime_en(struct ast_channel *chan, time_t t, const char *ints, co char fn[256]; int res = 0; int hour, pm=0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); res = ast_streamfile(chan, fn, lang); @@ -5765,7 +5773,8 @@ int ast_say_datetime_de(struct ast_channel *chan, time_t t, const char *ints, co { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); res = ast_say_date(chan, t, ints, lang); if (!res) ast_say_time(chan, t, ints, lang); @@ -5779,7 +5788,8 @@ int ast_say_datetime_fr(struct ast_channel *chan, time_t t, const char *ints, co struct tm tm; char fn[256]; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); if (!res) res = ast_say_number(chan, tm.tm_mday, ints, lang, (char *) NULL); @@ -5817,7 +5827,8 @@ int ast_say_datetime_nl(struct ast_channel *chan, time_t t, const char *ints, co { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); res = ast_say_date(chan, t, ints, lang); if (!res) { res = ast_streamfile(chan, "digits/nl-om", lang); @@ -5836,7 +5847,8 @@ int ast_say_datetime_pt(struct ast_channel *chan, time_t t, const char *ints, co char fn[256]; int res = 0; int hour, pm=0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); if (!res) { snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday); res = ast_streamfile(chan, fn, lang); @@ -5899,7 +5911,8 @@ int ast_say_datetime_pt_BR(struct ast_channel *chan, time_t t, const char *ints, { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); res = ast_say_date(chan, t, ints, lang); if (!res) res = ast_say_time(chan, t, ints, lang); @@ -5913,7 +5926,8 @@ int ast_say_datetime_tw(struct ast_channel *chan, time_t t, const char *ints, co char fn[256]; int res = 0; int hour, pm=0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); if (!res) res = ast_say_number(chan, tm.tm_year + 1900, ints, lang, (char *) NULL); if (!res) { @@ -5992,8 +6006,8 @@ int ast_say_datetime_from_now_en(struct ast_channel *chan, time_t t, const char time(&nowt); - localtime_r(&t,&tm); - localtime_r(&nowt,&now); + ast_localtime(&t, &tm, NULL); + ast_localtime(&nowt,&now, NULL); daydiff = now.tm_yday - tm.tm_yday; if ((daydiff < 0) || (daydiff > 6)) { /* Day of month and month */ @@ -6032,8 +6046,8 @@ int ast_say_datetime_from_now_fr(struct ast_channel *chan, time_t t, const char time(&nowt); - localtime_r(&t,&tm); - localtime_r(&nowt,&now); + ast_localtime(&t, &tm, NULL); + ast_localtime(&nowt, &now, NULL); daydiff = now.tm_yday - tm.tm_yday; if ((daydiff < 0) || (daydiff > 6)) { /* Day of month and month */ @@ -6072,8 +6086,8 @@ int ast_say_datetime_from_now_pt(struct ast_channel *chan, time_t t, const char time(&nowt); - localtime_r(&t,&tm); - localtime_r(&nowt,&now); + ast_localtime(&t, &tm, NULL); + ast_localtime(&nowt, &now, NULL); daydiff = now.tm_yday - tm.tm_yday; if ((daydiff < 0) || (daydiff > 6)) { /* Day of month and month */ @@ -6296,7 +6310,7 @@ static int ast_say_time_gr(struct ast_channel *chan, time_t t, const char *ints, int res = 0; int hour, pm=0; - localtime_r(&t,&tm); + ast_localtime(&t, &tm, NULL); hour = tm.tm_hour; if (!hour) @@ -6341,7 +6355,8 @@ static int ast_say_datetime_gr(struct ast_channel *chan, time_t t, const char *i struct tm tm; char fn[256]; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); /* W E E K - D A Y */ @@ -6829,7 +6844,8 @@ static int ast_say_time_ge(struct ast_channel *chan, time_t t, const char *ints, { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); res = ast_say_number(chan, tm.tm_hour, ints, lang, (char*)NULL); if (!res) { @@ -6859,7 +6875,8 @@ static int ast_say_datetime_ge(struct ast_channel *chan, time_t t, const char *i { struct tm tm; int res = 0; - localtime_r(&t,&tm); + + ast_localtime(&t, &tm, NULL); res = ast_say_date(chan, t, ints, lang); if (!res) ast_say_time(chan, t, ints, lang); @@ -6882,8 +6899,8 @@ static int ast_say_datetime_from_now_ge(struct ast_channel *chan, time_t t, cons time(&nowt); - localtime_r(&t,&tm); - localtime_r(&nowt,&now); + ast_localtime(&t, &tm, NULL); + ast_localtime(&nowt, &now, NULL); daydiff = now.tm_yday - tm.tm_yday; if ((daydiff < 0) || (daydiff > 6)) { /* Day of month and month */ |