[asterisk-commits] seanbright: trunk r137110 - /trunk/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Aug 10 15:57:27 CDT 2008


Author: seanbright
Date: Sun Aug 10 15:57:25 2008
New Revision: 137110

URL: http://svn.digium.com/view/asterisk?view=rev&rev=137110
Log:
That's all, folks.  Not going to update the Makefile until res_jabber is
converted (snuffy, you there? :))

Modified:
    trunk/main/say.c
    trunk/main/sched.c
    trunk/main/taskprocessor.c
    trunk/main/udptl.c

Modified: trunk/main/say.c
URL: http://svn.digium.com/view/asterisk/trunk/main/say.c?view=diff&rev=137110&r1=137109&r2=137110
==============================================================================
--- trunk/main/say.c (original)
+++ trunk/main/say.c Sun Aug 10 15:57:25 2008
@@ -368,19 +368,19 @@
 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);
@@ -3099,10 +3099,10 @@
 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);
@@ -3127,11 +3127,11 @@
 /* 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);
@@ -3176,11 +3176,11 @@
 /* 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);
@@ -3226,11 +3226,11 @@
 /* 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);
@@ -3258,11 +3258,11 @@
 /* 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);
@@ -3287,11 +3287,11 @@
 /* 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);
@@ -3316,11 +3316,11 @@
 /* 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);
@@ -3352,12 +3352,12 @@
 /* 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);
@@ -3379,11 +3379,11 @@
 /* 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);
@@ -3410,44 +3410,44 @@
 	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)
-{
-	struct timeval tv = { time, 0 };
+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 when = { t, 0 };
 	struct ast_tm tm;
 	int res=0, offset, sndoffset;
 	char sndfile[256], nextmsg[256];
@@ -3455,7 +3455,7 @@
 	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);
@@ -3537,13 +3537,13 @@
 				}
 				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);
 						}
 					}
@@ -3588,28 +3588,28 @@
 					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;
@@ -3624,32 +3624,32 @@
 					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 */
@@ -3667,7 +3667,7 @@
 				}
 				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 '	':
@@ -3686,9 +3686,9 @@
 }
 
 /* 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)
-{
-	struct timeval tv = { time, 0 };
+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 when = { t, 0 };
 	struct ast_tm tm;
 	int res=0, offset, sndoffset;
 	char sndfile[256], nextmsg[256];
@@ -3696,7 +3696,7 @@
 	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);
@@ -3813,18 +3813,18 @@
 					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;
@@ -3838,25 +3838,25 @@
 					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 */
@@ -3869,7 +3869,7 @@
 				}
 				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 '	':
@@ -3888,9 +3888,9 @@
 }
 
 /* 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)
-{
-	struct timeval tv = { time, 0 };
+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 when = { t, 0 };
 	struct ast_tm tm;
 	int res=0, offset, sndoffset;
 	char sndfile[256], nextmsg[256];
@@ -3898,7 +3898,7 @@
 	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);
@@ -4013,18 +4013,18 @@
 					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;
@@ -4038,25 +4038,25 @@
 					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 */
@@ -4069,7 +4069,7 @@
 				}
 				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 '	':
@@ -4088,9 +4088,9 @@
 }
 
 /* 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)
-{
-	struct timeval tv = { time, 0 };
+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 when = { t, 0 };
 	struct ast_tm tm;
 	int res=0, offset, sndoffset;
 	char sndfile[256], nextmsg[256];
@@ -4098,7 +4098,7 @@
 	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);
@@ -4171,28 +4171,28 @@
 					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;
@@ -4206,38 +4206,38 @@
 					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 '	':
@@ -4278,12 +4278,12 @@
 #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];
@@ -4292,7 +4292,7 @@
 		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);
@@ -4362,28 +4362,28 @@
 					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,
@@ -4391,18 +4391,18 @@
 				);
 				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 '	':
@@ -4422,9 +4422,9 @@
 
 
 /* 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)
-{
-	struct timeval tv = { time, 0 };
+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 when = { t, 0 };
 	struct ast_tm tm;
 	int res=0, offset, sndoffset;
 	char sndfile[256], nextmsg[256];
@@ -4432,7 +4432,7 @@
 	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);
@@ -4514,18 +4514,18 @@
 					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;
@@ -4539,26 +4539,26 @@
 					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 */
@@ -4590,7 +4590,7 @@
 				}
 				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 '	':
@@ -4611,9 +4611,9 @@
 /* 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)
-{
-	struct timeval tv = { time, 0 };
+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 when = { t, 0 };
 	struct ast_tm tm;
 	int res=0, offset, sndoffset;
 	char sndfile[256], nextmsg[256];
@@ -4621,7 +4621,7 @@
 	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);
@@ -4735,18 +4735,18 @@
 					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;
@@ -4760,25 +4760,25 @@
 					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 {

[... 1349 lines stripped ...]



More information about the asterisk-commits mailing list