#include "stdint.h"
Go to the source code of this file.
|
| uint8_t | ttz_render_country_name (uint8_t idx, char *buf) |
| |
| uint8_t | ttz_render_official_name (uint8_t idx, char *buf) |
| |
| uint8_t | ttz_render_country_code (uint8_t idx, char *buf) |
| |
| uint8_t | ttz_render_city (uint16_t idx, char *buf) |
| |
| uint8_t | ttz_render_zone_code (uint16_t idx, char *buf) |
| |
| ttz_match_t | ttz_find_country (char *s, uint8_t count, uint8_t *idx, uint8_t *scores) |
| |
| ttz_match_t | ttz_find_city (char *s, uint8_t count, uint16_t *idx, uint8_t *scores) |
| |
| ttz_match_t | ttz_find_country_code (char *s, uint8_t *idx) |
| |
| ttz_match_t | ttz_find_zone_code (char *s, uint16_t *idx) |
| |
| ttz_error_t | ttz_offset_by_zone_code (uint16_t idx, int64_t timestamp, int *offset) |
| |
| ttz_error_t | ttz_offset_by_city (uint16_t idx, int64_t timestamp, int *offset) |
| |
| ttz_error_t | ttz_offset_by_country (uint8_t idx, int64_t timestamp, int *offset) |
| |
◆ ttz_error_t
| Enumerator |
|---|
| TTZ_SUCCESS | No error.
|
| TTZ_NO_MATCH | No match found.
|
| TTZ_INVALID_INDEX | Out of bounds index provided.
|
| TTZ_MULTI_ZONES | Multiple zones found for the given country.
|
◆ ttz_match_t
| Enumerator |
|---|
| TTZ_NONE | No match found.
|
| TTZ_EXACT | We found an exact match.
|
| TTZ_SCORE | No exact match, so we return a list of matches ranked by scores
|
◆ ttz_find_city()
| ttz_match_t ttz_find_city |
( |
char * | s, |
|
|
uint8_t | count, |
|
|
uint16_t * | idx, |
|
|
uint8_t * | scores ) |
Search for a city from a query string
- Parameters
-
| [in] | s | The query string. |
| [in] | count | In case of non-exact match, the number of matches to return. |
| [out] | idx | The city indeces of the matches. |
| [out] | scores | The scores of the matches. |
- Returns
- The match type.
◆ ttz_find_country()
| ttz_match_t ttz_find_country |
( |
char * | s, |
|
|
uint8_t | count, |
|
|
uint8_t * | idx, |
|
|
uint8_t * | scores ) |
Search for a country code from a query string
- Parameters
-
| [in] | s | The query string. |
| [in] | count | In case of non-exact match, the number of matches to return. |
| [out] | idx | The country indeces of the matches. |
| [out] | scores | The scores of the matches. |
- Returns
- The match type.
◆ ttz_find_country_code()
| ttz_match_t ttz_find_country_code |
( |
char * | s, |
|
|
uint8_t * | idx ) |
Search for a country code from a query string using exact match.
- Parameters
-
| [in] | s | The query string. |
| [out] | idx | The country index. |
- Returns
- The match type.
◆ ttz_find_zone_code()
| ttz_match_t ttz_find_zone_code |
( |
char * | s, |
|
|
uint16_t * | idx ) |
Search for a zone code from a query string using exact match.
- Parameters
-
| [in] | s | The query string. |
| [out] | idx | The zone index. |
- Returns
- The match type.
◆ ttz_offset_by_city()
| ttz_error_t ttz_offset_by_city |
( |
uint16_t | idx, |
|
|
int64_t | timestamp, |
|
|
int * | offset ) |
Get the offset for a given city index and timestamp.
- Parameters
-
| [in] | idx | The city index. |
| [in] | timestamp | The timestamp. |
| [out] | offset | The offset. |
- Returns
- The error code.
◆ ttz_offset_by_country()
| ttz_error_t ttz_offset_by_country |
( |
uint8_t | idx, |
|
|
int64_t | timestamp, |
|
|
int * | offset ) |
Get the offset for a given country index and timestamp.
- Parameters
-
| [in] | idx | The country index. |
| [in] | timestamp | The timestamp. |
| [out] | offset | The offset. |
- Returns
- The error code.
◆ ttz_offset_by_zone_code()
| ttz_error_t ttz_offset_by_zone_code |
( |
uint16_t | idx, |
|
|
int64_t | timestamp, |
|
|
int * | offset ) |
Get the offset for a given zone index and timestamp.
- Parameters
-
| [in] | idx | The zone index. |
| [in] | timestamp | The timestamp. |
| [out] | offset | The offset. |
- Returns
- The error code.
◆ ttz_render_city()
| uint8_t ttz_render_city |
( |
uint16_t | idx, |
|
|
char * | buf ) |
Render the city name for a given city index.
- Parameters
-
| [in] | idx | The city index. |
| [out] | buf | The buffer to write the city name to. |
- Returns
- The length of the city name.
◆ ttz_render_country_code()
| uint8_t ttz_render_country_code |
( |
uint8_t | idx, |
|
|
char * | buf ) |
Render the country code for a given country index.
- Parameters
-
| [in] | idx | The country index. |
| [out] | buf | The buffer to write the country code to. |
- Returns
- The length of the country code.
◆ ttz_render_country_name()
| uint8_t ttz_render_country_name |
( |
uint8_t | idx, |
|
|
char * | buf ) |
Render the country name for a given country index.
- Parameters
-
| [in] | idx | The country index. |
| [out] | buf | The buffer to write the country name to. |
- Returns
- The length of the country name.
◆ ttz_render_official_name()
| uint8_t ttz_render_official_name |
( |
uint8_t | idx, |
|
|
char * | buf ) |
Render the official name for a given country index.
- Parameters
-
| [in] | idx | The country index. |
| [out] | buf | The buffer to write the official name to. |
- Returns
- The length of the official name.
◆ ttz_render_zone_code()
| uint8_t ttz_render_zone_code |
( |
uint16_t | idx, |
|
|
char * | buf ) |
Render the zone code for a given zone index.
- Parameters
-
| [in] | idx | The zone index. |
| [out] | buf | The buffer to write the zone code to. |
- Returns
- The length of the zone code.