summaryrefslogtreecommitdiff
path: root/src/postprocess/map_plz.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/postprocess/map_plz.h')
-rw-r--r--src/postprocess/map_plz.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/postprocess/map_plz.h b/src/postprocess/map_plz.h
new file mode 100644
index 0000000..8839b5c
--- /dev/null
+++ b/src/postprocess/map_plz.h
@@ -0,0 +1,39 @@
1#pragma once
2
3typedef struct {
4 const char * vorwahl;
5 const char * ort;
6 const char * strasse;
7 const char * hnr;
8 const char * name;
9 const char * vorname;
10 const char * nummer;
11 const char * plz;
12} entry_t;
13
14typedef struct {
15 const char * vorwahl;
16 const char * ort;
17 const char * strasse_1992;
18 const char * strasse_1995;
19 int similarity;
20 int count;
21} brute_t;
22
23static void *bsearch_first( const void * const key, const void * base, const size_t nel, const size_t width, int (*compar) (const void *, const void *));
24static int sort_by_voshnvn(const void *a, const void *b);
25static int sort_by_voshnv(const void *a, const void *b);
26static int sort_by_vosh(const void *a, const void *b);
27static int sort_by_vos(const void *a, const void *b);
28static int sort_by_vonvh(const void *a, const void *b);
29static int sort_by_vo(const void *a, const void *b);
30static int sort_brutes(const void *a, const void *b);
31static int search_brute(const void *a, const void *b);
32static int test_dot(entry_t * iter, entry_t * found);
33
34static int cc(const void *a, const void *b) { return strcmp(*(char**)a, *(char**)b); }
35static int cc2(const void *a, const void *b) { return strcmp((char*)a, *(char**)b); }
36static entry_t * verify_unique_zip(entry_t *found, entry_t *candidate, int (*compar) (const void *, const void *));
37static entry_t * verify_zip(entry_t *found, entry_t *candidate, int (*compar) (const void *, const void *));
38static int search_and_verify(entry_t *candidate, int (*compar) (const void *, const void *), int flag);
39static char * advance_and_replace(char **p, char find, char replace);