TTZ
Loading...
Searching...
No Matches
ttz.h
Go to the documentation of this file.
1#ifndef TTZ_H
2#define TTZ_H
3
4#include "stdint.h"
5
6typedef enum {
12
19
27uint8_t ttz_render_country_name(uint8_t idx, char *buf);
28
36uint8_t ttz_render_official_name(uint8_t idx, char *buf);
37
45uint8_t ttz_render_country_code(uint8_t idx, char *buf);
46
54uint8_t ttz_render_city(uint16_t idx, char *buf);
55
63uint8_t ttz_render_zone_code(uint16_t idx, char *buf);
64
74ttz_match_t ttz_find_country(char *s, uint8_t count, uint8_t *idx,
75 uint8_t *scores);
76
86ttz_match_t ttz_find_city(char *s, uint8_t count, uint16_t *idx,
87 uint8_t *scores);
88
96ttz_match_t ttz_find_country_code(char *s, uint8_t *idx);
97
105ttz_match_t ttz_find_zone_code(char *s, uint16_t *idx);
106
115ttz_error_t ttz_offset_by_zone_code(uint16_t idx, int64_t timestamp,
116 int *offset);
117
126ttz_error_t ttz_offset_by_city(uint16_t idx, int64_t timestamp, int *offset);
127
136ttz_error_t ttz_offset_by_country(uint8_t idx, int64_t timestamp, int *offset);
137
138#endif
uint8_t ttz_render_official_name(uint8_t idx, char *buf)
uint8_t ttz_render_zone_code(uint16_t idx, char *buf)
ttz_error_t ttz_offset_by_zone_code(uint16_t idx, int64_t timestamp, int *offset)
ttz_match_t ttz_find_zone_code(char *s, uint16_t *idx)
ttz_match_t ttz_find_country_code(char *s, uint8_t *idx)
ttz_match_t ttz_find_country(char *s, uint8_t count, uint8_t *idx, uint8_t *scores)
ttz_match_t
Definition ttz.h:6
@ TTZ_NONE
No match found.
Definition ttz.h:7
@ TTZ_SCORE
Definition ttz.h:9
@ TTZ_EXACT
We found an exact match.
Definition ttz.h:8
uint8_t ttz_render_country_name(uint8_t idx, char *buf)
uint8_t ttz_render_country_code(uint8_t idx, char *buf)
ttz_error_t ttz_offset_by_city(uint16_t idx, int64_t timestamp, int *offset)
ttz_match_t ttz_find_city(char *s, uint8_t count, uint16_t *idx, uint8_t *scores)
ttz_error_t
Definition ttz.h:13
@ TTZ_NO_MATCH
No match found.
Definition ttz.h:15
@ TTZ_INVALID_INDEX
Out of bounds index provided.
Definition ttz.h:16
@ TTZ_SUCCESS
No error.
Definition ttz.h:14
@ TTZ_MULTI_ZONES
Multiple zones found for the given country.
Definition ttz.h:17
uint8_t ttz_render_city(uint16_t idx, char *buf)
ttz_error_t ttz_offset_by_country(uint8_t idx, int64_t timestamp, int *offset)