[asterisk-commits] twilson: branch twilson/calendaring r156482 - in /team/twilson/calendaring: i...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 12 18:22:28 CST 2008


Author: twilson
Date: Wed Nov 12 18:22:28 2008
New Revision: 156482

URL: http://svn.digium.com/view/asterisk?view=rev&rev=156482
Log:
Whitespace cleanup

Modified:
    team/twilson/calendaring/include/asterisk/calendar.h
    team/twilson/calendaring/main/calendar.c
    team/twilson/calendaring/res/res_caldav.c
    team/twilson/calendaring/res/res_exchangecal.c
    team/twilson/calendaring/res/res_icalendar.c

Modified: team/twilson/calendaring/include/asterisk/calendar.h
URL: http://svn.digium.com/view/asterisk/team/twilson/calendaring/include/asterisk/calendar.h?view=diff&rev=156482&r1=156481&r2=156482
==============================================================================
--- team/twilson/calendaring/include/asterisk/calendar.h (original)
+++ team/twilson/calendaring/include/asterisk/calendar.h Wed Nov 12 18:22:28 2008
@@ -26,7 +26,7 @@
 #include "asterisk/lock.h"
 
 /*! \file calendar.h
- * \brief A general API for managing calendar events with Asterisk 
+ * \brief A general API for managing calendar events with Asterisk
  *
  * \author Terry Wilson <twilson at digium.com>
  *
@@ -77,7 +77,7 @@
 	int (* is_busy)(struct ast_calendar *calendar); /*!< Override default busy determination */
 	void *(* load_calendar)(void *data);   /*!< Create private structure, add calendar events, etc. */
 	void *(* unref_calendar)(void *obj);   /*!< Function to be called to free the private structure */
-	int (* write_event)(struct ast_calendar_event *event);  /*!< Function for writing an event to the calendar */ 
+	int (* write_event)(struct ast_calendar_event *event);  /*!< Function for writing an event to the calendar */
 };
 
 enum ast_calendar_busy_state {

Modified: team/twilson/calendaring/main/calendar.c
URL: http://svn.digium.com/view/asterisk/team/twilson/calendaring/main/calendar.c?view=diff&rev=156482&r1=156481&r2=156482
==============================================================================
--- team/twilson/calendaring/main/calendar.c (original)
+++ team/twilson/calendaring/main/calendar.c Wed Nov 12 18:22:28 2008
@@ -73,7 +73,7 @@
 };
 
 AST_LIST_HEAD_NOLOCK_STATIC(techs, caltechlist);
-AST_LIST_HEAD_NOLOCK(eventlist, evententry); 
+AST_LIST_HEAD_NOLOCK(eventlist, evententry);
 
 static struct ast_calendar *unref_calendar(struct ast_calendar *cal)
 {
@@ -381,7 +381,7 @@
 		ast_log(LOG_ERROR, "Could not append channel\n");
 		goto notify_cleanup;
 	}
-	
+
 	ast_dial_set_global_timeout(dial, event->owner->notify_waittime);
 	if (!(chan = ast_channel_alloc(1, AST_STATE_DOWN, 0, 0, 0, 0, 0, 0, "Calendar/%s-%d", event->owner->name, event->notify_sched))) {
 		ast_log(LOG_ERROR, "Could not allocate notification channel\n");
@@ -438,7 +438,7 @@
 {
 	struct ast_calendar_event *event = (struct ast_calendar_event *)data;
 	struct timeval now = ast_tvnow();
-	
+
 	/* We can have overlapping events, so ignore the event->busy_state and check busy state
 	 * based on all events in the calendar */
 	if (!calendar_is_busy(event->owner)) {
@@ -479,7 +479,7 @@
 
 	devstate_sched_start = (event->start - now.tv_sec) * 1000;
 	devstate_sched_end = (event->end - now.tv_sec) * 1000;
-	
+
 	if (devstate_sched_start < 1) {
 		devstate_sched_start = 1;
 	}
@@ -586,7 +586,7 @@
 				ast_log(LOG_ERROR, "Could not allocate calendar structure. Stopping.\n");
 				return -1;
 			}
-			
+
 			if (!(cal->events = ao2_container_alloc(MAX_BUCKETS, event_hash_fn, event_cmp_fn))) {
 				ast_log(LOG_ERROR, "Could not allocate events container for %s\n", cat);
 			}
@@ -624,10 +624,10 @@
 					cal->timeframe = atoi(v->value);
 				}
 			}
-			
+
 			cal->thread = AST_PTHREADT_NULL;
 			ast_cond_init(&cal->unload, NULL);
