accept an icaltimezone* of NULL for all the public functions, since NULL

2001-07-25  Damon Chaplin  <damon@ximian.com>

	* src/libical/icaltimezone.c: accept an icaltimezone* of NULL for all
	the public functions, since NULL is used to represent floating times.

svn path=/trunk/; revision=11413
This commit is contained in:
Damon Chaplin
2001-07-25 21:00:11 +00:00
committed by Damon Chaplin
parent 34af37ee96
commit 487fbbf877
2 changed files with 26 additions and 1 deletions
+5
View File
@@ -1,3 +1,8 @@
2001-07-25 Damon Chaplin <damon@ximian.com>
* src/libical/icaltimezone.c: accept an icaltimezone* of NULL for all
the public functions, since NULL is used to represent floating times.
2001-07-25 JP Rosevear <jpr@ximian.com>
* src/libical/icalparameter.c (icalparameter_as_ical_string): if
+21 -1
View File
@@ -1133,7 +1133,7 @@ icaltimezone_adjust_change (icaltimezonechange *tt,
char*
icaltimezone_get_tzid (icaltimezone *zone)
{
/* If this is a local time, without a timezone, return NULL. */
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
return NULL;
@@ -1147,6 +1147,10 @@ icaltimezone_get_tzid (icaltimezone *zone)
char*
icaltimezone_get_location (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
return NULL;
/* Note that for builtin timezones this comes from zones.tab so we don't
need to check the timezone is loaded here. */
return zone->location;
@@ -1156,6 +1160,10 @@ icaltimezone_get_location (icaltimezone *zone)
char*
icaltimezone_get_tznames (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
return NULL;
if (!zone->component)
icaltimezone_load_builtin_timezone (zone);
@@ -1167,6 +1175,10 @@ icaltimezone_get_tznames (icaltimezone *zone)
double
icaltimezone_get_latitude (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return 0. */
if (!zone)
return 0.0;
/* Note that for builtin timezones this comes from zones.tab so we don't
need to check the timezone is loaded here. */
return zone->latitude;
@@ -1177,6 +1189,10 @@ icaltimezone_get_latitude (icaltimezone *zone)
double
icaltimezone_get_longitude (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return 0. */
if (!zone)
return 0.0;
/* Note that for builtin timezones this comes from zones.tab so we don't
need to check the timezone is loaded here. */
return zone->longitude;
@@ -1187,6 +1203,10 @@ icaltimezone_get_longitude (icaltimezone *zone)
icalcomponent*
icaltimezone_get_component (icaltimezone *zone)
{
/* If this is a floating time, without a timezone, return NULL. */
if (!zone)
return NULL;
if (!zone->component)
icaltimezone_load_builtin_timezone (zone);