diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libical-glib/api/i-cal-derived-parameter.xml | 107 | ||||
-rw-r--r-- | src/libical/icaltime.c | 4 | ||||
-rw-r--r-- | src/libical/icalvalue.c | 7 | ||||
-rw-r--r-- | src/test/CMakeLists.txt | 13 |
4 files changed, 123 insertions, 8 deletions
diff --git a/src/libical-glib/api/i-cal-derived-parameter.xml b/src/libical-glib/api/i-cal-derived-parameter.xml index 54122a0d..a0799a74 100644 --- a/src/libical-glib/api/i-cal-derived-parameter.xml +++ b/src/libical-glib/api/i-cal-derived-parameter.xml @@ -24,13 +24,17 @@ <element name="ICAL_DELEGATEDFROM_PARAMETER"/> <element name="ICAL_DELEGATEDTO_PARAMETER"/> <element name="ICAL_DIR_PARAMETER"/> + <element name="ICAL_DISPLAY_PARAMETER"/> + <element name="ICAL_EMAIL_PARAMETER"/> <element name="ICAL_ENABLE_PARAMETER"/> <element name="ICAL_ENCODING_PARAMETER"/> <element name="ICAL_FBTYPE_PARAMETER"/> + <element name="ICAL_FEATURE_PARAMETER"/> <element name="ICAL_FILENAME_PARAMETER"/> <element name="ICAL_FMTTYPE_PARAMETER"/> <element name="ICAL_IANA_PARAMETER"/> <element name="ICAL_ID_PARAMETER"/> + <element name="ICAL_LABEL_PARAMETER"/> <element name="ICAL_LANGUAGE_PARAMETER"/> <element name="ICAL_LATENCY_PARAMETER"/> <element name="ICAL_LOCAL_PARAMETER"/> @@ -40,6 +44,7 @@ <element name="ICAL_MODIFIED_PARAMETER"/> <element name="ICAL_OPTIONS_PARAMETER"/> <element name="ICAL_PARTSTAT_PARAMETER"/> + <element name="ICAL_PATCHACTION_PARAMETER"/> <element name="ICAL_PUBLICCOMMENT_PARAMETER"/> <element name="ICAL_RANGE_PARAMETER"/> <element name="ICAL_REASON_PARAMETER"/> @@ -78,6 +83,14 @@ <element name="ICAL_CUTYPE_UNKNOWN"/> <element name="ICAL_CUTYPE_NONE"/> </enum> + <enum name="ICalParameterDisplay" native_name="icalparameter_display" default_native="I_CAL_DISPLAY_NONE"> + <element name="ICAL_DISPLAY_X"/> + <element name="ICAL_DISPLAY_BADGE"/> + <element name="ICAL_DISPLAY_GRAPHIC"/> + <element name="ICAL_DISPLAY_FULLSIZE"/> + <element name="ICAL_DISPLAY_THUMBNAIL"/> + <element name="ICAL_DISPLAY_NONE"/> + </enum> <enum name="ICalParameterEnable" native_name="icalparameter_enable" default_native="I_CAL_ENABLE_NONE"> <element name="ICAL_ENABLE_X"/> <element name="ICAL_ENABLE_TRUE"/> @@ -98,6 +111,17 @@ <element name="ICAL_FBTYPE_BUSYTENTATIVE"/> <element name="ICAL_FBTYPE_NONE"/> </enum> + <enum name="ICalParameterFeature" native_name="icalparameter_feature" default_native="I_CAL_FEATURE_NONE"> + <element name="ICAL_FEATURE_X"/> + <element name="ICAL_FEATURE_AUDIO"/> + <element name="ICAL_FEATURE_CHAT"/> + <element name="ICAL_FEATURE_FEED"/> + <element name="ICAL_FEATURE_MODERATOR"/> + <element name="ICAL_FEATURE_PHONE"/> + <element name="ICAL_FEATURE_SCREEN"/> + <element name="ICAL_FEATURE_VIDEO"/> + <element name="ICAL_FEATURE_NONE"/> + </enum> <enum name="ICalParameterLocal" native_name="icalparameter_local" default_native="I_CAL_LOCAL_NONE"> <element name="ICAL_LOCAL_X"/> <element name="ICAL_LOCAL_TRUE"/> @@ -116,6 +140,14 @@ <element name="ICAL_PARTSTAT_FAILED"/> <element name="ICAL_PARTSTAT_NONE"/> </enum> + <enum name="ICalParameterPatchaction" native_name="icalparameter_patchaction" default_native="I_CAL_PATCHACTION_NONE"> + <element name="ICAL_PATCHACTION_X"/> + <element name="ICAL_PATCHACTION_CREATE"/> + <element name="ICAL_PATCHACTION_BYNAME"/> + <element name="ICAL_PATCHACTION_BYVALUE"/> + <element name="ICAL_PATCHACTION_BYPARAM"/> + <element name="ICAL_PATCHACTION_NONE"/> + </enum> <enum name="ICalParameterRange" native_name="icalparameter_range" default_native="I_CAL_RANGE_NONE"> <element name="ICAL_RANGE_X"/> <element name="ICAL_RANGE_THISANDPRIOR"/> @@ -345,6 +377,36 @@ <parameter type="const gchar *" name="v" comment="The string used to set into the @value"/> <comment xml:space="preserve"></comment> </method> + <method name="i_cal_parameter_new_display" corresponds="icalparameter_new_display" kind="constructor" since="3.0.15"> + <parameter type="ICalParameterDisplay" name="value" comment="The #ICalParameterDisplay value of the new #ICalParameter"/> + <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter" /> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_get_display" corresponds="icalparameter_get_display" kind="get" since="3.0.15"> + <parameter type="const ICalParameter *" name="param" comment="The #ICalParameter to be queried"/> + <returns type="ICalParameterDisplay" comment="The #ICalParameterDisplay value of the @param"/> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_set_display" corresponds="icalparameter_set_display" kind="set" since="3.0.15"> + <parameter type="ICalParameter *" name="param" comment="The #ICalParameter to be set"/> + <parameter type="ICalParameterDisplay" name="value" comment="The #ICalParameterDisplay to set into the @param"/> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_new_email" corresponds="icalparameter_new_email" kind="constructor" since="3.0.15"> + <parameter type="const gchar *" name="value" comment="The string value of the new #ICalParameter"/> + <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter" /> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_get_email" corresponds="icalparameter_get_email" kind="get" since="3.0.15"> + <parameter type="const ICalParameter *" name="param" comment="The #ICalParameter to be queried"/> + <returns type="const gchar *" annotation="nullable" comment="The string value of the @param"/> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_set_email" corresponds="icalparameter_set_email" kind="set" since="3.0.15"> + <parameter type="ICalParameter *" name="param" comment="The #ICalParameter to be set"/> + <parameter type="const gchar *" name="value" comment="The string value to set into the @param"/> + <comment xml:space="preserve"></comment> + </method> <method name="i_cal_parameter_new_enable" corresponds="icalparameter_new_enable" kind="constructor" since="1.0"> <parameter type="ICalParameterEnable" name="v" comment="The type of #ICalParameter to be created"/> <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter." /> @@ -390,6 +452,21 @@ <parameter type="ICalParameterFbtype" name="v" comment="The type of #ICalParameter to be set in the @value"/> <comment xml:space="preserve"></comment> </method> + <method name="i_cal_parameter_new_feature" corresponds="icalparameter_new_feature" kind="constructor" since="3.0.15"> + <parameter type="ICalParameterFeature" name="value" comment="The #ICalParameterFeature value of the new #ICalParameter"/> + <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter" /> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_get_feature" corresponds="icalparameter_get_feature" kind="get" since="3.0.15"> + <parameter type="const ICalParameter *" name="param" comment="The #ICalParameter to be queried"/> + <returns type="ICalParameterFeature" comment="The #ICalParameterFeature value of the @param"/> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_set_feature" corresponds="icalparameter_set_feature" kind="set" since="3.0.15"> + <parameter type="ICalParameter *" name="param" comment="The #ICalParameter to be set"/> + <parameter type="ICalParameterFeature" name="value" comment="The #ICalParameterFeature to set into the @param"/> + <comment xml:space="preserve"></comment> + </method> <method name="i_cal_parameter_new_filename" corresponds="icalparameter_new_filename" kind="constructor" since="2.0"> <parameter type="const gchar *" name="v" comment="The string used to create the new #ICalParameter"/> <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter." /> @@ -450,6 +527,21 @@ <parameter type="const gchar *" name="v" comment="The string used to set into the @value"/> <comment xml:space="preserve"></comment> </method> + <method name="i_cal_parameter_new_label" corresponds="icalparameter_new_label" kind="constructor" since="3.0.15"> + <parameter type="const gchar *" name="value" comment="The string value of the new #ICalParameter"/> + <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter" /> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_get_label" corresponds="icalparameter_get_label" kind="get" since="3.0.15"> + <parameter type="const ICalParameter *" name="param" comment="The #ICalParameter to be queried"/> + <returns type="const gchar *" annotation="nullable" comment="The string value of the @param"/> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_set_label" corresponds="icalparameter_set_label" kind="set" since="3.0.15"> + <parameter type="ICalParameter *" name="param" comment="The #ICalParameter to be set"/> + <parameter type="const gchar *" name="value" comment="The string value to set into the @param"/> + <comment xml:space="preserve"></comment> + </method> <method name="i_cal_parameter_new_language" corresponds="icalparameter_new_language" kind="constructor" since="1.0"> <parameter type="const gchar *" name="v" comment="The string used to create the new #ICalParameter"/> <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter." /> @@ -585,6 +677,21 @@ <parameter type="ICalParameterPartstat" name="v" comment="The type of #ICalParameter to be set in the @value"/> <comment xml:space="preserve"></comment> </method> + <method name="i_cal_parameter_new_patchaction" corresponds="icalparameter_new_patchaction" kind="constructor" since="3.0.15"> + <parameter type="ICalParameterPatchaction" name="value" comment="The #ICalParameterPatchaction value of the new #ICalParameter"/> + <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter" /> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_get_patchaction" corresponds="icalparameter_get_patchaction" kind="get" since="3.0.15"> + <parameter type="const ICalParameter *" name="param" comment="The #ICalParameter to be queried"/> + <returns type="ICalParameterPatchaction" comment="The #ICalParameterPatchaction value of the @param"/> + <comment xml:space="preserve"></comment> + </method> + <method name="i_cal_parameter_set_patchaction" corresponds="icalparameter_set_patchaction" kind="set" since="3.0.15"> + <parameter type="ICalParameter *" name="param" comment="The #ICalParameter to be set"/> + <parameter type="ICalParameterPatchaction" name="value" comment="The #ICalParameterPatchaction to set into the @param"/> + <comment xml:space="preserve"></comment> + </method> <method name="i_cal_parameter_new_publiccomment" corresponds="icalparameter_new_publiccomment" kind="constructor" since="2.0"> <parameter type="const gchar *" name="v" comment="The string used to create the new #ICalParameter"/> <returns type="ICalParameter *" annotation="transfer full" comment="The newly created #ICalParameter." /> diff --git a/src/libical/icaltime.c b/src/libical/icaltime.c index fd1bf3d8..33209508 100644 --- a/src/libical/icaltime.c +++ b/src/libical/icaltime.c @@ -434,7 +434,7 @@ static const int _days_in_month[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, int icaltime_days_in_month(const int month, const int year) { - int days = _days_in_month[month]; + int days; /* The old code aborting if it was passed a parameter like BYMONTH=0 * Unfortunately it's not practical right now to pass an error all @@ -448,6 +448,8 @@ int icaltime_days_in_month(const int month, const int year) return 30; } + days = _days_in_month[month]; + if (month == 2) { days += icaltime_is_leap_year(year); } diff --git a/src/libical/icalvalue.c b/src/libical/icalvalue.c index 1becb059..e3053177 100644 --- a/src/libical/icalvalue.c +++ b/src/libical/icalvalue.c @@ -905,10 +905,13 @@ static char *icalvalue_utcoffset_as_ical_string_r(const icalvalue *value) m = (data - (h * 3600)) / 60; s = (data - (h * 3600) - (m * 60)); + h = MIN(abs(h), 23); + m = MIN(abs(m), 59); + s = MIN(abs(s), 59); if (s != 0) { - snprintf(str, 9, "%c%02d%02d%02d", sign, abs(h), abs(m), abs(s)); + snprintf(str, 9, "%c%02d%02d%02d", sign, h, m, s); } else { - snprintf(str, 9, "%c%02d%02d", sign, abs(h), abs(m)); + snprintf(str, 9, "%c%02d%02d", sign, h, m); } return str; diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 8bba8747..77b85a9a 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -20,6 +20,7 @@ set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) set(TEST_DATADIR "\"${CMAKE_SOURCE_DIR}/test-data\"") add_definitions(-DTEST_DATADIR=${TEST_DATADIR} -DTEST_ZONEDIR="${CMAKE_SOURCE_DIR}/zoneinfo") +# Set properties for the test macro(setprops _name) if(UNIX) set_tests_properties(${_name} PROPERTIES @@ -72,6 +73,7 @@ macro(buildme _name _srcs) endif() endmacro() +# Build the test and add the test, making sure the test properties are set macro(testme _name _srcs) buildme(${_name} "${_srcs}") add_test(NAME ${_name} COMMAND ${_name}) @@ -112,10 +114,10 @@ set(parser_SRCS icaltestparser.c) buildme(parser "${parser_SRCS}") file(GLOB TEST_FILES ${CMAKE_SOURCE_DIR}/test-data/*.ics) -foreach(TEST_FILE ${TEST_FILES}) - get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE) - add_test(NAME parser-${TEST_NAME} COMMAND parser ${TEST_FILE}) - setprops(parser-${TEST_NAME}) +foreach(test_file ${TEST_FILES}) + get_filename_component(test_name ${test_file} NAME_WE) + add_test(NAME parser-${test_name} COMMAND parser ${test_file}) + setprops(parser-${test_name}) endforeach() ########### next target ############### @@ -181,7 +183,8 @@ if(NOT ${CMAKE_VERSION} VERSION_LESS 3.14) set(CMAKE_COMPARE_FILES_IGNORE_EOL TRUE) endif() if(NOT WIN32 OR CMAKE_COMPARE_FILES_IGNORE_EOL) - if(NOT CYGWIN AND NOT USE_32BIT_TIME_T) #ignore_eol doesn't work on Cygwin. tests for years greater than 2037 will fail + #ignore_eol doesn't work on Cygwin. testing years greater than 2037 will fail + if(NOT CYGWIN AND NOT USE_32BIT_TIME_T) set(icalrecurtest_SRCS icalrecur_test.c) add_executable(icalrecurtest ${icalrecurtest_SRCS}) target_link_libraries(icalrecurtest ical icalss icalvcal) |