-			
+
 			ao2_link(calendars, cal);
 
 			if (!(load_data = ast_malloc(sizeof(*load_data)))) {
@@ -810,7 +810,7 @@
 	if (ast_strlen_zero(args.calendar)) {
 		ast_log(LOG_WARNING, "CALENDAR_QUERY requires a calendar argument\n");
 		return -1;
-	}	
+	}
 
 	if (!(cal = find_calendar(args.calendar))) {
 		ast_log(LOG_WARNING, "Unknown calendar '%s'\n", args.calendar);
@@ -1168,7 +1168,7 @@
 	        "end         : The end time of the event\n"
 	        "busystate   : The busy state of the event 0=FREE, 1=TENTATIVE, 2=BUSY\n",
 	.read = calendar_event_read,
-};	
+};
 
 static void delete_calendars(void)
 {

Modified: team/twilson/calendaring/res/res_caldav.c
URL: http://svn.digium.com/view/asterisk/team/twilson/calendaring/res/res_caldav.c?view=diff&rev=156482&r1=156481&r2=156482
==============================================================================
--- team/twilson/calendaring/res/res_caldav.c (original)
+++ team/twilson/calendaring/res/res_caldav.c Wed Nov 12 18:22:28 2008
@@ -88,7 +88,7 @@
 static void *unref_caldav(void *obj)
 {
 	struct caldav_pvt *pvt = obj;
-	
+
 	ao2_ref(pvt, -1);
 	return NULL;
 }
@@ -107,7 +107,7 @@
 			case '<' : strcpy(buf, "&lt;"); break;
 			case '>' : strcpy(buf, "&gt;"); break;
 			default  : sprintf(buf, "%c", *tmp);
-		} 
+		}
 
 		ast_str_append(&dst, 0, "%s", buf);
 	}
@@ -383,7 +383,7 @@
 		event = ast_calendar_unref_event(event);
 		return;
 	}
-	
+
 	if (!(prop = icalcomponent_get_first_property(valarm, ICAL_TRIGGER_PROPERTY))) {
 		ast_log(LOG_WARNING, "VALARM has no TRIGGER, skipping!\n");
 		ao2_link(pvt->events, event);
@@ -531,7 +531,7 @@
 
 	if (!(cal && cfg)) {
 		ast_log(LOG_ERROR, "Required parameters not provided\n");
-		return NULL; 
+		return NULL;
 	}
 
 	if (!(pvt = ao2_alloc(sizeof(*pvt), caldav_destructor))) {
@@ -572,7 +572,7 @@
 	}
 
 	if (ne_uri_parse(pvt->url, &pvt->uri) || pvt->uri.host == NULL || pvt->uri.path == NULL) {
-		ast_log(LOG_WARNING, "Could not parse url '%s' for iCalendar '%s' - skipping.\n", pvt->url, cal->name); 
+		ast_log(LOG_WARNING, "Could not parse url '%s' for iCalendar '%s' - skipping.\n", pvt->url, cal->name);
 		pvt = unref_caldav(pvt);
 		return NULL;
 	}
@@ -584,7 +584,7 @@
 	if (pvt->uri.port == 0) {
 		pvt->uri.port = ne_uri_defaultport(pvt->uri.scheme);
 	}
-	
+
 	pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port);
 	ne_set_server_auth(pvt->session, auth_credentials, pvt);
 	if (!strncasecmp(pvt->uri.scheme, "https", sizeof(pvt->uri.scheme))) {
@@ -592,7 +592,7 @@
 	}
 
 	cal->tech_pvt = pvt;
-	
+
 	ast_mutex_init(&refreshlock);
 
 	/* Load it the first time */
@@ -625,7 +625,7 @@
 		}
 
 		ast_debug(10, "Refreshing after %d second timeout\n", pvt->owner->refresh);
-		
+
 		update_caldav(pvt);
 	}
 

Modified: team/twilson/calendaring/res/res_exchangecal.c
URL: http://svn.digium.com/view/asterisk/team/twilson/calendaring/res/res_exchangecal.c?view=diff&rev=156482&r1=156481&r2=156482
==============================================================================
--- team/twilson/calendaring/res/res_exchangecal.c (original)
+++ team/twilson/calendaring/res/res_exchangecal.c Wed Nov 12 18:22:28 2008
@@ -187,7 +187,7 @@
 		ast_string_field_build(event, description, "%s%s", event->description, str);
 	} else if (!strcasecmp(state->tag, "dtstart")) {
 		event->start = mstime_to_time_t(str);
-	} else if (!strcasecmp(state->tag, "dtend")) {	
+	} else if (!strcasecmp(state->tag, "dtend")) {
 		event->end = mstime_to_time_t(str);
 	} else if (!strcasecmp(state->tag, "busystatus")) {
 		event->busy_state = msbusy_to_bs(str);
@@ -222,7 +222,7 @@
 static void *unref_exchangecal(void *obj)
 {
 	struct exchangecal_pvt *pvt = obj;
-	
+
 	ao2_ref(pvt, -1);
 	return NULL;
 }
@@ -275,7 +275,7 @@
 			case '<' : strcpy(buf, "&lt;"); break;
 			case '>' : strcpy(buf, "&gt;"); break;
 			default  : sprintf(buf, "%c", *tmp);
-		} 
+		}
 
 		ast_str_append(&dst, 0, "%s", buf);
 	}
