only allow values from 0 to time_t's maximum value.
authorRodrigo Moya <rodrigo@novell.com>
Wed, 2 Jun 2004 16:15:00 +0000 (16:15 +0000)
committerRodrigo Moya <rodrigo@src.gnome.org>
Wed, 2 Jun 2004 16:15:00 +0000 (16:15 +0000)
2004-06-02  Rodrigo Moya <rodrigo@novell.com>

* libecal/e-cal.c (e_cal_generate_instances,
e_cal_generate_instances_for_object, e_cal_get_alarms_in_range,
e_cal_get_alarms_for_object): only allow values from 0 to time_t's
maximum value.

* libecal/e-cal.h: added missing prototype.

calendar/ChangeLog
calendar/libecal/e-cal.c
calendar/libecal/e-cal.h

index 214c951..591c717 100644 (file)
@@ -1,3 +1,12 @@
+2004-06-02  Rodrigo Moya <rodrigo@novell.com>
+
+       * libecal/e-cal.c (e_cal_generate_instances,
+       e_cal_generate_instances_for_object, e_cal_get_alarms_in_range,
+       e_cal_get_alarms_for_object): only allow values from 0 to time_t's
+       maximum value.
+
+       * libecal/e-cal.h: added missing prototype.
+
 2004-06-01  Rodrigo Moya <rodrigo@novell.com>
 
        * libecal/e-cal.c (e_cal_generate_instances): moved all the logic...
index 37d4039..e5ba6db 100644 (file)
@@ -1,8 +1,10 @@
 /* Evolution calendar ecal
  *
  * Copyright (C) 2001 Ximian, Inc.
+ * Copyright (C) 2004 Novell, Inc.
  *
- * Author: Federico Mena-Quintero <federico@ximian.com>
+ * Authors: Federico Mena-Quintero <federico@ximian.com>
+ *          Rodrigo Moya <rodrigo@novell.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -3008,8 +3010,8 @@ e_cal_generate_instances (ECal *ecal, time_t start, time_t end,
        priv = ecal->priv;
        g_return_if_fail (priv->load_state == E_CAL_LOAD_LOADED);
 
-       g_return_if_fail (start >= -1);
-       g_return_if_fail (end >= -1);
+       g_return_if_fail (start >= 0);
+       g_return_if_fail (end >= 0);
        g_return_if_fail (cb != NULL);
 
        generate_instances (ecal, start, end, NULL, cb, cb_data);
@@ -3043,8 +3045,8 @@ e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
        GList *instances = NULL;
 
        g_return_if_fail (E_IS_CAL (ecal));
-       g_return_if_fail (start >= -1);
-       g_return_if_fail (end >= -1);
+       g_return_if_fail (start >= 0);
+       g_return_if_fail (end >= 0);
        g_return_if_fail (cb != NULL);
 
        priv = ecal->priv;
@@ -3143,7 +3145,7 @@ e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end)
        priv = ecal->priv;
        g_return_val_if_fail (priv->load_state == E_CAL_LOAD_LOADED, NULL);
 
-       g_return_val_if_fail (start != -1 && end != -1, NULL);
+       g_return_val_if_fail (start >= 0 && end >= 0, NULL);
        g_return_val_if_fail (start <= end, NULL);
 
        /* build the query string */
@@ -3220,7 +3222,7 @@ e_cal_get_alarms_for_object (ECal *ecal, const char *uid,
        g_return_val_if_fail (priv->load_state == E_CAL_LOAD_LOADED, FALSE);
 
        g_return_val_if_fail (uid != NULL, FALSE);
-       g_return_val_if_fail (start != -1 && end != -1, FALSE);
+       g_return_val_if_fail (start >= 0 && end >= 0, FALSE);
        g_return_val_if_fail (start <= end, FALSE);
        g_return_val_if_fail (alarms != NULL, FALSE);
 
index 090883d..7046059 100644 (file)
@@ -1,8 +1,10 @@
 /* Evolution calendar ecal
  *
  * Copyright (C) 2001 Ximian, Inc.
+ * Copyright (C) 2004 Novell, Inc.
  *
  * Authors: Federico Mena-Quintero <federico@ximian.com>
+ *          Rodrigo Moya <rodrigo@novell.com>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of version 2 of the GNU General Public
@@ -152,6 +154,9 @@ gboolean e_cal_get_free_busy (ECal *ecal, GList *users, time_t start, time_t end
 
 void e_cal_generate_instances (ECal *ecal, time_t start, time_t end,
                               ECalRecurInstanceFn cb, gpointer cb_data);
+void e_cal_generate_instances_for_object (ECal *ecal, icalcomponent *icalcomp,
+                                         time_t start, time_t end,
+                                         ECalRecurInstanceFn cb, gpointer cb_data);
 
 GSList *e_cal_get_alarms_in_range (ECal *ecal, time_t start, time_t end);