From 4d2b54ff8b3daff5ef6dfe41e24b69d51a80a022 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 5 Jun 2001 20:59:02 +0000 Subject: [PATCH] Changed to take a const argument, and then to cast out const. 2001-06-01 Jon Trowbridge * gdate.c (g_date_update_julian): Changed to take a const argument, and then to cast out const. (g_date_update_dmy): Changed to take a const argument, and then cast out const. (g_date_get_weekday): Changed argument to be const. (g_date_get_month): Changed argument to be const. (g_date_get_year): Changed argument to be const. (g_date_get_day): Changed argument to be const. (g_date_get_julian): Changed argument to be const. (g_date_get_day_of_year): Changed argument to be const. (g_date_get_monday_week_of_year): Changed argument to be const. (g_date_get_sunday_week_of_year): Changed argument to be const. (g_date_compare): Changed arguments to be const. (g_date_to_struct_tm): Changed GDate argument to be const. (g_date_strftime): Changed GDate argument to be const. (g_date_clamp): Added. The equivalent of the CLAMP macro for GDates. (g_date_order): Added. Ensure that the first GDate argument preceeds the second, swapping them if necessary. (g_date_days_between): Added. Computes the (signed) number of days between two dates. --- ChangeLog | 24 ++++++++++ ChangeLog.pre-2-0 | 24 ++++++++++ ChangeLog.pre-2-10 | 24 ++++++++++ ChangeLog.pre-2-12 | 24 ++++++++++ ChangeLog.pre-2-2 | 24 ++++++++++ ChangeLog.pre-2-4 | 24 ++++++++++ ChangeLog.pre-2-6 | 24 ++++++++++ ChangeLog.pre-2-8 | 24 ++++++++++ docs/reference/glib/glib-sections.txt | 3 ++ docs/reference/glib/tmpl/date.sgml | 35 ++++++++++++++ docs/reference/glib/tmpl/main.sgml | 1 - gdate.c | 86 ++++++++++++++++++++++++++++------- gdate.h | 42 +++++++++++------ glib/gdate.c | 86 ++++++++++++++++++++++++++++------- glib/gdate.h | 42 +++++++++++------ 15 files changed, 422 insertions(+), 65 deletions(-) diff --git a/ChangeLog b/ChangeLog index a297e83..223f5a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index a297e83..223f5a7 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index a297e83..223f5a7 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index a297e83..223f5a7 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index a297e83..223f5a7 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index a297e83..223f5a7 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index a297e83..223f5a7 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index a297e83..223f5a7 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,27 @@ +2001-06-01 Jon Trowbridge + + * gdate.c (g_date_update_julian): Changed to take a const + argument, and then to cast out const. + (g_date_update_dmy): Changed to take a const argument, and then + cast out const. + (g_date_get_weekday): Changed argument to be const. + (g_date_get_month): Changed argument to be const. + (g_date_get_year): Changed argument to be const. + (g_date_get_day): Changed argument to be const. + (g_date_get_julian): Changed argument to be const. + (g_date_get_day_of_year): Changed argument to be const. + (g_date_get_monday_week_of_year): Changed argument to be const. + (g_date_get_sunday_week_of_year): Changed argument to be const. + (g_date_compare): Changed arguments to be const. + (g_date_to_struct_tm): Changed GDate argument to be const. + (g_date_strftime): Changed GDate argument to be const. + (g_date_clamp): Added. The equivalent of the CLAMP macro for + GDates. + (g_date_order): Added. Ensure that the first GDate argument + preceeds the second, swapping them if necessary. + (g_date_days_between): Added. Computes the (signed) number of days + between two dates. + Mon Jun 4 16:02:57 2001 Owen Taylor * gstrfuncs.c (g_strup/strdown): to match g_strcasecmp, diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index a92b4ad..79d362c 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -895,7 +895,10 @@ g_date_add_months g_date_subtract_months g_date_add_years g_date_subtract_years +g_date_days_between g_date_compare +g_date_clamp +g_date_order g_date_get_day diff --git a/docs/reference/glib/tmpl/date.sgml b/docs/reference/glib/tmpl/date.sgml index 2137a14..60d0a4d 100644 --- a/docs/reference/glib/tmpl/date.sgml +++ b/docs/reference/glib/tmpl/date.sgml @@ -414,6 +414,18 @@ must be valid. @n_years: Number of years to move + + +Compute the number of days between two dates. +If @date2 is prior to @date1, the returned value is negative. +Both dates must be valid. + + +@date1: The first date +@date2: The second date +@Returns: The number of days between @date1 and @date2 + + qsort()-style comparsion function for dates. Both @@ -426,6 +438,29 @@ dates must be valid. greater than zero if @lhs is greater than @rhs + + +If @date is prior to @min_date, set @date equal to @min_date. +If @date falls after @max_date, set @date equal to @max_date. +Either @min_date and @max_date may be %NULL. All non-%NULL dates +must be valid. + + +@date: Date to clamp +@min_date: Minimum accepted value for @date +@max_date: Maximum accepted value for @date + + + + +Check if @date1 is less than or equal to @date2, +and swap the values if this is not the case. + + +@date1: The first date +@date2: The second date + + Return the day of the month; the #GDate must be valid. diff --git a/docs/reference/glib/tmpl/main.sgml b/docs/reference/glib/tmpl/main.sgml index 90d8126..c5e5518 100644 --- a/docs/reference/glib/tmpl/main.sgml +++ b/docs/reference/glib/tmpl/main.sgml @@ -837,7 +837,6 @@ of the above functions. @user_data: @Returns: -