Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion mapcodelib/mapcoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,17 @@ typedef struct {
} Mapcodes;


/**
* The MapcodeElement structure is returned by decodeXXX and can be used to inspect or clean up the
* mapcode input. The field territoryISO contains the cleaned up territory code from the input, but
* the code may be abbreviated, or even missing (if it wasn't available in the input).
*
* If you want to get a full territory code, use:
* char isoName[MAX_ISOCODE_LEN + 1];
* getTerritoryIsoName(isoName, mapcodeElement.territoryCode, 0)
*/
typedef struct {
char territoryISO[MAX_ISOCODE_LEN + 1]; // The (trimmed and uppercased) candidate territory ISO3166 code.
char territoryISO[MAX_ISOCODE_LEN + 1]; // The (trimmed and uppercased) territory code, from the input.
enum Territory territoryCode; // The territory, as recognized and disambiguated from territoryISO.
char properMapcode[MAX_PROPER_MAPCODE_LEN + 1]; // The (romanised) mapcode excl. territory or extension.
int indexOfDot; // Position of dot in properMapcode (a value between 2 and 5).
Expand Down
7 changes: 7 additions & 0 deletions utility/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
echo "Compiling..."
cd ../mapcodelib
gcc -O3 -c mapcoder.c
cd ../utility
gcc -O3 mapcode.cpp -lm -o mapcode ../mapcodelib/mapcoder.o