Changed to take a const argument, and then to cast out const.

2001-06-01  Jon Trowbridge  <trow@gnu.org>

       * 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.
This commit is contained in:
Jon Trowbridge
2001-06-05 20:59:02 +00:00
committed by Havoc Pennington
parent 96ba1917d8
commit 4d2b54ff8b
15 changed files with 422 additions and 65 deletions

View File

@@ -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
<SUBSECTION>
g_date_get_day

View File

@@ -414,6 +414,18 @@ must be valid.
@n_years: Number of years to move
<!-- ##### FUNCTION g_date_days_between ##### -->
<para>
Compute the number of days between two dates.
If @date2 is prior to @date1, the returned value is negative.
Both dates must be valid.
</para>
@date1: The first date
@date2: The second date
@Returns: The number of days between @date1 and @date2
<!-- ##### FUNCTION g_date_compare ##### -->
<para>
<function>qsort()</function>-style comparsion function for dates. Both
@@ -426,6 +438,29 @@ dates must be valid.
greater than zero if @lhs is greater than @rhs
<!-- ##### FUNCTION g_date_clamp ##### -->
<para>
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.
</para>
@date: Date to clamp
@min_date: Minimum accepted value for @date
@max_date: Maximum accepted value for @date
<!-- ##### FUNCTION g_date_order ##### -->
<para>
Check if @date1 is less than or equal to @date2,
and swap the values if this is not the case.
</para>
@date1: The first date
@date2: The second date
<!-- ##### FUNCTION g_date_get_day ##### -->
<para>
Return the day of the month; the #GDate must be valid.

View File

@@ -837,7 +837,6 @@ of the above functions.
@user_data:
@Returns:
<!--
Local variables:
mode: sgml