From 736e1225d2e9bd8be174cfe1e4340ed2ffcca55a Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Fri, 24 Mar 2023 10:23:37 -0400 Subject: appveyor.yml - switch to macos-monterey --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 3ab7db24..fdbd52c0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -22,7 +22,7 @@ image: #- Visual Studio 2013 #disable since Ninja is not available - Ubuntu2004 - Visual Studio 2019 - - macos + - macos-monterey # scripts that are called at very beginning, before repo cloning init: -- cgit v1.2.1 From 2128cb71d49547b71b5323f140f9272f17f14082 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Thu, 23 Mar 2023 03:03:57 +0100 Subject: libical-glib: Add get_zone_directory This will be useful for evolution-data-server to use the same zone directory as libical. --- ReleaseNotes.txt | 2 ++ src/libical-glib/api/i-cal-timezone.xml | 4 ++++ src/libical/icaltimezone.c | 19 ++++++++++++++----- src/libical/icaltimezone.h | 3 +++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 0c122207..e2080eb8 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -5,6 +5,8 @@ Version 3.0.17 (UNRELEASED): ---------------------------- * Improved Android support * Escape commas in x-property TEXT values + * New publicly available functions: + + get_zone_directory() Version 3.0.16 (17 October 2022): --------------------------------- diff --git a/src/libical-glib/api/i-cal-timezone.xml b/src/libical-glib/api/i-cal-timezone.xml index 0900e612..d677e945 100644 --- a/src/libical-glib/api/i-cal-timezone.xml +++ b/src/libical-glib/api/i-cal-timezone.xml @@ -180,6 +180,10 @@ Gets the name of the vtimezone in component. + + + Gets the directory to look for the zonefiles. + Sets the directory to look for the zonefiles. diff --git a/src/libical/icaltimezone.c b/src/libical/icaltimezone.c index e57c08d2..7b4b8a5a 100644 --- a/src/libical/icaltimezone.c +++ b/src/libical/icaltimezone.c @@ -170,7 +170,7 @@ static void icaltimezone_parse_zone_tab(void); static char *icaltimezone_load_get_line_fn(char *s, size_t size, void *data); static void format_utc_offset(int utc_offset, char *buffer, size_t buffer_size); -static const char *get_zone_directory(void); +static const char *get_zone_directory_builtin(void); static void icaltimezone_builtin_lock(void) { @@ -1686,7 +1686,7 @@ static void icaltimezone_parse_zone_tab(void) zonedir = icaltzutil_get_zone_directory(); zonetab = ZONES_TAB_SYSTEM_FILENAME; } else { - zonedir = get_zone_directory(); + zonedir = get_zone_directory_builtin(); zonetab = ZONES_TAB_FILENAME; } @@ -1837,7 +1837,7 @@ static void icaltimezone_load_builtin_timezone(icaltimezone *zone) FILE *fp; icalparser *parser; - filename_len = strlen(get_zone_directory()) + strlen(zone->location) + 6; + filename_len = strlen(get_zone_directory_builtin()) + strlen(zone->location) + 6; filename = (char *)malloc(filename_len); if (!filename) { @@ -1845,7 +1845,7 @@ static void icaltimezone_load_builtin_timezone(icaltimezone *zone) goto out; } - snprintf(filename, filename_len, "%s/%s.ics", get_zone_directory(), zone->location); + snprintf(filename, filename_len, "%s/%s.ics", get_zone_directory_builtin(), zone->location); fp = fopen(filename, "r"); free(filename); @@ -2014,7 +2014,7 @@ static void format_utc_offset(int utc_offset, char *buffer, size_t buffer_size) } } -static const char *get_zone_directory(void) +static const char *get_zone_directory_builtin(void) { #if !defined(_WIN32) return zone_files_directory == NULL ? ZONEINFO_DIRECTORY : zone_files_directory; @@ -2149,6 +2149,15 @@ static const char *get_zone_directory(void) #endif } +const char *get_zone_directory(void) +{ + if (use_builtin_tzdata) { + return get_zone_directory_builtin(); + } else { + return icaltzutil_get_zone_directory(); + } +} + void set_zone_directory(const char *path) { if (zone_files_directory) diff --git a/src/libical/icaltimezone.h b/src/libical/icaltimezone.h index 90951ac4..51eb5185 100644 --- a/src/libical/icaltimezone.h +++ b/src/libical/icaltimezone.h @@ -199,6 +199,9 @@ LIBICAL_ICAL_EXPORT void icaltimezone_truncate_vtimezone(icalcomponent *vtz, * @par Handling the default location the timezone files */ +/** Gets the directory to look for the zonefiles */ +LIBICAL_ICAL_EXPORT const char *get_zone_directory(void); + /** Sets the directory to look for the zonefiles */ LIBICAL_ICAL_EXPORT void set_zone_directory(const char *path); -- cgit v1.2.1