forked from maximuska/Freemap-waze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroadmap_db_dictionary.h
71 lines (60 loc) · 2.36 KB
/
roadmap_db_dictionary.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/* roadmap_db_dictionary.h - Name dictionary tables for RoadMap.
*
* LICENSE:
*
* Copyright 2002 Pascal F. Martin
*
* This file is part of RoadMap.
*
* RoadMap is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* RoadMap is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RoadMap; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* SYNOPSYS:
*
* A RoadMap dictionary is made of the following tables:
*
* string.*.data a buffer that contains the string value.
* string.*.tree for each node, the list of children nodes.
* string.*.node the tree nodes, reference either a tree branch
* or a leaf (i.e. the offset to the string data).
*
* The tree structure speeds up the retrieval of a given string. It is also
* designed to help enter a string by predicting which characters are
* possible after the last entered. Each time one enter a new character
* of the string, the program can move one node deeper in the tree and
* look ahead at what is the possible next character.
*
* There is a dictionary for each type of strings: street prefix, name,
* suffix and type, city name.
*/
#ifndef _ROADMAP_DB_DICTIONARY__H_
#define _ROADMAP_DB_DICTIONARY__H_
#include "roadmap_db.h"
#define ROADMAP_DICTIONARY_NULL 0
#define ROADMAP_DICTIONARY_TREE 1
#define ROADMAP_DICTIONARY_STRING 2
struct roadmap_dictionary_reference { /* tables string.*.node */
char character;
unsigned char type;
unsigned short index;
};
struct roadmap_dictionary_tree { /* tables string.*.tree */
unsigned short first;
unsigned char count;
unsigned char position;
unsigned char num_strings;
};
typedef struct roadmap_dictionary_reference RoadMapDictionaryReference;
typedef struct roadmap_dictionary_tree RoadMapDictionaryTree;
#endif /* _ROADMAP_DB_DICTIONARY__H_ */