summaryrefslogtreecommitdiff
path: root/src/postprocess/map_plz.h
blob: 8839b5c027bbc4bf247808dde5e35165d6b498fa (plain)
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
#pragma once

typedef struct {
  const char * vorwahl;
  const char * ort;
  const char * strasse;
  const char * hnr;
  const char * name;
  const char * vorname;
  const char * nummer;
  const char * plz;
} entry_t;

typedef struct {
  const char * vorwahl;
  const char * ort;
  const char * strasse_1992;
  const char * strasse_1995;
  int similarity;
  int count;
} brute_t;

static void *bsearch_first( const void * const key, const void * base, const size_t nel, const size_t width, int (*compar) (const void *, const void *));
static int sort_by_voshnvn(const void *a, const void *b);
static int sort_by_voshnv(const void *a, const void *b);
static int sort_by_vosh(const void *a, const void *b);
static int sort_by_vos(const void *a, const void *b);
static int sort_by_vonvh(const void *a, const void *b);
static int sort_by_vo(const void *a, const void *b);
static int sort_brutes(const void *a, const void *b);
static int search_brute(const void *a, const void *b);
static int test_dot(entry_t * iter, entry_t * found);

static int cc(const void *a, const void *b) { return strcmp(*(char**)a, *(char**)b); }
static int cc2(const void *a, const void *b) { return strcmp((char*)a, *(char**)b); }
static entry_t * verify_unique_zip(entry_t *found, entry_t *candidate, int (*compar) (const void *, const void *));
static entry_t * verify_zip(entry_t *found, entry_t *candidate, int (*compar) (const void *, const void *));
static int search_and_verify(entry_t *candidate, int (*compar) (const void *, const void *), int flag);
static char * advance_and_replace(char **p, char find, char replace);