This repository was archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlotyr.h
53 lines (42 loc) · 1.6 KB
/
lotyr.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef LOTYR_LOTYR_H_
#define LOTYR_LOTYR_H_
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _MSC_VER
# ifdef _LOTYR_DLL_EXPORT
# define _LOTYR_EXPORT __declspec(dllexport)
# else
# define _LOTYR_EXPORT __declspec(dllimport)
# endif
#else
# define _LOTYR_EXPORT
#endif
typedef struct lotyr_t lotyr_t;
typedef struct lotyr_error_t lotyr_error_t;
/// Creates a new routing engine context with the Valhalla configuration parsed
/// from `config`.
_LOTYR_EXPORT lotyr_error_t *lotyr_new(lotyr_t **lotyr, const char *config);
/// Frees the memory and resources associated with the given routing engine
/// context.
_LOTYR_EXPORT lotyr_error_t *lotyr_free(lotyr_t *lotyr);
/// Calculates a route described by `request`. It is the responsibility of the
/// library user to free the returned response string, which is stored into
/// `response` after a route has been found.
///
/// See the Valhalla API reference (linked below) for documentation on the
/// format of `request`.
/// https://valhalla.readthedocs.io/en/latest/api/turn-by-turn/api-reference/
_LOTYR_EXPORT lotyr_error_t *lotyr_route(lotyr_t *lotyr, const char *request, char **response);
/// Gets a human-readable error message representing the given error.
///
/// The returned string points to internal data of the given error; don't free
/// or modify it unless you want bad things to happen.
_LOTYR_EXPORT const char *lotyr_error_message(const lotyr_error_t *error);
/// Frees the memory associated with the given Lotyr error.
_LOTYR_EXPORT void lotyr_error_free(lotyr_error_t *error);
#undef _LOTYR_EXPORT
#ifdef __cplusplus
}
#endif
#endif // LOTYR_LOTYR_H_