#include <cstdarg>
#include <cstdint>
#include <cstdlib>
#include <new>
enum class RelationMemeberType {
Node,
Way,
Relation,
};
struct String;
template<typename T>
struct Vec;
using CoordType = double;
struct Coord {
CoordType lat;
CoordType lon;
};
using IDType = uint32_t;
struct Tag {
IDType key;
IDType val;
};
struct Tags {
IDType string_table_id;
Vec<Tag> tags;
};
struct Node {
Coord coord;
Tags tags;
};
struct Way {
Vec<IDType> nodes;
Tags tags;
};
struct RelationMemeber {
IDType member_id;
RelationMemeberType member_type;
IDType role_id;
};
struct Relation {
Tags tags;
Vec<RelationMemeber> members;
};
struct Strings {
Vec<String> strings;
};
struct LBox {
Coord top_left;
Coord bottom_right;
};
struct BlobPosition {
uintptr_t start;
uintptr_t size;
};
struct PbfInfo {
LBox bbox;
BlobPosition position;
};
struct CCallback {
bool (*node_cb)(Node node);
bool (*way_cb)(Way way);
bool (*relation_cb)(Relation relation);
bool (*strings_cb)(Strings strings);
bool (*info_cb)(PbfInfo info);
void (*finish_cb)(String msg);
};
extern "C" {
void rust_read_pbf(const String *fname, uint8_t threads, const CCallback *func);
const T *rust_vec_at(const Vec<T> *a, uintptr_t index);
uintptr_t rust_vec_size(const Vec<T> *a);
}