summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2019-03-28 10:44:35 +0100
committerMilan Crha <mcrha@redhat.com>2019-03-28 10:44:35 +0100
commit746fbcc6079181433446bc798d59814b0ad67891 (patch)
tree070c83dab2c264024f1ac2945cd7ddcaade43670
parentb896e806af02df99b283447a87897e2601e0a667 (diff)
downloadlibical-git-746fbcc6079181433446bc798d59814b0ad67891.tar.gz
[libical-glib] Let yes/no functions return and expect gboolean instead of gint
While the core libical functions use 'int' and 0/1 values, the glib has a dedicated type gboolean, which can be used here.
-rw-r--r--src/libical-glib/api/i-cal-attach.xml2
-rw-r--r--src/libical-glib/api/i-cal-component.xml6
-rw-r--r--src/libical-glib/api/i-cal-duration.xml12
-rw-r--r--src/libical-glib/api/i-cal-parameter.xml2
-rw-r--r--src/libical-glib/api/i-cal-period.xml4
-rw-r--r--src/libical-glib/api/i-cal-property.xml2
-rw-r--r--src/libical-glib/api/i-cal-recurrence.xml4
-rw-r--r--src/libical-glib/api/i-cal-time.xml20
-rw-r--r--src/libical-glib/api/i-cal-trigger.xml4
-rw-r--r--src/libical-glib/api/i-cal-value.xml4
10 files changed, 30 insertions, 30 deletions
diff --git a/src/libical-glib/api/i-cal-attach.xml b/src/libical-glib/api/i-cal-attach.xml
index 29bd1e19..3bf0bff3 100644
--- a/src/libical-glib/api/i-cal-attach.xml
+++ b/src/libical-glib/api/i-cal-attach.xml
@@ -36,7 +36,7 @@
</method>
<method name="i_cal_attach_get_is_url" corresponds="icalattach_get_is_url" kind="others" since="1.0">
<parameter type="ICalAttach *" name="attach" comment="The #ICalAttach to be queried"/>
- <returns type="gint" comment="1 if the @attach is built from url and 0 if not." />
+ <returns type="gboolean" comment="whether the @attach is built from url" />
<comment xml:space="preserve">Check whether the #ICalAttach is built from url</comment>
</method>
<method name="i_cal_attach_get_url" corresponds="icalattach_get_url" kind="others" since="1.0">
diff --git a/src/libical-glib/api/i-cal-component.xml b/src/libical-glib/api/i-cal-component.xml
index e0975435..c6b6983d 100644
--- a/src/libical-glib/api/i-cal-component.xml
+++ b/src/libical-glib/api/i-cal-component.xml
@@ -45,7 +45,7 @@
</method>
<method name="i_cal_component_is_valid" corresponds="icalcomponent_is_valid" since="1.0">
<parameter type="ICalComponent *" name="component" comment="The #ICalComponent to be checked."/>
- <returns type="gint" comment="1 if yes, 0 if not."/>
+ <returns type="gboolean" comment="1 if yes, 0 if not."/>
<comment xml:space="preserve">Check whether #ICalComponent is valid.</comment>
</method>
<method name="i_cal_component_isa" corresponds="icalcomponent_isa" since="1.0">
@@ -221,7 +221,7 @@
</method>
<method name="i_cal_component_kind_is_valid" corresponds="icalcomponent_kind_is_valid" since="1.0">
<parameter type="const ICalComponentKind" name="kind" comment="A #ICalComponentKind."/>
- <returns type="gint" comment="1 if @kind id a #ICalComponent but not the I_CAL_NO_COMPONENT, 0 if not."/>
+ <returns type="gboolean" comment="1 if @kind id a #ICalComponent but not the I_CAL_NO_COMPONENT, 0 if not."/>
<comment xml:space="preserve">Check if a #ICalComponentKind is valid.</comment>
</method>
<method name="i_cal_component_string_to_kind" corresponds="icalcomponent_string_to_kind" since="1.0">
@@ -492,7 +492,7 @@ static void foreach_recurrence_cb(icalcomponent *in_comp, struct icaltime_span *
<parameter type="ICalComponent *" name="comp" comment="A #ICalComponent."/>
<parameter type="ICalTime *" name="dtstart" native_op="POINTER" comment="The base dtstart value for this component."/>
<parameter type="ICalTime *" name="recurtime" native_op="POINTER" comment="The time to test against."/>
- <returns type="gint" comment="1 if yes, 0 if not."/>
+ <returns type="gboolean" comment="1 if yes, 0 if not."/>
<comment xml:space="preserve">Decide if this recurrance is acceptable. This function decides if a specific recurrence value is excluded by EXRULE or EXDATE properties.</comment>
</method>
<method name="i_cal_component_new_vcalendar" corresponds="icalcomponent_new_vcalendar" kind="constructor" since="1.0">
diff --git a/src/libical-glib/api/i-cal-duration.xml b/src/libical-glib/api/i-cal-duration.xml
index eb47806c..cb955b51 100644
--- a/src/libical-glib/api/i-cal-duration.xml
+++ b/src/libical-glib/api/i-cal-duration.xml
@@ -16,17 +16,17 @@
<structure namespace="ICal" name="Duration" native="struct icaldurationtype" is_bare="true" default_native="icaldurationtype_null_duration()">
<method name="i_cal_duration_is_neg" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalDuration *" name="duration" comment="The #ICalDuration to be queried."/>
- <returns type="gint" comment="The is_neg." />
+ <returns type="gboolean" comment="The is_neg." />
<comment xml:space="preserve">Get the is_neg of #ICalDuration.</comment>
<custom> g_return_val_if_fail (duration != NULL, 0);
- return ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration))->is_neg;</custom>
+ return (((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration))->is_neg) ? TRUE : FALSE;</custom>
</method>
<method name="i_cal_duration_set_is_neg" corresponds="CUSTOM" kind="set" since="1.0">
<parameter type="ICalDuration *" name="duration" comment="The #ICalDuration to be set."/>
- <parameter type="gint" name="is_neg" comment="The is_neg."/>
+ <parameter type="gboolean" name="is_neg" comment="The is_neg."/>
<comment>Set the is_neg of #ICalDuration.</comment>
<custom> g_return_if_fail (duration != NULL &amp;&amp; I_CAL_IS_DURATION (duration));
- ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration))->is_neg = is_neg;</custom>
+ ((struct icaldurationtype *)i_cal_object_get_native ((ICalObject *)duration))->is_neg = is_neg ? 1 : 0;</custom>
</method>
<method name="i_cal_duration_get_days" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="ICalDuration *" name="duration" comment="The #ICalDuration to be queried."/>
@@ -128,12 +128,12 @@
</method>
<method name="i_cal_duration_is_null_duration" corresponds="icaldurationtype_is_null_duration" kind="others" since="1.0">
<parameter type="ICalDuration *" name="duration" comment="The #ICalDuration to be checked"/>
- <returns type="gint" comment="1 if @duration is the null_duration, 0 if not." />
+ <returns type="gboolean" comment="1 if @duration is the null_duration, 0 if not." />
<comment xml:space="preserve">Check whether the #ICalDuration is the null_duration</comment>
</method>
<method name="i_cal_duration_is_bad_duration" corresponds="icaldurationtype_is_bad_duration" kind="others" since="1.0">
<parameter type="ICalDuration *" name="duration" comment="The #ICalDuration to be checked"/>
- <returns type="gint" comment="1 if @duration is the bad_duration, 0 if not." />
+ <returns type="gboolean" comment="1 if @duration is the bad_duration, 0 if not." />
<comment xml:space="preserve">Check whether the #ICalDuration is the bad_duration</comment>
</method>
</structure>
diff --git a/src/libical-glib/api/i-cal-parameter.xml b/src/libical-glib/api/i-cal-parameter.xml
index 09339118..4a85a02c 100644
--- a/src/libical-glib/api/i-cal-parameter.xml
+++ b/src/libical-glib/api/i-cal-parameter.xml
@@ -112,7 +112,7 @@
</method>
<method name="i_cal_parameter_kind_is_valid" corresponds="icalparameter_kind_is_valid" since="3.0.5">
<parameter type="const ICalParameterKind" name="kind" comment="The #ICalPropertyKind"/>
- <returns type="gint" comment="1 if valid, 0 if not."/>
+ <returns type="gboolean" comment="1 if valid, 0 if not."/>
<comment xml:space="preserve">Check whether #ICalParameterKind is valid.</comment>
</method>
</structure>
diff --git a/src/libical-glib/api/i-cal-period.xml b/src/libical-glib/api/i-cal-period.xml
index 68cf35f6..14d7d7ae 100644
--- a/src/libical-glib/api/i-cal-period.xml
+++ b/src/libical-glib/api/i-cal-period.xml
@@ -96,12 +96,12 @@
</method>
<method name="i_cal_period_is_null_period" corresponds="icalperiodtype_is_null_period" since="1.0">
<parameter type="ICalPeriod *" name="p" comment="The #ICalPeriod to be checked."/>
- <returns type="gint" comment="1 if yes, 0 if not."/>
+ <returns type="gboolean" comment="1 if yes, 0 if not."/>
<comment xml:space="preserve">Check the #ICalPeriod is null_period.</comment>
</method>
<method name="i_cal_period_is_valid_period" corresponds="icalperiodtype_is_valid_period" since="1.0">
<parameter type="ICalPeriod *" name="p" comment="The #ICalPeriod to be checked."/>
- <returns type="gint" comment="1 if yes, 0 if not."/>
+ <returns type="gboolean" comment="1 if yes, 0 if not."/>
<comment xml:space="preserve">Check the #ICalPeriod is valid_period.</comment>
</method>
</structure>
diff --git a/src/libical-glib/api/i-cal-property.xml b/src/libical-glib/api/i-cal-property.xml
index b3605c99..d69589d5 100644
--- a/src/libical-glib/api/i-cal-property.xml
+++ b/src/libical-glib/api/i-cal-property.xml
@@ -205,7 +205,7 @@
</method>
<method name="i_cal_property_kind_is_valid" corresponds="icalproperty_kind_is_valid" since="1.0">
<parameter type="const ICalPropertyKind" name="kind" comment="The #ICalPropertyKind"/>
- <returns type="gint" comment="1 if valid, 0 if not."/>
+ <returns type="gboolean" comment="1 if valid, 0 if not."/>
<comment xml:space="preserve">Check whether #ICalPropertyKind is valid.</comment>
</method>
<method name="i_cal_property_string_to_method" corresponds="icalproperty_string_to_method" since="1.0">
diff --git a/src/libical-glib/api/i-cal-recurrence.xml b/src/libical-glib/api/i-cal-recurrence.xml
index c874fdfc..d69b50bf 100644
--- a/src/libical-glib/api/i-cal-recurrence.xml
+++ b/src/libical-glib/api/i-cal-recurrence.xml
@@ -61,7 +61,7 @@
<element name="ICAL_BY_DAY_SIZE"/>
</enum>
<method name="i_cal_recurrence_rscale_is_supported" corresponds="icalrecurrencetype_rscale_is_supported" kind="get" since="2.0">
- <returns type="gint" comment="Whether rscale is supported"/>
+ <returns type="gboolean" comment="Whether rscale is supported"/>
<comment xml:space="preserve">Check whether rscale is supported.</comment>
</method>
<method name="i_cal_recurrence_rscale_supported_calendars" corresponds="icalrecurrencetype_rscale_supported_calendars" kind="other" since="2.0">
@@ -101,7 +101,7 @@
</method>
<method name="i_cal_recurrence_month_is_leap" corresponds="icalrecurrencetype_month_is_leap" since="2.0">
<parameter type="gshort" name="month" comment="The month to be decoded."/>
- <returns type="gint" comment="Whether this month is a leap month."/>
+ <returns type="gboolean" comment="Whether this month is a leap month."/>
<comment xml:space="preserve">Decode a month and check whether it is a leap month.</comment>
</method>
<method name="i_cal_recurrence_month_month" corresponds="icalrecurrencetype_month_month" since="2.0">
diff --git a/src/libical-glib/api/i-cal-time.xml b/src/libical-glib/api/i-cal-time.xml
index 2c77a569..9f440726 100644
--- a/src/libical-glib/api/i-cal-time.xml
+++ b/src/libical-glib/api/i-cal-time.xml
@@ -121,22 +121,22 @@
</method>
<method name="i_cal_time_is_null_time" corresponds="icaltime_is_null_time" since="1.0">
<parameter type="const ICalTime *" name="tt" annotation="in, transfer none" comment="The #ICalTime to be checked"/>
- <returns type="gint" comment="Whether @tt is null_time. 1 if yes, 0 if not." />
+ <returns type="gboolean" comment="Whether @tt is null_time. 1 if yes, 0 if not." />
<comment xml:space="preserve">Return true of the time is null.</comment>
</method>
<method name="i_cal_time_is_valid_time" corresponds="icaltime_is_valid_time" since="1.0">
<parameter type="const ICalTime *" name="tt" annotation="in, transfer none" comment="The #ICalTime to be checked"/>
- <returns type="gint" comment="Whether @tt is null_time. 1 if yes, 0 if not." />
+ <returns type="gboolean" comment="Whether @tt is null_time. 1 if yes, 0 if not." />
<comment xml:space="preserve">Return true of the time is null.</comment>
</method>
<method name="i_cal_time_is_date" corresponds="icaltime_is_date" since="1.0">
<parameter type="const ICalTime *" name="tt" annotation="in, transfer none" comment="The #ICalTime to be checked"/>
- <returns type="gint" comment="true if time is of DATE type, false if DATE-TIME." />
+ <returns type="gboolean" comment="true if time is of DATE type, false if DATE-TIME." />
<comment xml:space="preserve">Returns true if time is of DATE type, false if DATE-TIME.</comment>
</method>
<method name="i_cal_time_is_utc" corresponds="icaltime_is_utc" since="1.0">
<parameter type="const ICalTime *" name="tt" annotation="in, transfer none" comment="The #ICalTime to be checked"/>
- <returns type="gint" comment="true if time is relative to UTC zone." />
+ <returns type="gboolean" comment="true if time is relative to UTC zone." />
<comment xml:space="preserve">Returns true if time is relative to UTC zone.</comment>
</method>
<method name="i_cal_time_compare" corresponds="icaltime_compare" since="1.0">
@@ -212,7 +212,7 @@
</method>
<method name="i_cal_time_days_is_leap_year" corresponds="icaltime_is_leap_year" since="1.0">
<parameter type="gint" name="year" comment="The target year"/>
- <returns type="gint" comment="1 if @year is leap year, 0 if not." />
+ <returns type="gboolean" comment="whether the @year is a leap year" />
<comment xml:space="preserve">Check whether a year is a leap year.</comment>
</method>
<method name="i_cal_time_days_in_year" corresponds="icaltime_days_in_year" since="2.0">
@@ -337,24 +337,24 @@
</method>
<method name="i_cal_time_set_is_date" corresponds="CUSTOM" kind="set" since="1.0">
<parameter type="ICalTime *" name="timetype" comment="The #ICalTime to be set."/>
- <parameter type="gint" name="is_date" comment="The is_date."/>
+ <parameter type="gboolean" name="is_date" comment="The is_date."/>
<comment>Set the is_date of #ICalTime.</comment>
<custom> g_return_if_fail (timetype != NULL &amp;&amp; I_CAL_IS_TIME(timetype));
- ((struct icaltimetype *)i_cal_object_get_native ((ICalObject *)timetype))->is_date = is_date;</custom>
+ ((struct icaltimetype *)i_cal_object_get_native ((ICalObject *)timetype))->is_date = is_date ? 1 : 0;</custom>
</method>
<method name="i_cal_time_is_daylight" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="const ICalTime *" name="timetype" comment="The #ICalTime to be queried."/>
- <returns type="gint" comment="The is_daylight." />
+ <returns type="gboolean" comment="The is_daylight." />
<comment xml:space="preserve">Get the is_daylight of #ICalTime.</comment>
<custom> g_return_val_if_fail (timetype != NULL, 0);
return ((struct icaltimetype *)i_cal_object_get_native ((ICalObject *)timetype))->is_daylight;</custom>
</method>
<method name="i_cal_time_set_is_daylight" corresponds="CUSTOM" kind="set" since="1.0">
<parameter type="ICalTime *" name="timetype" comment="The #ICalTime to be set."/>
- <parameter type="gint" name="is_daylight" comment="The is_daylight."/>
+ <parameter type="gboolean" name="is_daylight" comment="The is_daylight."/>
<comment>Set the is_daylight of #ICalTime.</comment>
<custom> g_return_if_fail (timetype != NULL &amp;&amp; I_CAL_IS_TIME(timetype));
- ((struct icaltimetype *)i_cal_object_get_native ((ICalObject *)timetype))->is_daylight = is_daylight;</custom>
+ ((struct icaltimetype *)i_cal_object_get_native ((ICalObject *)timetype))->is_daylight = is_daylight ? 1 : 0;</custom>
</method>
<method name="i_cal_time_get_date" corresponds="CUSTOM" kind="get" since="1.0">
<parameter type="const ICalTime *" name="timetype" comment="The #ICalTime to be queried."/>
diff --git a/src/libical-glib/api/i-cal-trigger.xml b/src/libical-glib/api/i-cal-trigger.xml
index 8e45a9ba..bed85e17 100644
--- a/src/libical-glib/api/i-cal-trigger.xml
+++ b/src/libical-glib/api/i-cal-trigger.xml
@@ -26,12 +26,12 @@
</method>
<method name="i_cal_trigger_is_null_trigger" corresponds="icaltriggertype_is_null_trigger" since="1.0">
<parameter type="ICalTrigger *" name="tr" comment="A #ICalTrigger."/>
- <returns type="gint" comment="1 if yes, 0 if not."/>
+ <returns type="gboolean" comment="1 if yes, 0 if not."/>
<comment xml:space="preserve">Check if a #ICalTrigger is a null trigger.</comment>
</method>
<method name="i_cal_trigger_is_bad_trigger" corresponds="icaltriggertype_is_bad_trigger" since="1.0">
<parameter type="ICalTrigger *" name="tr" comment="A #ICalTrigger."/>
- <returns type="gint" comment="1 if yes, 0 if not."/>
+ <returns type="gboolean" comment="1 if yes, 0 if not."/>
<comment xml:space="preserve">Check if a #ICalTrigger is a bad trigger.</comment>
</method>
<method name="i_cal_trigger_get_time" corresponds="CUSTOM" kind="get" since="1.0">
diff --git a/src/libical-glib/api/i-cal-value.xml b/src/libical-glib/api/i-cal-value.xml
index c9e6f070..88ec769b 100644
--- a/src/libical-glib/api/i-cal-value.xml
+++ b/src/libical-glib/api/i-cal-value.xml
@@ -36,7 +36,7 @@
</method>
<method name="i_cal_value_is_valid" corresponds="icalvalue_is_valid" since="1.0">
<parameter type="const ICalValue *" name="value" comment="The #ICalValue to be checked."/>
- <returns type="gint" comment="1 if valid, 0 if not."/>
+ <returns type="gboolean" comment="1 if valid, 0 if not."/>
<comment xml:space="preserve">Check if #ICalValue is valid.</comment>
</method>
<method name="i_cal_value_as_ical_string_r" corresponds="icalvalue_as_ical_string_r" since="1.0">
@@ -72,7 +72,7 @@
</method>
<method name="i_cal_value_kind_is_valid" corresponds="icalvalue_kind_is_valid" since="1.0">
<parameter type="const ICalValueKind" name="kind" comment="The #ICalValueKind to be checked."/>
- <returns type="gint" comment="1 if yes, 0 if not."/>
+ <returns type="gboolean" comment="1 if yes, 0 if not."/>
<comment xml:space="preserve">Check whether the #ICalValueKind is valid.</comment>
</method>
<method name="i_cal_value_encode_ical_string" corresponds="CUSTOM" since="1.0">