static int ast_say_date_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
static int ast_say_date_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
-static int ast_say_date_with_format_en(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_da(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_de(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_es(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_he(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_fr(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_it(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_nl(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_pl(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
-static int ast_say_date_with_format_th(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone);
+static int ast_say_date_with_format_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_da(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_es(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_it(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_pl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
+static int ast_say_date_with_format_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone);
static int ast_say_time_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
static int ast_say_time_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
int ast_say_date_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
struct ast_tm tm;
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* Danish syntax */
int ast_say_date_da(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* German syntax */
int ast_say_date_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* Hungarian syntax */
int ast_say_date_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res)
res = ast_say_number(chan, tm.tm_year + 1900, ints, lang, (char *) NULL);
/* French syntax */
int ast_say_date_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* Dutch syntax */
int ast_say_date_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* Thai syntax */
int ast_say_date_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* Portuguese syntax */
int ast_say_date_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
if (!res)
res = wait_file(chan, ints, fn, lang);
/* Hebrew syntax */
int ast_say_date_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
return res;
}
-static int say_date_with_format(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+static int say_date_with_format(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
if (!strcasecmp(lang, "en") ) { /* English syntax */
- return(ast_say_date_with_format_en(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_en(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "da") ) { /* Danish syntax */
- return(ast_say_date_with_format_da(chan, time, ints, lang, format, timezone));
+ return(ast_say_date_with_format_da(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "de") ) { /* German syntax */
- return(ast_say_date_with_format_de(chan, time, ints, lang, format, timezone));
+ return(ast_say_date_with_format_de(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "es") || !strcasecmp(lang, "mx")) { /* Spanish syntax */
- return (ast_say_date_with_format_es(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_es(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "he")) { /* Hebrew syntax */
- return (ast_say_date_with_format_he(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_he(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "fr")) { /* French syntax */
- return (ast_say_date_with_format_fr(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_fr(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "it")) { /* Italian syntax */
- return (ast_say_date_with_format_it(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_it(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "nl")) { /* Dutch syntax */
- return (ast_say_date_with_format_nl(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_nl(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "pl")) { /* Polish syntax */
- return (ast_say_date_with_format_pl(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_pl(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "pt") || !strcasecmp(lang, "pt_BR")) { /* Portuguese syntax */
- return(ast_say_date_with_format_pt(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_pt(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "tw") || !strcasecmp(lang, "zh") ) { /* Taiwanese / Chinese syntax */
- return(ast_say_date_with_format_tw(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_tw(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "th") ) { /* Thai syntax */
- return(ast_say_date_with_format_th(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_th(chan, t, ints, lang, format, tzone));
} else if (!strcasecmp(lang, "gr") ) { /* Greek syntax */
- return(ast_say_date_with_format_gr(chan, time, ints, lang, format, timezone));
+ return (ast_say_date_with_format_gr(chan, t, ints, lang, format, tzone));
}
/* Default to English */
- return(ast_say_date_with_format_en(chan, time, ints, lang, format, timezone));
+ return(ast_say_date_with_format_en(chan, t, ints, lang, format, tzone));
}
/* English syntax */
-int ast_say_date_with_format_en(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "ABdY 'digits/at' IMp";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
}
if (!res) {
if (tm.tm_hour != 0) {
- int remainder = tm.tm_hour;
+ int remaining = tm.tm_hour;
if (tm.tm_hour > 20) {
res = wait_file(chan, ints, "digits/20", lang);
- remainder -= 20;
+ remaining -= 20;
}
if (!res) {
- snprintf(nextmsg, sizeof(nextmsg), "digits/%d", remainder);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", remaining);
res = wait_file(chan, ints, nextmsg, lang);
}
}
time_t beg_today;
gettimeofday(&now, NULL);
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
- } else if (beg_today - 2628000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "A", tzone);
+ } else if (beg_today - 2628000 < t) {
/* Less than a month ago - "Sunday, October third" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "ABd", timezone);
- } else if (beg_today - 15768000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "ABd", tzone);
+ } else if (beg_today - 15768000 < t) {
/* Less than 6 months ago - "August seventh" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "Bd", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "Bd", tzone);
} else {
/* More than 6 months ago - "April nineteenth two thousand three" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "BdY", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "BdY", tzone);
}
}
break;
time_t beg_today;
now = ast_tvnow();
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
- } else if (beg_today - 2628000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "A", tzone);
+ } else if (beg_today - 2628000 < t) {
/* Less than a month ago - "Sunday, October third" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "ABd", timezone);
- } else if (beg_today - 15768000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "ABd", tzone);
+ } else if (beg_today - 15768000 < t) {
/* Less than 6 months ago - "August seventh" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "Bd", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "Bd", tzone);
} else {
/* More than 6 months ago - "April nineteenth two thousand three" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "BdY", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "BdY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_en(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_en(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
}
/* Danish syntax */
-int ast_say_date_with_format_da(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_da(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (!format)
format = "A dBY HMS";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_da(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_da(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_da(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_da(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_da(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_da(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_da(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_da(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_da(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_da(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
}
/* German syntax */
-int ast_say_date_with_format_de(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (!format)
format = "A dBY HMS";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_de(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_de(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_de(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_de(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_de(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_de(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_de(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_de(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_de(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_de(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
}
/* Thai syntax */
-int ast_say_date_with_format_th(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "a 'digits/tee' e 'digits/duan' hY I 'digits/naliga' M 'digits/natee'";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_log(LOG_DEBUG, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
- } else if (beg_today - 2628000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "A", tzone);
+ } else if (beg_today - 2628000 < t) {
/* Less than a month ago - "Sunday, October third" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "ABd", timezone);
- } else if (beg_today - 15768000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "ABd", tzone);
+ } else if (beg_today - 15768000 < t) {
/* Less than 6 months ago - "August seventh" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "Bd", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "Bd", tzone);
} else {
/* More than 6 months ago - "April nineteenth two thousand three" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "BdY", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "BdY", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "A", timezone);
- } else if (beg_today - 2628000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "A", tzone);
+ } else if (beg_today - 2628000 < t) {
/* Less than a month ago - "Sunday, October third" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "ABd", timezone);
- } else if (beg_today - 15768000 < time) {
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "ABd", tzone);
+ } else if (beg_today - 15768000 < t) {
/* Less than 6 months ago - "August seventh" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "Bd", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "Bd", tzone);
} else {
/* More than 6 months ago - "April nineteenth two thousand three" */
- res = ast_say_date_with_format_en(chan, time, ints, lang, "BdY", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "BdY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_en(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
res = ast_say_number(chan, tm.tm_sec, ints, lang, (char *) NULL);
break;
case 'T':
- res = ast_say_date_with_format_en(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_en(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
#define IL_DATE_STR "AdBY"
#define IL_TIME_STR "HM" /* NOTE: In Hebrew we do not support 12 hours, only 24. No AM or PM exists in the Hebrew language */
#define IL_DATE_STR_FULL IL_DATE_STR " 'digits/at' " IL_TIME_STR
-int ast_say_date_with_format_he(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
/* TODO: This whole function is cut&paste from
* ast_say_date_with_format_en . Is that considered acceptable?
**/
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0, offset, sndoffset;
char sndfile[256], nextmsg[256];
format = IL_DATE_STR_FULL;
}
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset = 0; format[offset] != '\0'; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
time_t beg_today;
char todo = format[offset]; /* The letter to format*/
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
if (todo == 'Q') {
res = wait_file(chan, ints, "digits/today", lang);
}
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if ((todo != 'Q') && (beg_today - 86400 * 6 < time)) {
+ } else if ((todo != 'Q') && (beg_today - 86400 * 6 < t)) {
/* Within the last week */
- res = ast_say_date_with_format_he(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_he(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_he(chan, time, ints, lang, IL_DATE_STR, timezone);
+ res = ast_say_date_with_format_he(chan, t, ints, lang, IL_DATE_STR, tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_he(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_he(chan, t, ints, lang, "HM", tzone);
break;
case 'S': /* Seconds */
res = ast_say_number_full_he(chan, tm.tm_sec,
);
break;
case 'T':
- res = ast_say_date_with_format_he(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_he(chan, t, ints, lang, "HMS", tzone);
break;
/* c, x, and X seem useful for testing. Not sure
* if they're good for the general public */
case 'c':
- res = ast_say_date_with_format_he(chan, time, ints, lang, IL_DATE_STR_FULL, timezone);
+ res = ast_say_date_with_format_he(chan, t, ints, lang, IL_DATE_STR_FULL, tzone);
break;
case 'x':
- res = ast_say_date_with_format_he(chan, time, ints, lang, IL_DATE_STR, timezone);
+ res = ast_say_date_with_format_he(chan, t, ints, lang, IL_DATE_STR, tzone);
break;
case 'X': /* Currently not locale-dependent...*/
- res = ast_say_date_with_format_he(chan, time, ints, lang, IL_TIME_STR, timezone);
+ res = ast_say_date_with_format_he(chan, t, ints, lang, IL_TIME_STR, tzone);
break;
case ' ':
case ' ':
/* Spanish syntax */
-int ast_say_date_with_format_es(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_es(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y 'digits/at' IMp";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_es(chan, time, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", timezone);
+ res = ast_say_date_with_format_es(chan, t, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_es(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_es(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_es(chan, time, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", timezone);
+ res = ast_say_date_with_format_es(chan, t, ints, lang, "'digits/es-el' Ad 'digits/es-de' B 'digits/es-de' Y", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_es(chan, time, ints, lang, "H 'digits/y' M", timezone);
+ res = ast_say_date_with_format_es(chan, t, ints, lang, "H 'digits/y' M", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_es(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_es(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
/* French syntax
oclock = heure
*/
-int ast_say_date_with_format_fr(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "AdBY 'digits/at' IMp";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_fr(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_fr(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_fr(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_fr(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_fr(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_fr(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_fr(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_fr(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_fr(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_fr(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
return res;
}
-int ast_say_date_with_format_it(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_it(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "AdB 'digits/at' IMp";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_it(chan, time, ints, lang, "AdB", timezone);
+ res = ast_say_date_with_format_it(chan, t, ints, lang, "AdB", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_it(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_it(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_it(chan, time, ints, lang, "AdB", timezone);
+ res = ast_say_date_with_format_it(chan, t, ints, lang, "AdB", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_it(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_it(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_it(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_it(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
}
/* Dutch syntax */
-int ast_say_date_with_format_nl(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "ABdY 'digits/at' IMp";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_nl(chan, time, ints, lang, "ABdY", timezone);
+ res = ast_say_date_with_format_nl(chan, t, ints, lang, "ABdY", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_nl(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_nl(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_nl(chan, time, ints, lang, "ABdY", timezone);
+ res = ast_say_date_with_format_nl(chan, t, ints, lang, "ABdY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_nl(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_nl(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
res = ast_say_number(chan, tm.tm_sec, ints, lang, (char *) NULL);
break;
case 'T':
- res = ast_say_date_with_format_nl(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_nl(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
}
/* Polish syntax */
-int ast_say_date_with_format_pl(struct ast_channel *chan, time_t thetime, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_pl(struct ast_channel *chan, time_t thetime, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { thetime, 0 };
+ struct timeval when = { thetime, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset = 0 ; format[offset] != '\0' ; offset++) {
- int remainder;
+ int remaining;
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
switch (format[offset]) {
/* NOTE: if you add more options here, please try to be consistent with strftime(3) */
case 'd':
case 'e':
/* First - Thirtyfirst */
- remainder = tm.tm_mday;
+ remaining = tm.tm_mday;
if (tm.tm_mday > 30) {
res = wait_file(chan, ints, "digits/h-30", lang);
- remainder -= 30;
+ remaining -= 30;
}
if (tm.tm_mday > 20 && tm.tm_mday < 30) {
res = wait_file(chan, ints, "digits/h-20", lang);
- remainder -= 20;
+ remaining -= 20;
}
if (!res) {
- snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", remainder);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/h-%d", remaining);
res = wait_file(chan, ints, nextmsg, lang);
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format(chan, thetime, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format(chan, thetime, ints, lang, "AdBY", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
res = wait_file(chan, ints, "digits/yesterday", lang);
} else if (beg_today - 86400 * 6 < thetime) {
/* Within the last week */
- res = ast_say_date_with_format(chan, thetime, ints, lang, "A", timezone);
+ res = ast_say_date_with_format(chan, thetime, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format(chan, thetime, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format(chan, thetime, ints, lang, "AdBY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format(chan, thetime, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format(chan, thetime, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format(chan, thetime, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format(chan, thetime, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
}
/* Portuguese syntax */
-int ast_say_date_with_format_pt(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "Ad 'digits/pt-de' B 'digits/pt-de' Y I 'digits/pt-e' Mp";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
res = ast_say_number(chan, -tm.tm_hour, ints, lang, NULL);
if (!res) {
if (tm.tm_hour != 0) {
- int remainder = tm.tm_hour;
+ int remaining = tm.tm_hour;
if (tm.tm_hour > 20) {
res = wait_file(chan, ints, "digits/20", lang);
- remainder -= 20;
+ remaining -= 20;
}
if (!res) {
- snprintf(nextmsg, sizeof(nextmsg), "digits/%d", remainder);
+ snprintf(nextmsg, sizeof(nextmsg), "digits/%d", remaining);
res = wait_file(chan, ints, nextmsg, lang);
}
}
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_pt(chan, time, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", timezone);
+ res = ast_say_date_with_format_pt(chan, t, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_pt(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_pt(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_pt(chan, time, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", timezone);
+ res = ast_say_date_with_format_pt(chan, t, ints, lang, "Ad 'digits/pt-de' B 'digits/pt-de' Y", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_pt(chan, time, ints, lang, "H 'digits/pt-e' M", timezone);
+ res = ast_say_date_with_format_pt(chan, t, ints, lang, "H 'digits/pt-e' M", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_pt(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_pt(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
}
/* Taiwanese / Chinese syntax */
-int ast_say_date_with_format_tw(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+int ast_say_date_with_format_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (format == NULL)
format = "YBdAkM";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_tw(chan, time, ints, lang, "YBdA", timezone);
+ res = ast_say_date_with_format_tw(chan, t, ints, lang, "YBdA", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_tw(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_tw(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_tw(chan, time, ints, lang, "YBdA", timezone);
+ res = ast_say_date_with_format_tw(chan, t, ints, lang, "YBdA", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_tw(chan, time, ints, lang, "kM", timezone);
+ res = ast_say_date_with_format_tw(chan, t, ints, lang, "kM", tzone);
break;
case 'S':
/* Seconds */
}
break;
case 'T':
- res = ast_say_date_with_format_tw(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_tw(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
/* English syntax */
int ast_say_time_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
int hour, pm=0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
hour = tm.tm_hour;
if (!hour)
hour = 12;
/* German syntax */
int ast_say_time_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res)
res = ast_say_number(chan, tm.tm_hour, ints, lang, "n");
if (!res)
/* Hungarian syntax */
int ast_say_time_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res)
res = ast_say_number(chan, tm.tm_hour, ints, lang, "n");
if (!res)
/* French syntax */
int ast_say_time_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_number(chan, tm.tm_hour, ints, lang, "f");
if (!res)
/* Dutch syntax */
int ast_say_time_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res)
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char *) NULL);
if (!res)
/* Portuguese syntax */
int ast_say_time_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
int hour;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
hour = tm.tm_hour;
if (!res)
res = ast_say_number(chan, hour, ints, lang, "f");
/* Brazilian Portuguese syntax */
int ast_say_time_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_number(chan, tm.tm_hour, ints, lang, "f");
if (!res) {
/* Thai syntax */
int ast_say_time_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
int hour;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
hour = tm.tm_hour;
if (!hour)
hour = 24;
/* Taiwanese / Chinese syntax */
int ast_say_time_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
int hour, pm=0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
hour = tm.tm_hour;
if (!hour)
hour = 12;
/* Hebrew syntax */
int ast_say_time_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
int hour;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
hour = tm.tm_hour;
if (!hour)
hour = 12;
/* English syntax */
int ast_say_datetime_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
int hour, pm=0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* German syntax */
int ast_say_datetime_de(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_date(chan, t, ints, lang);
if (!res)
ast_say_time(chan, t, ints, lang);
/* Hungarian syntax */
int ast_say_datetime_hu(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_date(chan, t, ints, lang);
if (!res)
ast_say_time(chan, t, ints, lang);
/* French syntax */
int ast_say_datetime_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res)
res = ast_say_number(chan, tm.tm_mday, ints, lang, (char *) NULL);
/* Dutch syntax */
int ast_say_datetime_nl(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_date(chan, t, ints, lang);
if (!res) {
res = ast_streamfile(chan, "digits/nl-om", lang);
/* Portuguese syntax */
int ast_say_datetime_pt(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
int hour, pm=0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* Brazilian Portuguese syntax */
int ast_say_datetime_pt_BR(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_date(chan, t, ints, lang);
if (!res)
res = ast_say_time(chan, t, ints, lang);
/* Thai syntax */
int ast_say_datetime_th(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
int hour;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
/* Taiwanese / Chinese syntax */
int ast_say_datetime_tw(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
int hour, pm=0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res)
res = ast_say_number(chan, tm.tm_year + 1900, ints, lang, (char *) NULL);
if (!res) {
/* Hebrew syntax */
int ast_say_datetime_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
int hour;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
res = ast_streamfile(chan, fn, lang);
int ast_say_datetime_from_now_en(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
int res=0;
- struct timeval nowtv = ast_tvnow(), tv = { t, 0 };
+ struct timeval nowtv = ast_tvnow(), when = { t, 0 };
int daydiff;
struct ast_tm tm;
struct ast_tm now;
char fn[256];
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
ast_localtime(&nowtv, &now, NULL);
daydiff = now.tm_yday - tm.tm_yday;
if ((daydiff < 0) || (daydiff > 6)) {
int ast_say_datetime_from_now_fr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
int res=0;
- struct timeval nowtv = ast_tvnow(), tv = { t, 0 };
+ struct timeval nowtv = ast_tvnow(), when = { t, 0 };
int daydiff;
struct ast_tm tm;
struct ast_tm now;
char fn[256];
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
ast_localtime(&nowtv, &now, NULL);
daydiff = now.tm_yday - tm.tm_yday;
if ((daydiff < 0) || (daydiff > 6)) {
int daydiff;
struct ast_tm tm;
struct ast_tm now;
- struct timeval nowtv = ast_tvnow(), tv = { t, 0 };
+ struct timeval nowtv = ast_tvnow(), when = { t, 0 };
char fn[256];
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
ast_localtime(&nowtv, &now, NULL);
daydiff = now.tm_yday - tm.tm_yday;
if ((daydiff < 0) || (daydiff > 6)) {
int ast_say_datetime_from_now_he(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
int res = 0;
- struct timeval nowt = ast_tvnow(), tv = { t, 0 };
+ struct timeval nowt = ast_tvnow(), when = { t, 0 };
int daydiff;
struct ast_tm tm;
struct ast_tm now;
char fn[256];
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
ast_localtime(&nowt, &now, NULL);
daydiff = now.tm_yday - tm.tm_yday;
if ((daydiff < 0) || (daydiff > 6)) {
static int ast_say_date_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
struct ast_tm tm;
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
/* W E E K - D A Y */
if (!res) {
snprintf(fn, sizeof(fn), "digits/day-%d", tm.tm_wday);
static int ast_say_time_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
int hour, pm=0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
hour = tm.tm_hour;
if (!hour)
static int ast_say_datetime_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
/* W E E K - D A Y */
if (!res) {
return res;
}
-static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t time, const char *ints, const char *lang, const char *format, const char *timezone)
+static int ast_say_date_with_format_gr(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *tzone)
{
- struct timeval tv = { time, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res=0, offset, sndoffset;
char sndfile[256], nextmsg[256];
if (!format)
format = "AdBY 'digits/at' IMp";
- ast_localtime(&tv, &tm, timezone);
+ ast_localtime(&when, &tm, tzone);
for (offset=0 ; format[offset] != '\0' ; offset++) {
ast_debug(1, "Parsing %c (offset %d) in %s\n", format[offset], offset, format);
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
res = wait_file(chan, ints, "digits/today", lang);
- } else if (beg_today - 86400 < time) {
+ } else if (beg_today - 86400 < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
} else {
- res = ast_say_date_with_format_gr(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_gr(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
struct ast_tm tmnow;
time_t beg_today;
- ast_localtime(&now, &tmnow, timezone);
+ ast_localtime(&now, &tmnow, tzone);
/* This might be slightly off, if we transcend a leap second, but never more off than 1 second */
/* In any case, it saves not having to do ast_mktime() */
beg_today = now.tv_sec - (tmnow.tm_hour * 3600) - (tmnow.tm_min * 60) - (tmnow.tm_sec);
- if (beg_today < time) {
+ if (beg_today < t) {
/* Today */
- } else if ((beg_today - 86400) < time) {
+ } else if ((beg_today - 86400) < t) {
/* Yesterday */
res = wait_file(chan, ints, "digits/yesterday", lang);
- } else if (beg_today - 86400 * 6 < time) {
+ } else if (beg_today - 86400 * 6 < t) {
/* Within the last week */
- res = ast_say_date_with_format_gr(chan, time, ints, lang, "A", timezone);
+ res = ast_say_date_with_format_gr(chan, t, ints, lang, "A", tzone);
} else {
- res = ast_say_date_with_format_gr(chan, time, ints, lang, "AdBY", timezone);
+ res = ast_say_date_with_format_gr(chan, t, ints, lang, "AdBY", tzone);
}
}
break;
case 'R':
- res = ast_say_date_with_format_gr(chan, time, ints, lang, "HM", timezone);
+ res = ast_say_date_with_format_gr(chan, t, ints, lang, "HM", tzone);
break;
case 'S':
/* Seconds */
res = wait_file(chan, ints, nextmsg, lang);
break;
case 'T':
- res = ast_say_date_with_format_gr(chan, time, ints, lang, "HMS", timezone);
+ res = ast_say_date_with_format_gr(chan, t, ints, lang, "HMS", tzone);
break;
case ' ':
case ' ':
{
char buf[256];
int digit = 0;
- int remainder = 0;
+ int remaining = 0;
if (num < 0) {
if (num < 1000) { /* as, oras, samas, ..., cxraas. asi, orasi, ..., cxraasi. */
- remainder = num % 100;
- digit = (num - remainder) / 100;
+ remaining = num % 100;
+ digit = (num - remaining) / 100;
- if (remainder == 0) {
+ if (remaining == 0) {
snprintf(buf, sizeof(buf), "%d", num);
strncat(res, buf, res_len - strlen(res) - 1);
return res;
} else {
snprintf(buf, sizeof(buf), "%d_ ", digit*100);
strncat(res, buf, res_len - strlen(res) - 1);
- return ast_translate_number_ge(remainder, res, res_len);
+ return ast_translate_number_ge(remaining, res, res_len);
}
}
if (num < 1000000) {
- remainder = num % 1000;
- digit = (num - remainder) / 1000;
+ remaining = num % 1000;
+ digit = (num - remaining) / 1000;
- if (remainder == 0) {
+ if (remaining == 0) {
ast_translate_number_ge(digit, res, res_len);
strncat(res, " 1000", res_len - strlen(res) - 1);
return res;
if (digit == 1) {
strncat(res, "1000_ ", res_len - strlen(res) - 1);
- return ast_translate_number_ge(remainder, res, res_len);
+ return ast_translate_number_ge(remaining, res, res_len);
}
ast_translate_number_ge(digit, res, res_len);
strncat(res, " 1000_ ", res_len - strlen(res) - 1);
- return ast_translate_number_ge(remainder, res, res_len);
+ return ast_translate_number_ge(remaining, res, res_len);
}
if (num < 1000000000) {
- remainder = num % 1000000;
- digit = (num - remainder) / 1000000;
+ remaining = num % 1000000;
+ digit = (num - remaining) / 1000000;
- if (remainder == 0) {
+ if (remaining == 0) {
ast_translate_number_ge(digit, res, res_len);
strncat(res, " 1000000", res_len - strlen(res) - 1);
return res;
ast_translate_number_ge(digit, res, res_len);
strncat(res, " 1000000_ ", res_len - strlen(res) - 1);
- return ast_translate_number_ge(remainder, res, res_len);
+ return ast_translate_number_ge(remaining, res, res_len);
}
if (num > 1000000000) {
- remainder = num % 1000000000;
- digit = (num - remainder) / 1000000000;
+ remaining = num % 1000000000;
+ digit = (num - remaining) / 1000000000;
- if (remainder == 0) {
+ if (remaining == 0) {
ast_translate_number_ge(digit, res, res_len);
strncat(res, " 1000000000", res_len - strlen(res) - 1);
return res;
ast_translate_number_ge(digit, res, res_len);
strncat(res, " 1000000000_ ", res_len - strlen(res) - 1);
- return ast_translate_number_ge(remainder, res, res_len);
+ return ast_translate_number_ge(remaining, res, res_len);
}
int res = 0;
char fn[512] = "";
char* s = 0;
- const char* remainder = fn;
+ const char* remaining = fn;
if (!num)
return ast_say_digits_full(chan, 0, ints, language, audiofd, ctrlfd);
- while (res == 0 && (s = strstr(remainder, " "))) {
- size_t len = s - remainder;
+ while (res == 0 && (s = strstr(remaining, " "))) {
+ size_t len = s - remaining;
char* new_string = ast_malloc(len + 1 + strlen("digits/"));
sprintf(new_string, "digits/");
- strncat(new_string, remainder, len); /* we can't sprintf() it, it's not null-terminated. */
+ strncat(new_string, remaining, len); /* we can't sprintf() it, it's not null-terminated. */
/* new_string[len + strlen("digits/")] = '\0'; */
if (!ast_streamfile(chan, new_string, language)) {
ast_free(new_string);
- remainder = s + 1; /* position just after the found space char. */
- while (*remainder == ' ') /* skip multiple spaces */
- remainder++;
+ remaining = s + 1; /* position just after the found space char. */
+ while (*remaining == ' ') /* skip multiple spaces */
+ remaining++;
}
/* the last chunk. */
- if (res == 0 && *remainder) {
+ if (res == 0 && *remaining) {
- char* new_string = ast_malloc(strlen(remainder) + 1 + strlen("digits/"));
- sprintf(new_string, "digits/%s", remainder);
+ char* new_string = ast_malloc(strlen(remaining) + 1 + strlen("digits/"));
+ sprintf(new_string, "digits/%s", remaining);
if (!ast_streamfile(chan, new_string, language)) {
if ((audiofd > -1) && (ctrlfd > -1))
/* Georgian syntax. e.g. "oriatas xuti tslis 5 noemberi". */
static int ast_say_date_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
char fn[256];
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
if (!res)
res = ast_say_number(chan, tm.tm_year + 1900, ints, lang, (char *) NULL);
/* Georgian syntax. e.g. "otxi saati da eqvsi tsuti" */
static int ast_say_time_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_number(chan, tm.tm_hour, ints, lang, (char*)NULL);
if (!res) {
/* Georgian syntax. Say date, then say time. */
static int ast_say_datetime_ge(struct ast_channel *chan, time_t t, const char *ints, const char *lang)
{
- struct timeval tv = { t, 0 };
+ struct timeval when = { t, 0 };
struct ast_tm tm;
int res = 0;
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
res = ast_say_date(chan, t, ints, lang);
if (!res)
ast_say_time(chan, t, ints, lang);
int daydiff;
struct ast_tm tm;
struct ast_tm now;
- struct timeval tv = { t, 0 }, nowt = ast_tvnow();
+ struct timeval when = { t, 0 }, nowt = ast_tvnow();
char fn[256];
- ast_localtime(&tv, &tm, NULL);
+ ast_localtime(&when, &tm, NULL);
ast_localtime(&nowt, &now, NULL);
daydiff = now.tm_yday - tm.tm_yday;
if ((daydiff < 0) || (daydiff > 6)) {