After some quick investigation, I found that gnome-control-center pulls its data directly from the zone.tab file, just like Paul Eggert warned against doing in the comment I quoted above.
tz_data_file = tz_data_file_get ();
if (!tz_data_file) {
g_warning ("Could not get the TimeZone data file name");
return NULL;
}
tzfile = fopen (tz_data_file, "r");
if (!tzfile) {
g_warning ("Could not open *%s*\n", tz_data_file);
return NULL;
}
After some quick investigation, I found that gnome-control- center pulls its data directly from the zone.tab file, just like Paul Eggert warned against doing in the comment I quoted above.
in tz.h (https:/ /github. com/GNOME/ gnome-control- center/ blob/5532301ce7 6d2719c1105c61f 576abe7fae2dc16 /panels/ datetime/ tz.h)
# define TZ_DATA_FILE "/usr/share/ zoneinfo/ zone.tab"
in tz.c (https:/ /github. com/GNOME/ gnome-control- center/ blob/5532301ce7 6d2719c1105c61f 576abe7fae2dc16 /panels/ datetime/ tz.c)
static gchar *
tz_data_file_get (void)
{
gchar *file;
file = g_strdup (TZ_DATA_FILE);
return file;
}
[...]
TzDB *
tz_load_db (void)
{
g_autofree gchar *tz_data_file = NULL;
TzDB *tz_db;
FILE *tzfile;
char buf[4096];
tz_data_file = tz_data_file_get ();
if (!tz_data_file) {
g_warning ("Could not get the TimeZone data file name");
return NULL;
}
tzfile = fopen (tz_data_file, "r");
if (!tzfile) {
g_warning ("Could not open *%s*\n", tz_data_file);
return NULL;
}
tz_db = g_new0 (TzDB, 1);
tz_db->locations = g_ptr_array_new ();
while (fgets (buf, sizeof(buf), tzfile))
{
[PARSING CODE].
}
fclose (tzfile);
/* now sort by country */ _by_country (tz_db->locations);
sort_locations
/* Load up the hashtable of backward links */
load_backward_tz (tz_db);
return tz_db;
}