Skip to content

Commit 9e8b3bd

Browse files
committed
Fixed docs
1 parent 3e609d1 commit 9e8b3bd

File tree

3 files changed

+45
-27
lines changed

3 files changed

+45
-27
lines changed

README.md

Lines changed: 37 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,34 @@ The directory 'mapcodelib' contains the files:
1515

1616
mapcodelib/
1717
mapcoder.h <-- Header file with method prototypes and defines for caller.
18-
mapcoder.c
19-
basics.h
18+
mapcoder.c <-- Implementation of mapcode routines.
19+
internal_*.h <-- Internal implementataion details for library.
2020

21-
mapcode_fastencode.h <-- include unless FAST_ENCODE is undefined
22-
mapcode_fastalpha.h <-- needed only if FAST_ALPHA is defined
23-
24-
mapcode_countrynames.h <-- optional array with english territory names, including official names
25-
mapcode_countrynames_short.h <-- optional array with english territory names
21+
mapcode_alphabets.h <-- Enumeration of supported alphabets (or scripts).
22+
mapcode_territories.h <-- Enumeration of supported territories.
23+
24+
mapcode_legacy.h <-- Courtesy support for legacy calls, may be deprecated in future.
2625

2726
Together these provide routine to encode/decode Mapcodes.
2827

2928
Documentation, including example snippets of C source code, can be found in
3029

3130
docs/
3231
mapcode_library_c.pdf <-- PDF format.
33-
mapcode_library_c.doc <-- Microsoft Word format.
32+
mapcode_library_c.docx <-- Microsoft Word format.
3433

35-
A unit test can be found in the `test` subdirectory.
36-
Compile and run `unittest.c` to see if the library performs as expected.
37-
Check the `README.md` file in `test` to see how you can compile it/
34+
A unit test can be found in the `test` subdirectory. Compile and run `unittest.c` to see
35+
if the library performs as expected:
3836

39-
Also see www.mapcode.com for background and reference materials.
37+
cd mapcodelib
38+
gcc -O -c mapcoder.c
39+
cd ../test
40+
gcc -O unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o
41+
./unittest
4042

41-
Note: this version may be restricted to a particular area of the Earth!
42-
In that case, basics.h will state a version number of the for:
43+
Check the `README.md` in directory `test` for more information.
4344

44-
#define mapcode_cversion "1.2xxx"
45-
46-
where "xxx" states the geographical limitation.
45+
Also see http://www.mapcode.com for background and reference materials.
4746

4847

4948
## A Real-Life Example, The 'mapcode' Codec Tool: `utility/`
@@ -53,8 +52,10 @@ of how to use the library.
5352

5453
To build the original Mapcode tool, execute:
5554

56-
cd utility
57-
gcc -O mapcode.cpp -o mapcode
55+
cd mapcodelib
56+
gcc -O -c mapcoder.c
57+
cd ../utility
58+
gcc -O mapcode.cpp -o mapcode ../mapcodelib/mapcoder.o
5859

5960
For help, simply execute the binary file 'mapcode' without no arguments.
6061
This tool provides a rather extensive command-line interface to encode and
@@ -136,6 +137,23 @@ The Mapcode C/C++ Library has includes a number of fixed data tables, which incr
136137
You may not require all of this data, so we've added some options for you to be able to reduce its
137138
footprint, for example for embedded applications.
138139

140+
You can specify the define `MAPCODE_NO_SUPPORT_ALL_LANGUAGES` to disable support for territory names
141+
in all languages.
142+
143+
Note that English names are always supported and it's also always possible to get territory names
144+
in their locale language.
145+
146+
To add individual support support for other languages (of all territory names), use:
147+
148+
-DMAPCODE_NO_SUPPORT_ALL_LANGUAGES // If not defined, ALL languages are available.
149+
-DMAPCODE_SUPPORT_LANGUAGE_DA // Add individual languages.
150+
-DMAPCODE_SUPPORT_LANGUAGE_DE
151+
-DMAPCODE_SUPPORT_LANGUAGE_FR
152+
-DMAPCODE_SUPPORT_LANGUAGE_HI
153+
-DMAPCODE_SUPPORT_LANGUAGE_NL
154+
155+
The list of support languages may grow over time.
156+
139157
## Release Notes
140158

