[geodb] Additional filenames and struct members in geodb.h
This commit is contained in:
20
src/geodb.h
20
src/geodb.h
@@ -5,19 +5,23 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "bloom.h"
|
||||
#include "libpostal_config.h"
|
||||
#include "geonames.h"
|
||||
#include "graph.h"
|
||||
#include "sparkey/sparkey.h"
|
||||
#include "sparkey/sparkey-internal.h"
|
||||
#include "string_utils.h"
|
||||
#include "trie.h"
|
||||
#include "trie_search.h"
|
||||
|
||||
#define GEODB_TRIE_FILENAME "geodb.trie"
|
||||
#define GEODB_TRIE_FILENAME_LEN strlen(GEODB_TRIE_FILENAME)
|
||||
#define GEODB_BLOOM_FILTER_FILENAME "geodb.bloom"
|
||||
#define GEODB_BLOOM_FILTER_FILENAME_LEN strlen(GEODB_BLOOM_FILTER_FILENAME)
|
||||
#define GEODB_NAMES_TRIE_FILENAME "geodb_names.trie"
|
||||
#define GEODB_TRIE_FILENAME_LEN strlen(GEODB_NAMES_TRIE_FILENAME)
|
||||
#define GEODB_FEATURES_TRIE_FILENAME "geodb_features.trie"
|
||||
#define GEODB_FEATURES_TRIE_FILENAME_LEN strlen(GEODB_FEATURES_TRIE_FILENAME)
|
||||
#define GEODB_FEATURE_GRAPH_FILENAME "geodb_feature_graph.dat"
|
||||
#define GEODB_FEATURE_GRAPH_FILENAME_LEN strlen(GEODB_FEATURE_GRAPH_FILENAME)
|
||||
#define GEODB_POSTAL_CODES_FILENAME "geodb_postal_codes.dat"
|
||||
#define GEODB_POSTAL_CODES_FILENAME_LEN strlen(GEODB_POSTAL_CODES_FILENAME)
|
||||
#define GEODB_HASH_FILENAME "geodb.spi"
|
||||
#define GEODB_HASH_FILENAME_LEN strlen(GEODB_HASH_FILENAME)
|
||||
#define GEODB_LOG_FILENAME "geodb.spl"
|
||||
@@ -34,8 +38,10 @@ typedef union geodb_value {
|
||||
} geodb_value_t;
|
||||
|
||||
typedef struct geodb {
|
||||
trie_t *trie;
|
||||
bloom_filter_t *bloom_filter;
|
||||
trie_t *names;
|
||||
trie_t *features;
|
||||
cstring_array *postal_codes;
|
||||
graph_t *feature_graph;
|
||||
sparkey_hashreader *hash_reader;
|
||||
sparkey_logiter *log_iter;
|
||||
char_array *value_buf;
|
||||
|
||||
@@ -8,7 +8,7 @@ KSORT_INIT(graph_edge_array, graph_edge_t, ks_lt_graph_edge)
|
||||
KSORT_INIT(graph_edge_array_sort_vertices, graph_edge_t, ks_lt_graph_edge_sort_vertices)
|
||||
|
||||
|
||||
static void graph_builder_destroy(graph_builder_t *self) {
|
||||
void graph_builder_destroy(graph_builder_t *self) {
|
||||
if (self == NULL) return;
|
||||
|
||||
if (self->edges != NULL) {
|
||||
|
||||
@@ -35,6 +35,8 @@ typedef struct graph_builder {
|
||||
} graph_builder_t;
|
||||
|
||||
graph_builder_t *graph_builder_new(graph_type_t type, bool fixed_rows);
|
||||
void graph_builder_destroy(graph_builder_t *self);
|
||||
|
||||
/*
|
||||
Destroy the builder and return a graph.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user