@@ -564,7 +564,7 @@
 	iks_parse(p, response->str, response->used, 1);
 	ast_calendar_merge_events(pvt->owner, pvt->events);
 	ast_free(response);
-	
+
 	return 0;
 }
 
@@ -579,7 +579,7 @@
 
 	if (!(cal && cfg)) {
 		ast_log(LOG_ERROR, "Required parameters not provided\n");
-		return NULL; 
+		return NULL;
 	}
 
 	if (!(pvt = ao2_alloc(sizeof(*pvt), exchangecal_destructor))) {
@@ -620,7 +620,7 @@
 	}
 
 	if (ne_uri_parse(pvt->url, &pvt->uri) || pvt->uri.host == NULL || pvt->uri.path == NULL) {
-		ast_log(LOG_WARNING, "Could not parse url '%s' for iCalendar '%s' - skipping.\n", pvt->url, cal->name); 
+		ast_log(LOG_WARNING, "Could not parse url '%s' for iCalendar '%s' - skipping.\n", pvt->url, cal->name);
 		pvt = unref_exchangecal(pvt);
 		return NULL;
 	}
@@ -632,7 +632,7 @@
 	if (pvt->uri.port == 0) {
 		pvt->uri.port = ne_uri_defaultport(pvt->uri.scheme);
 	}
-	
+
 	pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port);
 	ne_set_server_auth(pvt->session, auth_credentials, pvt);
 	if (!strncasecmp(pvt->uri.scheme, "https", sizeof(pvt->uri.scheme))) {
@@ -640,7 +640,7 @@
 	}
 
 	cal->tech_pvt = pvt;
-	
+
 	ast_mutex_init(&refreshlock);
 
 	/* Load it the first time */
@@ -673,7 +673,7 @@
 		}
 
 		ast_debug(10, "Refreshing after %d second timeout\n", pvt->owner->refresh);
-		
+
 		update_exchangecal(pvt);
 	}
 

Modified: team/twilson/calendaring/res/res_icalendar.c
URL: http://svn.digium.com/view/asterisk/team/twilson/calendaring/res/res_icalendar.c?view=diff&rev=156482&r1=156481&r2=156482
==============================================================================
--- team/twilson/calendaring/res/res_icalendar.c (original)
+++ team/twilson/calendaring/res/res_icalendar.c Wed Nov 12 18:22:28 2008
@@ -86,7 +86,7 @@
 static void *unref_icalendar(void *obj)
 {
 	struct icalendar_pvt *pvt = obj;
-	
+
 	ao2_ref(pvt, -1);
 	return NULL;
 }
@@ -225,7 +225,7 @@
 		event = ast_calendar_unref_event(event);
 		return;
 	}
-	
+
 	if (!(prop = icalcomponent_get_first_property(valarm, ICAL_TRIGGER_PROPERTY))) {
 		ast_log(LOG_WARNING, "VALARM has no TRIGGER, skipping!\n");
 		ao2_link(pvt->events, event);
@@ -345,7 +345,7 @@
 	}
 
 	if (ne_uri_parse(pvt->url, &pvt->uri) || pvt->uri.host == NULL || pvt->uri.path == NULL) {
-		ast_log(LOG_WARNING, "Could not parse url '%s' for iCalendar '%s' - skipping.\n", pvt->url, cal->name); 
+		ast_log(LOG_WARNING, "Could not parse url '%s' for iCalendar '%s' - skipping.\n", pvt->url, cal->name);
 		pvt = unref_icalendar(pvt);
 		return NULL;
 	}
@@ -357,7 +357,7 @@
 	if (pvt->uri.port == 0) {
 		pvt->uri.port = ne_uri_defaultport(pvt->uri.scheme);
 	}
-	
+
 	pvt->session = ne_session_create(pvt->uri.scheme, pvt->uri.host, pvt->uri.port);
 	ne_set_server_auth(pvt->session, auth_credentials, pvt);
 	if (!strncasecmp(pvt->uri.scheme, "https", sizeof(pvt->uri.scheme))) {
@@ -365,7 +365,7 @@
 	}
 
 	cal->tech_pvt = pvt;
-	
+
 	ast_mutex_init(&refreshlock);
 
 	/* Load it the first time */
@@ -374,7 +374,7 @@
 	}
 
 	icalendar_update_events(pvt);
-	
+
 	ao2_unlock(cal);
 
 	cfg = NULL;
@@ -402,7 +402,7 @@
 		}
 
 		ast_debug(10, "Refreshing after %d second timeout\n", pvt->owner->refresh);
-		
+
 		if (!(pvt->data = fetch_icalendar(pvt))) {
 			ast_log(LOG_WARNING, "Unable to parse iCalendar '%s'\n", pvt->owner->name);
 			continue;




More information about the asterisk-commits mailing list