141159
### 2.5.2

mapcodelib/mapcoder.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3047,7 +3047,7 @@ getFullTerritoryName_internal(char *territoryName, enum Territory territory, int
30473047

30483048
ASSERT(territoryName);
30493049
ASSERT((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX));
3050-
ASSERT((alphabet == _ALPHABET_MIN) || (_ALPHABET_MIN < alphabet) && (alphabet < _ALPHABET_MAX));
3050+
ASSERT((alphabet == _ALPHABET_MIN) || ((_ALPHABET_MIN < alphabet) && (alphabet < _ALPHABET_MAX)));
30513051

30523052
// Defensive bail out if incorrect arguments.
30533053
if (!territoryName || (alternative < 0) || (territory <= _TERRITORY_MIN) || (territory >= _TERRITORY_MAX)) {
@@ -3147,7 +3147,7 @@ int getFullTerritoryNameEnglish(char *territoryName, enum Territory territory, i
31473147
int getFullTerritoryNameInLocaleUtf8(char *territoryName, enum Territory territory, int alternative,
31483148
const char *locale) {
31493149
ASSERT(territoryName);
3150-
ASSERT((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX) || (territory == TERRITORY_UNKNOWN));
3150+
ASSERT(((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX)) || (territory == TERRITORY_UNKNOWN));
31513151
return getFullTerritoryName_internal(territoryName, territory, alternative, locale, _ALPHABET_MIN);
31523152
}
31533153

test/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ To build the unit tests, execute:
44

55
cd ../mapcodelib
66
gcc -DDEBUG -O -c mapcoder.c
7-
cd ../unittest
7+
cd ../test
88
gcc -DDEBUG -O -DDEBUG unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o
99

1010
To execute the tests, simply execute:
@@ -17,7 +17,7 @@ Compile and run as follows to use `valgrind` (http://valgrind.org) to detect mem
1717

1818
cd ../mapcodelib
1919
gcc -g -O0 -c mapcoder.c
20-
cd ../unittest
20+
cd ../test
2121
gcc -g -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o
2222
valgrind --leak-check=yes ./unittest
2323

@@ -27,7 +27,7 @@ Or, add `-fsanitize=address` to run the address sanitizer:
2727

2828
cd ../mapcodelib
2929
gcc -O -c mapcoder.c
30-
cd ../unittest
30+
cd ../test
3131
gcc -O unittest.c -lm -lpthread -fsanitize=address -o unittest ../mapcodelib/mapcoder.o
3232

3333
And add the environment variable `ASAN_OPTIONS` to your shell:
@@ -42,7 +42,7 @@ Compile and run as follows to use `gprof` to profile the library:
4242

4343
cd ../mapcodelib
4444
gcc -g -O0 -c mapcoder.c -pg
45-
cd ../unittest
45+
cd ../test
4646
gcc -g -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -pg
4747

4848
## Using `gcov` to Show Test Coverage
@@ -51,12 +51,12 @@ Compile and run as follows to use `gcov` to show test coverage for the libray:
5151

5252
cd ../mapcodelib
5353
gcc -fprofile-arcs -ftest-coverage -O0 -c mapcoder.c
54-
cd ../unittest
54+
cd ../test
5555
gcc -fprofile-arcs -ftest-coverage -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -pg
5656
./unittest
5757
cd ../mapcodelib
5858
gcov mapcoder.c
59-
cd ../unittest
59+
cd ../test
6060
gcov unittest.c
6161

6262
The test coverage reports are the `*.gcov` text files.

0 commit comments

Comments
 (0)