Lines Matching refs:tzf
58 static int read_preamble(const unsigned char **tzf, timelib_tzinfo *tz) in read_preamble() argument
63 version = (*tzf)[3] - '0'; in read_preamble()
64 *tzf += 4; in read_preamble()
67 tz->bc = (**tzf == '\1'); in read_preamble()
68 *tzf += 1; in read_preamble()
71 memcpy(tz->location.country_code, *tzf, 2); in read_preamble()
73 *tzf += 2; in read_preamble()
76 *tzf += 13; in read_preamble()
81 static void read_header(const unsigned char **tzf, timelib_tzinfo *tz) in read_header() argument
85 memcpy(&buffer, *tzf, sizeof(buffer)); in read_header()
92 *tzf += sizeof(buffer); in read_header()
95 static void skip_64bit_transistions(const unsigned char **tzf, timelib_tzinfo *tz) in skip_64bit_transistions() argument
98 *tzf += (sizeof(int64_t) * tz->bit64.timecnt); in skip_64bit_transistions()
99 *tzf += (sizeof(unsigned char) * tz->bit64.timecnt); in skip_64bit_transistions()
103 static void read_transistions(const unsigned char **tzf, timelib_tzinfo *tz) in read_transistions() argument
114 memcpy(buffer, *tzf, sizeof(int32_t) * tz->bit32.timecnt); in read_transistions()
115 *tzf += (sizeof(int32_t) * tz->bit32.timecnt); in read_transistions()
125 memcpy(cbuffer, *tzf, sizeof(unsigned char) * tz->bit32.timecnt); in read_transistions()
126 *tzf += sizeof(unsigned char) * tz->bit32.timecnt; in read_transistions()
133 static void skip_64bit_types(const unsigned char **tzf, timelib_tzinfo *tz) in skip_64bit_types() argument
135 *tzf += sizeof(unsigned char) * 6 * tz->bit64.typecnt; in skip_64bit_types()
136 *tzf += sizeof(char) * tz->bit64.charcnt; in skip_64bit_types()
138 *tzf += sizeof(int64_t) * tz->bit64.leapcnt * 2; in skip_64bit_types()
141 *tzf += sizeof(unsigned char) * tz->bit64.ttisstdcnt; in skip_64bit_types()
144 *tzf += sizeof(unsigned char) * tz->bit64.ttisgmtcnt; in skip_64bit_types()
148 static void read_types(const unsigned char **tzf, timelib_tzinfo *tz) in read_types() argument
158 memcpy(buffer, *tzf, sizeof(unsigned char) * 6 * tz->bit32.typecnt); in read_types()
159 *tzf += sizeof(unsigned char) * 6 * tz->bit32.typecnt; in read_types()
179 memcpy(tz->timezone_abbr, *tzf, sizeof(char) * tz->bit32.charcnt); in read_types()
180 *tzf += sizeof(char) * tz->bit32.charcnt; in read_types()
187 memcpy(leap_buffer, *tzf, sizeof(int32_t) * tz->bit32.leapcnt * 2); in read_types()
188 *tzf += sizeof(int32_t) * tz->bit32.leapcnt * 2; in read_types()
207 memcpy(buffer, *tzf, sizeof(unsigned char) * tz->bit32.ttisstdcnt); in read_types()
208 *tzf += sizeof(unsigned char) * tz->bit32.ttisstdcnt; in read_types()
221 memcpy(buffer, *tzf, sizeof(unsigned char) * tz->bit32.ttisgmtcnt); in read_types()
222 *tzf += sizeof(unsigned char) * tz->bit32.ttisgmtcnt; in read_types()
231 static void skip_posix_string(const unsigned char **tzf, timelib_tzinfo *tz) in skip_posix_string() argument
236 if (*tzf[0] == '\n') { in skip_posix_string()
239 (*tzf)++; in skip_posix_string()
243 static void read_location(const unsigned char **tzf, timelib_tzinfo *tz) in read_location() argument
248 memcpy(&buffer, *tzf, sizeof(buffer)); in read_location()
254 *tzf += sizeof(buffer); in read_location()
257 memcpy(tz->location.comments, *tzf, comments_len); in read_location()
259 *tzf += comments_len; in read_location()
305 static int seek_to_tz_position(const unsigned char **tzf, char *timezone, const timelib_tzdb *tzdb) in seek_to_tz_position() argument
327 (*tzf) = &(tzdb->data[tzdb->index[mid].pos]); in seek_to_tz_position()
357 const unsigned char *tzf; in timelib_timezone_id_is_valid() local
358 return (seek_to_tz_position(&tzf, timezone, tzdb)); in timelib_timezone_id_is_valid()
361 static void skip_64bit_preamble(const unsigned char **tzf, timelib_tzinfo *tz) in skip_64bit_preamble() argument
363 *tzf += 20; in skip_64bit_preamble()
366 static void read_64bit_header(const unsigned char **tzf, timelib_tzinfo *tz) in read_64bit_header() argument
370 memcpy(&buffer, *tzf, sizeof(buffer)); in read_64bit_header()
377 *tzf += sizeof(buffer); in read_64bit_header()
382 const unsigned char *tzf; in timelib_parse_tzfile() local
386 if (seek_to_tz_position(&tzf, timezone, tzdb)) { in timelib_parse_tzfile()
389 version = read_preamble(&tzf, tmp); in timelib_parse_tzfile()
390 read_header(&tzf, tmp); in timelib_parse_tzfile()
391 read_transistions(&tzf, tmp); in timelib_parse_tzfile()
392 read_types(&tzf, tmp); in timelib_parse_tzfile()
394 skip_64bit_preamble(&tzf, tmp); in timelib_parse_tzfile()
395 read_64bit_header(&tzf, tmp); in timelib_parse_tzfile()
396 skip_64bit_transistions(&tzf, tmp); in timelib_parse_tzfile()
397 skip_64bit_types(&tzf, tmp); in timelib_parse_tzfile()
398 skip_posix_string(&tzf, tmp); in timelib_parse_tzfile()
400 read_location(&tzf, tmp); in timelib_parse_tzfile()