diff --git a/.gitignore b/.gitignore index 0f8d2b1..63fdf13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,22 @@ -unittest/gmon.out -unittest/_*.txt -unittest/*.gcov -unittest/*.gcda -unittest/*.gcno +test/gmon.out +test/_*.txt +test/*.gcov +test/*.gcda +test/*.gcno mapcodelib/*.gcov mapcodelib/*.gcda mapcodelib/*.gcno +CMakeCache.txt +CMakeFiles/** +Makefile +cmake_install.cmake +*.a +unittest +mapcode +test/unittest +utility/mapcode +cmake-build-debug/ +*.cbp # ----------------------------------------------------------------------------- # Compiled sources @@ -16,8 +27,6 @@ mapcodelib/*.gcno *.exe *.o *.so -unittest/unittest -utility/mapcode # ----------------------------------------------------------------------------- # Packages and archives @@ -123,3 +132,4 @@ Release # ----------------------------------------------------------------------------- nb-configuration.xml *.orig +.gitnexus diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c38bfd..fccca4c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.5) project(mapcode_cpp) # The debug configuration adds the "address sanitizer" to check for out of bounds behavior and such. @@ -27,7 +27,7 @@ project(mapcode_cpp) # NO_FAST_ENCODE - Drop fast encoding support - only for internal use. set(MAPCODE_OPTIONS "") -set(MAPCODE_WARNING_OPTIONS "-Wall -Werror") +set(MAPCODE_WARNING_OPTIONS "-Wall -Werror -Wextra -Wno-pointer-to-int-cast -Wno-deprecated-declarations -Wno-unused-but-set-variable") set(MAPCODE_SANITIZER_COMPILER_OPTIONS "-fsanitize=address -fno-common -fno-optimize-sibling-calls -fno-omit-frame-pointer") set(MAPCODE_SANITIZER_LINKER_OPTIONS "-fsanitize=address") @@ -48,8 +48,34 @@ set(SOURCE_FILES_MAPCODELIB mapcodelib/internal_alphabet_recognizer.h mapcodelib/internal_iso3166_data.h mapcodelib/internal_territory_alphabets.h - mapcodelib/internal_territory_names_english.h + mapcodelib/internal_territory_names_af.h + mapcodelib/internal_territory_names_ar.h + mapcodelib/internal_territory_names_be.h + mapcodelib/internal_territory_names_cn.h + mapcodelib/internal_territory_names_cs.h + mapcodelib/internal_territory_names_da.h + mapcodelib/internal_territory_names_de.h + mapcodelib/internal_territory_names_en.h + mapcodelib/internal_territory_names_es.h + mapcodelib/internal_territory_names_fi.h + mapcodelib/internal_territory_names_fr.h + mapcodelib/internal_territory_names_he.h + mapcodelib/internal_territory_names_hi.h + mapcodelib/internal_territory_names_hr.h + mapcodelib/internal_territory_names_id.h + mapcodelib/internal_territory_names_it.h + mapcodelib/internal_territory_names_ja.h + mapcodelib/internal_territory_names_ko.h mapcodelib/internal_territory_names_local.h + mapcodelib/internal_territory_names_nl.h + mapcodelib/internal_territory_names_no.h + mapcodelib/internal_territory_names_pl.h + mapcodelib/internal_territory_names_pt.h + mapcodelib/internal_territory_names_ru.h + mapcodelib/internal_territory_names_sv.h + mapcodelib/internal_territory_names_sw.h + mapcodelib/internal_territory_names_tr.h + mapcodelib/internal_territory_names_uk.h mapcodelib/internal_territory_search.h mapcodelib/mapcode_alphabets.h mapcodelib/mapcode_legacy.c @@ -58,18 +84,30 @@ set(SOURCE_FILES_MAPCODELIB mapcodelib/mapcoder.c mapcodelib/mapcoder.h) -set(SOURCE_FILES_UNITTEST - unittest/decode_test.h - unittest/unittest.c) +set(SOURCE_FILES_TEST + test/decode_test.h + test/unittest.c) set(SOURCE_FILES_UTILITY utility/mapcode.cpp) +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +find_library(M_LIB m) + add_library(mapcodelib ${SOURCE_FILES_MAPCODELIB}) target_include_directories(mapcodelib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_link_libraries(mapcodelib Threads::Threads) +target_link_libraries(mapcodelib ${M_LIB}) -add_executable(unittest ${SOURCE_FILES_UNITTEST}) +add_executable(unittest ${SOURCE_FILES_TEST}) target_link_libraries(unittest LINK_PUBLIC mapcodelib) +target_link_libraries(unittest LINK_PUBLIC Threads::Threads) +target_link_libraries(unittest LINK_PUBLIC ${M_LIB}) add_executable(mapcode ${SOURCE_FILES_UTILITY}) target_link_libraries(mapcode LINK_PUBLIC mapcodelib) +target_link_libraries(mapcode LINK_PUBLIC Threads::Threads) +target_link_libraries(mapcode LINK_PUBLIC ${M_LIB}) + +install(TARGETS mapcode DESTINATION /usr/local/bin) diff --git a/LICENSE b/LICENSE index d645695..59cfcac 100644 --- a/LICENSE +++ b/LICENSE @@ -176,18 +176,7 @@ END OF TERMS AND CONDITIONS - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] + Copyright 2018, Stichting Mapcode Foundation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/NOTICE b/NOTICE index bbd5f4d..d7561a4 100644 --- a/NOTICE +++ b/NOTICE @@ -1,4 +1,4 @@ Original C library created by Pieter Geelen. Work on Java version of the Mapcode library by Rijn Buve (original port by Matthew Lowden). -Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) +Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) diff --git a/README.md b/README.md index 678314f..6f0b46d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Mapcode Library for C/C++ +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d2e3d7a469484bfd8b801ce94d3f1737)](https://www.codacy.com/app/rijnb/mapcode-cpp?utm_source=github.com&utm_medium=referral&utm_content=mapcode-foundation/mapcode-cpp&utm_campaign=Badge_Grade) [![License](http://img.shields.io/badge/license-APACHE2-blue.svg)]() -**Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com)** +**Copyright (C) 2014-2026 Stichting Mapcode Foundation (http://www.mapcode.com)** **Online documentation: http://mapcode-foundation.github.io/mapcode-cpp/** @@ -15,14 +16,13 @@ The directory 'mapcodelib' contains the files: mapcodelib/ mapcoder.h <-- Header file with method prototypes and defines for caller. - mapcoder.c - basics.h + mapcoder.c <-- Implementation of mapcode routines. + internal_*.h <-- Internal implementataion details for library. - mapcode_fastencode.h <-- include unless FAST_ENCODE is undefined - mapcode_fastalpha.h <-- needed only if FAST_ALPHA is defined - - mapcode_countrynames.h <-- optional array with english territory names, including official names - mapcode_countrynames_short.h <-- optional array with english territory names + mapcode_alphabets.h <-- Enumeration of supported alphabets (or scripts). + mapcode_territories.h <-- Enumeration of supported territories. + + mapcode_legacy.h <-- Courtesy support for legacy calls, may be deprecated in future. Together these provide routine to encode/decode Mapcodes. @@ -30,19 +30,20 @@ Documentation, including example snippets of C source code, can be found in docs/ mapcode_library_c.pdf <-- PDF format. - mapcode_library_c.doc <-- Microsoft Word format. + mapcode_library_c.docx <-- Microsoft Word format. -A unit test can be found in the unittest\ subdirectory. -Compile and run unittest\unittest/c to see if the library performs as expected. +A unit test can be found in the `test` subdirectory. Compile and run `unittest.c` to see +if the library performs as expected: -Also see www.mapcode.com for background and reference materials. + cd mapcodelib + gcc -O -c mapcoder.c + cd ../test + gcc -O unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o + ./unittest -Note: this version may be restricted to a particular area of the Earth! -In that case, basics.h will state a version number of the for: +Check the `README.md` in directory `test` for more information. - #define mapcode_cversion "1.2xxx" - -where "xxx" states the geographical limitation. +Also see http://www.mapcode.com for background and reference materials. ## A Real-Life Example, The 'mapcode' Codec Tool: `utility/` @@ -52,8 +53,10 @@ of how to use the library. To build the original Mapcode tool, execute: - cd utility - gcc -O mapcode.cpp -o mapcode + cd mapcodelib + gcc -O -c mapcoder.c + cd ../utility + gcc -O mapcode.cpp -o mapcode ../mapcodelib/mapcoder.o For help, simply execute the binary file 'mapcode' without no arguments. This tool provides a rather extensive command-line interface to encode and @@ -61,33 +64,33 @@ decode Mapcodes. This produces the following help text: - MAPCODE (version 2.5.1) - Copyright (C) 2014-2016 Stichting Mapcode Foundation + MAPCODE (version 2.5.6) + Copyright (C) 2014-2025 Stichting Mapcode Foundation Usage: - ./mapcode [-d| --decode] [ ...] + mapcode [-d| --decode] [ ...] Decode a mapcode to a lat/lon. The default territory code is used if the mapcode is a shorthand local code - ./mapcode [-e[0-8] | --encode[0-8]] [territory]> + mapcode [-e[0-8] | --encode[0-8]] [territory]> Encode a lat/lon to a mapcode. If the territory code is specified, the encoding will only succeeed if the lat/lon is located in the territory. You can specify the number of additional digits, 0, 1 or 2 (default 0) for high-precision mapcodes. - ./mapcode [-t | --territories] + mapcode [-t | --territories] Create a full set of territories in CSV format. - ./mapcode [-a | --alphabets] + mapcode [-a | --alphabets] Create a full set of alphabet tests in CSV format. - ./mapcode [-b[XYZ] | --boundaries[XYZ]] [] - ./mapcode [-g[XYZ] | --grid[XYZ]] [] - ./mapcode [-r[XYZ] | --random[XYZ]] [] [] + mapcode [-b[XYZ] | --boundaries[XYZ]] [] + mapcode [-g[XYZ] | --grid[XYZ]] [] + mapcode [-r[XYZ] | --random[XYZ]] [] [] Create a test set of lat/lon pairs based on the mapcode boundaries database as a fixed 3D grid or random uniformly distributed set of lat/lons with their @@ -111,16 +114,16 @@ This produces the following help text: The (x, y, z) coordinates are primarily meant for visualization of the data set. Example: - ./mapcode -g 100 : produces a grid of 100 points as lat/lon pairs - ./mapcode -gXYZ 100 : produces a grid of 100 points as (x, y, z) sphere coordinates) + mapcode -g 100 : produces a grid of 100 points as lat/lon pairs + mapcode -gXYZ 100 : produces a grid of 100 points as (x, y, z) sphere coordinates) Notes on the use of stdout and stderr: - stdout: used for outputting 3D point data; stderr: used for statistics. + stdout: used for outputting 3D Point data; stderr: used for statistics. You can redirect stdout to a destination file, while stderr will show progress. The result code is 0 when no error occurred, 1 if an input error occurred and 2 if an internal error occurred. - + ## Compile Options for Microsoft Visual C++ If you use **Microsoft Visual C++**, you may need to add the following compiler directives to your build: @@ -135,8 +138,136 @@ The Mapcode C/C++ Library has includes a number of fixed data tables, which incr You may not require all of this data, so we've added some options for you to be able to reduce its footprint, for example for embedded applications. +You can specify the define `MAPCODE_NO_SUPPORT_ALL_LANGUAGES` to disable support for territory names +in all languages. + +Note that English names are always supported and it's also always possible to get territory names +in their locale language. + +To add individual support support for other languages (of all territory names), use: + + -DMAPCODE_NO_SUPPORT_ALL_LANGUAGES // If not defined, ALL languages are available. + -DMAPCODE_SUPPORT_LANGUAGE_AF // Add the languages you need. The names are the + -DMAPCODE_SUPPORT_LANGUAGE_AR // ISO 3166-2 character codes. + -DMAPCODE_SUPPORT_LANGUAGE_BE + -DMAPCODE_SUPPORT_LANGUAGE_CN + -DMAPCODE_SUPPORT_LANGUAGE_CS + -DMAPCODE_SUPPORT_LANGUAGE_DA + -DMAPCODE_SUPPORT_LANGUAGE_DE + -DMAPCODE_SUPPORT_LANGUAGE_EN + -DMAPCODE_SUPPORT_LANGUAGE_ES + -DMAPCODE_SUPPORT_LANGUAGE_FI + -DMAPCODE_SUPPORT_LANGUAGE_FR + -DMAPCODE_SUPPORT_LANGUAGE_HE + -DMAPCODE_SUPPORT_LANGUAGE_HI + -DMAPCODE_SUPPORT_LANGUAGE_HR + -DMAPCODE_SUPPORT_LANGUAGE_ID + -DMAPCODE_SUPPORT_LANGUAGE_IT + -DMAPCODE_SUPPORT_LANGUAGE_JA + -DMAPCODE_SUPPORT_LANGUAGE_KO + -DMAPCODE_SUPPORT_LANGUAGE_NL + -DMAPCODE_SUPPORT_LANGUAGE_NO + -DMAPCODE_SUPPORT_LANGUAGE_PL + -DMAPCODE_SUPPORT_LANGUAGE_PT + -DMAPCODE_SUPPORT_LANGUAGE_RU + -DMAPCODE_SUPPORT_LANGUAGE_SV + -DMAPCODE_SUPPORT_LANGUAGE_SW + -DMAPCODE_SUPPORT_LANGUAGE_TR + -DMAPCODE_SUPPORT_LANGUAGE_UK + +The list of support languages may grow over time. + +## Using the C Library in an Xcode iOS Swift project + +You can use this C library in an iOS application, built with Swift in Xcode, fairly easily. +All you need to do is: + +First, copy the directory `mapcodelib` to the source directory of your iOS application. + +Then, add a text file called `module.modulemap` in the directory `mapcodelib` to export all symbols +from the C library to Swift (note that `#defines` are not exported): + +``` +module mapcodelib [system][extern_c]{ + header "mapcode_alphabets.h" + header "mapcode_territories.h" + header "mapcoder.h" + export * +} +``` + +Now, you can access the C library methods like this in a Swift project: + +``` +// Example of decoding a full mapcode to a lat/lon: +let territory = getTerritoryCode(context, TERRITORY_NONE) +var lat: Double = 0.0 +var lon: Double = 0.0 +let mapcodeError = decodeMapcodeToLatLonUtf8(&lat, &lon, fullMapcode, territory, nil) +if mapcodeError == ERR_OK { + // Use the decoded lat and lon. +} else { + // Something went wrong decoding the full mapcode string. +} +``` +Or encode a latitude, longitude pair to a set of Mapcodes like this: + +``` +let buffer = UnsafeMutablePointer.allocate(capacity: Int(_MAX_MAPCODE_RESULT_ASCII_LEN)) +buffer.initialize(to: 0, count: Int(_MAX_MAPCODE_RESULT_ASCII_LEN)) +var total: Int32 = 0; +var i: Int32 = 0 +repeat { + total = encodeLatLonToSelectedMapcode(buffer, lat, lon, TERRITORY_NONE, 0, i) + if (total > 0) { + let mapcode = String.init(cString: buffer); + } + i = i + 1 +} while (i < total) +``` + +Or get a territory name like this: + +``` +let buffer = UnsafeMutablePointer.allocate(capacity: Int(MAX_TERRITORY_FULLNAME_UTF8_LEN + 1)) +buffer.initialize(to: 0, count: Int(_MAX_TERRITORY_FULLNAME_UTF8_LEN + 1)) + +// Get alpha code. +getTerritoryIsoName(buffer, TERRITORY_NLD, 0) +let alphaCode = String.init(cString: buffer) + +// Get full name. +getFullTerritoryNameEnglish(buffer, TERRITORY_NLD, 0) +let fullName = String.init(cString: buffer) +``` + ## Release Notes +### 2.5.6 + +* Updated to latest compilers. + +### 2.5.4 - 2.5.5 + +* Added `encodeLatLonToSelectedMapcode` as a convenience for languages that use the +C library, but have difficulties dealing with multi-dimensional arrays (like Swift). + +### 2.5.3 + +* Cleaned up code after running Codacy code reviews. + +* Fixed copyright message. + +### 2.5.2 + +* Added unit test for floating point error with code "40822.schol". + +* Added locale support. + +* Added many languages. + +* Hardened unit tests. + ### 2.5.1 * Updated unit test to compile with plain C and added some test cases. diff --git a/docs/mapcode_library_c.docx b/docs/mapcode_library_c.docx index 5b80828..3b4ee24 100644 Binary files a/docs/mapcode_library_c.docx and b/docs/mapcode_library_c.docx differ diff --git a/docs/superpowers/perf-results.md b/docs/superpowers/perf-results.md new file mode 100644 index 0000000..97162a4 --- /dev/null +++ b/docs/superpowers/perf-results.md @@ -0,0 +1,26 @@ +# mapcodelib performance results — feat/optimize + +Branch: `feat/optimize` | Measurement: `time ./unittest` at `-O3` (best `user` of 3 runs, multithreaded so user ≫ real) | Baseline T0 = 114.13s + +| Commit | Change | Best user time | vs. baseline | +|--------|--------|---------------|-------------| +| `f1cb736` | baseline | 114.13s | 0.0% | +| `430bbba` | A1: cache `flags` per iteration in hot loops | 112.21s | +1.7% | +| `b9b3f2c` | A2: longitude-first in `fitsInsideBoundaries` (**reverted** — regression) | 121.10s | −6.1% | +| `1b01b82` | A3: `memcpy`-based result assembly in `encoderEngine` | 113.19s | +0.8% | +| `753c337` | A4: single division per iteration in `encodeBase31` (no gain at `-O3`) | ~114s | noise | +| `554af29` | B3: companion tables defined + `initCompanionTables` called at entry points | 109.99s | +3.6% | +| `3416f87` | B4: hot loops read from companion tables | **99.40s** | **+12.9%** | +| `2cdf52b` | B5: `#ifdef DEBUG` sanity check (zero cost in release) | 99.73s | +12.6% | + +**Final cumulative speedup: ~12.6%** (14.4s saved out of 114.13s) + +**Binary size growth:** +2,240 bytes (limit was 100,000 bytes) + +## Notes + +- **A2 reverted:** `isInRange()` checks for longitude wrap-around — its overhead exceeded the saving from the early-out it enabled. +- **A4 no-op:** GCC `-O3` already performs strength reduction on `/31` + `%31`, so the explicit version gave no new information to the compiler. +- **A5 no-op:** The early-exit was already present in the codebase. +- **Primary driver:** B4 — replacing per-iteration mask/shift operations on a 4-byte `flags` field with single byte loads from precomputed byte-sized companion tables (`RECORD_KIND`, `RECORD_CODEX`, `RECORD_REC_TYPE`, `RECORD_HEADER_LETTER`). +- **Why short of 20–50% target:** The test suite includes correctness overhead (asserts, sprintf, comparisons) that dilutes the encode/decode speedup. Approach C (loop restructuring) would be the next lever. diff --git a/docs/superpowers/plans/2026-05-28-mapcodelib-optimize.md b/docs/superpowers/plans/2026-05-28-mapcodelib-optimize.md new file mode 100644 index 0000000..78c739e --- /dev/null +++ b/docs/superpowers/plans/2026-05-28-mapcodelib-optimize.md @@ -0,0 +1,1366 @@ +# mapcodelib speed optimization implementation plan + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** Reduce `time ./unittest` wall time by 20–50% on `-O3` builds while preserving bit-exact output, strict portable C99/C11, and per-call memory footprint. + +**Architecture:** +- **Approach A** (Tasks 2–6): Local hot-path edits in `mapcoder.c` — flag caching, branch reordering, length-tracked string assembly, tighter base-31 encode, and early exits in repack/unpack. +- **Approach B** (Tasks 7–9): Precomputed static companion tables derived once from `TERRITORY_BOUNDARIES`; hot loops in `encoderEngine`/`decoderEngine` read from them instead of re-deriving from `flags` per iteration. + +**Tech Stack:** C99, GCC `-O3`, pthread (test-only), `time` (wall-clock measurement). + +**Spec:** `docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md` + +**Branch:** `feat/optimize` (already created, currently at design-spec commit `740bfec`). + +--- + +## Conventions used across all tasks + +### Build command +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O3 -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o +``` + +### Test command (correctness) +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && ./unittest +``` +Expected: final line `Unit tests passed`, exit code 0. + +### Timing command (performance) +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test +( time ./unittest ) 2>&1 | tail -3 # repeat 3 times, take best user time +``` +Each commit body records: best `user` time, and the percent-delta vs. Task 1 baseline. + +### Commit footer +Every commit includes: +``` +Co-Authored-By: Claude Sonnet 4.6 +``` + +### Test integrity +Any commit that fails `./unittest` (non-zero exit, non-zero error count, or missing "Unit tests passed" line) MUST be reverted before continuing. Do not push fixes on top — revert and reattempt. + +--- + +## File structure + +| File | Status | Responsibility | +|------|--------|----------------| +| `mapcodelib/mapcoder.c` | Modify | All optimization edits land here. Hot paths (`encoderEngine`, `decoderEngine`, `fitsInsideBoundaries`, `encodeBase31`, etc.) and new static-scope companion tables + their initializer. | +| `mapcodelib/internal_data.h` | Read-only | Source of truth for `TERRITORY_BOUNDARIES`, `MAPCODE_BOUNDARY_MAX`, `DATA_START`. Do NOT modify. | +| `mapcodelib/mapcoder.h` | Read-only | Public ABI. Do NOT modify. | +| `test/unittest.c` | Read-only | Correctness + timing harness. Do NOT modify. | + +All other files (CMake, scripts, docs) are untouched by this plan. + +--- + +## Task 1: Baseline measurement + +**Files:** +- No source changes. Single commit pins the baseline timing. + +- [ ] **Step 1: Build with -O3** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O3 -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o +``` + +Expected: clean compile, no warnings/errors. Both `.o` and `unittest` binary produced. + +- [ ] **Step 2: Verify tests pass** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && ./unittest 2>&1 | tail -5 +``` + +Expected: last lines include `Unit tests passed`. Exit code 0. + +- [ ] **Step 3: Run three timed iterations, capture best `user` time** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test +for i in 1 2 3; do echo "=== run $i ==="; ( time ./unittest >/dev/null ) 2>&1 | grep -E '^(real|user|sys)'; done +``` + +Record the **best of three** `user` times — that is the baseline number for all subsequent comparisons. Note it down (call it `T0`). + +- [ ] **Step 4: Commit baseline marker** + +Create an empty commit so the baseline timing lives in git history: + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git commit --allow-empty -m "$(cat <<'EOF' +chore: pin perf baseline for feat/optimize + +Measured `time ./unittest` on -O3 build (best of 3 runs): + user time = T0 = s + +All subsequent perf commits on this branch quote their best user time +and the cumulative delta vs. this baseline. + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +Replace `` with the actual best-of-three user time from Step 3. + +--- + +## Task 2: A1 — Cache `flags` per iteration in hot loops + +**Goal:** Read `TERRITORY_BOUNDARIES[i].flags` once per loop iteration into a local; rewrite macro call sites to use the local. Six call sites in three functions. + +**Files:** +- Modify: `mapcodelib/mapcoder.c` — `encoderEngine` (around line 1487), `decoderEngine` (around line 2710), `firstNamelessRecord` (line 822), `countNamelessRecords` (line 835). + +- [ ] **Step 1: Edit `encoderEngine` inner loop body to cache flags** + +Open `mapcodelib/mapcoder.c`. Locate the loop at line 1487: + +```c +for (i = from; i <= upto; i++) { + if (fitsInsideBoundaries(&enc->coord32, TERRITORY_BOUNDARY(i))) { + if (IS_NAMELESS(i)) { +``` + +Replace this loop body (lines 1487–1542 inclusive) with a version that introduces a local `flags` cache. The transformation is mechanical: every `IS_NAMELESS(i)`, `IS_RESTRICTED(i)`, `IS_SPECIAL_SHAPE(i)`, `REC_TYPE(i)`, `coDex(i)`, `HEADER_LETTER(i)` inside the loop body becomes a local-variable read. Keep behavior identical: + +```c +for (i = from; i <= upto; i++) { + const int flags = TERRITORY_BOUNDARIES[i].flags; + if (fitsInsideBoundaries(&enc->coord32, TERRITORY_BOUNDARY(i))) { + const int isNameless = (flags & 64); + const int recType = (flags >> 7) & 3; + const int isRestricted = (flags & 512); + if (isNameless) { + encodeNameless(result, enc, ccode, extraDigits, i); + } + else if (recType > 1) { + encodeAutoHeader(result, enc, i, extraDigits); + } + else if ((i == upto) && isSubdivision(ccode)) { + // *** do a recursive call for the parent *** + encoderEngine(parentTerritoryOf(ccode), enc, stop_with_one_result, extraDigits, requiredEncoder, + ccode); + return; + } + else // must be grid + { + // skip IS_RESTRICTED records unless there already is a result + if (result_counter || !isRestricted) { + const int c = flags & 31; + const int codexLocal = 10 * (c / 5) + ((c % 5) + 1); + if (codexLocal < 54) { + const char headerletter = (char)((recType == 1) ? ENCODE_CHARS[(flags >> 11) & 31] : 0); + encodeGrid(result, enc, i, extraDigits, headerletter); + } + } + } + + // =========== handle result (if any) + if (*result) { + result_counter++; + + repackIfAllDigits(result, 0); + + if ((requiredEncoder < 0) || (requiredEncoder == i)) { + const enum Territory ccodeFinal = (ccode_override != TERRITORY_NONE ? ccode_override : ccode); + if (*result && enc->mapcodes && (enc->mapcodes->count < MAX_NR_OF_MAPCODE_RESULTS)) { + char* s = enc->mapcodes->mapcode[enc->mapcodes->count++]; + if (ccodeFinal == TERRITORY_AAA) { + // AAA is never shown with territory + strcpy(s, result); + } + else { + getTerritoryIsoName(s, ccodeFinal, 0); + strcat(s, " "); + strcat(s, result); + } + } + if (requiredEncoder == i) { + return; + } + } + if (stop_with_one_result) { + return; + } + *result = 0; // clear for next iteration + } + } +} // for i +``` + +Reasoning: identical semantics, but the compiler now has a guaranteed single load for `flags` regardless of how `IS_NAMELESS` etc. are written elsewhere, and the locally extracted bit values are SSA-friendly. + +- [ ] **Step 2: Edit `decoderEngine` inner loop body** + +Locate the loop at `mapcoder.c:2710`: + +```c +for (i = from; i <= upto; i++) { + const int codexi = coDex(i); + const int r = REC_TYPE(i); + if (r == 0) { + if (IS_NAMELESS(i)) { +``` + +Replace lines 2710–2800 with a version that caches `flags` once: + +```c +for (i = from; i <= upto; i++) { + const int flags = TERRITORY_BOUNDARIES[i].flags; + const int c = flags & 31; + const int codexi = 10 * (c / 5) + ((c % 5) + 1); + const int r = (flags >> 7) & 3; + if (r == 0) { + if (flags & 64) { // IS_NAMELESS + if (((codexi == 21) && (codex == 22)) || + ((codexi == 22) && (codex == 32)) || + ((codexi == 13) && (codex == 23))) { + err = decodeNameless(dec, i); + break; + } + } + else { + if ((codexi == codex) || ((codex == 22) && (codexi == 21))) { + err = decodeGrid(dec, i, 0); + + // first of all, make sure the zone fits the country + restrictZoneTo(&dec->zone, &dec->zone, TERRITORY_BOUNDARY(upto)); + + if ((err == ERR_OK) && (flags & 512)) { // IS_RESTRICTED + int nrZoneOverlaps = 0; + int j; + + // *** make sure decode fits somewhere *** + dec->result = getMidPointFractions(&dec->zone); + dec->coord32 = convertFractionsToCoord32(&dec->result); + for (j = i - 1; j >= from; j--) { + // look in previous rects + if (!IS_RESTRICTED(j)) { + if (fitsInsideBoundaries(&dec->coord32, TERRITORY_BOUNDARY(j))) { + nrZoneOverlaps = 1; + break; + } + } + } + + if (!nrZoneOverlaps) { + MapcodeZone zfound; + TerritoryBoundary prevu; + for (j = from; j < i; j++) { + // try all smaller rectangles j + if (!IS_RESTRICTED(j)) { + MapcodeZone z; + if (restrictZoneTo(&z, &dec->zone, TERRITORY_BOUNDARY(j))) { + nrZoneOverlaps++; + if (nrZoneOverlaps == 1) { + // first fit! remember... + zoneCopyFrom(&zfound, &z); + ASSERT(j <= MAPCODE_BOUNDARY_MAX); + memcpy(&prevu, TERRITORY_BOUNDARY(j), sizeof(TerritoryBoundary)); + } + else { + // nrZoneOverlaps >= 2 + // more than one hit + break; // give up + } + } + } // IS_RESTRICTED + } // for j + + // if several sub-areas intersect, just return the whole zone + // (the center of which may NOT re-encode to the same mapcode!) + if (nrZoneOverlaps == 1) { + // found exactly ONE intersection? + zoneCopyFrom(&dec->zone, &zfound); + } + } + + if (!nrZoneOverlaps) { + err = ERR_MAPCODE_UNDECODABLE; // type 3 "NLD L222.222" + } + } // *** make sure decode fits somewhere *** + break; + } + } + } + else if (r == 1) { + if (codex == codexi + 10 && ENCODE_CHARS[(flags >> 11) & 31] == *s) { + err = decodeGrid(dec, i, 1); + break; + } + } + else { + //r>1 + if (((codex == 23) && (codexi == 22)) || + ((codex == 33) && (codexi == 23))) { + err = decodeAutoHeader(dec, i); + break; + } + } +} // for +``` + +Note: the inner `j` loops continue to use the `IS_RESTRICTED(j)` macro (not the cached `flags`) because they index a different record `j`. Leaving them as-is is correct. + +- [ ] **Step 3: Edit `firstNamelessRecord`** + +Locate `mapcoder.c:822`: + +```c +static int firstNamelessRecord(const int m, const int firstcode) { + int i = m; + const int codexm = coDex(m); + ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); + ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); + while (i >= firstcode && coDex(i) == codexm && IS_NAMELESS(i)) { + i--; + } + return (i + 1); +} +``` + +Replace with: + +```c +static int firstNamelessRecord(const int m, const int firstcode) { + int i = m; + const int codexm = coDex(m); + ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); + ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); + while (i >= firstcode) { + const int flags = TERRITORY_BOUNDARIES[i].flags; + const int c = flags & 31; + const int codexi = 10 * (c / 5) + ((c % 5) + 1); + if (codexi != codexm || !(flags & 64)) { + break; + } + i--; + } + return (i + 1); +} +``` + +- [ ] **Step 4: Edit `countNamelessRecords`** + +Locate `mapcoder.c:835`: + +```c +static int countNamelessRecords(const int m, const int firstcode) { + const int first = firstNamelessRecord(m, firstcode); + const int codexm = coDex(m); + int last = m; + ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); + ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); + while (coDex(last) == codexm) { + last++; + } + ... +``` + +Replace the inner `while` loop with: + +```c +static int countNamelessRecords(const int m, const int firstcode) { + const int first = firstNamelessRecord(m, firstcode); + const int codexm = coDex(m); + int last = m; + ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); + ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); + while (1) { + const int c = TERRITORY_BOUNDARIES[last].flags & 31; + const int codexLast = 10 * (c / 5) + ((c % 5) + 1); + if (codexLast != codexm) { + break; + } + last++; + } + ASSERT((0 <= last) && (last <= MAPCODE_BOUNDARY_MAX)); + ASSERT(last >= first); + return (last - first); +} +``` + +- [ ] **Step 5: Build and run tests** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O3 -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o && ./unittest 2>&1 | tail -5 +``` + +Expected: clean compile, no warnings/errors. `./unittest` exits 0 with `Unit tests passed` in the output. + +If anything fails: revert the changes in `mapcodelib/mapcoder.c` and stop. Do not proceed to Step 6. + +- [ ] **Step 6: Measure timing (3× best)** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test +for i in 1 2 3; do echo "=== run $i ==="; ( time ./unittest >/dev/null ) 2>&1 | grep -E '^(real|user|sys)'; done +``` + +Record the best `user` time (call it `T2`). Compute `delta_pct = (T0 - T2) / T0 * 100`. + +- [ ] **Step 7: Commit** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: A1 — cache flags per loop iteration in hot paths + +In encoderEngine and decoderEngine inner loops, read +TERRITORY_BOUNDARIES[i].flags once per iteration into a const local and +extract bit fields from it, instead of using flag-extraction macros that +each re-dereference the same memory. Same change in firstNamelessRecord +and countNamelessRecords. + +Bit-exact: macros stay defined and used in cold paths; only the inner +loop body call sites were rewritten to local reads. + + time ./unittest (best of 3, user): + baseline (T0) = s + after A1 (T2) = s + delta = % + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +Replace `` with the recorded numbers from Step 6 and Task 1. + +--- + +## Task 3: A2 — Reorder checks in `fitsInsideBoundaries` + +**Goal:** Test longitude band first to short-circuit faster on the typical case (most territory rectangles are narrow in longitude relative to the planet). + +**Files:** +- Modify: `mapcodelib/mapcoder.c:602` + +- [ ] **Step 1: Edit `fitsInsideBoundaries`** + +Locate `mapcoder.c:602`: + +```c +static int fitsInsideBoundaries(const Point32* coord32, const TerritoryBoundary* b) { + ASSERT(coord32); + ASSERT(b); + return (b->miny <= coord32->latMicroDeg && + coord32->latMicroDeg < b->maxy && + isInRange(coord32->lonMicroDeg, b->minx, b->maxx)); +} +``` + +Replace with longitude-first ordering: + +```c +static int fitsInsideBoundaries(const Point32* coord32, const TerritoryBoundary* b) { + ASSERT(coord32); + ASSERT(b); + return (isInRange(coord32->lonMicroDeg, b->minx, b->maxx) && + b->miny <= coord32->latMicroDeg && + coord32->latMicroDeg < b->maxy); +} +``` + +Reasoning: `&&` short-circuits left to right. Longitude is the more selective dimension for typical territory rectangles, so the cheap `isInRange` call rejects most non-matches first. + +- [ ] **Step 2: Build and run tests** + +Same commands as Task 2 Step 5. Expected: clean compile, `Unit tests passed`. + +- [ ] **Step 3: Measure timing (3× best)** + +Same as Task 2 Step 6. Record best `user` time (`T3`). Compute cumulative delta vs. `T0`. + +- [ ] **Step 4: Commit** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: A2 — reorder fitsInsideBoundaries to test longitude first + +Most territory rectangles are narrower in longitude than in latitude +relative to their bounding ranges, so testing longitude first short- +circuits faster on the typical reject case. + + time ./unittest (best of 3, user): + baseline = s + after A2 = s + delta = % cumulative + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +--- + +## Task 4: A3 — Length-tracked result assembly in `encoderEngine` + +**Goal:** Replace `strcpy`+`strcat`+`strcat` pattern (which rescans the destination on each `strcat`) with length-tracked `memcpy` calls. + +**Files:** +- Modify: `mapcodelib/mapcoder.c` — block around lines 1521–1530 (post-A1 line numbers shift slightly; locate by content). + +- [ ] **Step 1: Locate the relevant block** + +Within `encoderEngine`, find the section starting with: + +```c +char* s = enc->mapcodes->mapcode[enc->mapcodes->count++]; +if (ccodeFinal == TERRITORY_AAA) { + // AAA is never shown with territory + strcpy(s, result); +} +else { + getTerritoryIsoName(s, ccodeFinal, 0); + strcat(s, " "); + strcat(s, result); +} +``` + +- [ ] **Step 2: Replace with length-tracked memcpy** + +Replace the entire `if (ccodeFinal == TERRITORY_AAA) { ... } else { ... }` block with: + +```c +char* s = enc->mapcodes->mapcode[enc->mapcodes->count++]; +if (ccodeFinal == TERRITORY_AAA) { + // AAA is never shown with territory + strcpy(s, result); +} +else { + getTerritoryIsoName(s, ccodeFinal, 0); + size_t isoLen = strlen(s); + size_t resultLen = strlen(result); + s[isoLen] = ' '; + memcpy(s + isoLen + 1, result, resultLen + 1); // +1 to include NUL +} +``` + +Reasoning: `strcat(s, " ")` does `strlen(s)` then writes 2 bytes; `strcat(s, result)` does another `strlen(s)` (now longer) then writes `strlen(result)+1` bytes. The replacement does one `strlen` per source string and a single byte write + memcpy. Output is byte-identical. + +Note: `` is already included; `size_t` is fine in C99 source. + +- [ ] **Step 3: Build and run tests** + +Same as Task 2 Step 5. + +- [ ] **Step 4: Measure timing (3× best)** + +Same as Task 2 Step 6. + +- [ ] **Step 5: Commit** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: A3 — length-tracked result assembly in encoderEngine + +strcpy + strcat + strcat each re-scans the destination from the start +to find the null terminator. Replace with explicit strlen on each +source plus a single memcpy. + +Output bytes are unchanged. + + time ./unittest (best of 3, user): + baseline = s + after A3 = s + delta = % cumulative + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +--- + +## Task 5: A4 — Tighten `encodeBase31` + +**Goal:** Eliminate the per-iteration `value % 31` + `value / 31` by combining via `__builtin_*`-free C: compute quotient once, derive remainder. This is one machine division per iteration instead of two (the compiler may already do this, but it's not guaranteed without `-fno-trapping-math` etc.). + +**Files:** +- Modify: `mapcodelib/mapcoder.c:1083` + +- [ ] **Step 1: Edit `encodeBase31`** + +Locate `mapcoder.c:1083`: + +```c +static void encodeBase31(char* result, int value, int nrchars) { + ASSERT(result); + ASSERT(nrchars >= 0); + result[nrchars] = 0; // zero-terminate! + while (nrchars > 0) { + nrchars--; + result[nrchars] = ENCODE_CHARS[value % 31]; + value /= 31; + } +} +``` + +Replace with: + +```c +static void encodeBase31(char* result, int value, int nrchars) { + ASSERT(result); + ASSERT(nrchars >= 0); + result[nrchars] = 0; // zero-terminate! + while (nrchars > 0) { + const int q = value / 31; + const int r = value - q * 31; + nrchars--; + result[nrchars] = ENCODE_CHARS[r]; + value = q; + } +} +``` + +Reasoning: For `int` with `value >= 0` (precondition by inspection — callers always pass non-negative computed offsets), `r = value - q*31` is equivalent to `value % 31` but uses one IDIV/MUL+SUB pair rather than potentially two division-class operations. Modern compilers often emit `imul` magic constants for division by 31 and do this optimization themselves; we make it explicit so it survives older toolchains and `-O3` -> `-O2` regressions. + +- [ ] **Step 2: Build and run tests** + +Same as Task 2 Step 5. + +- [ ] **Step 3: Measure timing (3× best)** + +Same as Task 2 Step 6. + +- [ ] **Step 4: Commit** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: A4 — single division per iteration in encodeBase31 + +Compute quotient once, derive remainder via subtraction so the loop +has one division-class op per character rather than two. + + time ./unittest (best of 3, user): + baseline = s + after A4 = s + delta = % cumulative + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +--- + +## Task 6: A5 — Tighten `repackIfAllDigits` early-exit + +**Goal:** The current implementation walks the string twice in many cases. We add a tightened first-pass that bails sooner. + +**Files:** +- Modify: `mapcodelib/mapcoder.c:892` + +- [ ] **Step 1: Read the current implementation in full** + +The function spans `mapcoder.c:892–930` (approx). Read it carefully — it already has an `alldigits` flag flipped to 0 on first non-digit, but it still continues the scan looking for `'.'`. Let's tighten it. + +Look at the current code: + +```c +static void repackIfAllDigits(char* input, const int aonly) { + char* s = input; + int alldigits = 1; // assume all digits + char* e; + char* dotpos = NULL; + ASSERT(input); + for (e = s; *e != 0 && *e != '-'; e++) { + if (*e < '0' || *e > '9') { + ... +``` + +- [ ] **Step 2: Read the rest of the function first** + +```bash +sed -n '892,935p' /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib/mapcoder.c +``` + +The implementing engineer MUST read the full function before editing it. The optimization opportunity is to short-circuit when `alldigits` becomes 0 AND `dotpos` is already set — at that point we know the full structure and don't need to scan further within this loop. + +- [ ] **Step 3: Apply minimal early-exit** + +In the loop body, after `alldigits = 0;` is set inside the `if (*e < '0' || *e > '9')` branch, the function already has a `break` for the case `*e != '.'`. If `*e == '.'`, the loop continues, but once `alldigits` is 0 there's no more work the loop accomplishes other than setting `dotpos`. + +The cleanest tightening: after the existing `if (*e == '.')` block that assigns `dotpos`, if `alldigits` is already 0 and `dotpos` is non-null, `break`. + +Locate the existing `else if (*e == '.')` clause (it should look like): + +```c +else if (*e == '.') { + dotpos = e; +} +``` + +Modify the surrounding `for` loop body so that after `dotpos = e;` we check both conditions and break when no useful work remains. Replace the entire `for` loop with: + +```c +for (e = s; *e != 0 && *e != '-'; e++) { + if (*e < '0' || *e > '9') { + if (*e == '.') { + if (dotpos) { + // Two dots: malformed for repack purposes, bail. + return; + } + dotpos = e; + if (!alldigits) { + break; // structure fully known; nothing else to learn here + } + } else { + alldigits = 0; + if (dotpos) { + break; // structure fully known + } + } + } +} +``` + +Be very careful: the original code may handle the "two dots" case differently. If the actual code differs from what is described here, ABORT this task and consult the maintainer. Do NOT change the semantics for any input. + +- [ ] **Step 4: Read the function again to confirm semantics** + +Before committing, the implementer MUST diff the file against `git HEAD` and ensure the only changes are: +1. Optional `break`s added in well-understood control-flow locations. +2. No other behavioral change. + +If the diff shows anything else changed (variable names, condition rewrites, etc.), revert. + +- [ ] **Step 5: Build and run tests** + +Same as Task 2 Step 5. Bit-exactness is essential here — if any single test fails, revert immediately. + +- [ ] **Step 6: Measure timing (3× best)** + +Same as Task 2 Step 6. + +- [ ] **Step 7: Commit (or skip if no measurable gain)** + +If the timing delta vs. previous commit is below noise threshold (< 0.5%) and the diff is non-trivial, prefer NOT to commit (skipping A5 is acceptable per the spec). Otherwise: + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: A5 — early-exit when structure is fully known in repackIfAllDigits + +Break out of the scan loop once both the digits-only status and the +dot position are determined. Same input/output mapping; the loop just +stops earlier on common inputs. + + time ./unittest (best of 3, user): + baseline = s + after A5 = s + delta = % cumulative + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +If skipped, document the skip in the next commit's body ("A5 skipped: gain below noise"). + +--- + +## Task 7: B1+B2+B3 — Define and initialize companion tables (not yet used) + +**Goal:** Add companion static tables, a one-time initializer, and call sites that invoke the initializer at every public entry point. The hot loops still use macros at this point — this task is verified by tests-still-pass + the initializer running without crashing. + +**Files:** +- Modify: `mapcodelib/mapcoder.c` — add static-scope tables and `initCompanionTables()` near the top of the file (after macros, before any hot function). + +- [ ] **Step 1: Add static companion tables and initializer** + +Open `mapcodelib/mapcoder.c`. Find the line right after the flag-extraction macro definitions (after `mapcoder.c:154` `#define HEADER_LETTER(m) ...`). Add the following block: + +```c +/////////////////////////////////////////////////////////////////////////////////////////////// +// +// PRECOMPUTED COMPANION TABLES (perf: feat/optimize, see docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md) +// +// These tables are derived once from TERRITORY_BOUNDARIES.flags and queried +// in hot encode/decode loops to avoid repeated bit-masking on the same record. +// +/////////////////////////////////////////////////////////////////////////////////////////////// + +#define KIND_BIT_NAMELESS 0x01 +#define KIND_BIT_RESTRICTED 0x02 +#define KIND_BIT_SPECIAL_SHAPE 0x04 + +static unsigned char RECORD_CODEX[MAPCODE_BOUNDARY_MAX + 1]; // = coDex(m) +static unsigned char RECORD_REC_TYPE[MAPCODE_BOUNDARY_MAX + 1]; // (flags >> 7) & 3 +static unsigned char RECORD_KIND[MAPCODE_BOUNDARY_MAX + 1]; // KIND_BIT_* bitwise OR +static unsigned char RECORD_HEADER_LETTER[MAPCODE_BOUNDARY_MAX + 1]; // ENCODE_CHARS[(flags >> 11) & 31] +static unsigned short RECORD_SMART_DIV[MAPCODE_BOUNDARY_MAX + 1]; // flags >> 16 + +// Per-territory: index of the first nameless record (or -1), and how many. +// These tables are sized to the full territory enum range. +#define TERRITORY_TABLE_SIZE (_TERRITORY_MAX - _TERRITORY_MIN) +static int TERRITORY_FIRST_NAMELESS[TERRITORY_TABLE_SIZE]; +static int TERRITORY_NAMELESS_COUNT[TERRITORY_TABLE_SIZE]; + +// Init flag. Write-once after first call. Idempotent: deterministic values mean +// a race on first call only causes duplicate work, never wrong results. +// The library does not promise thread-safety on first call (see header docs). +static int companion_initialized = 0; + +static void initCompanionTables(void) { + int m; + int t; + if (companion_initialized) { + return; + } + for (m = 0; m <= MAPCODE_BOUNDARY_MAX; m++) { + const int flags = TERRITORY_BOUNDARIES[m].flags; + const int c = flags & 31; + const int codex_val = 10 * (c / 5) + ((c % 5) + 1); + const int rec_type = (flags >> 7) & 3; + unsigned char kind = 0; + if (flags & 64) kind |= KIND_BIT_NAMELESS; + if (flags & 512) kind |= KIND_BIT_RESTRICTED; + if (flags & 1024) kind |= KIND_BIT_SPECIAL_SHAPE; + RECORD_CODEX[m] = (unsigned char) codex_val; + RECORD_REC_TYPE[m] = (unsigned char) rec_type; + RECORD_KIND[m] = kind; + RECORD_HEADER_LETTER[m] = (unsigned char) ENCODE_CHARS[(flags >> 11) & 31]; + RECORD_SMART_DIV[m] = (unsigned short) ((unsigned int) flags >> 16); + } + for (t = 0; t < TERRITORY_TABLE_SIZE; t++) { + TERRITORY_FIRST_NAMELESS[t] = -1; + TERRITORY_NAMELESS_COUNT[t] = 0; + } + for (t = 0; t < TERRITORY_TABLE_SIZE - 1; t++) { + const int from = DATA_START[t]; + const int upto_excl = DATA_START[t + 1]; + int i; + int first = -1; + int count = 0; + for (i = from; i < upto_excl; i++) { + if (RECORD_KIND[i] & KIND_BIT_NAMELESS) { + if (first < 0) { + first = i; + } + count++; + } + } + TERRITORY_FIRST_NAMELESS[t] = first; + TERRITORY_NAMELESS_COUNT[t] = count; + } + companion_initialized = 1; +} +``` + +Placement: insert this block immediately after the `HEADER_LETTER` macro (line 154) and BEFORE any function definitions. It depends only on `TERRITORY_BOUNDARIES` and `ENCODE_CHARS` (defined further down) — so be careful: `ENCODE_CHARS` is defined at `mapcoder.c:332`. The initializer references it. Since `initCompanionTables` is a function (not a static initializer), it's evaluated at call time, after `ENCODE_CHARS` is fully visible in the translation unit. C99 allows a function to reference any file-scope identifier as long as the identifier is declared before the function's first call. We must therefore either: + - Insert this block AFTER `ENCODE_CHARS` (i.e. after line 332). RECOMMENDED. + - Or insert a forward declaration of `ENCODE_CHARS` earlier in the file. + +Use the RECOMMENDED option: place the entire companion-tables block immediately AFTER the `ENCODE_CHARS` definition (around line 332+, before `decodeChar` at line 352). + +- [ ] **Step 2: Call `initCompanionTables()` from public entry points** + +The public encode/decode entry points are: +- `encodeLatLonToMapcodes_internal` (`mapcoder.c:1549`) +- `decoderEngine` (`mapcoder.c:2651`) + +At the very top of `encodeLatLonToMapcodes_internal` (after the `ASSERT(mapcodes);` etc., before `convertCoordsToMicrosAndFractions`), add: + +```c +initCompanionTables(); +``` + +At the very top of `decoderEngine` (after `ASSERT(dec);`, before `parseMapcodeString`), add: + +```c +initCompanionTables(); +``` + +Both calls are guarded by the cheap `if (companion_initialized) return;` so the call cost is one branch per call after the first. + +- [ ] **Step 3: Build and run tests** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O3 -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o && ./unittest 2>&1 | tail -5 +``` + +Expected: clean compile (no unused-variable warnings on the new tables — they ARE used by the initializer), `Unit tests passed`. If anything fails, revert. + +- [ ] **Step 4: Measure timing (3× best)** + +Same as Task 2 Step 6. The expected delta vs. previous commit is tiny (near zero or slightly negative due to init cost on first call). That's expected; B4 is where the payoff lands. + +- [ ] **Step 5: Commit** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: B1+B2+B3 — add precomputed companion tables and one-time init + +Static tables RECORD_CODEX / RECORD_REC_TYPE / RECORD_KIND / +RECORD_HEADER_LETTER / RECORD_SMART_DIV are precomputed once from +TERRITORY_BOUNDARIES.flags. Per-territory TERRITORY_FIRST_NAMELESS / +TERRITORY_NAMELESS_COUNT replace linear scans. + +This commit only defines the tables and calls initCompanionTables at +the top of encodeLatLonToMapcodes_internal and decoderEngine. Hot loops +still use the existing macros; the switch happens in B4. + +Memory footprint: ~74 KB of additional static data. + + time ./unittest (best of 3, user): + baseline = s + after B3 = s + delta = % cumulative + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +--- + +## Task 8: B4 — Hot loops read from companion tables + +**Goal:** The payoff commit. Switch the inner-loop reads in `encoderEngine`, `decoderEngine`, `firstNamelessRecord`, `countNamelessRecords` from the local `flags` cache (added in A1) to the precomputed companion tables. + +**Files:** +- Modify: `mapcodelib/mapcoder.c` — same loop bodies edited in Task 2 (A1), plus the two nameless helpers. + +- [ ] **Step 1: Replace `encoderEngine` loop body to use companion tables** + +Locate the loop edited in Task 2 (the `for (i = from; i <= upto; i++)` in `encoderEngine`). Replace the local `flags`-based extractions with direct table reads: + +```c +for (i = from; i <= upto; i++) { + const unsigned char kind = RECORD_KIND[i]; + const unsigned char recTypeI = RECORD_REC_TYPE[i]; + if (fitsInsideBoundaries(&enc->coord32, TERRITORY_BOUNDARY(i))) { + if (kind & KIND_BIT_NAMELESS) { + encodeNameless(result, enc, ccode, extraDigits, i); + } + else if (recTypeI > 1) { + encodeAutoHeader(result, enc, i, extraDigits); + } + else if ((i == upto) && isSubdivision(ccode)) { + encoderEngine(parentTerritoryOf(ccode), enc, stop_with_one_result, extraDigits, requiredEncoder, + ccode); + return; + } + else // must be grid + { + if (result_counter || !(kind & KIND_BIT_RESTRICTED)) { + if (RECORD_CODEX[i] < 54) { + const char headerletter = (char)((recTypeI == 1) ? RECORD_HEADER_LETTER[i] : 0); + encodeGrid(result, enc, i, extraDigits, headerletter); + } + } + } + + // =========== handle result (if any) + if (*result) { + result_counter++; + + repackIfAllDigits(result, 0); + + if ((requiredEncoder < 0) || (requiredEncoder == i)) { + const enum Territory ccodeFinal = (ccode_override != TERRITORY_NONE ? ccode_override : ccode); + if (*result && enc->mapcodes && (enc->mapcodes->count < MAX_NR_OF_MAPCODE_RESULTS)) { + char* s = enc->mapcodes->mapcode[enc->mapcodes->count++]; + if (ccodeFinal == TERRITORY_AAA) { + strcpy(s, result); + } + else { + getTerritoryIsoName(s, ccodeFinal, 0); + size_t isoLen = strlen(s); + size_t resultLen = strlen(result); + s[isoLen] = ' '; + memcpy(s + isoLen + 1, result, resultLen + 1); + } + } + if (requiredEncoder == i) { + return; + } + } + if (stop_with_one_result) { + return; + } + *result = 0; + } + } +} // for i +``` + +The local `const int flags = ...` line introduced in A1 is removed (no longer used inside this loop). + +- [ ] **Step 2: Replace `decoderEngine` loop body to use companion tables** + +Locate the corresponding loop in `decoderEngine`. Replace with: + +```c +for (i = from; i <= upto; i++) { + const unsigned char kind = RECORD_KIND[i]; + const int codexi = RECORD_CODEX[i]; + const int r = RECORD_REC_TYPE[i]; + if (r == 0) { + if (kind & KIND_BIT_NAMELESS) { + if (((codexi == 21) && (codex == 22)) || + ((codexi == 22) && (codex == 32)) || + ((codexi == 13) && (codex == 23))) { + err = decodeNameless(dec, i); + break; + } + } + else { + if ((codexi == codex) || ((codex == 22) && (codexi == 21))) { + err = decodeGrid(dec, i, 0); + + // first of all, make sure the zone fits the country + restrictZoneTo(&dec->zone, &dec->zone, TERRITORY_BOUNDARY(upto)); + + if ((err == ERR_OK) && (kind & KIND_BIT_RESTRICTED)) { + int nrZoneOverlaps = 0; + int j; + + dec->result = getMidPointFractions(&dec->zone); + dec->coord32 = convertFractionsToCoord32(&dec->result); + for (j = i - 1; j >= from; j--) { + if (!(RECORD_KIND[j] & KIND_BIT_RESTRICTED)) { + if (fitsInsideBoundaries(&dec->coord32, TERRITORY_BOUNDARY(j))) { + nrZoneOverlaps = 1; + break; + } + } + } + + if (!nrZoneOverlaps) { + MapcodeZone zfound; + TerritoryBoundary prevu; + for (j = from; j < i; j++) { + if (!(RECORD_KIND[j] & KIND_BIT_RESTRICTED)) { + MapcodeZone z; + if (restrictZoneTo(&z, &dec->zone, TERRITORY_BOUNDARY(j))) { + nrZoneOverlaps++; + if (nrZoneOverlaps == 1) { + zoneCopyFrom(&zfound, &z); + ASSERT(j <= MAPCODE_BOUNDARY_MAX); + memcpy(&prevu, TERRITORY_BOUNDARY(j), sizeof(TerritoryBoundary)); + } + else { + break; + } + } + } + } + + if (nrZoneOverlaps == 1) { + zoneCopyFrom(&dec->zone, &zfound); + } + } + + if (!nrZoneOverlaps) { + err = ERR_MAPCODE_UNDECODABLE; + } + } + break; + } + } + } + else if (r == 1) { + if (codex == codexi + 10 && RECORD_HEADER_LETTER[i] == (unsigned char) *s) { + err = decodeGrid(dec, i, 1); + break; + } + } + else { + if (((codex == 23) && (codexi == 22)) || + ((codex == 33) && (codexi == 23))) { + err = decodeAutoHeader(dec, i); + break; + } + } +} // for +``` + +The inner `j` loops now also use `RECORD_KIND[j] & KIND_BIT_RESTRICTED` (this is a small extra win since the same loop ran the `IS_RESTRICTED(j)` macro repeatedly). + +- [ ] **Step 3: Replace `firstNamelessRecord` and `countNamelessRecords` to use tables** + +For `firstNamelessRecord`: + +```c +static int firstNamelessRecord(const int m, const int firstcode) { + int i = m; + const int codexm = RECORD_CODEX[m]; + ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); + ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); + while (i >= firstcode && RECORD_CODEX[i] == codexm && (RECORD_KIND[i] & KIND_BIT_NAMELESS)) { + i--; + } + return (i + 1); +} +``` + +For `countNamelessRecords`: + +```c +static int countNamelessRecords(const int m, const int firstcode) { + const int first = firstNamelessRecord(m, firstcode); + const int codexm = RECORD_CODEX[m]; + int last = m; + ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); + ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); + while (RECORD_CODEX[last] == codexm) { + last++; + } + ASSERT((0 <= last) && (last <= MAPCODE_BOUNDARY_MAX)); + ASSERT(last >= first); + return (last - first); +} +``` + +- [ ] **Step 4: Build and run tests** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O3 -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o && ./unittest 2>&1 | tail -5 +``` + +Expected: `Unit tests passed`. Any failure → immediate revert. + +- [ ] **Step 5: Measure timing (3× best)** + +Same as Task 2 Step 6. This should show the largest single-commit speedup. + +- [ ] **Step 6: Commit** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: B4 — hot loops read from precomputed companion tables + +Replace per-iteration mask/shift extractions in encoderEngine, +decoderEngine, firstNamelessRecord, countNamelessRecords with direct +reads from RECORD_KIND / RECORD_CODEX / RECORD_REC_TYPE / +RECORD_HEADER_LETTER. The companion tables are byte-sized so each +field is a single byte load with friendlier cache behavior than the +4-byte flags field. + +Values are derived from the same macros they replace (see B3 init); +output is bit-exact. + + time ./unittest (best of 3, user): + baseline = s + after B4 = s + delta = % cumulative + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +--- + +## Task 9: B5 — Debug-build sanity check + +**Goal:** In `#ifdef DEBUG` builds only, have `initCompanionTables` assert that every precomputed value matches the macro-derived value. Free correctness guarantee during development. + +**Files:** +- Modify: `mapcodelib/mapcoder.c` — the `initCompanionTables` function. + +- [ ] **Step 1: Add the debug check at the end of `initCompanionTables`** + +Just before `companion_initialized = 1;` (the last line of `initCompanionTables`), add: + +```c +#ifdef DEBUG + for (m = 0; m <= MAPCODE_BOUNDARY_MAX; m++) { + const int flags = TERRITORY_BOUNDARIES[m].flags; + const int c = flags & 31; + const int codex_val = 10 * (c / 5) + ((c % 5) + 1); + ASSERT(RECORD_CODEX[m] == (unsigned char) codex_val); + ASSERT(RECORD_REC_TYPE[m] == (unsigned char) ((flags >> 7) & 3)); + ASSERT(((RECORD_KIND[m] & KIND_BIT_NAMELESS) != 0) == ((flags & 64) != 0)); + ASSERT(((RECORD_KIND[m] & KIND_BIT_RESTRICTED) != 0) == ((flags & 512) != 0)); + ASSERT(((RECORD_KIND[m] & KIND_BIT_SPECIAL_SHAPE) != 0) == ((flags & 1024) != 0)); + ASSERT(RECORD_HEADER_LETTER[m] == (unsigned char) ENCODE_CHARS[(flags >> 11) & 31]); + ASSERT(RECORD_SMART_DIV[m] == (unsigned short) ((unsigned int) flags >> 16)); + } +#endif +``` + +(`m` is already declared at the top of `initCompanionTables`, so no new declarations needed.) + +- [ ] **Step 2: Build and run tests in BOTH O3 and DEBUG modes** + +```bash +# -O3 release (no debug assertions) +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O3 -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o && ./unittest 2>&1 | tail -5 + +# DEBUG build (with assertions) +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O0 -DDEBUG -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O0 -DDEBUG unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o && ./unittest 2>&1 | tail -5 +``` + +Both must report `Unit tests passed`. The DEBUG run additionally exercises the new `ASSERT` block in `initCompanionTables` — if any precomputed value diverges from the macro-derived one, the DEBUG build aborts (which is exactly what we want). + +- [ ] **Step 3: Re-build -O3 (so the binary in test/ is the release one for timing)** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/mapcodelib && gcc -O3 -c mapcoder.c +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o +``` + +- [ ] **Step 4: Measure timing (3× best)** + +Same as Task 2 Step 6. Expected: delta from previous commit is near zero (the new code is `#ifdef DEBUG` gated and absent in -O3). + +- [ ] **Step 5: Commit** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add mapcodelib/mapcoder.c +git commit -m "$(cat <<'EOF' +perf: B5 — DEBUG-build sanity check for companion tables + +Under -DDEBUG, initCompanionTables asserts that every precomputed value +matches the macro-derived one. Free correctness guard during development; +zero cost in release. + +Verified: both -O3 and -O0 -DDEBUG builds pass the unit suite. + + time ./unittest -O3 (best of 3, user): + baseline = s + after B5 = s + delta = % cumulative + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +--- + +## Task 10: Final summary commit (mandatory) + +**Goal:** Single commit summarizing the full optimization arc: baseline, per-step deltas, and the cumulative win. Useful for review and for future archaeology. + +**Files:** +- Modify: `docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md` — append a results section. + +- [ ] **Step 1: Append a results section to the spec** + +Open `docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md` and append at the bottom: + +```markdown +## 8. Results + +Measurements taken on branch `feat/optimize`, `-O3` build, `time ./unittest` +(best `user` of 3 back-to-back runs). + +| Commit | Description | Best user time | Delta vs. baseline | +|--------|-------------|---------------|--------------------| +| Task 1 | baseline | s | 0.0% | +| Task 2 | A1 — cache flags per iteration | s | % | +| Task 3 | A2 — reorder fitsInsideBoundaries | s | % | +| Task 4 | A3 — length-tracked result assembly | s | % | +| Task 5 | A4 — tighten encodeBase31 | s | % | +| Task 6 | A5 — repack early-exit | s | % | +| Task 7 | B3 — companion tables init (no hot-path use yet) | s | % | +| Task 8 | B4 — hot loops use companion tables | s | % | +| Task 9 | B5 — DEBUG sanity check | s | % | + +**Final cumulative speedup:** % + +**Success criteria check:** +- [ ] All unit tests passing after every commit (verified) +- [ ] Binary size growth ≤ 100 KB (verified) +- [ ] ≥20% wall-time reduction (target — record whether achieved) +- [ ] ≥30% wall-time reduction (stretch — record whether achieved) +``` + +Fill in all `` values from the prior commit messages. + +- [ ] **Step 2: Verify binary size delta** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git stash || true +git checkout 740bfec -- mapcodelib/mapcoder.c +cd mapcodelib && gcc -O3 -c mapcoder.c && BASELINE_SIZE=$(stat -f%z mapcoder.o) +cd .. +git checkout HEAD -- mapcodelib/mapcoder.c +git stash pop 2>/dev/null || true +cd mapcodelib && gcc -O3 -c mapcoder.c && OPTIMIZED_SIZE=$(stat -f%z mapcoder.o) +echo "Baseline .o: $BASELINE_SIZE bytes" +echo "Optimized .o: $OPTIMIZED_SIZE bytes" +echo "Delta: $((OPTIMIZED_SIZE - BASELINE_SIZE)) bytes" +``` + +If delta > 100,000 bytes (100 KB) the optimization violated a hard constraint — investigate before committing. + +- [ ] **Step 3: Final test pass** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp/test && ./unittest 2>&1 | tail -5 +``` + +Expected: `Unit tests passed`. + +- [ ] **Step 4: Commit summary** + +```bash +cd /Users/rijn/source/mapcode-foundation/mapcode-cpp +git add docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md +git commit -m "$(cat <<'EOF' +docs: record final perf results for feat/optimize branch + +Appends a results table to the design spec capturing per-commit timing +deltas and the cumulative speedup vs. the Task 1 baseline. + +Final speedup: % wall-time on `time ./unittest` at -O3. + +Co-Authored-By: Claude Sonnet 4.6 +EOF +)" +``` + +--- + +## Self-review + +Spec coverage check: +- §1 scope/goals → covered by all tasks; bit-exact guardrail enforced by Step "run tests" in every task. +- §2 measurement methodology → Task 1 establishes baseline; every subsequent task records timing. +- §3 Approach A (A1–A5) → Tasks 2–6. +- §4 Approach B (B1–B5) → Tasks 7–9. +- §4 "Interaction with A1" → Task 8 Step 1 explicitly removes the A1 local `flags` cache when switching to companion tables. +- §5 workflow → matches Tasks 1–9. +- §6 risks → mitigated by "test after every step + revert on failure" in each task; debug-build assertion in Task 9. +- §7 success criteria → Task 10 verifies binary size and produces the final results table. + +Placeholder scan: `` markers are intentional — they're per-run measurements the implementer fills in at commit time. No `TBD`/`TODO`/"implement later" anywhere. + +Type consistency: `unsigned char` used uniformly for KIND/CODEX/REC_TYPE/HEADER_LETTER; `unsigned short` for SMART_DIV; `int` for TERRITORY_FIRST_NAMELESS/COUNT (matches existing code conventions for record indices). Names `KIND_BIT_NAMELESS` / `KIND_BIT_RESTRICTED` / `KIND_BIT_SPECIAL_SHAPE` used consistently across Tasks 7 and 8. diff --git a/docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md b/docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md new file mode 100644 index 0000000..66c35d6 --- /dev/null +++ b/docs/superpowers/specs/2026-05-28-mapcodelib-optimize-design.md @@ -0,0 +1,235 @@ +# mapcodelib speed optimization — design spec + +- **Date:** 2026-05-28 +- **Branch:** `feat/optimize` (off `fix/bugfix`) +- **Author:** Rijn Buve (with Claude) + +## 1. Scope & goals + +Achieve a substantial speedup on the `mapcoder.c` encode and decode hot paths, measured by `time ./unittest` in `test/` (real wall-clock against the existing unit test suite, which already loops over millions of points). + +**Target:** 20–50% wall-time reduction at `-O3`. + +### Hard guardrails + +- **Bit-exact output.** All existing unit tests must pass unchanged. No test files modified. +- **Strict portable C99/C11.** No `__builtin_*`, no SIMD intrinsics, no compiler-specific attributes. +- **No runtime / heap growth.** Per-call stack and heap usage must not increase. Public ABI (struct sizes in `mapcoder.h`) unchanged. +- **Small static-table growth OK.** Precomputed companion tables in the order of tens of KB are acceptable (negligible against existing data tables in `internal_data.h`). + +### Out of scope + +- Public API changes. +- Refactoring unrelated to performance. +- New features. +- Build-system changes (CMake, scripts) beyond what's strictly needed to compile. +- Approach C (loop restructuring, DFA decode parser) — deferred to a future branch if A+B underdeliver. + +## 2. Measurement methodology + +1. Build with `-O3` exactly as `test/run_normal.sh` does: + ``` + cd mapcodelib && gcc -O3 -c mapcoder.c + cd ../test && gcc -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o + ``` +2. Run `time ./unittest` three times back-to-back; record the best `user` time. +3. Repeat after each commit that touches `mapcoder.c`. + +### Baseline + +Capture the baseline on the **first commit** of `feat/optimize` (before any code change) so we have a clean reference number. + +### Per-commit reporting + +Each optimization commit's message includes: + +- `time` output before vs. after (best of 3). +- Cumulative speedup vs. the baseline. +- One-line description of the change. + +### Test integrity + +Every commit must end with `unittest` printing `Unit tests passed` and zero errors. Any commit that regresses tests is rolled back before continuing. + +### Noise caveat + +The unit test does correctness work (asserts, sprintf, comparisons) in addition to encode/decode, so a 30% speedup of encode/decode core will appear as a smaller wall-time delta (perhaps 10–20%). That is expected; "significant" is judged on the total wall-clock number since that is the measurement method chosen. + +## 3. Approach A — Local hot-path cleanups + +Discrete, low-risk edits in `mapcoder.c`. Each is independently revertable and individually testable. + +### A1. Cache `flags` per iteration in encode/decode loops + +In `encoderEngine` (`mapcoder.c:1460`) and `decoderEngine` (`mapcoder.c:2651`), the loop body invokes `IS_NAMELESS(i)`, `IS_RESTRICTED(i)`, `IS_SPECIAL_SHAPE(i)`, `REC_TYPE(i)`, `coDex(i)`, `SMART_DIV(i)` on the same `i`. Each macro re-reads `TERRITORY_BOUNDARIES[i].flags`. + +Replace with a single `const int flags = TERRITORY_BOUNDARIES[i].flags;` at the top of the loop body, plus local extracted variables where used more than once. + +Same pattern in `firstNamelessRecord` (`mapcoder.c:822`) and `countNamelessRecords` (`mapcoder.c:835`). + +### A2. Reorder checks in `fitsInsideBoundaries` + +`mapcoder.c:602` checks lat-min, lat-max, lon-range. For mapcode territory boundaries (most are narrow longitudinally relative to the full earth lon range), test longitude band first to maximise early-out. Same logic, same correctness, fewer comparisons on average. + +### A3. Length-tracked result assembly in `encoderEngine` + +Around `mapcoder.c:1520` the per-result code uses `strcpy` + `strcat` patterns. `strcat` re-scans the destination from the start each time. Replace with `memcpy` using known lengths. + +### A4. Speed up `encodeBase31` + +`mapcoder.c:1083` emits a base-31 representation by repeated `%31` / `/31`. The compiler turns `/31` into a magic-multiply, but the loop is small. A tight unroll (or const lookup for the common small `nrchars` cases) can help. + +### A5. Early-exit in `repackIfAllDigits` / `unpackIfAllDigits` + +`mapcoder.c:892`, `:933`. If the input clearly fails the "all digits" precondition (e.g. first non-digit position), bail before any string mutation. The existing code already does some of this; tighten the check. + +### Risk per change + +Very low; each one is mechanically equivalent. Run full unit tests after each commit. + +### Expected gain from A + +~10–20% wall-time. + +## 4. Approach B — Precomputed companion tables + +Core insight: `encoderEngine`/`decoderEngine` loop over a range of records and re-derive metadata (`codex`, `recType`, `isNameless`, `isSpecialShape`, `smartDiv`) from `flags` on every iteration. Approach A caches `flags` per-iteration, but across many iterations we still recompute the same masks/shifts on the same record data. Precompute that metadata into a compact companion table once at library init, and have the hot loops read directly from it. + +### B1. Companion arrays sized to `TERRITORY_BOUNDARIES` + +Add to `mapcoder.c` at file scope (not exported): + +```c +// One byte per record. Initialized once via initCompanionTables(). +static unsigned char RECORD_CODEX[MAPCODE_BOUNDARY_MAX + 1]; // = coDex(m): 10*(c/5)+(c%5+1), c = flags & 31 +static unsigned char RECORD_REC_TYPE[MAPCODE_BOUNDARY_MAX + 1]; // (flags >> 7) & 3 +static unsigned char RECORD_KIND[MAPCODE_BOUNDARY_MAX + 1]; // bit0=nameless, bit1=restricted, + // bit2=specialShape, bit3=hasHeaderLetter +static unsigned char RECORD_HEADER_LETTER[MAPCODE_BOUNDARY_MAX + 1]; // ENCODE_CHARS[(flags >> 11) & 31] +static unsigned short RECORD_SMART_DIV[MAPCODE_BOUNDARY_MAX + 1]; // flags >> 16 +``` + +Per-record overhead: 6 bytes. With ~12,000 records, total ≈ 72 KB of static `.bss`/`.data`. Well within "small additions OK". + +### B2. Per-territory derived metadata + +```c +static int TERRITORY_FIRST_NAMELESS[_TERRITORY_MAX + 1]; // -1 if none +static int TERRITORY_NAMELESS_COUNT[_TERRITORY_MAX + 1]; // 0 if none +``` + +Eliminates linear scans in `firstNamelessRecord` (`mapcoder.c:822`) and `countNamelessRecords` (`mapcoder.c:835`), turning O(records-per-territory) into O(1). With ~241 territories, ~2 KB extra. + +### B3. One-time initialization + +A `static int companion_initialized = 0;` flag and an `initCompanionTables()` function called at the top of every public entry point that uses the data (`encodeLatLonToMapcodes_internal`, `decoderEngine`, etc.). The init computes everything from `TERRITORY_BOUNDARIES` and the flag-extraction macros — guaranteeing the precomputed values are *definitionally* the same as the macros. + +**Thread safety.** The public API is not specified as thread-safe for first call; the existing code uses pthread only in tests. Init is idempotent (writes deterministic values), so even under a first-call race the worst case is duplicate work — never wrong values. This assumption is documented inline. + +### B4. Replace macro call sites in hot loops only + +`IS_NAMELESS(m)` and the other macros stay defined (used in cold paths, debug asserts, and the init function itself). In `encoderEngine`/`decoderEngine` inner loops, switch to direct table reads: + +```c +const unsigned char kind = RECORD_KIND[i]; +const int codex = RECORD_CODEX[i]; +// ... +``` + +This decouples hot-loop performance from the bit-pack layout of `flags`. + +### B5. Debug-build sanity check + +In `#ifdef DEBUG` builds, `initCompanionTables` also asserts that the precomputed values match the macro-derived values for every record. Free correctness guarantee during development; zero cost in `-O3` release. + +### Risk + +Medium-low. Companion tables are derived directly from the same macros they replace, so by construction they hold identical values. The debug assertions catch any drift if someone later modifies the flag layout. + +### Interaction with A1 + +A1 caches `flags` locally in the very same hot loops that B4 later switches to direct companion-table reads. After B4 lands, the local `flags` cache in those specific loop bodies becomes unused and must be removed as part of that commit. A1 remains useful in any cold-path call site that does not switch to companion tables. + +### Expected combined gain from A+B + +~20–35% wall-time. + +## 5. Workflow + +One commit per checkpoint, linear progression: + +| # | Commit | Purpose | +|---|--------|---------| +| 1 | `chore: branch baseline` | Pin the baseline. Run `time ./unittest` 3× and record best `user` time in commit message. | +| 2 | `perf: A1 — cache flags per loop iteration` | Smallest, safest first. Re-run timing. | +| 3 | `perf: A2 — reorder fitsInsideBoundaries checks` | | +| 4 | `perf: A3 — length-tracked result assembly` | | +| 5 | `perf: A4 — tighten encodeBase31` | | +| 6 | `perf: A5 — early-exit in repack/unpack` | | +| 7 | `perf: B1+B2+B3 — companion tables init` | Tables defined and populated, but not yet read in hot path. Verifies init correctness in isolation. | +| 8 | `perf: B4 — hot loops read from companion tables` | The main payoff commit. | +| 9 | `perf: B5 — debug-build sanity check` | Optional polish. | + +Each commit ends with: + +- Full unit tests green (`Unit tests passed`, 0 errors). +- `time ./unittest` (best of 3) noted in the commit body, plus cumulative speedup vs. commit #1. + +## 6. Risks & mitigations + +| Risk | Mitigation | +|------|------------| +| A change breaks bit-exact behaviour | Run full test suite after every commit; revert if red. | +| Companion table values drift from `flags` semantics | B5 debug-build assertion verifies equivalence at init. | +| Thread-safety regression on first call | `initCompanionTables` is idempotent (deterministic writes). Documented. Safe under existing usage patterns. | +| Gains too small to justify | Stop after A and reassess; A alone should be ≥10% and is the lowest-risk subset. | +| Test wall-time too noisy to read signal | Use best-of-3 `user` time (not `real`), build with `-O3`, run on a quiet machine. | + +## 7. Success criteria + +- **Mandatory:** all unit tests pass after every commit. +- **Mandatory:** binary size growth ≤ 100 KB (companion tables are ~74 KB; allow margin). +- **Target:** ≥20% wall-time reduction on `time ./unittest` at `-O3` after commit #8. +- **Stretch:** ≥30% wall-time reduction. +- **Stop condition:** if Approach A alone delivers ≥30%, B is optional. If A+B underdeliver vs. 20%, re-evaluate before any further restructuring. + +## 8. Results + +Measurements taken on branch `feat/optimize`, `-O3` build, `time ./unittest` +(best `user` of 3 back-to-back runs, multithreaded so user ≫ real). + +| Commit | Description | Best user time | Delta vs. baseline | +|--------|-------------|---------------|--------------------| +| f1cb736 | baseline | 114.13s | 0.0% | +| 430bbba | A1 — cache flags per iteration | 112.21s | +1.7% | +| b9b3f2c | A2 — reorder fitsInsideBoundaries (REVERTED) | 121.10s | −6.1% | +| 5246c79 | revert A2 | ~112s | recovered | +| 1b01b82 | A3 — length-tracked result assembly | 113.19s | +0.8% | +| 753c337 | A4 — encodeBase31 single division (no gain) | 114.35s | noise | +| — | A5 — repackIfAllDigits (already optimized, skipped) | — | — | +| 554af29 | B3 — companion tables init (hot loops unchanged) | 109.99s | +3.6% | +| 3416f87 | B4 — hot loops read from companion tables | 99.40s | +12.9% | +| 2cdf52b | B5 — DEBUG sanity check | 99.73s | +12.6% | + +**Final cumulative speedup: ~12.6%** (best: 12.9% at B4 commit) + +**Binary size delta:** +2240 bytes (constraint: ≤ 100,000 bytes) + +**Success criteria check:** +- ✅ All unit tests passing after every commit +- ✅ Binary size growth ≤ 100 KB +- ⚠️ ≥20% wall-time reduction — NOT achieved (12.6% achieved) +- ❌ ≥30% stretch target — not achieved + +**Notes:** +- A2 (longitude-first boundary check) caused a regression because `isInRange()` has + non-trivial overhead (handles longitude wrap-around) and displaced a cheaper + lat-min comparison to second position. +- A4 (encodeBase31) showed no gain at -O3 because the compiler already performs + strength reduction on division by 31. +- A5 was already implemented in the codebase (unconditional break in else branch). +- The 12.6% improvement comes primarily from B4: replacing per-iteration mask/shift + operations on a 4-byte flags field with single byte loads from the precomputed + companion tables. +- Further gains would require Approach C (loop restructuring) or SIMD, which were + out of scope for this branch. diff --git a/mapcodelib/internal_alphabet_recognizer.h b/mapcodelib/internal_alphabet_recognizer.h index 91c1b00..b18be33 100644 --- a/mapcodelib/internal_alphabet_recognizer.h +++ b/mapcodelib/internal_alphabet_recognizer.h @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __INTERNAL_ALPHABET_RECOGNIZER_H__ #define __INTERNAL_ALPHABET_RECOGNIZER_H__ diff --git a/mapcodelib/internal_data.h b/mapcodelib/internal_data.h index bf742ef..eaf9a06 100644 --- a/mapcodelib/internal_data.h +++ b/mapcodelib/internal_data.h @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __INTERNAL_DATA_H__ #define __INTERNAL_DATA_H__ @@ -16549,4 +16547,3 @@ static const TerritoryBoundary TERRITORY_BOUNDARIES[MAPCODE_BOUNDARY_MAX + 1] = #endif #endif // __INTERNAL_DATA_H__ - diff --git a/mapcodelib/internal_iso3166_data.h b/mapcodelib/internal_iso3166_data.h index ff6f4aa..f48963a 100644 --- a/mapcodelib/internal_iso3166_data.h +++ b/mapcodelib/internal_iso3166_data.h @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __INTERNAL_ISO3166_DATA_H__ #define __INTERNAL_ISO3166_DATA_H__ diff --git a/mapcodelib/internal_territory_alphabets.h b/mapcodelib/internal_territory_alphabets.h index 3846586..de9c729 100644 --- a/mapcodelib/internal_territory_alphabets.h +++ b/mapcodelib/internal_territory_alphabets.h @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __INTERNAL_TERRITORY_ALPHABETS_H__ #define __INTERNAL_TERRITORY_ALPHABETS_H__ @@ -565,4 +563,3 @@ static const TerritoryAlphabets ALPHABETS_FOR_TERRITORY[_TERRITORY_MAX - _TERRIT #endif #endif // __INTERNAL_TERRITORY_ALPHABETS_H__ - diff --git a/mapcodelib/internal_territory_names_af.h b/mapcodelib/internal_territory_names_af.h new file mode 100644 index 0000000..303aa2e --- /dev/null +++ b/mapcodelib/internal_territory_names_af.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_AF_H__ +#define __INTERNAL_TERRITORY_NAMES_AF_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_AF[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_AF // Afrikaans + /* VAT */ "Vatikaanstad|Heilige Stoel", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Cocos Islands|Keeling Eilande", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk en Philip Island|Philip Island", + /* PCN */ "Pitcairn", + /* BVT */ "Bouvet Island", + /* BMU */ "Bermuda", + /* IOT */ "Britse Indiese Oseaan Gebied", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Christmas Island", + /* WLF */ "Wallis en Futuna|Futuna", + /* VGB */ "Britse Virgin Eilande|Virgin Islands, British", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Marshall-eilande", + /* ASM */ "Amerikaanse Samoa|Samoa, Amerikaanse", + /* COK */ "Cook eilande", + /* SPM */ "Saint-Pierre en Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts en Nevis|Nevis", + /* CYM */ "Kaaimanseilande", + /* BES */ "Bonaire, St Eustatuis en Saba|Saba|St Eustatius", + /* MDV */ "Maldives", + /* SHN */ "Saint Helena, Ascension en Tristan da Cunha|Hemelvaart|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Amerikaanse Maagde-eilande|Virgin Islands, US", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard en Jan Mayen|Jan Mayen", + /* VCT */ "St Vincent en die Grenadine|Grenadines", + /* HMD */ "Gehoor Island en McDonald Eilande|McDonald Eilande", + /* BRB */ "Barbados", + /* ATG */ "Antigua en Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seychelle", + /* PLW */ "Palau", + /* MNP */ "Noord Mariana Eilande", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Eiland Man", + /* LCA */ "Saint Lucia", + /* FSM */ "Mikronesië|Gefedereerde State van Mikronesië", + /* SGP */ "Singapoer", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks en Caicos Eilande|Caicos Eilande", + /* STP */ "Sao Tomé en Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Faroëreilande", + /* GLP */ "Guadeloupe", + /* COM */ "Comore", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Luxemburg", + /* WSM */ "Samoa", + /* SGS */ "Suid-Georgië en die Suid-Sandwich Eilande|Suid-Sandwich Eilande", + /* PYF */ "Frans-Polinesië", + /* CPV */ "Kaap Verde", + /* TTO */ "Trinidad en Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Franse Suidelike en Antarktiese Gebiede", + /* PRI */ "Puerto Rico", + /* CYP */ "Ciprus", + /* LBN */ "Libanon", + /* JAM */ "Jamaica", + /* GMB */ "Gambië", + /* QAT */ "Katar", + /* FLK */ "Falkland-eilande", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Oos-Timor", + /* SWZ */ "Swaziland", + /* KWT */ "Kuwait", + /* FJI */ "Fidji-eilande", + /* NCL */ "New Caledonia", + /* SVN */ "Slowenië", + /* ISR */ "Israel", + /* PSE */ "Palestynse gebiede", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djiboeti", + /* MKD */ "Macedonië", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Ekwatoriaal-Guinee", + /* ALB */ "Albanië", + /* SLB */ "Solomon Eilande", + /* ARM */ "Armenië", + /* LSO */ "Lesotho", + /* BEL */ "België", + /* MDA */ "Moldawië", + /* GNB */ "Guinee-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhoetan", + /* CHE */ "Switserland", + /* NLD */ "Nederland", + /* DNK */ "Denemarke", + /* EST */ "Estland", + /* DOM */ "Dominikaanse Republiek", + /* SVK */ "Slowakye", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnië en Herzegovina", + /* HRV */ "Kroasië", + /* TGO */ "Togo", + /* LVA */ "Letland", + /* LTU */ "Litaue", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgia", + /* IRL */ "Ierland", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Tsjeggiese Republiek", + /* GUF */ "Franse Guiana", + /* ARE */ "Verenigde Arabiese Emirate", + /* AUT */ "Oostenryk", + /* AZE */ "Azerbaijan", + /* SRB */ "Serwië", + /* JOR */ "Jordan", + /* PRT */ "Portugal", + /* HUN */ "Hongarye", + /* KOR */ "Suid-Korea", + /* ISL */ "Ysland", + /* GTM */ "Guatemala", + /* CUB */ "Kuba", + /* BGR */ "Bulgarye", + /* LBR */ "Liberië", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Noord-Korea", + /* NIC */ "Nicaragua", + /* GRC */ "Griekeland", + /* TJK */ "Tadjikistan", + /* BGD */ "Bangladesj", + /* NPL */ "Nepal", + /* TUN */ "Tunisië", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Kambodja", + /* SYR */ "Sirië", + /* SEN */ "Senegal", + /* KGZ */ "Kyrgyzstan", + /* BLR */ "Wit-Rusland", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Roemenië", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Verenigde Koninkryk|Skotland|Groot-Brittanje|Noord-Ierland|Ierland, Noord", + /* GIN */ "Guinee", + /* ECU */ "Ecuador", + /* ESH */ "Wes-Sahara|Sahrawi", + /* GAB */ "Gaboen", + /* NZL */ "Nieu-Seeland", + /* BFA */ "Burkina Faso", + /* PHL */ "Filippyne", + /* ITA */ "Italië", + /* OMN */ "Oman", + /* POL */ "Pole", + /* CIV */ "Ivoorkus", + /* NOR */ "Noorweë", + /* MYS */ "Maleisië", + /* VNM */ "Viëtnam", + /* FIN */ "Finland", + /* COG */ "Republiek van die Kongo", + /* DEU */ "Duitsland", + /* JPN */ "Japan", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Marokko", + /* UZB */ "Oesbekistan", + /* SWE */ "Swede", + /* PNG */ "Papoea-Nieu-Guinee", + /* CMR */ "Kameroen", + /* TKM */ "Turkmenistan", + /* ESP */ "Spanje", + /* THA */ "Thailand", + /* YEM */ "Jemen", + /* FRA */ "Frankryk", + /* ALA */ "AAland-eilande", + /* KEN */ "Kenia", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Oekraïne", + /* SSD */ "Suid-Soedan", + /* CAF */ "Sentraal-Afrikaanse Republiek", + /* SOM */ "Somalië", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Birma", + /* ZMB */ "Zambië", + /* CHL */ "Chili", + /* TUR */ "Turkye", + /* PAK */ "Pakistan", + /* MOZ */ "Mosambiek", + /* NAM */ "Namibië", + /* VEN */ "Venezuela", + /* NGA */ "Nigerië", + /* TZA */ "Tanzanië", + /* EGY */ "Egipte", + /* MRT */ "Mauritanië", + /* BOL */ "Bolivia", + /* ETH */ "Ethiopië", + /* COL */ "Colombia", + /* ZAF */ "Suid-Afrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Chad", + /* PER */ "Peru", + /* MNG */ "Mongolië", + /* IRN */ "Iran", + /* LBY */ "Libië", + /* SDN */ "Soedan", + /* IDN */ "Indonesië", + /* DIF */ "Federale Distrik", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexiko", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Vera Cruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Groenland", + /* SAU */ "Saoedi-Arabië", + /* COD */ "Kongo-Kinshasa", + /* DZA */ "Algerië", + /* KAZ */ "Kazakstan", + /* ARG */ "Argentinië", + /* IN-DD */ "Daman en Diu", + /* IN-DN */ "Dadra en Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman and Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Gujarat", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Ladismith", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu en Kasjmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Wes-Bengal", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territory", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "Suid-Australië", + /* TAS */ "Tasmanië", + /* VIC */ "Victoria", + /* AU-WA */ "Wes-Australië", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapá", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondônia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piauí", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "Distrik van Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "Suid Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Noord-Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "Kalifornië", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "Indië", + /* AUS */ "Australië", + /* BRA */ "Brasilië", + /* USA */ "VSA|Verenigde State van Amerika|Amerika", + /* MEX */ "Mexiko", + /* MOW */ "Moskou", + /* SPE */ "Saint Petersburg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingoesjetië Republiek", + /* RU-AD */ "Adygea Republiek", + /* RU-SE */ "Noord-Ossetië-Alania Republiek", + /* RU-KB */ "Kabardino-Balkar Republic", + /* RU-KC */ "Karachay-Cherkess Republiek", + /* RU-CE */ "Tsjetsjeense Republiek", + /* RU-CU */ "Chuvash Republiek", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Koersk Oblast", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrakhan Oblast", + /* MOS */ "Moskou Oblast", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "Stan Republiek", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Nowgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia Republiek", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Moermansk Oblast", + /* RU-KR */ "Karelië Republiek", + /* NEN */ "Nenets outonome Okrug", + /* RU-KO */ "Komi Republiek", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovia Republiek", + /* NIZ */ "Nizjni Nowgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Republiek", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan Republiek", + /* RU-UD */ "Udmurt Republiek", + /* RU-TA */ "Tatarstan Republiek", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Buryatia Republiek", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Khakassia Republiek", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Altai Republiek", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republiek", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Joodse Outonome Oblast", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Oostelike Oblast", + /* RU-SA */ "Sakha Republiek|Yakutia Republiek", + /* CAN */ "Kanada", + /* RUS */ "Rusland", + /* CN-SH */ "Sjanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Beijing", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Mpumalanga", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "KwaZulu-Natal", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilunkiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Tibet|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "Sjina", + /* UMI */ "Verenigde State Minor afgeleë eilande", + /* CPT */ "Clipperton Island", + /* ATA */ "Antarktika", + /* AAA */ "International|Wêreldwyd|Aarde" +#else // MAPCODE_SUPPORT_LANGUAGE_AF + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_AF +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_AF_H__ diff --git a/mapcodelib/internal_territory_names_ar.h b/mapcodelib/internal_territory_names_ar.h new file mode 100644 index 0000000..423847a --- /dev/null +++ b/mapcodelib/internal_territory_names_ar.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_AR_H__ +#define __INTERNAL_TERRITORY_NAMES_AR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_AR[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_AR // Arabic + /* VAT */ "الفاتيكان|مدينة الفاتيكان|الكرسي الرسولي", + /* MCO */ "موناكو", + /* GIB */ "جبل طارق", + /* TKL */ "توكلو", + /* CCK */ "جزر كوكوس", + /* BLM */ "سان بارتليمي", + /* NRU */ "ناورو", + /* TUV */ "توفالو", + /* MAC */ "ماكاو", + /* SXM */ "سينت مارتن", + /* MAF */ "سانت مارتن الفرنسية", + /* NFK */ "جزيرة نورفولك|فيليب ايلاند", + /* PCN */ "جزر بيتكيرن", + /* BVT */ "جزيرة بوفيه", + /* BMU */ "برمودا", + /* IOT */ "إقليم المحيط الهندي البريطاني", + /* SMR */ "سان مارينو", + /* GGY */ "غيرنزي", + /* AIA */ "أنغويلا", + /* MSR */ "مونتسرات", + /* JEY */ "جيرزي|جيرسي", + /* CXR */ "جزيرة الكريسماس", + /* WLF */ "الس وفوتونا|فوتونا", + /* VGB */ "الجزر العذراء البريطانية", + /* LIE */ "ليختنشتاين", + /* ABW */ "أروبا", + /* MHL */ "جزر مارشال", + /* ASM */ "ساموا الأمريكية", + /* COK */ "جزر كوك", + /* SPM */ "سان بيير وميكلون|ميكلون", + /* NIU */ "نييوي", + /* KNA */ "سانت كيتس ونيفيس", + /* CYM */ "جزر كايمان", + /* BES */ "الجزر الكاريبية الهولندية", + /* MDV */ "جزر المالديف", + /* SHN */ "سانت هيلينا وأسينشين وتريستان دا كونا|أسينشين|تريستان دا كونا", + /* MLT */ "مالطا", + /* GRD */ "غرناطة", + /* VIR */ "جزر العذراء الأمريكية", + /* MYT */ "مايوت", + /* SJM */ "سفالبارد وجان ماين|جان ماين", + /* VCT */ "سانت فنسنت والجرينادين|لجرينادين", + /* HMD */ "جزيرة هيرد وجزر ماكدونالد", + /* BRB */ "باربادوس", + /* ATG */ "أنتيغوا وباربودا|باربودا", + /* CUW */ "كوراساو", + /* SYC */ "سيشل", + /* PLW */ "بالاو", + /* MNP */ "جزر ماريانا الشمالية", + /* AND */ "أندورا", + /* GUM */ "غوام", + /* IMN */ "جزيرة مان", + /* LCA */ "سانت لوسيا", + /* FSM */ "ميكرونيزيا|ولايات ميكرونيسيا المتحدة", + /* SGP */ "سنغافورة", + /* TON */ "تونغا", + /* DMA */ "دومينيكا", + /* BHR */ "البحرين", + /* KIR */ "كيريباتي", + /* TCA */ "جزر توركس وكايكوس", + /* STP */ "ساو تومي وبرينسيب|برينسيب", + /* HKG */ "هونغ كونغ", + /* MTQ */ "مارتينيك", + /* FRO */ "جزر فارو", + /* GLP */ "غوادلوب", + /* COM */ "جزر القمر", + /* MUS */ "موريشيوس", + /* REU */ "لا ريونيون", + /* LUX */ "لوكسمبورغ", + /* WSM */ "ساموا", + /* SGS */ "جورجيا الجنوبية وجزر ساندويتش الجنوبية|جنوب جزر ساندويتش", + /* PYF */ "بولينزيا الفرنسية", + /* CPV */ "الرأس الأخضر", + /* TTO */ "ترينيداد وتوباغو|توباغو", + /* BRN */ "بروناي", + /* ATF */ "أراض فرنسية جنوبية وأنتارتيكية", + /* PRI */ "بورتوريكو", + /* CYP */ "قبرص", + /* LBN */ "لبنان", + /* JAM */ "جامايكا", + /* GMB */ "غامبيا", + /* QAT */ "قطر", + /* FLK */ "جزر فوكلاند", + /* VUT */ "فانواتو", + /* MNE */ "الجبل الأسود", + /* BHS */ "باهاماس", + /* TLS */ "تيمور الشرقية", + /* SWZ */ "سوازيلاند", + /* KWT */ "الكويت", + /* FJI */ "فيجي", + /* NCL */ "كاليدونيا الجديدة", + /* SVN */ "سلوفينيا", + /* ISR */ "إسرائيل", + /* PSE */ "فلسطين", + /* SLV */ "السلفادور", + /* BLZ */ "بليز", + /* DJI */ "جيبوتي", + /* MKD */ "مقدونيا", + /* RWA */ "رواندا", + /* HTI */ "هايتي", + /* BDI */ "بوروندي", + /* GNQ */ "غينيا الاستوائية", + /* ALB */ "ألبانيا", + /* SLB */ "جزر سليمان", + /* ARM */ "أرمينيا", + /* LSO */ "ليسوتو", + /* BEL */ "بلجيكا", + /* MDA */ "مولدافيا", + /* GNB */ "غينيا بيساو", + /* TWN */ "تايوان", + /* BTN */ "بوتان", + /* CHE */ "سويسرا", + /* NLD */ "هولندا", + /* DNK */ "الدنمارك", + /* EST */ "إستونيا", + /* DOM */ "جمهورية الدومينيكان", + /* SVK */ "سلوفاكيا", + /* CRI */ "كوستاريكا", + /* BIH */ "البوسنة والهرسك", + /* HRV */ "كرواتيا", + /* TGO */ "توغو", + /* LVA */ "لاتفيا", + /* LTU */ "ليتوانيا", + /* LKA */ "سريلانكا", + /* GEO */ "جورجيا", + /* IRL */ "جمهورية أيرلندا|أيرلندا", + /* SLE */ "سيراليون", + /* PAN */ "بنما", + /* CZE */ "جمهورية التشيك", + /* GUF */ "غويانا الفرنسية", + /* ARE */ "الإمارات العربية المتحدة", + /* AUT */ "النمسا", + /* AZE */ "أذربيجان", + /* SRB */ "صربيا", + /* JOR */ "الأردن", + /* PRT */ "البرتغال", + /* HUN */ "المجر", + /* KOR */ "كوريا الجنوبية", + /* ISL */ "آيسلندا", + /* GTM */ "غواتيمالا", + /* CUB */ "كوبا", + /* BGR */ "بلغاريا", + /* LBR */ "ليبيريا", + /* HND */ "هندوراس", + /* BEN */ "بنين", + /* ERI */ "إريتريا", + /* MWI */ "مالاوي", + /* PRK */ "كوريا الشمالية", + /* NIC */ "نيكاراغوا", + /* GRC */ "اليونان", + /* TJK */ "طاجيكستان", + /* BGD */ "بنغلاديش", + /* NPL */ "نيبال", + /* TUN */ "تونس", + /* SUR */ "سورينام", + /* URY */ "الأوروغواي", + /* KHM */ "كمبوديا", + /* SYR */ "سوريا", + /* SEN */ "السنغال", + /* KGZ */ "قيرغيزستان", + /* BLR */ "بيلاروسيا", + /* GUY */ "غيانا", + /* LAO */ "لاوس", + /* ROU */ "رومانيا", + /* GHA */ "غانا", + /* UGA */ "أوغندا", + /* GBR */ "المملكة المتحدة|اسكتلندا|بريطانيا العظمى|ايرلندا الشمالية", + /* GIN */ "غينيا", + /* ECU */ "الإكوادور", + /* ESH */ "الصحراء الغربية", + /* GAB */ "الغابون", + /* NZL */ "نيوزيلندا", + /* BFA */ "بوركينا فاسو", + /* PHL */ "الفلبين", + /* ITA */ "إيطاليا", + /* OMN */ "سلطنة عمان", + /* POL */ "بولندا", + /* CIV */ "ساحل العاج", + /* NOR */ "النرويج", + /* MYS */ "ماليزيا", + /* VNM */ "فيتنام", + /* FIN */ "فنلندا", + /* COG */ "جمهورية الكونغو", + /* DEU */ "ألمانيا", + /* JPN */ "اليابان", + /* ZWE */ "زيمبابوي", + /* PRY */ "باراغواي", + /* IRQ */ "العراق", + /* MAR */ "المغرب", + /* UZB */ "أوزبكستان", + /* SWE */ "السويد", + /* PNG */ "بابوا غينيا الجديدة", + /* CMR */ "الكاميرون", + /* TKM */ "تركمانستان", + /* ESP */ "إسبانيا", + /* THA */ "تايلاند", + /* YEM */ "اليمن", + /* FRA */ "فرنسا", + /* ALA */ "أولند|جزر آلاند", + /* KEN */ "كينيا", + /* BWA */ "بوتسوانا", + /* MDG */ "مدغشقر", + /* UKR */ "أوكرانيا", + /* SSD */ "جنوب السودان", + /* CAF */ "جمهورية أفريقيا الوسطى", + /* SOM */ "الصومال", + /* AFG */ "أفغانستان", + /* MMR */ "ميانمار|بورما", + /* ZMB */ "زامبيا", + /* CHL */ "تشيلي", + /* TUR */ "تركيا", + /* PAK */ "باكستان", + /* MOZ */ "موزمبيق", + /* NAM */ "ناميبيا", + /* VEN */ "فنزويلا", + /* NGA */ "نيجيريا", + /* TZA */ "تنزانيا", + /* EGY */ "مصر", + /* MRT */ "موريتانيا", + /* BOL */ "بوليفيا", + /* ETH */ "إثيوبيا", + /* COL */ "كولومبيا", + /* ZAF */ "جنوب أفريقيا", + /* MLI */ "مالي", + /* AGO */ "أنغولا", + /* NER */ "النيجر", + /* TCD */ "تشاد", + /* PER */ "بيرو", + /* MNG */ "منغوليا", + /* IRN */ "إيران", + /* LBY */ "ليبيا", + /* SDN */ "السودان", + /* IDN */ "إندونيسيا", + /* DIF */ "المقاطعة الاتحادية", + /* TLA */ "تلاكسكالا", + /* MOR */ "موريلوس", + /* AGU */ "اغواسكالينتيس", + /* MX-CL */ "كوليما", + /* QUE */ "كوينتانا رو", + /* HID */ "الهيدلج من نبلاء الأسبان", + /* MX-MX */ "الدولة المكسيك", + /* TAB */ "تاباسكو", + /* NAY */ "ناياريت", + /* GUA */ "غواناخواتو", + /* PUE */ "بويبلا", + /* YUC */ "يوكاتان", + /* ROO */ "كويريتارو", + /* SIN */ "سينالوا", + /* CAM */ "كامبيتشي", + /* MIC */ "ميتشواكان", + /* SLP */ "سان لويس بوتوسي", + /* GRO */ "غيريرو", + /* NLE */ "نويفو ليون", + /* BCN */ "باجا كاليفورنيا", + /* VER */ "فيراكروز", + /* CHP */ "تشياباس", + /* BCS */ "باجا كاليفورنيا سور", + /* ZAC */ "زاكاتيكاس", + /* JAL */ "خاليسكو", + /* TAM */ "تاماوليباس", + /* OAX */ "أواكساكا", + /* DUR */ "دورانجو", + /* COA */ "كواهويلا", + /* SON */ "سونورا", + /* CHH */ "تشيهواهوا", + /* GRL */ "غرينلاند", + /* SAU */ "السعودية", + /* COD */ "جمهورية الكونغو الديمقراطية", + /* DZA */ "الجزائر", + /* KAZ */ "كازاخستان", + /* ARG */ "الأرجنتين", + /* IN-DD */ "دامان وديو", + /* IN-DN */ "دادرا وناغار هافيلي", + /* IN-CH */ "شانديغار", + /* IN-AN */ "اندامان ونيكوبار", + /* IN-LD */ "اكشادويب", + /* IN-DL */ "دلهي", + /* IN-ML */ "ميغالايا", + /* IN-NL */ "ناجالاند", + /* IN-MN */ "مانيبور", + /* IN-TR */ "تريبورا", + /* IN-MZ */ "ميزورام", + /* IN-SK */ "سيكيم", + /* IN-PB */ "البنجاب", + /* IN-HR */ "هاريانا", + /* IN-AR */ "اروناتشال براديش", + /* IN-AS */ "أسام", + /* IN-BR */ "بيهار", + /* IN-UT */ "أوتارانتشال", + /* IN-GA */ "غوا", + /* IN-KL */ "ولاية كيرالا", + /* IN-TN */ "تاميل نادو", + /* IN-HP */ "هيماشال براديش", + /* IN-JK */ "جامو وكشمير", + /* IN-CT */ "تشهاتيسجاره", + /* IN-JH */ "جهارخاند", + /* IN-KA */ "كارناتاكا", + /* IN-RJ */ "راجستان", + /* IN-OR */ "أوديشا|أوريسا", + /* IN-GJ */ "غوجارات", + /* IN-WB */ "بنغال الغربية", + /* IN-MP */ "ماديا براديش", + /* IN-TG */ "تيلانجانا", + /* IN-AP */ "ولاية اندرا براديش", + /* IN-MH */ "ماهاراشترا", + /* IN-UP */ "ولاية اوتار براديش", + /* IN-PY */ "بودوتشيري", + /* NSW */ "نيو ساوث ويلز", + /* ACT */ "إقليم العاصمة الأسترالية", + /* JBT */ "جيرفيس خليج الأرض", + /* AU-NT */ "المقاطعة الشمالية", + /* AU-SA */ "جنوب استراليا", + /* TAS */ "تسمانيا", + /* VIC */ "فيكتوريا", + /* AU-WA */ "أستراليا الغربية", + /* QLD */ "كوينزلاند", + /* BR-DF */ "ديستريتو فيديرال", + /* BR-SE */ "سيرجيبي", + /* BR-AL */ "ألاغواس", + /* BR-RJ */ "ريو دي جانيرو", + /* BR-ES */ "إسبيريتو سانتو", + /* BR-RN */ "ريو غراندي دو نورتي", + /* BR-PB */ "بارايبا", + /* BR-SC */ "سانتا كاتارينا", + /* BR-PE */ "بيرنامبوكو", + /* BR-AP */ "أمابا", + /* BR-CE */ "سيارا", + /* BR-AC */ "أكري", + /* BR-PR */ "بارانا", + /* BR-RR */ "رورايما", + /* BR-RO */ "روندونيا", + /* BR-SP */ "ساو باولو", + /* BR-PI */ "بياوي", + /* BR-TO */ "توكانتينس", + /* BR-RS */ "ريو غراندي دو سول", + /* BR-MA */ "مارانهاو", + /* BR-GO */ "غوياس", + /* BR-MS */ "ماتو غروسو دو سول", + /* BR-BA */ "باهيا", + /* BR-MG */ "ميناس جيرايس", + /* BR-MT */ "ماتو غروسو", + /* BR-PA */ "بارا", + /* BR-AM */ "الأمازون", + /* US-DC */ "مقاطعة كولومبيا", + /* US-RI */ "جزيرة رود", + /* US-DE */ "ولاية ديلاوير", + /* US-CT */ "كونيتيكت", + /* US-NJ */ "نيو جيرسي", + /* US-NH */ "نيو هامبشاير", + /* US-VT */ "فيرمونت", + /* US-MA */ "ماساتشوستس", + /* US-HI */ "هاواي", + /* US-MD */ "ماريلاند", + /* US-WV */ "فرجينيا الغربية", + /* US-SC */ "كارولينا الجنوبية", + /* US-ME */ "مين", + /* US-IN */ "إنديانا", + /* US-KY */ "كنتاكي", + /* US-TN */ "تينيسي", + /* US-VA */ "فرجينيا", + /* US-OH */ "أوهايو", + /* US-PA */ "ولاية بنسلفانيا", + /* US-MS */ "ميسيسيبي", + /* US-LA */ "لويزيانا", + /* US-AL */ "ألاباما", + /* US-AR */ "أركنساس", + /* US-NC */ "شمال كارولينا", + /* US-NY */ "نيويورك", + /* US-IA */ "أيوا", + /* US-IL */ "إلينوي", + /* US-GA */ "جورجيا", + /* US-WI */ "ولاية ويسكونسن", + /* US-FL */ "فلوريدا", + /* US-MO */ "ميسوري", + /* US-OK */ "أوكلاهوما", + /* US-ND */ "شمال داكوتا", + /* US-WA */ "واشنطن", + /* US-SD */ "جنوب داكوتا", + /* US-NE */ "نبراسكا", + /* US-KS */ "كانساس", + /* US-ID */ "ايداهو", + /* US-UT */ "يوتا", + /* US-MN */ "مينيسوتا", + /* US-MI */ "ميشيغان", + /* US-WY */ "وايومنغ", + /* US-OR */ "ولاية أوريغون", + /* US-CO */ "كولورادو", + /* US-NV */ "نيفادا", + /* US-AZ */ "أريزونا", + /* US-NM */ "المكسيك جديدة", + /* US-MT */ "مونتانا", + /* US-CA */ "كاليفورنيا", + /* US-TX */ "تكساس", + /* US-AK */ "ألاسكا", + /* CA-BC */ "كولومبيا البريطانية", + /* CA-AB */ "ألبرتا", + /* CA-ON */ "أونتاريو", + /* CA-QC */ "كيبيك", + /* CA-SK */ "ساسكاتشوان", + /* CA-MB */ "مانيتوبا", + /* CA-NL */ "نيوفاوندلاند", + /* CA-NB */ "برونزيك جديد", + /* CA-NS */ "مقاطعة نفوفا سكوشيا", + /* CA-PE */ "جزيرة الأمير إدوارد", + /* CA-YT */ "يوكون", + /* CA-NT */ "الاقاليم الشمالية الغربية", + /* CA-NU */ "نونافوت", + /* IND */ "الهند", + /* AUS */ "أستراليا", + /* BRA */ "البرازيل", + /* USA */ "الولايات المتحدة الأمريكية|أمريكا", + /* MEX */ "المكسيك", + /* MOW */ "موسكو", + /* SPE */ "سان بطرسبورج", + /* KGD */ "كالينينغراد أوبلاست", + /* RU-IN */ "جمهورية إنغوشيا", + /* RU-AD */ "جمهورية أديغيا", + /* RU-SE */ "شمال أوسيتيا-ألانيا الجمهورية", + /* RU-KB */ "قبردينو بلقاريا", + /* RU-KC */ "كراشاي-الشركس الجمهورية", + /* RU-CE */ "جمهورية الشيشان", + /* RU-CU */ "جمهورية التشفاش", + /* IVA */ "إيفانوفو أوبلاست", + /* LIP */ "ليبيتسك أوبلاست", + /* ORL */ "أوريول أوبلاست", + /* TUL */ "تولا أوبلاست", + /* RU-BE */ "بيلغورود أوبلاست", + /* VLA */ "فلاديمير أوبلاست", + /* KRS */ "كورسك أوبلاست", + /* KLU */ "كالوغا أوبلاست", + /* RU-TT */ "تامبوف أوبلاست", + /* BRY */ "بريانسك أوبلاست", + /* YAR */ "ياروسلافل أوبلاست", + /* RYA */ "ريازان", + /* AST */ "أستراخان أوبلاست", + /* MOS */ "موسكو أوبلاست", + /* SMO */ "سمولينسك أوبلاست", + /* RU-DA */ "جمهورية داغستان", + /* VOR */ "فورونيج أوبلاست", + /* NGR */ "نوفغورود أوبلاست", + /* PSK */ "بسكوف أوبلاست", + /* KOS */ "كوستروما أوبلاست", + /* STA */ "ستافروبول كراي", + /* KDA */ "كراسنودار كراي", + /* RU-KL */ "جمهورية كالميكيا", + /* TVE */ "تفير أوبلاست", + /* LEN */ "لينينغراد أوبلاست", + /* ROS */ "روستوف", + /* VGG */ "فولغوغراد أوبلاست", + /* VLG */ "منطقة فولوغدا", + /* MUR */ "مورمانسك أوبلاست", + /* RU-KR */ "جمهورية كاريليا", + /* NEN */ "أوكروغ نينيتس الذاتية", + /* RU-KO */ "جمهورية كومي", + /* ARK */ "أرخانجيلسك أوبلاست", + /* RU-MO */ "جمهورية موردوفيا", + /* NIZ */ "نيجني نوفغورود أوبلاست", + /* PNZ */ "بانزا أوبلاست", + /* RU-KI */ "كيروف أوبلاست", + /* RU-ME */ "ماري جمهورية شركة", + /* ORE */ "أورينبورغ أوبلاست", + /* ULY */ "أوليانوفسك أوبلاست", + /* RU-PM */ "بيرم كراي", + /* RU-BA */ "جمهورية بشكيريا", + /* RU-UD */ "جمهورية الأدمرت", + /* RU-TA */ "جمهورية تتارستان", + /* SAM */ "سمارا أوبلاست", + /* SAR */ "ساراتوف أوبلاست", + /* YAN */ "يامالو نينتس", + /* RU-KM */ "خانتي المنسي", + /* SVE */ "سفيردلوفسك أوبلاست", + /* TYU */ "تيومين أوبلاست", + /* KGN */ "كورغان أوبلاست", + /* RU-CH */ "تشيليابينسك أوبلاست", + /* RU-BU */ "جمهورية بورياتيا", + /* ZAB */ "كراي عبر البايكال", + /* IRK */ "إيركوتسك أوبلاست", + /* NVS */ "نوفوسيبيرسك", + /* TOM */ "منطقة تومسك", + /* OMS */ "أومسك أوبلاست", + /* RU-KK */ "جمهورية خاكاسيا", + /* KEM */ "كيميروفو أوبلاست", + /* RU-AL */ "جمهورية التاي", + /* ALT */ "التاي كراي", + /* RU-TY */ "جمهورية توفا", + /* KYA */ "كراسنويارسك كراي", + /* MAG */ "ماجادان أوبلاست", + /* CHU */ "تشوكوتكا أوكروغ", + /* KAM */ "كامتشاتكا كراي", + /* SAK */ "ساخالين أوبلاست", + /* RU-PO */ "بريمورسكي كراي", + /* YEV */ "الأوبلاست اليهودية الذاتية", + /* KHA */ "خاباروفسك كراي", + /* AMU */ "أمور أوبلاست", + /* RU-SA */ "جمهورية ساخا|ياقوتيا الجمهورية", + /* CAN */ "كندا", + /* RUS */ "روسيا", + /* CN-SH */ "شنغهاي", + /* CN-TJ */ "تيانجين", + /* CN-BJ */ "بكين", + /* CN-HI */ "هاينان", + /* CN-NX */ "نينغشيا هوى", + /* CN-CQ */ "تشونغتشينغ", + /* CN-ZJ */ "تشجيانغ", + /* CN-JS */ "جيانغسو", + /* CN-FJ */ "فوجيان", + /* CN-AH */ "انهوى", + /* CN-LN */ "لياونينغ", + /* CN-SD */ "شاندونغ", + /* CN-SX */ "شانشى", + /* CN-JX */ "جيانغشى", + /* CN-HA */ "خنان", + /* CN-GZ */ "قويتشو", + /* CN-GD */ "قوانغدونغ", + /* CN-HB */ "هوبى", + /* CN-JL */ "جيلين", + /* CN-HE */ "خبى", + /* CN-SN */ "شنشى", + /* CN-NM */ "ني المغول|منغوليا الداخلية", + /* CN-HL */ "هيلونغجيانغ", + /* CN-HN */ "هونان", + /* CN-GX */ "قوانغشى لقومية تشوانغ", + /* CN-SC */ "سيتشوان", + /* CN-YN */ "يونان", + /* CN-XZ */ "زيزانغ|التبت", + /* CN-GS */ "قانسو", + /* CN-QH */ "تشينغهاى", + /* CN-XJ */ "شينجيانغ الويغورية", + /* CHN */ "الصين", + /* UMI */ "جزر الولايات المتحدة الصغيرة النائية", + /* CPT */ "جزيرة كليبرتون", + /* ATA */ "القارة القطبية الجنوبية", + /* AAA */ "دولي" +#else // MAPCODE_SUPPORT_LANGUAGE_AR + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_AR +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_AR_H__ diff --git a/mapcodelib/internal_territory_names_be.h b/mapcodelib/internal_territory_names_be.h new file mode 100644 index 0000000..d491447 --- /dev/null +++ b/mapcodelib/internal_territory_names_be.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_BE_H__ +#define __INTERNAL_TERRITORY_NAMES_BE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_BE[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_BE // Belarussian + /* VAT */ "Горад Ватыкан|Святы Пасад", + /* MCO */ "Манака", + /* GIB */ "Гібралтар", + /* TKL */ "Такелаў", + /* CCK */ "Какосавыя астравы|Кілінг выспы", + /* BLM */ "Сен-Бартэльмі", + /* NRU */ "Науру", + /* TUV */ "Тувалу", + /* MAC */ "Макао", + /* SXM */ "Сінт-Маартен", + /* MAF */ "Сен-Мартэн", + /* NFK */ "Норфолк і Філіп-Айлэнд|Філіп-Айлэнд", + /* PCN */ "Піткэрн", + /* BVT */ "востраў Буве", + /* BMU */ "Бэрмудзкія выспы", + /* IOT */ "Брытанская тэрыторыя ў Індыйскім акіяне", + /* SMR */ "Сан - Марына", + /* GGY */ "Гернсі", + /* AIA */ "Ангілья", + /* MSR */ "Мансерат", + /* JEY */ "Джэрсі", + /* CXR */ "востраў каляд", + /* WLF */ "Уоліс і Футуна|Паўднёвая Афрыка", + /* VGB */ "Брытанскія Віргінскія астравы|Віргінскія выспы, брытанскія", + /* LIE */ "Ліхтэнштэйн", + /* ABW */ "Аруба", + /* MHL */ "Маршалавы выспы", + /* ASM */ "Амерыканскае Самоа|Самоа, амерыканскае", + /* COK */ "выспы Кука", + /* SPM */ "Сен-П`ер і Міквэлон|Міквэлон", + /* NIU */ "Ніуе", + /* KNA */ "Сэнт-Кітс і Нэвіс|Нэвіс", + /* CYM */ "Кайманавы выспы", + /* BES */ "Бонайре, Сэнт-Эстатиус і Саба|Саба|Сэнт-Эстатиус", + /* MDV */ "Мальдывы", + /* SHN */ "Святой Алены, Ушэсця і Трыстан-да-Кунья|Ушэсце|Трыстан-да-Кунья", + /* MLT */ "Мальта", + /* GRD */ "Грэнада", + /* VIR */ "Амерыканскія Віргінскія астравы|Віргінскія выспы, ЗША", + /* MYT */ "Маёта", + /* SJM */ "Шпіцбэрген і Ян-Майен|Ян-Майен", + /* VCT */ "Сэнт-Вінсэнт і Грэнадыны|Грэнадыны", + /* HMD */ "Востраў Херд і выспы Макдональд|Макдональд", + /* BRB */ "Барбадас", + /* ATG */ "Антыгуа і Барбуда|Барбуда", + /* CUW */ "лікёр Кюрасо", + /* SYC */ "Сейшэльскія выспы", + /* PLW */ "Палаў", + /* MNP */ "Паўночныя Марыянскія астравы", + /* AND */ "Андора", + /* GUM */ "Гуам", + /* IMN */ "востраў Мэн", + /* LCA */ "Сэнт-Люсія", + /* FSM */ "Мікранезія|Фэдэратыўныя Штаты Мікранэзіі", + /* SGP */ "Сінгапур", + /* TON */ "Тангійская", + /* DMA */ "Дамініка", + /* BHR */ "Бахрэйн", + /* KIR */ "Кірыбаці", + /* TCA */ "Астравы Тэркс і Кайкас|Кайкас", + /* STP */ "Сан-Томе і Прынсэп|Прынсэп", + /* HKG */ "Ганконг", + /* MTQ */ "Марцініка", + /* FRO */ "Фарэрскія выспы", + /* GLP */ "Гвадэлупа", + /* COM */ "Каморскія выспы", + /* MUS */ "Маўрыкій", + /* REU */ "ўз`яднанне", + /* LUX */ "Люксембург", + /* WSM */ "Самоа", + /* SGS */ "Паўднёвая Джорджыя і Паўднёвыя Сандвічавы астравы|Паўднёвыя Сэндвічавыя выспы", + /* PYF */ "Французская Палінезія", + /* CPV */ "Каба-Вэрдэ", + /* TTO */ "Трынідад і Табага|Табага", + /* BRN */ "Бруней", + /* ATF */ "Французскія Паўднёвыя і антарктычных зямлі", + /* PRI */ "Пуэрта-Рыка", + /* CYP */ "Кіпр", + /* LBN */ "Ліван", + /* JAM */ "Ямайка", + /* GMB */ "Гамбія", + /* QAT */ "Катар", + /* FLK */ "Фалклендскія астравы", + /* VUT */ "Вануату", + /* MNE */ "Чарнагорыя", + /* BHS */ "Багамскія а-вы", + /* TLS */ "усходні Тымор", + /* SWZ */ "Свазіленд", + /* KWT */ "Кувейт", + /* FJI */ "Фіджы|выспы Фіджы", + /* NCL */ "Новая Каледонія", + /* SVN */ "Славенія", + /* ISR */ "Ізраіль", + /* PSE */ "палестынскія тэрыторыі", + /* SLV */ "Сальвадор", + /* BLZ */ "Беліз", + /* DJI */ "Джыбуці", + /* MKD */ "Македонія", + /* RWA */ "Руанда", + /* HTI */ "Гаіці", + /* BDI */ "Бурундзі", + /* GNQ */ "экватарыяльная Гвінея", + /* ALB */ "Албанія", + /* SLB */ "Саламонавы выспы", + /* ARM */ "Арменія", + /* LSO */ "Лесота", + /* BEL */ "Бельгія", + /* MDA */ "Малдова", + /* GNB */ "Гвінея-Бісау", + /* TWN */ "Тайвань", + /* BTN */ "Бутан", + /* CHE */ "Швейцарыя", + /* NLD */ "Нідэрланды", + /* DNK */ "Данія", + /* EST */ "Эстонія", + /* DOM */ "Дамініканская Рэспубліка", + /* SVK */ "Славакія", + /* CRI */ "Коста-Рыка", + /* BIH */ "Боснія і Герцагавіна", + /* HRV */ "Харватыя", + /* TGO */ "Таго", + /* LVA */ "Латвія", + /* LTU */ "Літва", + /* LKA */ "Шры Ланка", + /* GEO */ "Грузія", + /* IRL */ "Ірландыя", + /* SLE */ "Сьера-Леонэ", + /* PAN */ "панама", + /* CZE */ "Чэская Рэспубліка", + /* GUF */ "Французская Гвіяна", + /* ARE */ "Аб`яднаныя Арабскія Эміраты", + /* AUT */ "Аўстрыя", + /* AZE */ "Азербайджан", + /* SRB */ "Сербія", + /* JOR */ "Іарданія", + /* PRT */ "Партугалія", + /* HUN */ "Венгрыя", + /* KOR */ "Паўднёвая Карэя", + /* ISL */ "Ісландыя", + /* GTM */ "Гватэмала", + /* CUB */ "куба", + /* BGR */ "Балгарыя", + /* LBR */ "Ліберыя", + /* HND */ "Гандурас", + /* BEN */ "Бенін", + /* ERI */ "Эрытрэя", + /* MWI */ "Малаві", + /* PRK */ "Паўночная Карэя", + /* NIC */ "Нікарагуа", + /* GRC */ "Грэцыя", + /* TJK */ "Таджыкістан", + /* BGD */ "Бангладэш", + /* NPL */ "Непал", + /* TUN */ "Туніс", + /* SUR */ "Сурынам", + /* URY */ "Уругвай", + /* KHM */ "Камбоджа", + /* SYR */ "Сірыя", + /* SEN */ "Сенегал", + /* KGZ */ "Кіргізія", + /* BLR */ "Беларусь", + /* GUY */ "Гаяна", + /* LAO */ "Лаос", + /* ROU */ "Румынія", + /* GHA */ "Гана", + /* UGA */ "Уганда", + /* GBR */ "Злучанае Каралеўства|Шатландыя|Вялікабрытанія|Паўночная Ірландыя|Ірландыя, Паўночная", + /* GIN */ "Гвінея", + /* ECU */ "Эквадор", + /* ESH */ "Заходняя Сахара|сахрави", + /* GAB */ "Габон", + /* NZL */ "Новая Зеландыя", + /* BFA */ "Буркіна-Фасо", + /* PHL */ "Філіпіны", + /* ITA */ "Італія", + /* OMN */ "Аман", + /* POL */ "Польшча", + /* CIV */ "Бераг Слановай Косці", + /* NOR */ "Нарвегія", + /* MYS */ "Малайзія", + /* VNM */ "В`етнам", + /* FIN */ "Фінляндыя", + /* COG */ "Конга-Бразавіль", + /* DEU */ "Германія", + /* JPN */ "Японія", + /* ZWE */ "Зімбабвэ", + /* PRY */ "Парагвай", + /* IRQ */ "Ірак", + /* MAR */ "Марока", + /* UZB */ "Узбекістан", + /* SWE */ "Швецыя", + /* PNG */ "Папуа-Новая Гвінея", + /* CMR */ "Камерун", + /* TKM */ "Туркменістан", + /* ESP */ "Іспанія", + /* THA */ "Тайланд", + /* YEM */ "Емен", + /* FRA */ "Францыя", + /* ALA */ "Аландскія астравы", + /* KEN */ "Кенія", + /* BWA */ "Батсвана", + /* MDG */ "Мадагаскар", + /* UKR */ "Украіна", + /* SSD */ "паўднёвы Судан", + /* CAF */ "Цэнтральна-Афрыканская Рэспубліка", + /* SOM */ "Самалі", + /* AFG */ "Афганістан", + /* MMR */ "М`янма|Бірма", + /* ZMB */ "Замбія", + /* CHL */ "чылі", + /* TUR */ "Турцыя", + /* PAK */ "Пакістан", + /* MOZ */ "Мазамбік", + /* NAM */ "Намібія", + /* VEN */ "Венесуэла", + /* NGA */ "Нігерыя", + /* TZA */ "Танзанія", + /* EGY */ "Егіпет", + /* MRT */ "Маўрытанія", + /* BOL */ "Балівія", + /* ETH */ "Эфіопія", + /* COL */ "Калумбія", + /* ZAF */ "Паўднёвая Афрыка", + /* MLI */ "Малі", + /* AGO */ "Ангола", + /* NER */ "Нігер", + /* TCD */ "Чад", + /* PER */ "Перу", + /* MNG */ "Манголія", + /* IRN */ "Іран", + /* LBY */ "Лівія", + /* SDN */ "Судан", + /* IDN */ "Інданезія", + /* DIF */ "федэральная акруга", + /* TLA */ "Тлашкала", + /* MOR */ "Морелос", + /* AGU */ "Агуаскальентес", + /* MX-CL */ "Колима", + /* QUE */ "Керетаро", + /* HID */ "Ідальга", + /* MX-MX */ "штат Мексіка", + /* TAB */ "табаско", + /* NAY */ "Наярит", + /* GUA */ "Гуанахуато", + /* PUE */ "Пуэбла", + /* YUC */ "Юкатан", + /* ROO */ "Кінта-РГА", + /* SIN */ "Сіналоа", + /* CAM */ "Кампече", + /* MIC */ "Мічаакан", + /* SLP */ "Сан - Луіс-Потоси", + /* GRO */ "Герэра", + /* NLE */ "Нуэво-Леон", + /* BCN */ "ніжняя Каліфорнія", + /* VER */ "Веракрус", + /* CHP */ "Ч`япас", + /* BCS */ "Паўднёвая Ніжняя Каліфорнія", + /* ZAC */ "Сакатекас", + /* JAL */ "Халиско", + /* TAM */ "Тамаулипас", + /* OAX */ "Оахака", + /* DUR */ "Дуранго", + /* COA */ "Коахуила", + /* SON */ "Санора", + /* CHH */ "чыхуахуа", + /* GRL */ "Грэнландыя", + /* SAU */ "Саўдаўская Аравія", + /* COD */ "Конга-Кіншаса", + /* DZA */ "Алжыр", + /* KAZ */ "Казахстан", + /* ARG */ "Аргенціна", + /* IN-DD */ "Даман і дзі", + /* IN-DN */ "Дадра і Нагархавели", + /* IN-CH */ "Чандыгарх", + /* IN-AN */ "Андаманскія і Никобарские", + /* IN-LD */ "Лакшадвип", + /* IN-DL */ "Дэлі", + /* IN-ML */ "Мегхалая", + /* IN-NL */ "Нагаленд", + /* IN-MN */ "Маніпур", + /* IN-TR */ "Трипура", + /* IN-MZ */ "Мизорам", + /* IN-SK */ "Сикким", + /* IN-PB */ "Пенджаб", + /* IN-HR */ "Хар`яна", + /* IN-AR */ "Аруначал-Прадэш", + /* IN-AS */ "Асам", + /* IN-BR */ "Біхар", + /* IN-UT */ "Уттаракханд", + /* IN-GA */ "гоа", + /* IN-KL */ "Керала", + /* IN-TN */ "Тамілнад", + /* IN-HP */ "Хімачал-Прадэш", + /* IN-JK */ "Джаму і Кашмір", + /* IN-CT */ "Чхаттысгарха", + /* IN-JH */ "Джаркханд", + /* IN-KA */ "Карнатака", + /* IN-RJ */ "Раджастхан", + /* IN-OR */ "Арыса", + /* IN-GJ */ "Гуджарат", + /* IN-WB */ "Заходняя Бенгалія", + /* IN-MP */ "Мадх`я-Прадэш", + /* IN-TG */ "Телингана", + /* IN-AP */ "Андхра-Прадэш", + /* IN-MH */ "Махараштра", + /* IN-UP */ "Утар-Прадэш", + /* IN-PY */ "Пондичерри", + /* NSW */ "Новы Паўднёвы Уэльс", + /* ACT */ "Аўстралійская сталічная тэрыторыя", + /* JBT */ "Тэрыторыя Джэрвіс-Бі", + /* AU-NT */ "Паўночная тэрыторыя", + /* AU-SA */ "Паўднёвая Аўстралія", + /* TAS */ "Тасманія", + /* VIC */ "Вікторыя", + /* AU-WA */ "Заходняя Аўстралія", + /* QLD */ "Квінсленд", + /* BR-DF */ "федэральная акруга", + /* BR-SE */ "Сержипи", + /* BR-AL */ "Алагоас", + /* BR-RJ */ "Рыа-дэ-Жанейра", + /* BR-ES */ "Эсьпірыту-Санта", + /* BR-RN */ "Рыа-Грандэ-ду-Норте", + /* BR-PB */ "Параибы", + /* BR-SC */ "Санта-Катарына", + /* BR-PE */ "Пернамбуку", + /* BR-AP */ "Амапа", + /* BR-CE */ "Сеара", + /* BR-AC */ "Акры", + /* BR-PR */ "Парана", + /* BR-RR */ "Рорайма", + /* BR-RO */ "Рондония", + /* BR-SP */ "Сан-Паўлу", + /* BR-PI */ "Пиауи", + /* BR-TO */ "Токантинс", + /* BR-RS */ "Рыа-Грандэ-ду-Сул", + /* BR-MA */ "Мараньян", + /* BR-GO */ "Гаяс", + /* BR-MS */ "Мату-Гросу-ду-Сул", + /* BR-BA */ "Баия", + /* BR-MG */ "Мінас-Жерайс", + /* BR-MT */ "Мату-Гросу", + /* BR-PA */ "пара", + /* BR-AM */ "Амазонас", + /* US-DC */ "Федэральная акруга Калумбія", + /* US-RI */ "Род-Айлэнд", + /* US-DE */ "Дэлавэр", + /* US-CT */ "Канэктыкут", + /* US-NJ */ "Нью-Джэрсі", + /* US-NH */ "Нью-Гэмпшыр", + /* US-VT */ "Вермонт", + /* US-MA */ "Масачусэтс", + /* US-HI */ "Гаваі", + /* US-MD */ "Мэрыленд", + /* US-WV */ "Заходняя Вірджынія", + /* US-SC */ "Паўднёвая Караліна", + /* US-ME */ "мэн", + /* US-IN */ "Індыяна", + /* US-KY */ "Кентукі", + /* US-TN */ "Тэнэсі", + /* US-VA */ "Віргінія", + /* US-OH */ "Агаё", + /* US-PA */ "Пэнсыльванія", + /* US-MS */ "Місісіпі", + /* US-LA */ "Луізіяна", + /* US-AL */ "Алабама", + /* US-AR */ "Арканзас", + /* US-NC */ "Паўночная Караліна", + /* US-NY */ "Нью-Ёрк", + /* US-IA */ "Аёва", + /* US-IL */ "Ілінойс", + /* US-GA */ "Грузія", + /* US-WI */ "Вісконсін", + /* US-FL */ "Фларыда", + /* US-MO */ "Місуры", + /* US-OK */ "Аклахома", + /* US-ND */ "Паўночная Дакота", + /* US-WA */ "Вашынгтон", + /* US-SD */ "Паўднёвая Дакота", + /* US-NE */ "Небраска", + /* US-KS */ "Канзас", + /* US-ID */ "Айдаха", + /* US-UT */ "Юта", + /* US-MN */ "Мінесота", + /* US-MI */ "Мічыган", + /* US-WY */ "Ваёмінг", + /* US-OR */ "Арэгон", + /* US-CO */ "Каларада", + /* US-NV */ "Невада", + /* US-AZ */ "Арызона", + /* US-NM */ "Нью-Мексіка", + /* US-MT */ "Мантана", + /* US-CA */ "Каліфорнія", + /* US-TX */ "Тэхас", + /* US-AK */ "Аляска", + /* CA-BC */ "брытанская Калумбія", + /* CA-AB */ "Альберта", + /* CA-ON */ "Антарыё", + /* CA-QC */ "Квебек", + /* CA-SK */ "Саскачеван", + /* CA-MB */ "Манітобы", + /* CA-NL */ "ньюфаўндленд", + /* CA-NB */ "Нью-Брансўік", + /* CA-NS */ "Новая Шатландыя", + /* CA-PE */ "Востраў Прынца Эдуарда", + /* CA-YT */ "Юкон", + /* CA-NT */ "паўночна-заходнія тэрыторыі", + /* CA-NU */ "Нунавут", + /* IND */ "Індыя", + /* AUS */ "Аўстралія", + /* BRA */ "Бразілія", + /* USA */ "ЗША|Злучаныя Штаты Амерыкі|Амерыка", + /* MEX */ "Мексіка", + /* MOW */ "Масква", + /* SPE */ "Санкт-Пецярбург", + /* KGD */ "Калінінградская вобласць", + /* RU-IN */ "Рэспубліка Інгушэція", + /* RU-AD */ "Рэспубліка Адыгея", + /* RU-SE */ "Паўночная Асеція-Аланія", + /* RU-KB */ "Кабардзіна-Балкарыя Рэспубліка", + /* RU-KC */ "Карачаева-Чаркеская Рэспубліка", + /* RU-CE */ "чачэнская Рэспубліка", + /* RU-CU */ "Чувашская Рэспубліка", + /* IVA */ "Іванаўская вобласць", + /* LIP */ "Ліпецкая вобласць", + /* ORL */ "Арлоўская вобласць", + /* TUL */ "Тульская вобласць", + /* RU-BE */ "Белгародская вобласць", + /* VLA */ "Уладзімірская вобласьць", + /* KRS */ "Курская вобласць", + /* KLU */ "Калужская вобласць", + /* RU-TT */ "Тамбоўская вобласць", + /* BRY */ "Бранская вобласць", + /* YAR */ "Яраслаўская вобласць", + /* RYA */ "Разанская вобласьць", + /* AST */ "Астраханская вобласць", + /* MOS */ "маскоўская вобласць", + /* SMO */ "Смаленская вобласць", + /* RU-DA */ "Рэспубліка Дагестан", + /* VOR */ "Варонежская вобласць", + /* NGR */ "Наўгародская вобласць", + /* PSK */ "Пскоўская вобласць", + /* KOS */ "Кастрамская вобласць", + /* STA */ "Стаўрапольскі край", + /* KDA */ "Краснадарскі край", + /* RU-KL */ "Рэспубліка Калмыкія", + /* TVE */ "Цвярская вобласць", + /* LEN */ "Ленінградская вобласць", + /* ROS */ "Растоўская вобласць", + /* VGG */ "Валгаградская вобласць", + /* VLG */ "Валагодская вобласць", + /* MUR */ "Мурманская вобласць", + /* RU-KR */ "Рэспубліка Карэлія", + /* NEN */ "Ненецкая аўтаномная акруга", + /* RU-KO */ "Рэспубліка Комі", + /* ARK */ "Архангельская вобласць", + /* RU-MO */ "Рэспубліка Мардовія", + /* NIZ */ "Ніжагародская вобласць", + /* PNZ */ "Пензенская вобласць", + /* RU-KI */ "Кіраўская вобласць", + /* RU-ME */ "Рэспубліка Марый Эл", + /* ORE */ "Арэнбургская вобласць", + /* ULY */ "Ульянаўская вобласць", + /* RU-PM */ "Пермскі край", + /* RU-BA */ "Рэспубліка Башкартастан", + /* RU-UD */ "Удмурцкая Рэспубліка", + /* RU-TA */ "Рэспубліка Татарстан", + /* SAM */ "Самарская вобласць", + /* SAR */ "Саратаўская вобласць", + /* YAN */ "Ямала-Ненецкая", + /* RU-KM */ "Ханты-Мансійская", + /* SVE */ "Свярдлоўская вобласць", + /* TYU */ "Цюменская вобласць", + /* KGN */ "Курганская вобласць", + /* RU-CH */ "Чэлябінская вобласць", + /* RU-BU */ "Рэспубліка Бурація", + /* ZAB */ "Забайкальскі край", + /* IRK */ "Іркуцкая вобласць", + /* NVS */ "новасібірская вобласць", + /* TOM */ "Томская вобласць", + /* OMS */ "Омская вобласць", + /* RU-KK */ "Рэспубліка Хакасія", + /* KEM */ "Кемераўская вобласць", + /* RU-AL */ "Рэспубліка Алтай", + /* ALT */ "Алтайскі край", + /* RU-TY */ "Рэспубліка Тыва", + /* KYA */ "Краснаярскі край", + /* MAG */ "Магаданская вобласць", + /* CHU */ "Чукоцкая акруга", + /* KAM */ "Камчацкі край", + /* SAK */ "Сахалінская вобласць", + /* RU-PO */ "прыморскі край", + /* YEV */ "Яўрэйская аўтаномная вобласць", + /* KHA */ "Хабараўскі край", + /* AMU */ "Амурская вобласць", + /* RU-SA */ "Рэспубліка Саха|Якуція", + /* CAN */ "Канада", + /* RUS */ "Расія", + /* CN-SH */ "Шанхай", + /* CN-TJ */ "Цяньцзінь", + /* CN-BJ */ "Пекін", + /* CN-HI */ "Хайнань", + /* CN-NX */ "Нінся-Хуэйский", + /* CN-CQ */ "Чунцын", + /* CN-ZJ */ "Чжэцзян", + /* CN-JS */ "Цзянсу", + /* CN-FJ */ "Фуцзянь", + /* CN-AH */ "Аньхой", + /* CN-LN */ "Ляанін", + /* CN-SD */ "Шаньдун", + /* CN-SX */ "Шаньсі", + /* CN-JX */ "Цзянсу", + /* CN-HA */ "Хэнань", + /* CN-GZ */ "Гуйчжоу", + /* CN-GD */ "Гуандун", + /* CN-HB */ "Хубэй", + /* CN-JL */ "Цзілінь", + /* CN-HE */ "Хэбэй", + /* CN-SN */ "Шэньсі", + /* CN-NM */ "унутраная Манголія", + /* CN-HL */ "Хэйлунцзян", + /* CN-HN */ "Хунань", + /* CN-GX */ "Гуансі-Чжуанскі", + /* CN-SC */ "Сычуань", + /* CN-YN */ "Юньнань", + /* CN-XZ */ "Тыбецкі аўтаномны раён|Тыбет", + /* CN-GS */ "Ганьсу", + /* CN-QH */ "Цынхай", + /* CN-XJ */ "Сіньцзян-Уйгурскі", + /* CHN */ "Кітай", + /* UMI */ "ЗША Знешнія малыя выспы", + /* CPT */ "востраў Кліпертан", + /* ATA */ "Антарктыда", + /* AAA */ "Міжнародны|Свет|Зямля" +#else // MAPCODE_SUPPORT_LANGUAGE_BE + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_BE +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_BE_H__ diff --git a/mapcodelib/internal_territory_names_cn.h b/mapcodelib/internal_territory_names_cn.h new file mode 100644 index 0000000..bcf64d0 --- /dev/null +++ b/mapcodelib/internal_territory_names_cn.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_CN_H__ +#define __INTERNAL_TERRITORY_NAMES_CN_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_CN[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_CN // Chinese + /* VAT */ "梵蒂冈城|教廷", + /* MCO */ "摩纳哥", + /* GIB */ "直布罗陀", + /* TKL */ "托克劳", + /* CCK */ "科科斯群岛|基林群岛", + /* BLM */ "圣巴泰勒米", + /* NRU */ "瑙鲁", + /* TUV */ "图瓦卢", + /* MAC */ "澳门", + /* SXM */ "圣马丁", + /* MAF */ "圣马丁", + /* NFK */ "诺福克岛和菲利普岛|菲利普岛", + /* PCN */ "皮特凯恩群岛", + /* BVT */ "布韦岛", + /* BMU */ "百慕大", + /* IOT */ "英属印度洋领地", + /* SMR */ "圣马力诺", + /* GGY */ "根西岛", + /* AIA */ "安圭拉", + /* MSR */ "蒙特塞拉特", + /* JEY */ "泽西岛", + /* CXR */ "圣诞岛", + /* WLF */ "瓦利斯和富图纳", + /* VGB */ "英属维尔京群岛|维尔京群岛,英国", + /* LIE */ "列支敦士登", + /* ABW */ "阿鲁巴", + /* MHL */ "马绍尔群岛", + /* ASM */ "美属萨摩亚|萨摩亚,美国", + /* COK */ "库克岛", + /* SPM */ "圣皮埃尔和密克隆", + /* NIU */ "纽埃", + /* KNA */ "圣基茨和尼维斯|尼维斯", + /* CYM */ "开曼群岛", + /* BES */ "博内尔岛,圣尤斯图斯和萨巴|萨巴", + /* MDV */ "马尔代夫", + /* SHN */ "圣赫勒拿,阿森松和特里斯坦达库尼亚|阿森松|特里斯坦达库尼亚", + /* MLT */ "马耳他", + /* GRD */ "格林纳达", + /* VIR */ "美属维尔京群岛|美属维尔京群岛", + /* MYT */ "马约特", + /* SJM */ "斯瓦尔巴和杨梅", + /* VCT */ "圣文森特和格林纳丁斯|格林纳丁斯", + /* HMD */ "赫德岛和麦克唐纳群岛|麦克唐纳群岛", + /* BRB */ "巴巴多斯", + /* ATG */ "安提瓜和巴布达|巴布达", + /* CUW */ "库拉索", + /* SYC */ "塞舌尔", + /* PLW */ "帕劳", + /* MNP */ "北马里亚那群岛", + /* AND */ "安道尔", + /* GUM */ "关岛", + /* IMN */ "马恩岛", + /* LCA */ "圣卢西亚", + /* FSM */ "密克罗尼西亚|密克罗尼西亚联邦", + /* SGP */ "新加坡", + /* TON */ "汤加", + /* DMA */ "多米尼加", + /* BHR */ "巴林", + /* KIR */ "基里巴斯", + /* TCA */ "特克斯和凯科斯群岛|凯科斯群岛", + /* STP */ "圣多美和普林西比", + /* HKG */ "香港", + /* MTQ */ "马提尼克", + /* FRO */ "法罗群岛", + /* GLP */ "瓜德罗普", + /* COM */ "科摩罗", + /* MUS */ "毛里求斯", + /* REU */ "团圆", + /* LUX */ "卢森堡", + /* WSM */ "萨摩亚", + /* SGS */ "南乔治亚和南桑威奇群岛|南桑威奇群岛", + /* PYF */ "法属波利尼西亚", + /* CPV */ "佛得角", + /* TTO */ "特立尼达和多巴哥|多巴哥", + /* BRN */ "文莱", + /* ATF */ "法国南部和南极土地", + /* PRI */ "波多黎各", + /* CYP */ "塞浦路斯", + /* LBN */ "黎巴嫩", + /* JAM */ "牙买加", + /* GMB */ "冈比亚", + /* QAT */ "卡塔尔", + /* FLK */ "福克兰群岛", + /* VUT */ "瓦努阿图", + /* MNE */ "黑山", + /* BHS */ "巴哈马", + /* TLS */ "东帝汶", + /* SWZ */ "斯威士兰", + /* KWT */ "科威特", + /* FJI */ "斐济", + /* NCL */ "新喀里多尼亚", + /* SVN */ "斯洛文尼亚", + /* ISR */ "以色列", + /* PSE */ "巴勒斯坦领土", + /* SLV */ "萨尔瓦多", + /* BLZ */ "伯利兹", + /* DJI */ "吉布提", + /* MKD */ "马其顿", + /* RWA */ "卢旺达", + /* HTI */ "海地", + /* BDI */ "布隆迪", + /* GNQ */ "赤道几内亚", + /* ALB */ "阿尔巴尼亚", + /* SLB */ "所罗门群岛", + /* ARM */ "亚美尼亚", + /* LSO */ "莱索托", + /* BEL */ "比利时", + /* MDA */ "摩尔多瓦", + /* GNB */ "几内亚比绍", + /* TWN */ "台湾", + /* BTN */ "不丹", + /* CHE */ "瑞士", + /* NLD */ "荷兰", + /* DNK */ "丹麦", + /* EST */ "爱沙尼亚", + /* DOM */ "多明尼加共和国", + /* SVK */ "斯洛伐克", + /* CRI */ "哥斯达黎加", + /* BIH */ "波斯尼亚和黑塞哥维那", + /* HRV */ "克罗地亚", + /* TGO */ "多哥", + /* LVA */ "拉脱维亚", + /* LTU */ "立陶宛", + /* LKA */ "斯里兰卡", + /* GEO */ "格鲁吉亚", + /* IRL */ "爱尔兰", + /* SLE */ "塞拉利昂", + /* PAN */ "巴拿马", + /* CZE */ "捷克共和国", + /* GUF */ "法属圭亚那", + /* ARE */ "阿拉伯联合酋长国", + /* AUT */ "奥地利", + /* AZE */ "阿塞拜疆", + /* SRB */ "塞尔维亚", + /* JOR */ "约旦", + /* PRT */ "葡萄牙", + /* HUN */ "匈牙利", + /* KOR */ "韩国", + /* ISL */ "冰岛", + /* GTM */ "危地马拉", + /* CUB */ "古巴", + /* BGR */ "保加利亚", + /* LBR */ "利比里亚", + /* HND */ "洪都拉斯", + /* BEN */ "贝宁", + /* ERI */ "厄立特里亚", + /* MWI */ "马拉维", + /* PRK */ "北朝鲜", + /* NIC */ "尼加拉瓜", + /* GRC */ "希腊", + /* TJK */ "塔吉克斯坦", + /* BGD */ "孟加拉国", + /* NPL */ "尼泊尔", + /* TUN */ "突尼斯", + /* SUR */ "苏里南", + /* URY */ "乌拉圭", + /* KHM */ "柬埔寨", + /* SYR */ "叙利亚", + /* SEN */ "塞内加尔", + /* KGZ */ "吉尔吉斯斯坦", + /* BLR */ "白俄罗斯", + /* GUY */ "圭亚那", + /* LAO */ "老挝", + /* ROU */ "罗马尼亚", + /* GHA */ "加纳", + /* UGA */ "乌干达", + /* GBR */ "英国|苏格兰|英国|北爱尔兰|爱尔兰,北方", + /* GIN */ "几内亚", + /* ECU */ "厄瓜多尔", + /* ESH */ "西撒哈拉", + /* GAB */ "加蓬", + /* NZL */ "新西兰", + /* BFA */ "布基纳法索", + /* PHL */ "菲律宾", + /* ITA */ "意大利", + /* OMN */ "阿曼", + /* POL */ "波兰", + /* CIV */ "象牙海岸", + /* NOR */ "挪威", + /* MYS */ "马来西亚", + /* VNM */ "越南", + /* FIN */ "芬兰", + /* COG */ "刚果 - 布拉柴维尔", + /* DEU */ "德国", + /* JPN */ "日本", + /* ZWE */ "津巴布韦", + /* PRY */ "巴拉圭", + /* IRQ */ "伊拉克", + /* MAR */ "摩洛哥", + /* UZB */ "乌兹别克斯坦", + /* SWE */ "瑞典", + /* PNG */ "巴布亚新几内亚", + /* CMR */ "喀麦隆", + /* TKM */ "土库曼斯坦", + /* ESP */ "西班牙", + /* THA */ "泰国", + /* YEM */ "也门", + /* FRA */ "法国", + /* ALA */ "奥兰群岛", + /* KEN */ "肯尼亚", + /* BWA */ "博茨瓦纳", + /* MDG */ "马达加斯加", + /* UKR */ "乌克兰", + /* SSD */ "南苏丹", + /* CAF */ "中非共和国", + /* SOM */ "索马里", + /* AFG */ "阿富汗", + /* MMR */ "缅甸", + /* ZMB */ "赞比亚", + /* CHL */ "智利", + /* TUR */ "土耳其", + /* PAK */ "巴基斯坦", + /* MOZ */ "莫桑比克", + /* NAM */ "纳米比亚", + /* VEN */ "委内瑞拉", + /* NGA */ "尼日利亚", + /* TZA */ "坦桑尼亚", + /* EGY */ "埃及", + /* MRT */ "毛里塔尼亚", + /* BOL */ "玻利维亚", + /* ETH */ "埃塞俄比亚", + /* COL */ "哥伦比亚", + /* ZAF */ "南非", + /* MLI */ "马里", + /* AGO */ "安哥拉", + /* NER */ "尼日尔", + /* TCD */ "乍得", + /* PER */ "秘鲁", + /* MNG */ "蒙古", + /* IRN */ "伊朗", + /* LBY */ "利比亚", + /* SDN */ "苏丹", + /* IDN */ "印度尼西亚", + /* DIF */ "联邦区", + /* TLA */ "特拉斯卡拉", + /* MOR */ "莫雷洛斯", + /* AGU */ "阿瓜斯卡连特斯", + /* MX-CL */ "科利马", + /* QUE */ "克雷塔罗", + /* HID */ "伊达尔戈", + /* MX-MX */ "墨西哥州", + /* TAB */ "塔巴斯科", + /* NAY */ "纳亚里特", + /* GUA */ "瓜纳华托", + /* PUE */ "普埃布拉", + /* YUC */ "尤卡坦", + /* ROO */ "金塔纳罗奥", + /* SIN */ "锡那罗亚", + /* CAM */ "坎佩切", + /* MIC */ "米却肯", + /* SLP */ "圣路易斯波托西", + /* GRO */ "格雷罗", + /* NLE */ "新莱昂", + /* BCN */ "下加利福尼亚州", + /* VER */ "韦拉克鲁斯", + /* CHP */ "恰帕斯", + /* BCS */ "南下加利福尼亚州", + /* ZAC */ "萨卡特卡斯", + /* JAL */ "哈利斯科", + /* TAM */ "塔毛利帕斯州", + /* OAX */ "瓦哈卡", + /* DUR */ "杜兰戈", + /* COA */ "科阿韦拉", + /* SON */ "索诺拉", + /* CHH */ "奇瓦瓦", + /* GRL */ "格陵兰", + /* SAU */ "沙特阿拉伯", + /* COD */ "刚果 - 金沙萨", + /* DZA */ "阿尔及利亚", + /* KAZ */ "哈萨克斯坦", + /* ARG */ "阿根廷", + /* IN-DD */ "达曼-第乌", + /* IN-DN */ "达德拉-纳加尔哈维利", + /* IN-CH */ "昌迪加尔", + /* IN-AN */ "安达曼和尼科巴", + /* IN-LD */ "拉克沙群島", + /* IN-DL */ "德里", + /* IN-ML */ "梅加拉亚邦", + /* IN-NL */ "纳加兰", + /* IN-MN */ "曼尼普尔", + /* IN-TR */ "特里普拉邦", + /* IN-MZ */ "米佐拉姆邦", + /* IN-SK */ "锡金", + /* IN-PB */ "旁遮普", + /* IN-HR */ "哈里亚纳", + /* IN-AR */ "阿鲁纳恰尔邦", + /* IN-AS */ "阿萨姆邦", + /* IN-BR */ "比哈尔邦", + /* IN-UT */ "北阿坎德邦", + /* IN-GA */ "果阿", + /* IN-KL */ "喀拉拉", + /* IN-TN */ "泰米尔纳德邦", + /* IN-HP */ "喜马偕尔邦", + /* IN-JK */ "查谟和克什米尔", + /* IN-CT */ "恰蒂斯加尔邦", + /* IN-JH */ "贾坎德", + /* IN-KA */ "卡纳塔克", + /* IN-RJ */ "拉贾斯坦邦", + /* IN-OR */ "奥里萨", + /* IN-GJ */ "古吉拉特", + /* IN-WB */ "西孟加拉邦", + /* IN-MP */ "中央邦", + /* IN-TG */ "特伦甘纳邦", + /* IN-AP */ "安德拉邦", + /* IN-MH */ "马哈拉施特拉", + /* IN-UP */ "北方邦", + /* IN-PY */ "本地治里", + /* NSW */ "新南威尔士州", + /* ACT */ "澳大利亚首都特区", + /* JBT */ "杰维斯湾领地", + /* AU-NT */ "北领地", + /* AU-SA */ "南澳大利亚", + /* TAS */ "塔斯马尼亚", + /* VIC */ "维多利亚", + /* AU-WA */ "西澳大利亚", + /* QLD */ "昆士兰", + /* BR-DF */ "联邦区", + /* BR-SE */ "塞尔希培州", + /* BR-AL */ "阿拉戈斯州", + /* BR-RJ */ "里约热内卢州", + /* BR-ES */ "圣埃斯皮里图州", + /* BR-RN */ "北里奥格兰德州", + /* BR-PB */ "帕拉伊巴州", + /* BR-SC */ "圣卡塔琳娜州", + /* BR-PE */ "伯南布哥州", + /* BR-AP */ "阿马帕州", + /* BR-CE */ "塞阿拉州", + /* BR-AC */ "阿克里州", + /* BR-PR */ "巴拉那州", + /* BR-RR */ "罗赖马州", + /* BR-RO */ "朗多尼亚州", + /* BR-SP */ "圣保罗州", + /* BR-PI */ "皮奥伊州", + /* BR-TO */ "托坎廷斯州", + /* BR-RS */ "南里奥格兰德州", + /* BR-MA */ "马拉尼昂州", + /* BR-GO */ "戈亚斯州", + /* BR-MS */ "南马托格罗索州", + /* BR-BA */ "巴伊亚州", + /* BR-MG */ "米纳斯吉拉斯州", + /* BR-MT */ "马托格罗索州", + /* BR-PA */ "帕拉州", + /* BR-AM */ "亚马孙州", + /* US-DC */ "華盛頓哥倫比亞特區", + /* US-RI */ "罗得岛州", + /* US-DE */ "特拉华州", + /* US-CT */ "康涅狄格州", + /* US-NJ */ "新泽西州", + /* US-NH */ "新罕布什尔州", + /* US-VT */ "佛蒙特州", + /* US-MA */ "马萨诸塞州", + /* US-HI */ "夏威夷州", + /* US-MD */ "马里兰州", + /* US-WV */ "西弗吉尼亚州", + /* US-SC */ "南卡罗来纳州", + /* US-ME */ "缅因州", + /* US-IN */ "印第安纳州", + /* US-KY */ "肯塔基州", + /* US-TN */ "田纳西州", + /* US-VA */ "弗吉尼亚州", + /* US-OH */ "俄亥俄州", + /* US-PA */ "宾夕法尼亚州", + /* US-MS */ "密西西比州", + /* US-LA */ "路易斯安那州", + /* US-AL */ "亚拉巴马州", + /* US-AR */ "阿肯色州", + /* US-NC */ "北卡罗来纳州", + /* US-NY */ "纽约州", + /* US-IA */ "愛荷華州", + /* US-IL */ "伊利诺伊州", + /* US-GA */ "格鲁吉亚", + /* US-WI */ "威斯康星州", + /* US-FL */ "佛罗里达州", + /* US-MO */ "密苏里州", + /* US-OK */ "奧克拉荷馬州", + /* US-ND */ "北达科他州", + /* US-WA */ "华盛顿州", + /* US-SD */ "南达科他州", + /* US-NE */ "内布拉斯加州", + /* US-KS */ "堪萨斯州", + /* US-ID */ "爱达荷州", + /* US-UT */ "犹他州", + /* US-MN */ "明尼苏达州", + /* US-MI */ "密西根州", + /* US-WY */ "怀俄明州", + /* US-OR */ "俄勒冈州", + /* US-CO */ "科罗拉多州", + /* US-NV */ "内华达州", + /* US-AZ */ "亚利桑那州", + /* US-NM */ "新墨西哥州", + /* US-MT */ "蒙大拿州", + /* US-CA */ "加利福尼亚州", + /* US-TX */ "得克萨斯州", + /* US-AK */ "阿拉斯加州", + /* CA-BC */ "不列颠哥伦比亚省", + /* CA-AB */ "艾伯塔省", + /* CA-ON */ "安大略", + /* CA-QC */ "魁北克", + /* CA-SK */ "萨斯喀彻温", + /* CA-MB */ "马尼托巴", + /* CA-NL */ "纽芬兰", + /* CA-NB */ "新不伦瑞克", + /* CA-NS */ "新斯科舍省", + /* CA-PE */ "爱德华王子岛", + /* CA-YT */ "育空", + /* CA-NT */ "西北地区", + /* CA-NU */ "努纳武特", + /* IND */ "印度", + /* AUS */ "澳大利亚", + /* BRA */ "巴西", + /* USA */ "美国|美利坚合众国", + /* MEX */ "墨西哥", + /* MOW */ "莫斯科州", + /* SPE */ "圣彼得堡", + /* KGD */ "加里宁格勒州", + /* RU-IN */ "印古什共和国", + /* RU-AD */ "阿迪格共和国", + /* RU-SE */ "北奥塞梯 - 阿拉尼亚共和国", + /* RU-KB */ "卡巴尔达 - 巴尔卡共和国", + /* RU-KC */ "卡拉恰伊-切尔克斯共和国", + /* RU-CE */ "车臣共和国", + /* RU-CU */ "楚瓦什共和国", + /* IVA */ "伊万诺沃州", + /* LIP */ "利佩茨克州", + /* ORL */ "奥廖尔州", + /* TUL */ "图拉州", + /* RU-BE */ "别尔哥罗德州", + /* VLA */ "弗拉基米尔州", + /* KRS */ "库尔斯克州", + /* KLU */ "卡卢加州", + /* RU-TT */ "坦波夫州", + /* BRY */ "布良斯克州", + /* YAR */ "雅罗斯拉夫尔州", + /* RYA */ "梁赞州", + /* AST */ "阿斯特拉罕州", + /* MOS */ "莫斯科州", + /* SMO */ "斯摩棱斯克州", + /* RU-DA */ "达吉斯坦共和国", + /* VOR */ "沃罗涅日州", + /* NGR */ "诺夫哥罗德州", + /* PSK */ "普斯科夫州", + /* KOS */ "科斯特罗马州", + /* STA */ "斯塔夫罗波尔边疆区", + /* KDA */ "克拉斯诺达尔边疆区", + /* RU-KL */ "卡尔梅克共和国", + /* TVE */ "特维尔州", + /* LEN */ "列宁格勒州", + /* ROS */ "罗斯托夫州", + /* VGG */ "伏尔加格勒州", + /* VLG */ "沃洛格达州", + /* MUR */ "摩尔曼斯克州", + /* RU-KR */ "卡累利阿共和国", + /* NEN */ "涅涅茨自治区", + /* RU-KO */ "科米共和国", + /* ARK */ "阿尔汉格尔斯克州", + /* RU-MO */ "莫尔多维亚共和国", + /* NIZ */ "下诺夫哥罗德州", + /* PNZ */ "奔萨州", + /* RU-KI */ "基洛夫州", + /* RU-ME */ "马里埃尔共和国", + /* ORE */ "奥伦堡州", + /* ULY */ "乌里扬诺夫斯克州", + /* RU-PM */ "彼尔姆边疆区", + /* RU-BA */ "巴什科尔托斯坦共和国", + /* RU-UD */ "乌德穆尔特共和国", + /* RU-TA */ "鞑靼斯坦共和国", + /* SAM */ "萨马拉州", + /* SAR */ "萨拉托夫州", + /* YAN */ "亚马尔-涅涅茨自治区", + /* RU-KM */ "汉特曼西", + /* SVE */ "斯維爾德洛夫斯克州", + /* TYU */ "秋明州", + /* KGN */ "库尔干州", + /* RU-CH */ "车里雅宾斯克州", + /* RU-BU */ "布里亚特共和国", + /* ZAB */ "外貝加爾邊疆區", + /* IRK */ "伊尔库茨克州", + /* NVS */ "新西伯利亚州", + /* TOM */ "托木斯克州", + /* OMS */ "鄂木斯克州", + /* RU-KK */ "哈卡斯共和国", + /* KEM */ "科麦罗沃州", + /* RU-AL */ "阿尔泰共和国", + /* ALT */ "阿尔泰边疆区", + /* RU-TY */ "图瓦共和国", + /* KYA */ "克拉斯诺亚尔斯克边疆区", + /* MAG */ "马加丹州", + /* CHU */ "楚科奇自治区", + /* KAM */ "堪察加边疆区", + /* SAK */ "萨哈林州", + /* RU-PO */ "滨海边疆区", + /* YEV */ "犹太自治州", + /* KHA */ "哈巴罗夫斯克边疆区", + /* AMU */ "阿穆尔州", + /* RU-SA */ "萨哈共和国|雅库特共和国", + /* CAN */ "加拿大", + /* RUS */ "俄国", + /* CN-SH */ "上海", + /* CN-TJ */ "天津", + /* CN-BJ */ "北京", + /* CN-HI */ "海南", + /* CN-NX */ "宁夏回族", + /* CN-CQ */ "重庆", + /* CN-ZJ */ "浙江", + /* CN-JS */ "江苏", + /* CN-FJ */ "福建", + /* CN-AH */ "安徽", + /* CN-LN */ "辽宁", + /* CN-SD */ "山东", + /* CN-SX */ "山西", + /* CN-JX */ "江西", + /* CN-HA */ "河南", + /* CN-GZ */ "贵州", + /* CN-GD */ "粤", + /* CN-HB */ "湖北", + /* CN-JL */ "吉林", + /* CN-HE */ "河北", + /* CN-SN */ "陕西", + /* CN-NM */ "内蒙古", + /* CN-HL */ "黑龙江", + /* CN-HN */ "湖南", + /* CN-GX */ "广西壮族", + /* CN-SC */ "四川", + /* CN-YN */ "云南", + /* CN-XZ */ "西藏", + /* CN-GS */ "甘肃", + /* CN-QH */ "青海", + /* CN-XJ */ "新疆维吾尔族", + /* CHN */ "中国", + /* UMI */ "美國本土外小島嶼", + /* CPT */ "克利珀顿岛", + /* ATA */ "南极洲", + /* AAA */ "国际|地球|世界" +#else // MAPCODE_SUPPORT_LANGUAGE_CN + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_CN +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_CN_H__ diff --git a/mapcodelib/internal_territory_names_cs.h b/mapcodelib/internal_territory_names_cs.h new file mode 100644 index 0000000..67ad194 --- /dev/null +++ b/mapcodelib/internal_territory_names_cs.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_CS_H__ +#define __INTERNAL_TERRITORY_NAMES_CS_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_CS[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_CS // Czech + /* VAT */ "Vatikán|Svatý stolec", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Kokosové ostrovy|Keeling Islands", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk a Philip Island|Philip Island", + /* PCN */ "Pitcairn", + /* BVT */ "Bouvetův ostrov", + /* BMU */ "Bermudy", + /* IOT */ "Britské indickooceánské území", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Vánoční ostrov", + /* WLF */ "Wallis a Futuna|Futuně", + /* VGB */ "Britské Panenské ostrovy|Britské Panenské ostrovy", + /* LIE */ "Lichtenštejnsko", + /* ABW */ "Aruba", + /* MHL */ "Marshallovy ostrovy", + /* ASM */ "Americká Samoa|Samoa, Američan", + /* COK */ "Cookovy ostrovy", + /* SPM */ "Saint-Pierre a Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Svatý Kryštof a Nevis|Nevis", + /* CYM */ "Kajmanské ostrovy", + /* BES */ "Bonaire, St Eustatuis a Saba|Saba|St Eustatius", + /* MDV */ "Maledivy", + /* SHN */ "Svatá Helena, Ascension a Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Americké Panenské ostrovy|Panenské ostrovy, USA", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard a Jan Mayen|Jan Mayen", + /* VCT */ "Svatý Vincenc a Grenadiny|Grenadiny", + /* HMD */ "Heardův ostrov a McDonaldovy ostrovy|McDonald ostrovy", + /* BRB */ "Barbados", + /* ATG */ "Antigua a Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seychely", + /* PLW */ "Palau", + /* MNP */ "Severní Mariany", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Isle of Man", + /* LCA */ "svatá Lucie", + /* FSM */ "Mikronésie|Federativní státy Mikronésie", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominika", + /* BHR */ "Bahrajn", + /* KIR */ "Kiribati", + /* TCA */ "Turks a Caicos|Caicos", + /* STP */ "Sao Tome a Principe|Principe", + /* HKG */ "Hongkong", + /* MTQ */ "Martinik", + /* FRO */ "Faerské ostrovy", + /* GLP */ "Guadeloupe", + /* COM */ "Komory", + /* MUS */ "Mauritius", + /* REU */ "Shledání", + /* LUX */ "Lucembursko", + /* WSM */ "Samoa", + /* SGS */ "Jižní Georgie a Jižní Sandwichovy ostrovy|Jižní Sandwichovy ostrovy", + /* PYF */ "Francouzská Polynésie", + /* CPV */ "Kapverdy", + /* TTO */ "Trinidad a Tobago|Tobago", + /* BRN */ "Brunej", + /* ATF */ "Francouzská jižní a antarktická území", + /* PRI */ "Portoriko", + /* CYP */ "Kypr", + /* LBN */ "Libanon", + /* JAM */ "Jamaica", + /* GMB */ "Gambie", + /* QAT */ "Katar", + /* FLK */ "Falklandy", + /* VUT */ "Vanuatu", + /* MNE */ "Černá Hora", + /* BHS */ "Bahamské ostrovy", + /* TLS */ "Východní Timor", + /* SWZ */ "Svazijsko", + /* KWT */ "Kuvajt", + /* FJI */ "Fidži ostrovy", + /* NCL */ "Nová Kaledonie", + /* SVN */ "Slovinsko", + /* ISR */ "Izrael", + /* PSE */ "Palestinská území", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Džibutsko", + /* MKD */ "Makedonie", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Rovníková Guinea", + /* ALB */ "Albánie", + /* SLB */ "Šalamounovy ostrovy", + /* ARM */ "Arménie", + /* LSO */ "Lesotho", + /* BEL */ "Belgie", + /* MDA */ "Moldavsko", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Tchaj-wan", + /* BTN */ "Bhůtán", + /* CHE */ "Švýcarsko", + /* NLD */ "Nizozemí", + /* DNK */ "Dánsko", + /* EST */ "Estonsko", + /* DOM */ "Dominikánská republika", + /* SVK */ "Slovensko", + /* CRI */ "Kostarika", + /* BIH */ "Bosna a Hercegovina", + /* HRV */ "Chorvatsko", + /* TGO */ "Togo", + /* LVA */ "Lotyšsko", + /* LTU */ "Litva", + /* LKA */ "Srí Lanka", + /* GEO */ "Georgia", + /* IRL */ "Irsko", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Česká republika", + /* GUF */ "Francouzsky Guyana", + /* ARE */ "Spojené arabské emiráty", + /* AUT */ "Rakousko", + /* AZE */ "Ázerbajdžán", + /* SRB */ "Srbsko", + /* JOR */ "Jordán", + /* PRT */ "Portugalsko", + /* HUN */ "Maďarsko", + /* KOR */ "Jižní Korea", + /* ISL */ "Island", + /* GTM */ "Guatemala", + /* CUB */ "Kuba", + /* BGR */ "Bulharsko", + /* LBR */ "Libérie", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Severní Korea", + /* NIC */ "Nikaragua", + /* GRC */ "Řecko", + /* TJK */ "Tádžikistán", + /* BGD */ "Bangladéš", + /* NPL */ "Nepál", + /* TUN */ "Tunisko", + /* SUR */ "Surinam", + /* URY */ "Uruguay", + /* KHM */ "Kambodža", + /* SYR */ "Sýrie", + /* SEN */ "Senegal", + /* KGZ */ "Kyrgyzstán", + /* BLR */ "Bělorusko", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Rumunsko", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Spojené království|Skotsko|Velká Británie|Severní Irsko|Ireland, Northern", + /* GIN */ "Guinea", + /* ECU */ "Ekvádor", + /* ESH */ "Západní Sahara|Sahrawi", + /* GAB */ "Gabon", + /* NZL */ "Nový Zéland", + /* BFA */ "Burkina Faso", + /* PHL */ "Filipíny", + /* ITA */ "Itálie", + /* OMN */ "Omán", + /* POL */ "Polsko", + /* CIV */ "Pobřeží slonoviny", + /* NOR */ "Norsko", + /* MYS */ "Malajsie", + /* VNM */ "Vietnam", + /* FIN */ "Finsko", + /* COG */ "Kongo-Brazzaville", + /* DEU */ "Německo", + /* JPN */ "Japonsko", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irák", + /* MAR */ "Maroko", + /* UZB */ "Uzbekistán", + /* SWE */ "Švédsko", + /* PNG */ "Papua-Nová Guinea", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistán", + /* ESP */ "Španělsko", + /* THA */ "Thailand", + /* YEM */ "Jemen", + /* FRA */ "Francie", + /* ALA */ "Alandské ostrovy", + /* KEN */ "Keňa", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukrajina", + /* SSD */ "Jižní Súdán", + /* CAF */ "Středoafrická republika", + /* SOM */ "Somálsko", + /* AFG */ "Afghánistán", + /* MMR */ "Myanmar|Barma", + /* ZMB */ "Zambie", + /* CHL */ "Chile", + /* TUR */ "Turecko", + /* PAK */ "Pákistán", + /* MOZ */ "Mosambik", + /* NAM */ "Namibie", + /* VEN */ "Venezuela", + /* NGA */ "Nigérie", + /* TZA */ "Tanzanie", + /* EGY */ "Egypt", + /* MRT */ "Mauritánie", + /* BOL */ "Bolívie", + /* ETH */ "Etiopie", + /* COL */ "Kolumbie", + /* ZAF */ "Jižní Afrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Chad", + /* PER */ "Peru", + /* MNG */ "Mongolsko", + /* IRN */ "Írán", + /* LBY */ "Libye", + /* SDN */ "Súdán", + /* IDN */ "Indonésie", + /* DIF */ "Federální Okruh", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grónsko", + /* SAU */ "Saudská arábie", + /* COD */ "Kongo-Kinshasa", + /* DZA */ "Alžírsko", + /* KAZ */ "Kazachstán", + /* ARG */ "Argentina", + /* IN-DD */ "Daman a Diu", + /* IN-DN */ "Dadra a Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman a Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Paňdžáb", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunáčalpradéš", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himáčalpradéš", + /* IN-JK */ "Džammú a Kašmír", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Urísa|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "West Bengal", + /* IN-MP */ "Madhjapradéš", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "Nový Jížní Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territory", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "Jižní Austrálie", + /* TAS */ "Tasmánie", + /* VIC */ "Victoria", + /* AU-WA */ "Západní Austrálie", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "para", + /* BR-AM */ "Amazonas", + /* US-DC */ "Washington, D.C.", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Havaj", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "Jižní Karolína", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Severní Karolína", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Severní Dakota", + /* US-WA */ "Washington", + /* US-SD */ "Jižní Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Nové Mexiko", + /* US-MT */ "Montana", + /* US-CA */ "Kalifornie", + /* US-TX */ "Texas", + /* US-AK */ "Aljaška", + /* CA-BC */ "Britská Kolumbie", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Novofundlanďan", + /* CA-NB */ "Nový Brunswick", + /* CA-NS */ "Nové Skotsko", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Severozápadní teritoria", + /* CA-NU */ "Nunavut", + /* IND */ "Indie", + /* AUS */ "Austrálie", + /* BRA */ "Brazílie", + /* USA */ "USA|United States of America|America", + /* MEX */ "Mexiko", + /* MOW */ "Moskva", + /* SPE */ "Petrohrad", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingušsko Republic", + /* RU-AD */ "Adygea Republic", + /* RU-SE */ "Severní Osetie-Alanie Republic", + /* RU-KB */ "Kabardino-Balkar Republic", + /* RU-KC */ "Karachay-Cherkess Republic", + /* RU-CE */ "čečenská republika", + /* RU-CU */ "Chuvash Republic", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipecká oblast", + /* ORL */ "Orelská oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Brjanská oblast", + /* YAR */ "Jaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrachaň Oblast", + /* MOS */ "Moskva Oblast", + /* SMO */ "Smolenská oblast", + /* RU-DA */ "Dagestan Republic", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia Republic", + /* TVE */ "Tverská oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgogradská oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Karélie Republic", + /* NEN */ "Něnecký autonomní okruh", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovie Republic", + /* NIZ */ "Nižněnovgorodská oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El republika", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Baškortostán Republic", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Tatarstán republiky", + /* SAM */ "Samarská oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Jamalskon Nenets", + /* RU-KM */ "Chanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Čeljabinsk Oblast", + /* RU-BU */ "Buryatia Republic", + /* ZAB */ "Zabajkalský kraj", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Chakaské republice", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Altai Republic", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republic", + /* KYA */ "Krasnojarský kraj", + /* MAG */ "Magadan Oblast", + /* CHU */ "Čukotka Okrug", + /* KAM */ "Kamčatský kraj", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Židovská autonomní oblast", + /* KHA */ "Chabarovský kraj", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Sacha|Jakutsko republika", + /* CAN */ "Kanada", + /* RUS */ "Rusko", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Peking", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Vnitřní Mongolsko", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "Čína", + /* UMI */ "Menší americké odlehlé ostrovy", + /* CPT */ "Clipperton Island", + /* ATA */ "Antarctica", + /* AAA */ "Svět|Mezinárodní|Země" +#else // MAPCODE_SUPPORT_LANGUAGE_CS + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_CS +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_CS_H__ diff --git a/mapcodelib/internal_territory_names_da.h b/mapcodelib/internal_territory_names_da.h new file mode 100644 index 0000000..071251e --- /dev/null +++ b/mapcodelib/internal_territory_names_da.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_DA_H__ +#define __INTERNAL_TERRITORY_NAMES_DA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_DA[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_DA // Danish + /* VAT */ "Vatikanstaten|Pavestolen", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Cocosøerne|Keeling Islands", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk og Philip Island|Philip Island", + /* PCN */ "Pitcairn", + /* BVT */ "Bouvetø", + /* BMU */ "Bermuda", + /* IOT */ "British Indian Ocean Territory", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Juleøen", + /* WLF */ "Wallis-og Futuna|Futuna", + /* VGB */ "British Virgin Islands|Virgin Islands, British", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Marshalløerne", + /* ASM */ "Amerikansk Samoa|Samoa, Amerikansk", + /* COK */ "Cookøerne", + /* SPM */ "Saint Pierre og Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts og Nevis|Nevis", + /* CYM */ "Cayman Islands", + /* BES */ "Bonaire, Saint Eustasuis og Saba|Saba|St Eustasius", + /* MDV */ "Maldiverne", + /* SHN */ "Saint Helena, Ascension og Tristan da Cunha|Kristi Himmelfart|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "US Virgin Islands|Virgin Islands, USA", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard and Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent og Grenadinerne|Grenadinerne", + /* HMD */ "Heard og McDonald-øerne|McDonald Islands", + /* BRB */ "Barbados", + /* ATG */ "Antigua og Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seychellerne", + /* PLW */ "Palau", + /* MNP */ "Nordmarianerne", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Isle of Man", + /* LCA */ "Saint Lucia", + /* FSM */ "Micronesia|Federated States of Micronesia", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks-og Caicosøerne|Caicosøerne", + /* STP */ "Sao Tome og Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Færøerne", + /* GLP */ "Guadeloupe", + /* COM */ "Comorerne", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Luxembourg", + /* WSM */ "Samoa", + /* SGS */ "South Georgia og De Sydlige Sandwichøer|Sydsandwichøerne", + /* PYF */ "Fransk Polynesien", + /* CPV */ "Kap Verde", + /* TTO */ "Trinidad og Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Franske sydlige og antarktiske Lands", + /* PRI */ "Puerto Rico", + /* CYP */ "Cypern", + /* LBN */ "Libanon", + /* JAM */ "Jamaica", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Falklandsøerne", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Østtimor", + /* SWZ */ "Swaziland", + /* KWT */ "Kuwait", + /* FJI */ "Fijiøerne", + /* NCL */ "Ny Kaledonien", + /* SVN */ "Slovenien", + /* ISR */ "Israel", + /* PSE */ "Palestinian territory", + /* SLV */ "Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Makedonien", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Ækvatorial Guinea", + /* ALB */ "Albanien", + /* SLB */ "Salomonøerne", + /* ARM */ "Armenien", + /* LSO */ "Lesotho", + /* BEL */ "Belgien", + /* MDA */ "Moldova", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Schweiz", + /* NLD */ "Holland", + /* DNK */ "Danmark", + /* EST */ "Estland", + /* DOM */ "Den Dominikanske Republik", + /* SVK */ "Slovakiet", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnien og Hercegovina", + /* HRV */ "Kroatien", + /* TGO */ "Togo", + /* LVA */ "Letland", + /* LTU */ "Litauen", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgia", + /* IRL */ "Irland", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Tjekkiet", + /* GUF */ "Fransk Guyana", + /* ARE */ "Forenede Arabiske Emirater", + /* AUT */ "Østrig", + /* AZE */ "Aserbajdsjan", + /* SRB */ "Serbia", + /* JOR */ "Jordan", + /* PRT */ "Portugal", + /* HUN */ "Ungarn", + /* KOR */ "Sydkorea", + /* ISL */ "Island", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgarien", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Nordkorea", + /* NIC */ "Nicaragua", + /* GRC */ "Grækenland", + /* TJK */ "Tadsjikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunesien", + /* SUR */ "Surinam", + /* URY */ "Uruguay", + /* KHM */ "Cambodia", + /* SYR */ "Syrien", + /* SEN */ "Senegal", + /* KGZ */ "Kirgisistan", + /* BLR */ "Belarus", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Rumænien", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Storbritannien", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Western Sahara|Sahrawi", + /* GAB */ "Gabon", + /* NZL */ "New Zealand", + /* BFA */ "Burkina Faso", + /* PHL */ "Filippinerne", + /* ITA */ "Italien", + /* OMN */ "Oman", + /* POL */ "Polen", + /* CIV */ "Elfenbenskysten", + /* NOR */ "Norge", + /* MYS */ "Malaysia", + /* VNM */ "Vietnam", + /* FIN */ "Finland", + /* COG */ "Congo-Brazzaville", + /* DEU */ "Tyskland", + /* JPN */ "Japan", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Iraq", + /* MAR */ "Marokko", + /* UZB */ "Usbekistan", + /* SWE */ "Sverige", + /* PNG */ "Papua Ny Guinea", + /* CMR */ "Cameroon", + /* TKM */ "Turkmenistan", + /* ESP */ "Spanien", + /* THA */ "Thailand", + /* YEM */ "Yemen", + /* FRA */ "France", + /* ALA */ "Ålandsøerne", + /* KEN */ "Kenya", + /* BWA */ "Botswana", + /* MDG */ "Madagascar", + /* UKR */ "Ukraine", + /* SSD */ "Sydsudan", + /* CAF */ "Centralafrikanske Republik", + /* SOM */ "Somalia", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Burma", + /* ZMB */ "Zambia", + /* CHL */ "Chile", + /* TUR */ "Tyrkiet", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambique", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Egypten", + /* MRT */ "Mauretanien", + /* BOL */ "Bolivia", + /* ETH */ "Etiopien", + /* COL */ "Colombia", + /* ZAF */ "Sydafrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Chad", + /* PER */ "Peru", + /* MNG */ "Mongoliet", + /* IRN */ "Iran", + /* LBY */ "Libyen", + /* SDN */ "Sudan", + /* IDN */ "Indonesien", + /* DIF */ "Federal District", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grønland", + /* SAU */ "Saudi Arabien", + /* COD */ "Congo-Kinshasa", + /* DZA */ "Algeriet", + /* KAZ */ "Kasakhstan", + /* ARG */ "Argentina", + /* IN-DD */ "Daman og Diu", + /* IN-DN */ "Dadra og Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman og Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu og Kashmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Vestbengalen", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territory", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "South Australia", + /* TAS */ "Tasmanien", + /* VIC */ "Victoria", + /* AU-WA */ "Western Australia", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "South Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "North Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "California", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "Indien", + /* AUS */ "Australien", + /* BRA */ "Brasilien", + /* USA */ "USA|USA|Amerika", + /* MEX */ "Mexico", + /* MOW */ "Moskva", + /* SPE */ "Sankt Petersborg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingusjetien Republik", + /* RU-AD */ "Adygea Republik", + /* RU-SE */ "Nordossetien-Alania Republik", + /* RU-KB */ "Kabardino-Balkar Republic", + /* RU-KC */ "Karachay-Cherkess Republic", + /* RU-CE */ "Tjetjenske republik", + /* RU-CU */ "Chuvash Republic", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrakhan Oblast", + /* MOS */ "Moskva Oblast", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "Dagestan Republik", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia Republik", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Karelia Republik", + /* NEN */ "Nenets Autonome Okrug", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovien Republik", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Republik", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan Republik", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Tatarstan Republik", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Buryatia Republik", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Khakassia Republik", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Altai Republik", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republik", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Tjukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Jødisk selvstyrende Oblast", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Sakha Republik|Yakutia Republic", + /* CAN */ "Canada", + /* RUS */ "Rusland", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Beijing", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "Kina", + /* UMI */ "United States Minor Outlying Islands", + /* CPT */ "Clipperton Island", + /* ATA */ "Antarctica", + /* AAA */ "International|Verdenen|Jord" +#else // MAPCODE_SUPPORT_LANGUAGE_DA + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_DA +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_DA_H__ diff --git a/mapcodelib/internal_territory_names_de.h b/mapcodelib/internal_territory_names_de.h new file mode 100644 index 0000000..d26e017 --- /dev/null +++ b/mapcodelib/internal_territory_names_de.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_DE_H__ +#define __INTERNAL_TERRITORY_NAMES_DE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_DE[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_DE // German + /* VAT */ "Vatikanstadt|Heiliger Stuhl", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Kokosinseln|Keeling-Insel", + /* BLM */ "Sankt Bartholomäus", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolkinsel|Philip-Insel", + /* PCN */ "Pitcairninseln", + /* BVT */ "Bouvet-Insel", + /* BMU */ "Bermuda", + /* IOT */ "Britisches Territorium im Indischen Ozean", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Weihnachtsinsel", + /* WLF */ "Wallis und Futuna|Futuna", + /* VGB */ "Britische Jungferninseln|Jungferninseln, Britisch", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Marshall-Inseln", + /* ASM */ "Amerikanisch Samoa|Samoa, Amerikanisch", + /* COK */ "Cookinseln", + /* SPM */ "Saint-Pierre und Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts und Nevis|Nevis", + /* CYM */ "Cayman-Inseln", + /* BES */ "Bonaire, St. Eustatius und Saba|Saba|St Eustatius", + /* MDV */ "Malediven", + /* SHN */ "Saint Helena, Ascension und Tristan da Cunha|Christi Himmelfahrt|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Amerikanische Jungferninseln|Virgin-Inseln, USA", + /* MYT */ "Mayotte", + /* SJM */ "Spitzbergen|Jan Mayen", + /* VCT */ "Saint Vincent und die Grenadinen|Grenadines", + /* HMD */ "Heard- und McDonald-Inseln|McDonald-Inseln", + /* BRB */ "Barbados", + /* ATG */ "Antigua und Barbuda|Barbuda", + /* CUW */ "Curaçao", + /* SYC */ "Seychellen", + /* PLW */ "Palau", + /* MNP */ "Nördliche Marianen", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Isle of Man", + /* LCA */ "Saint Lucia", + /* FSM */ "Micronesia|Föderierte Staaten von Mikronesien", + /* SGP */ "Singapur", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks- und Caicosinseln|Caicos-Inseln", + /* STP */ "Sao Tome und Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Färöer-Inseln", + /* GLP */ "Guadeloupe", + /* COM */ "Komoren", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Luxemburg", + /* WSM */ "Samoa", + /* SGS */ "Südgeorgien und die Südlichen Sandwich-Inseln|South Sandwich-Inseln", + /* PYF */ "Französisch-Polynesien", + /* CPV */ "Kap Verde", + /* TTO */ "Trinidad und Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Französisch Süd- und Antarktisgebiete", + /* PRI */ "Puerto Rico", + /* CYP */ "Zypern", + /* LBN */ "Libanon", + /* JAM */ "Jamaika", + /* GMB */ "Gambia", + /* QAT */ "Katar", + /* FLK */ "Falkland-Inseln", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Osttimor", + /* SWZ */ "Swasiland", + /* KWT */ "Kuwait", + /* FJI */ "Fidschi-Inseln", + /* NCL */ "Neukaledonien", + /* SVN */ "Slowenien", + /* ISR */ "Israel", + /* PSE */ "Palästinensische Autonomiegebiete", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Dschibuti", + /* MKD */ "Mazedonien", + /* RWA */ "Ruanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Äquatorial-Guinea", + /* ALB */ "Albanien", + /* SLB */ "Salomon-Inseln", + /* ARM */ "Armenien", + /* LSO */ "Lesotho", + /* BEL */ "Belgien", + /* MDA */ "Moldawien", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Schweiz", + /* NLD */ "Niederlande", + /* DNK */ "Dänemark", + /* EST */ "Estland", + /* DOM */ "Dominikanische Republik", + /* SVK */ "Slowakei", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnien und Herzegowina", + /* HRV */ "Kroatien", + /* TGO */ "Togo", + /* LVA */ "Lettland", + /* LTU */ "Litauen", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgien", + /* IRL */ "Irland", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Tschechische Republik", + /* GUF */ "Französisch-Guayana", + /* ARE */ "Vereinigte Arabische Emirate", + /* AUT */ "Österreich", + /* AZE */ "Aserbaidschan", + /* SRB */ "Serbia", + /* JOR */ "Jordan", + /* PRT */ "Portugal", + /* HUN */ "Ungarn", + /* KOR */ "Südkorea", + /* ISL */ "Island", + /* GTM */ "Guatemala", + /* CUB */ "Kuba", + /* BGR */ "Bulgarien", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Nordkorea", + /* NIC */ "Nicaragua", + /* GRC */ "Griechenland", + /* TJK */ "Tadschikistan", + /* BGD */ "Bangladesch", + /* NPL */ "Nepal", + /* TUN */ "Tunesien", + /* SUR */ "Surinam", + /* URY */ "Uruguay", + /* KHM */ "Kambodscha", + /* SYR */ "Syrien", + /* SEN */ "Senegal", + /* KGZ */ "Kirgisistan", + /* BLR */ "Weißrussland", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Rumänien", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Vereinigtes Königreich", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Western Sahara|Sahrawi", + /* GAB */ "Gabun", + /* NZL */ "Neuseeland", + /* BFA */ "Burkina Faso", + /* PHL */ "Philippinen", + /* ITA */ "Italien", + /* OMN */ "Oman", + /* POL */ "Polen", + /* CIV */ "Elfenbeinküste", + /* NOR */ "Norwegen", + /* MYS */ "Malaysia", + /* VNM */ "Vietnam", + /* FIN */ "Finnland", + /* COG */ "Kongo-Brazzaville", + /* DEU */ "Deutschland", + /* JPN */ "Japan", + /* ZWE */ "Simbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Marokko", + /* UZB */ "Usbekistan", + /* SWE */ "Schweden", + /* PNG */ "Papua-Neuguinea", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Spanien", + /* THA */ "Thailand", + /* YEM */ "Jemen", + /* FRA */ "Frankreich", + /* ALA */ "Åland-Inseln|Aaland-Inseln", + /* KEN */ "Kenia", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukraine", + /* SSD */ "Süd-Sudan", + /* CAF */ "Zentralafrikanische Republik", + /* SOM */ "Somalia", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Birma", + /* ZMB */ "Sambia", + /* CHL */ "Chile", + /* TUR */ "Türkei", + /* PAK */ "Pakistan", + /* MOZ */ "Mosambik", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tansania", + /* EGY */ "Ägypten", + /* MRT */ "Mauretanien", + /* BOL */ "Bolivien", + /* ETH */ "Äthiopien", + /* COL */ "Kolumbien", + /* ZAF */ "Südafrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Tschad", + /* PER */ "Peru", + /* MNG */ "Mongolei", + /* IRN */ "Iran", + /* LBY */ "Libyen", + /* SDN */ "Sudan", + /* IDN */ "Indonesien", + /* DIF */ "Federal District", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grönland", + /* SAU */ "Saudi-Arabien", + /* COD */ "Kongo-Kinshasa", + /* DZA */ "Algerien", + /* KAZ */ "Kasachstan", + /* ARG */ "Argentinien", + /* IN-DD */ "Daman und Diu", + /* IN-DN */ "Dadra und Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andamanen-und Nikobaren", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu und Kaschmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Westbengalen", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territory", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "South Australia", + /* TAS */ "Tasmanien", + /* VIC */ "Victoria", + /* AU-WA */ "Western Australia", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapá", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "South Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "North Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "Kalifornien", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prince Edward-Insel", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "Indien", + /* AUS */ "Australien", + /* BRA */ "Brasilien", + /* USA */ "USA|Vereinigte Staaten von Amerika|Amerika", + /* MEX */ "Mexiko", + /* MOW */ "Moskau", + /* SPE */ "Saint Petersburg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Inguschetien Republik", + /* RU-AD */ "Adygea Republik", + /* RU-SE */ "Nordossetien-Alania Republic", + /* RU-KB */ "Kabardino-Balkarien", + /* RU-KC */ "Karatschai-Tscherkessien Republik", + /* RU-CE */ "Tschetschenische Republik", + /* RU-CU */ "Republik Tschuwaschien", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Orjol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Brjansk", + /* YAR */ "Oblast Jaroslawl", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrakhan Oblast", + /* MOS */ "Oblast Moskau", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "Republik Dagestan", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stawropol", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia Republik", + /* TVE */ "Oblast Twer", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Republik Karelien", + /* NEN */ "Nenzen", + /* RU-KO */ "Republik Komi", + /* ARK */ "Archangelsk Oblast", + /* RU-MO */ "Mordovia Republic", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Republik Mari El", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Uljanowsk", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Republik Baschkortostan", + /* RU-UD */ "Republik Udmurtien", + /* RU-TA */ "Republik Tatarstan", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Jamal-Nenzen", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Oblast Swerdlowsk", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Burjatien Republik", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Chakassien Republik", + /* KEM */ "Kemerowo", + /* RU-AL */ "Altai Republik", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republik", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Tschukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sachalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Jüdischen Autonomen Oblast", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Republik Sacha|Yakutia Republic", + /* CAN */ "Kanada", + /* RUS */ "Russland", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Peking", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uiguren", + /* CHN */ "China", + /* UMI */ "United States Minor Outlying Islands", + /* CPT */ "Clipperton-Insel", + /* ATA */ "Antarktis", + /* AAA */ "International|Weltweit|Erde" +#else // MAPCODE_SUPPORT_LANGUAGE_DE + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_DE +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_DE_H__ diff --git a/mapcodelib/internal_territory_names_english.h b/mapcodelib/internal_territory_names_en.h similarity index 94% rename from mapcodelib/internal_territory_names_english.h rename to mapcodelib/internal_territory_names_en.h index 6973cd7..1a7432a 100644 --- a/mapcodelib/internal_territory_names_english.h +++ b/mapcodelib/internal_territory_names_en.h @@ -1,27 +1,27 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __INTERNAL_TERRITORY_NAMES_ENGLISH_H__ -#define __INTERNAL_TERRITORY_NAMES_ENGLISH_H__ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_EN_H__ +#define __INTERNAL_TERRITORY_NAMES_EN_H__ #ifdef __cplusplus extern "C" { #endif // *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** -static const char *TERRITORY_FULL_NAME[] = { + +static const char *TERRITORY_FULL_NAME_EN[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_EN "Vatican|Holy See", "Monaco", "Gibraltar", @@ -555,10 +555,13 @@ static const char *TERRITORY_FULL_NAME[] = { "Clipperton Island", "Antarctica", "International|Worldwide|Earth", - "?"}; +#else // MAPCODE_SUPPORT_LANGUAGE_EN + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_EN +}; #ifdef __cplusplus } #endif -#endif // __INTERNAL_TERRITORY_NAMES_ENGLISH_H__ +#endif // __INTERNAL_TERRITORY_NAMES_EN_H__ diff --git a/mapcodelib/internal_territory_names_es.h b/mapcodelib/internal_territory_names_es.h new file mode 100644 index 0000000..76f08fe --- /dev/null +++ b/mapcodelib/internal_territory_names_es.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_ES_H__ +#define __INTERNAL_TERRITORY_NAMES_ES_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_ES[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_ES // Spanish + /* VAT */ "Vaticano|Ciudad del Vaticano|Santa Sede", + /* MCO */ "Mónaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Islas Cocos|Islas Keeling", + /* BLM */ "San Bartolomé", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "San Martín", + /* NFK */ "Norfolk y Phillip Island|isla de Phillip|isla de Norfolk", + /* PCN */ "Islas Pitcairn", + /* BVT */ "Isla Bouvet", + /* BMU */ "Islas Bermudas|Bermudas", + /* IOT */ "Territorio Británico del Océano Índico", + /* SMR */ "San Marino", + /* GGY */ "Guernesey", + /* AIA */ "Anguila", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Isla de Navidad", + /* WLF */ "Wallis y Futuna|Futuna", + /* VGB */ "Islas Vírgenes Británicas", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Islas Marshall", + /* ASM */ "Samoa Americana", + /* COK */ "Islas Cook", + /* SPM */ "San Pedro y Miquelón|Miquelón", + /* NIU */ "Niue", + /* KNA */ "San Cristóbal y Nieves|Nevis", + /* CYM */ "Islas Caimán", + /* BES */ "Bonaire, St Eustatuis y Saba|Saba|San Eustaquio", + /* MDV */ "Maldivas", + /* SHN */ "Santa Helena, Ascensión y Tristán da Cunha|Ascensión|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Granada", + /* VIR */ "Islas Vírgenes de EE.UU", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard y Jan Mayen|Jan Mayen", + /* VCT */ "San Vicente y las Granadinas|Granadinas", + /* HMD */ "Islas Heard y McDonald|Islas McDonald", + /* BRB */ "Barbados", + /* ATG */ "Antigua y Barbuda|Barbuda", + /* CUW */ "Curazao", + /* SYC */ "Seychelles", + /* PLW */ "Palau", + /* MNP */ "Islas Marianas del Norte", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Isla de Man", + /* LCA */ "Santa Lucía", + /* FSM */ "Micronesia|Estados Federados de Micronesia", + /* SGP */ "Singapur", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrein", + /* KIR */ "Kiribati", + /* TCA */ "Islas Turcas y Caicos|Islas Caicos", + /* STP */ "Santo Tomé y Príncipe|Príncipe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinica", + /* FRO */ "Islas Faroe", + /* GLP */ "Guadalupe", + /* COM */ "Comoras", + /* MUS */ "Mauricio", + /* REU */ "Reunión", + /* LUX */ "Luxemburgo", + /* WSM */ "Samoa", + /* SGS */ "Georgia del Sur y las Islas Sandwich del Sur|Islas Sandwich del Sur", + /* PYF */ "Polinesia francés", + /* CPV */ "Cabo Verde", + /* TTO */ "Trinidad y Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Tierras Australes y Antárticas Francesas", + /* PRI */ "Puerto Rico", + /* CYP */ "Chipre", + /* LBN */ "Líbano", + /* JAM */ "Jamaica", + /* GMB */ "Gambia", + /* QAT */ "Katar", + /* FLK */ "Islas Malvinas", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Timor Oriental", + /* SWZ */ "Swazilandia", + /* KWT */ "Kuwait", + /* FJI */ "Islas Fiji", + /* NCL */ "Nueva Caledonia", + /* SVN */ "Eslovenia", + /* ISR */ "Israel", + /* PSE */ "Territorio Palestino", + /* SLV */ "El Salvador", + /* BLZ */ "Belice", + /* DJI */ "Djibouti", + /* MKD */ "macedonia", + /* RWA */ "Ruanda", + /* HTI */ "Haití", + /* BDI */ "Burundi", + /* GNQ */ "Guinea Ecuatorial", + /* ALB */ "Albania", + /* SLB */ "Islas Salomón", + /* ARM */ "Armenia", + /* LSO */ "Lesoto", + /* BEL */ "Bélgica", + /* MDA */ "Moldavia", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwán", + /* BTN */ "Bután", + /* CHE */ "Suiza", + /* NLD */ "Países Bajos", + /* DNK */ "Dinamarca", + /* EST */ "Estonia", + /* DOM */ "República Dominicana", + /* SVK */ "Eslovaquia", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnia y Herzegovina", + /* HRV */ "Croacia", + /* TGO */ "Togo", + /* LVA */ "Letonia", + /* LTU */ "Lituania", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgia", + /* IRL */ "Irlanda", + /* SLE */ "Sierra Leona", + /* PAN */ "Panamá", + /* CZE */ "República Checa", + /* GUF */ "Guayana francés", + /* ARE */ "Emiratos Árabes Unidos", + /* AUT */ "Austria", + /* AZE */ "Azerbaiyán", + /* SRB */ "Serbia", + /* JOR */ "Jordán", + /* PRT */ "Portugal", + /* HUN */ "Hungría", + /* KOR */ "Corea del Sur", + /* ISL */ "Islandia", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgaria", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "malawi", + /* PRK */ "Corea del Norte", + /* NIC */ "Nicaragua", + /* GRC */ "Grecia", + /* TJK */ "Tayikistán", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Túnez", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Camboya", + /* SYR */ "Siria", + /* SEN */ "Senegal", + /* KGZ */ "Kirguistán", + /* BLR */ "Bielorrusia", + /* GUY */ "Guayana", + /* LAO */ "Laos", + /* ROU */ "Rumania", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Reino Unido|Escocia|Gran Bretaña|Irlanda del Norte|Irlanda, Norte", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Sahara Occidental|Saharaui", + /* GAB */ "Gabón", + /* NZL */ "Nueva Zelanda", + /* BFA */ "Burkina Faso", + /* PHL */ "Filipinas", + /* ITA */ "Italia", + /* OMN */ "Omán", + /* POL */ "Polonia", + /* CIV */ "Costa de Marfil", + /* NOR */ "Noruega", + /* MYS */ "Malasia", + /* VNM */ "Vietnam", + /* FIN */ "Finlandia", + /* COG */ "Congo-Brazzaville", + /* DEU */ "Alemania", + /* JPN */ "Japón", + /* ZWE */ "Zimbabue", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Marruecos", + /* UZB */ "Uzbekistán", + /* SWE */ "Suecia", + /* PNG */ "Papúa Nueva Guinea", + /* CMR */ "Camerún", + /* TKM */ "Turkmenistán", + /* ESP */ "España", + /* THA */ "Tailandia", + /* YEM */ "Yemen", + /* FRA */ "Francia", + /* ALA */ "Islas Aland", + /* KEN */ "Kenia", + /* BWA */ "Botswana", + /* MDG */ "Madagascar", + /* UKR */ "Ucrania", + /* SSD */ "Sudán del Sur", + /* CAF */ "República Centroafricana", + /* SOM */ "Somalia", + /* AFG */ "Afganistán", + /* MMR */ "Myanmar|Birmania", + /* ZMB */ "Zambia", + /* CHL */ "Chile", + /* TUR */ "Turquía", + /* PAK */ "Pakistán", + /* MOZ */ "Mozambique", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Egipto", + /* MRT */ "Mauritania", + /* BOL */ "Bolivia", + /* ETH */ "Etiopía", + /* COL */ "Colombia", + /* ZAF */ "Sudáfrica", + /* MLI */ "Malí", + /* AGO */ "Angola", + /* NER */ "Níger", + /* TCD */ "Chad", + /* PER */ "Perú", + /* MNG */ "Mongolia", + /* IRN */ "Irán", + /* LBY */ "Libia", + /* SDN */ "Sudán", + /* IDN */ "Indonesia", + /* DIF */ "Distrito Federal", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Estado de México", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatán", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacán", + /* SLP */ "San Luis Potosí", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Tierra Verde", + /* SAU */ "Arabia Saudita", + /* COD */ "Congo-Kinshasa", + /* DZA */ "Argelia", + /* KAZ */ "Kazajstán", + /* ARG */ "Argentina", + /* IN-DD */ "Daman y Diu", + /* IN-DN */ "Dadra y Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman y Nicobar", + /* IN-LD */ "Lakshadweep|Laquedivas", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu y Cachemira", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Bengala Occidental", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "Nueva Gales del Sur", + /* ACT */ "Territorio de la Capital Australiana|Australian Capital Territory", + /* JBT */ "Territorio de Jervis Bay", + /* AU-NT */ "Territorio del Norte", + /* AU-SA */ "Australia del Sur", + /* TAS */ "Tasmania", + /* VIC */ "Victoria", + /* AU-WA */ "Australia Occidental", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapá", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Paraná", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Marañón", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Paraca", + /* BR-AM */ "Amazonas", + /* US-DC */ "Distrito de Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "Nueva Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawai", + /* US-MD */ "Maryland", + /* US-WV */ "Virginia Occidental", + /* US-SC */ "Carolina del Sur", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennesse", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pensilvania", + /* US-MS */ "Misisipí", + /* US-LA */ "Luisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Carolina del Norte", + /* US-NY */ "Nueva York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Misuri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Dakota del Norte", + /* US-WA */ "Washington", + /* US-SD */ "Dakota del Sur", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregón", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Nuevo Mexico", + /* US-MT */ "Montana", + /* US-CA */ "California", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "Columbia Británica", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Terranova", + /* CA-NB */ "Nuevo Brunswick", + /* CA-NS */ "Nueva Escocia", + /* CA-PE */ "Isla del Príncipe Eduardo", + /* CA-YT */ "Yukon", + /* CA-NT */ "Territorios del Noroeste", + /* CA-NU */ "Nunavut", + /* IND */ "India", + /* AUS */ "Australia", + /* BRA */ "Brasil", + /* USA */ "USA|Estados Unidos de América|América", + /* MEX */ "Méjico", + /* MOW */ "Moscú", + /* SPE */ "San Petersburgo", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "República de Ingushetia", + /* RU-AD */ "República de Adygea", + /* RU-SE */ "República de Osetia del Norte-Alania", + /* RU-KB */ "República de Kabardino-Balkar", + /* RU-KC */ "República Karachay-Cherkess", + /* RU-CE */ "República Chechena", + /* RU-CU */ "República de Chuvash", + /* IVA */ "Óblast de Ivanovo", + /* LIP */ "Óblast de Lipetsk", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Óblast de Kursk", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Óblast de Tambov", + /* BRY */ "Oblast de Bryansk", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Óblast de Astrakhan", + /* MOS */ "Oblast de Moscú", + /* SMO */ "Oblast de Smolensk", + /* RU-DA */ "República de Daguestán", + /* VOR */ "Óblast de Voronezh", + /* NGR */ "Óblast de Novgorod", + /* PSK */ "Óblast de Pskov", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "República de Kalmykia", + /* TVE */ "Oblast de Tver", + /* LEN */ "Oblast de Leningrado", + /* ROS */ "Óblast de Rostov", + /* VGG */ "Óblast de Volgogrado", + /* VLG */ "Óblast de Vologda", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "República de Carelia", + /* NEN */ "Nenets Autónoma Okrug", + /* RU-KO */ "República de Komi", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "República de Mordovia", + /* NIZ */ "Óblast de Nizhny Novgorod", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Óblast de Kirov", + /* RU-ME */ "Mari El Republic", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "República de Bashkortostán", + /* RU-UD */ "República de Udmurt", + /* RU-TA */ "República de Tatarstán", + /* SAM */ "Samara Oblast", + /* SAR */ "Óblast de Saratov", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Óblast de Sverdlovsk", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Oblast de Kurgan", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "República de Buriatia", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Óblast de Irkutsk", + /* NVS */ "Óblast de Novosibirsk", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Oblast de Omsk", + /* RU-KK */ "República de Khakassia", + /* KEM */ "Óblast de Kemerovo", + /* RU-AL */ "República de Altai", + /* ALT */ "Krai de Altai", + /* RU-TY */ "Tuva Republic", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Óblast de Magadan", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Óblast de Sajalín", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Oblast autónomo judío", + /* KHA */ "Krai de Jabárovsk", + /* AMU */ "Óblast de Amur", + /* RU-SA */ "República de Sakha|República de Yakutia", + /* CAN */ "Canadá", + /* RUS */ "Rusia", + /* CN-SH */ "Llevar a la fuerza", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Beijing", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "provincia de Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Mongolia Interior", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tíbet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "China", + /* UMI */ "Islas menores alejadas de los Estados Unidos", + /* CPT */ "Isla Clipperton", + /* ATA */ "Antártida", + /* AAA */ "Internacional|Mundial|Tierra" +#else // MAPCODE_SUPPORT_LANGUAGE_ES + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_ES +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_ES_H__ diff --git a/mapcodelib/internal_territory_names_fi.h b/mapcodelib/internal_territory_names_fi.h new file mode 100644 index 0000000..0fece2e --- /dev/null +++ b/mapcodelib/internal_territory_names_fi.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_FI_H__ +#define __INTERNAL_TERRITORY_NAMES_FI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_FI[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_FI // Finnish + /* VAT */ "Vatikaani|Pyhä istuin", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Kookossaaret|Keeling Islands", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macao", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk ja Philip Island|Philip Island", + /* PCN */ "Pitcairnsaaret", + /* BVT */ "Bouvet`nsaari", + /* BMU */ "Bermuda", + /* IOT */ "Brittiläinen Intian valtameren alue", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Joulusaari", + /* WLF */ "Wallis ja Futuna|Futuna", + /* VGB */ "Brittiläiset Neitsytsaaret|Brittiläiset Neitsytsaaret", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Marshallinsaaret", + /* ASM */ "Amerikan Samoa|Samoa, amerikkalainen", + /* COK */ "Cook saaret", + /* SPM */ "Saint-Pierre ja Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts ja Nevis|Nevis", + /* CYM */ "Caymansaaret", + /* BES */ "Bonaire, St Eustatuis ja Saba|Saba|St Eustatius", + /* MDV */ "Malediivit", + /* SHN */ "Saint Helena, Ascension ja Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Yhdysvaltain Neitsytsaaret", + /* MYT */ "Mayotte", + /* SJM */ "Huippuvuoret ja Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent ja Grenadiinit|Grenadiinit", + /* HMD */ "Heard ja McDonald Islands|McDonald-saaret", + /* BRB */ "Barbados", + /* ATG */ "Antigua ja Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seychellit", + /* PLW */ "Palau", + /* MNP */ "Pohjois-Mariaanit", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Mansaari", + /* LCA */ "Saint Lucia", + /* FSM */ "Mikronesia", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks- ja Caicossaaret|Caicossaaret", + /* STP */ "Sao Tome ja Principe|Principe", + /* HKG */ "Hongkong", + /* MTQ */ "Martinique", + /* FRO */ "Färsaaret", + /* GLP */ "Guadeloupe", + /* COM */ "Komorit", + /* MUS */ "Mauritius", + /* REU */ "Jälleennäkeminen", + /* LUX */ "Luxemburg", + /* WSM */ "Samoa", + /* SGS */ "Etelä-Georgia ja Eteläiset Sandwichsaaret|Sandwichsaaret", + /* PYF */ "Ranskan Polynesia", + /* CPV */ "Kap Verde", + /* TTO */ "Trinidad ja Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Ranskan eteläiset alueet", + /* PRI */ "Puerto Rico", + /* CYP */ "Kypros", + /* LBN */ "Libanon", + /* JAM */ "Jamaika", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Falklandinsaaret", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahama", + /* TLS */ "Itä-Timor", + /* SWZ */ "Swazimaa", + /* KWT */ "Kuwait", + /* FJI */ "Fiji", + /* NCL */ "Uusi-Caledonia", + /* SVN */ "Slovenia", + /* ISR */ "Israel", + /* PSE */ "Palestiinalaisalueet", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Makedonia", + /* RWA */ "Ruanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Päiväntasaajan Guinea", + /* ALB */ "Albania", + /* SLB */ "Salomonsaaret", + /* ARM */ "Armenia", + /* LSO */ "Lesotho", + /* BEL */ "Belgia", + /* MDA */ "Moldova", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Sveitsi", + /* NLD */ "Hollanti|Alankomaat", + /* DNK */ "Tanska", + /* EST */ "Viro", + /* DOM */ "Dominikaaninen tasavalta", + /* SVK */ "Slovakia", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnia ja Hertsegovina", + /* HRV */ "Kroatia", + /* TGO */ "Togo", + /* LVA */ "Latvia", + /* LTU */ "Liettua", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgia", + /* IRL */ "Irlanti", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Tšekin tasavalta", + /* GUF */ "Ranskan Guayana", + /* ARE */ "Yhdistyneet Arabiemiirikunnat", + /* AUT */ "Itävalta", + /* AZE */ "Azerbaidžan", + /* SRB */ "Serbia", + /* JOR */ "Jordania", + /* PRT */ "Portugali", + /* HUN */ "Unkari", + /* KOR */ "Etelä-Korea", + /* ISL */ "Islanti", + /* GTM */ "Guatemala", + /* CUB */ "Kuuba", + /* BGR */ "Bulgaria", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Pohjois-Korea", + /* NIC */ "Nicaragua", + /* GRC */ "Kreikka", + /* TJK */ "Tadžikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunisia", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Kambodza", + /* SYR */ "Syyria", + /* SEN */ "Senegal", + /* KGZ */ "Kirgisia", + /* BLR */ "Valko-Venäjä", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Romania", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Iso-Britannia|Skotlanti|Pohjois-Irlanti|Irlanti, Pohjois", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Länsi-Sahara|Länsi-Saharan", + /* GAB */ "Gabon", + /* NZL */ "Uusi Seelanti", + /* BFA */ "Burkina Faso", + /* PHL */ "Filippiinit", + /* ITA */ "Italia", + /* OMN */ "Oman", + /* POL */ "Puola", + /* CIV */ "Norsunluurannikko", + /* NOR */ "Norja", + /* MYS */ "Malesia", + /* VNM */ "Vietnam", + /* FIN */ "Suomi", + /* COG */ "Kongon", + /* DEU */ "Saksa", + /* JPN */ "Japani", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Marokko", + /* UZB */ "Uzbekistan", + /* SWE */ "Ruotsi", + /* PNG */ "Papua-Uusi-Guinea", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Espanja", + /* THA */ "Thaimaa", + /* YEM */ "Jemen", + /* FRA */ "Ranska", + /* ALA */ "Ahvenanmaa", + /* KEN */ "Kenia", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukraina", + /* SSD */ "Etelä-Sudan", + /* CAF */ "Keski-Afrikan tasavalta", + /* SOM */ "Somalia", + /* AFG */ "Afganistan", + /* MMR */ "Myanmar|Burma", + /* ZMB */ "Sambia", + /* CHL */ "Chile", + /* TUR */ "Turkki", + /* PAK */ "Pakistan", + /* MOZ */ "Mosambik", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tansania", + /* EGY */ "Egypti", + /* MRT */ "Mauritania", + /* BOL */ "Bolivia", + /* ETH */ "Etiopia", + /* COL */ "Kolumbia", + /* ZAF */ "Etelä-Afrikka", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Chad", + /* PER */ "Peru", + /* MNG */ "Mongolia", + /* IRN */ "Iran", + /* LBY */ "Libya", + /* SDN */ "Sudan", + /* IDN */ "Indonesia", + /* DIF */ "Federal District", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grönlanti", + /* SAU */ "Saudi-Arabia", + /* COD */ "Kongo-Kinshasa", + /* DZA */ "Algeria", + /* KAZ */ "Kazakstan", + /* ARG */ "Argentiina", + /* IN-DD */ "Daman ja Diu", + /* IN-DN */ "Dadra ja Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman ja Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadun", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammun ja Kashmirin", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujaratin", + /* IN-WB */ "Länsi-Bengal", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian pääkaupunkiterritorio|Australian Capital Territory", + /* JBT */ "Jervis Bay Territory", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "South Australia", + /* TAS */ "Tasmania", + /* VIC */ "Victoria", + /* AU-WA */ "Western Australia", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Havaiji", + /* US-MD */ "Maryland", + /* US-WV */ "Länsi-Virginia", + /* US-SC */ "Etelä-Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Pohjois-Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota|Etelä-Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Uusi Meksiko|New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "Kalifornia", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "Brittiläinen Kolumbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Luoteisterritoriot", + /* CA-NU */ "Nunavut", + /* IND */ "Intia", + /* AUS */ "Australia", + /* BRA */ "Brasilia", + /* USA */ "USA|Yhdysvallat|Amerikka", + /* MEX */ "Meksiko", + /* MOW */ "Moskova", + /* SPE */ "Pietari", + /* KGD */ "Kaliningradin alue", + /* RU-IN */ "Ingušian tasavalta", + /* RU-AD */ "Adygeia tasavalta", + /* RU-SE */ "Pohjois-Ossetia-Alania tasavalta", + /* RU-KB */ "Kabardi-Balkarian tasavalta", + /* RU-KC */ "Karatšai-Tšerkessit tasavalta", + /* RU-CE */ "Tšetšenian tasavallassa", + /* RU-CU */ "Tšuvassi tasavalta", + /* IVA */ "Ivanovon alue", + /* LIP */ "Lipetskin alue", + /* ORL */ "Orjolin alue", + /* TUL */ "Tulan alue", + /* RU-BE */ "Belgorodin alue", + /* VLA */ "Vladimirin alue", + /* KRS */ "Kurskin alue", + /* KLU */ "Kalugan alue", + /* RU-TT */ "Tambovin alue", + /* BRY */ "Brjanskin alue", + /* YAR */ "Jaroslavlin alue", + /* RYA */ "Rjazanin alue", + /* AST */ "Astrahanin alue", + /* MOS */ "Moskovan", + /* SMO */ "Smolenskin alue", + /* RU-DA */ "Dagestanin tasavalta", + /* VOR */ "Voronežin alue", + /* NGR */ "Novgorodin alue", + /* PSK */ "Pihkovan alue", + /* KOS */ "Kostromossa", + /* STA */ "Stavropolin aluepiiri", + /* KDA */ "Krasnodarin", + /* RU-KL */ "Kalmykia tasavalta", + /* TVE */ "Tverin alue", + /* LEN */ "Leningradin", + /* ROS */ "Rostovin alue", + /* VGG */ "Volgogradin alue", + /* VLG */ "Vologdan alue", + /* MUR */ "Murmanskin alue", + /* RU-KR */ "Karjalan tasavalta", + /* NEN */ "Nenetsiassa", + /* RU-KO */ "Komin", + /* ARK */ "Arkangelin", + /* RU-MO */ "Mordvan tasavalta", + /* NIZ */ "Nižni Novgorodin alue", + /* PNZ */ "Penzan alue", + /* RU-KI */ "Kirovin alue", + /* RU-ME */ "Marin tasavallan", + /* ORE */ "Orenburgin alue", + /* ULY */ "Uljanovskin alue", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostanin tasavalta", + /* RU-UD */ "Udmurtian", + /* RU-TA */ "Tatarstanin tasavalta", + /* SAM */ "Samaran alue", + /* SAR */ "Saratovin alue", + /* YAN */ "Jamalin Nenetsian", + /* RU-KM */ "Hanti-Mansi", + /* SVE */ "Sverdlovskin alue", + /* TYU */ "Tjumenin alue", + /* KGN */ "Kurganin alue", + /* RU-CH */ "Tšeljabinskin alue", + /* RU-BU */ "Burjatian tasavalta", + /* ZAB */ "Taka-Baikalian aluepiiri", + /* IRK */ "Irkutskin alue", + /* NVS */ "Novosibirskin alue", + /* TOM */ "Tomskin alue", + /* OMS */ "Omskin alue", + /* RU-KK */ "Hakassian tasavalta", + /* KEM */ "Kemerovon alue", + /* RU-AL */ "Altai Republic", + /* ALT */ "Altain aluepiiri", + /* RU-TY */ "Tuvan tasavalta", + /* KYA */ "Krasnojarskin aluepiiri", + /* MAG */ "Magadanin alue", + /* CHU */ "Chukotkan Okrugin", + /* KAM */ "Kamtšatkan aluepiiri", + /* SAK */ "Sahalinin alue", + /* RU-PO */ "Primorsky aluepiiri", + /* YEV */ "Juutalaisten autonominen alue", + /* KHA */ "Habarovskin aluepiiri", + /* AMU */ "Amurin alue", + /* RU-SA */ "Sahan Tasavallassa|Yakutia Tasavalta", + /* CAN */ "Kanada", + /* RUS */ "Venäjä", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Peking", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoningin", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhoun", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubein", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxin", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilongjiangin", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tiibet", + /* CN-GS */ "Gansun", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiangin uiguurien", + /* CHN */ "Kiina", + /* UMI */ "Yhdysvaltain Tyynenmeren erillissaaret", + /* CPT */ "Clippertoninsaari", + /* ATA */ "Antarktis", + /* AAA */ "Kansainvälinen|Maailma|Maapallo" +#else // MAPCODE_SUPPORT_LANGUAGE_FI + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_FI +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_FI_H__ diff --git a/mapcodelib/internal_territory_names_fr.h b/mapcodelib/internal_territory_names_fr.h new file mode 100644 index 0000000..e8afcff --- /dev/null +++ b/mapcodelib/internal_territory_names_fr.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_FR_H__ +#define __INTERNAL_TERRITORY_NAMES_FR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_FR[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_FR // French + /* VAT */ "Vatican|Cité du Vatican|Saint-Siège", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Îles Cocos|Îles Keeling", + /* BLM */ "Saint-Barthélemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macao", + /* SXM */ "Saint-Martin|Royaume des Pays-Bas", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk et Phillip Island|Phillip Island", + /* PCN */ "Îles Pitcairn", + /* BVT */ "Île Bouvet", + /* BMU */ "Bermudes", + /* IOT */ "Territoire britannique de l`océan Indien", + /* SMR */ "Saint-Marin", + /* GGY */ "Guernesey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Île Christmas", + /* WLF */ "Wallis et Futuna|Futuna", + /* VGB */ "Îles Vierges britanniques", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Îles Marshall", + /* ASM */ "Samoa américaines", + /* COK */ "Îles Cook", + /* SPM */ "Saint-Pierre-et-Miquelon|Miquelon", + /* NIU */ "Nioué", + /* KNA */ "Saint-Christophe-et-Niévès|Niévès", + /* CYM */ "Îles Caïmans", + /* BES */ "Bonaire, Saint-Eustache et Saba|Saba|St Eustache", + /* MDV */ "Maldives", + /* SHN */ "Sainte-Hélène, Ascension et Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malte", + /* GRD */ "Grenade", + /* VIR */ "Îles Vierges américaines", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard et Jan Mayen|Jan Mayen", + /* VCT */ "Saint-Vincent-et-les-Grenadines|Grenadines", + /* HMD */ "Île Heard-et-MacDonald|Îles MacDonald", + /* BRB */ "Barbade", + /* ATG */ "Antigua-et-Barbuda|Barbuda", + /* CUW */ "Curaçao", + /* SYC */ "Seychelles", + /* PLW */ "Palaos", + /* MNP */ "Îles Mariannes du Nord", + /* AND */ "Andorre", + /* GUM */ "Guam", + /* IMN */ "Île de Man", + /* LCA */ "Sainte-Lucie", + /* FSM */ "Micronésie|États fédérés de Micronésie", + /* SGP */ "Singapour", + /* TON */ "Tonga", + /* DMA */ "Dominique", + /* BHR */ "Bahreïn", + /* KIR */ "Kiribati", + /* TCA */ "Îles Turques-et-Caïques|Caïques", + /* STP */ "Sao Tomé-et-Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Îles Féroé", + /* GLP */ "Guadeloupe", + /* COM */ "Comores", + /* MUS */ "Île Maurice", + /* REU */ "Réunion", + /* LUX */ "Luxembourg", + /* WSM */ "Samoa", + /* SGS */ "Géorgie du Sud-et-les Îles Sandwich du Sud|Îles Sandwich du Sud", + /* PYF */ "Polynésie française", + /* CPV */ "Cap-Vert", + /* TTO */ "Trinité-et-Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Terres australes et antarctiques françaises", + /* PRI */ "Puerto Rico", + /* CYP */ "Chypre", + /* LBN */ "Liban", + /* JAM */ "Jamaïque", + /* GMB */ "Gambie", + /* QAT */ "Qatar", + /* FLK */ "Îles Falkland", + /* VUT */ "Vanuatu", + /* MNE */ "Monténégro", + /* BHS */ "Bahamas", + /* TLS */ "Timor oriental", + /* SWZ */ "Swaziland", + /* KWT */ "Koweït", + /* FJI */ "Îles Fidji", + /* NCL */ "Nouvelle-Calédonie", + /* SVN */ "Slovénie", + /* ISR */ "Israël", + /* PSE */ "Territoires palestiniens", + /* SLV */ "Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Macédoine", + /* RWA */ "Rwanda", + /* HTI */ "Haïti", + /* BDI */ "Burundi", + /* GNQ */ "Guinée équatoriale", + /* ALB */ "Albanie", + /* SLB */ "Îles Salomon", + /* ARM */ "Arménie", + /* LSO */ "Lesotho", + /* BEL */ "Belgique", + /* MDA */ "Moldavie", + /* GNB */ "Guinée-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhoutan", + /* CHE */ "Suisse", + /* NLD */ "Pays-Bas", + /* DNK */ "Danemark", + /* EST */ "Estonie", + /* DOM */ "République dominicaine", + /* SVK */ "Slovaquie", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnie-Herzégovine", + /* HRV */ "Croatie", + /* TGO */ "Togo", + /* LVA */ "Lettonie", + /* LTU */ "Lituanie", + /* LKA */ "Sri Lanka", + /* GEO */ "Géorgie", + /* IRL */ "Irlande", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "République tchèque", + /* GUF */ "Guyane française", + /* ARE */ "Émirats Arabes Unis", + /* AUT */ "Autriche", + /* AZE */ "Azerbaïdjan", + /* SRB */ "Serbie", + /* JOR */ "Jordanie", + /* PRT */ "Portugal", + /* HUN */ "Hongrie", + /* KOR */ "Corée du Sud", + /* ISL */ "Islande", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgarie", + /* LBR */ "Libéria", + /* HND */ "Honduras", + /* BEN */ "Bénin", + /* ERI */ "Érythrée", + /* MWI */ "Malawi", + /* PRK */ "Corée du Nord", + /* NIC */ "Nicaragua", + /* GRC */ "Grèce", + /* TJK */ "Tadjikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Népal", + /* TUN */ "Tunisie", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Cambodge", + /* SYR */ "Syrie", + /* SEN */ "Sénégal", + /* KGZ */ "Kirghizistan", + /* BLR */ "Bélarus", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Roumanie", + /* GHA */ "Ghana", + /* UGA */ "Ouganda", + /* GBR */ "Royaume-Uni", + /* GIN */ "Guinée", + /* ECU */ "Équateur", + /* ESH */ "Sahara occidental|Sahraoui", + /* GAB */ "Gabon", + /* NZL */ "Nouvelle-Zélande", + /* BFA */ "Burkina Faso", + /* PHL */ "Philippines", + /* ITA */ "Italie", + /* OMN */ "Oman", + /* POL */ "Pologne", + /* CIV */ "Côte-d`Ivoire", + /* NOR */ "Norvège", + /* MYS */ "Malaisie", + /* VNM */ "Vietnam", + /* FIN */ "Finlande", + /* COG */ "Congo-Brazzaville", + /* DEU */ "Allemagne", + /* JPN */ "Japon", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Maroc", + /* UZB */ "Ouzbékistan", + /* SWE */ "Suède", + /* PNG */ "Papouasie-Nouvelle-Guinée", + /* CMR */ "Cameroun", + /* TKM */ "Turkménistan", + /* ESP */ "Espagne", + /* THA */ "Thaïlande", + /* YEM */ "Yémen", + /* FRA */ "France", + /* ALA */ "Åland Îles|Aaland", + /* KEN */ "Kenya", + /* BWA */ "Botswana", + /* MDG */ "Madagascar", + /* UKR */ "Ukraine", + /* SSD */ "Sud-Soudan", + /* CAF */ "République centrafricaine", + /* SOM */ "Somalie", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Birmanie", + /* ZMB */ "Zambie", + /* CHL */ "Chili", + /* TUR */ "Turquie", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambique", + /* NAM */ "Namibie", + /* VEN */ "Venezuela", + /* NGA */ "Nigéria", + /* TZA */ "Tanzanie", + /* EGY */ "Égypte", + /* MRT */ "Mauritanie", + /* BOL */ "Bolivie", + /* ETH */ "Éthiopie", + /* COL */ "Colombie", + /* ZAF */ "Afrique du Sud", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Tchad", + /* PER */ "Pérou", + /* MNG */ "Mongolie", + /* IRN */ "Iran", + /* LBY */ "Libye", + /* SDN */ "Soudan", + /* IDN */ "Indonésie", + /* DIF */ "District fédéral", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Querétaro", + /* HID */ "Hidalgo", + /* MX-MX */ "État de Mexico", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatán", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacán", + /* SLP */ "San Luis Potosí", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo León", + /* BCN */ "Basse-Californie", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Basse-Californie du Sud", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Groenland", + /* SAU */ "Arabie Saoudite", + /* COD */ "Congo-Kinshasa", + /* DZA */ "Algérie", + /* KAZ */ "Kazakhstan", + /* ARG */ "Argentine", + /* IN-DD */ "Daman et Diu", + /* IN-DN */ "Dadra et Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman-et-Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Pendjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu-et-Cachemire", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Bengale-occidental", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Pondichéry", + /* NSW */ "Nouvelle-Galles du Sud", + /* ACT */ "Territoire de la capitale australienne", + /* JBT */ "Territoire de la baie de Jervis", + /* AU-NT */ "Territoire du Nord", + /* AU-SA */ "Australie Méridionale", + /* TAS */ "Tasmanie", + /* VIC */ "Victoria", + /* AU-WA */ "Australie-Occidentale", + /* QLD */ "Queensland", + /* BR-DF */ "District fédéral", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espírito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraíba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambouc", + /* BR-AP */ "Amapá", + /* BR-CE */ "Ceará", + /* BR-AC */ "Acre", + /* BR-PR */ "Paraná", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondônia", + /* BR-SP */ "São Paulo", + /* BR-PI */ "Piauí", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhão", + /* BR-GO */ "Goiás", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District de Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaï", + /* US-MD */ "Maryland", + /* US-WV */ "Virginie-Occidentale", + /* US-SC */ "Caroline du Sud", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginie", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvanie", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiane", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Caroline du Nord", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Géorgie", + /* US-WI */ "Wisconsin", + /* US-FL */ "Floride", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Dakota du Nord", + /* US-WA */ "Washington", + /* US-SD */ "Dakota du Sud", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Nouveau-Mexique", + /* US-MT */ "Montana", + /* US-CA */ "Californie", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "Colombie-Britannique", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Québec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Terre-Neuve", + /* CA-NB */ "Nouveau-Brunswick", + /* CA-NS */ "Nouvelle-Écosse", + /* CA-PE */ "Île-du-Prince-Edward", + /* CA-YT */ "Yukon", + /* CA-NT */ "Territoires du Nord-Ouest", + /* CA-NU */ "Nunavut", + /* IND */ "Inde", + /* AUS */ "Australie", + /* BRA */ "Brésil", + /* USA */ "USA|États-Unis d`Amérique|Amérique", + /* MEX */ "Mexique", + /* MOW */ "Moscou", + /* SPE */ "Saint-Pétersbourg", + /* KGD */ "Oblast de Kaliningrad", + /* RU-IN */ "Ingouchie", + /* RU-AD */ "République d’Adyguée", + /* RU-SE */ "République d’Ossétie du Nord-Alanie", + /* RU-KB */ "Kabardino-Balkarie", + /* RU-KC */ "République de Karatchaïévo-Tcherkessie", + /* RU-CE */ "République tchétchène", + /* RU-CU */ "République de Tchouvachie", + /* IVA */ "Oblast d’Ivanovo", + /* LIP */ "Oblast de Lipetsk", + /* ORL */ "Oblast d’Orel", + /* TUL */ "Oblast de Toula", + /* RU-BE */ "Oblast de Belgorod", + /* VLA */ "Oblast de Vladimir", + /* KRS */ "Oblast de Koursk", + /* KLU */ "Oblast de Kaluga", + /* RU-TT */ "Oblast de Tambov", + /* BRY */ "Oblast de Briansk", + /* YAR */ "Oblast de Iaroslavl", + /* RYA */ "Oblast de Riazan", + /* AST */ "Oblast d’Astrakhan", + /* MOS */ "Oblast de Moscou", + /* SMO */ "Oblast de Smolensk", + /* RU-DA */ "République du Daguestan", + /* VOR */ "Oblast de Voronej", + /* NGR */ "Oblast de Novgorod", + /* PSK */ "Oblast de Pskov", + /* KOS */ "Oblast de Kostroma", + /* STA */ "Kraï de Stavropol", + /* KDA */ "Kraï de Krasnodar", + /* RU-KL */ "République de Kalmoukie", + /* TVE */ "Oblast de Tver", + /* LEN */ "Oblast de Léningrad", + /* ROS */ "Oblast de Rostov", + /* VGG */ "Oblast de Volgograd", + /* VLG */ "Oblast de Vologda", + /* MUR */ "Oblast de Mourmansk", + /* RU-KR */ "République de Carélie", + /* NEN */ "District autonome de Nénétsie", + /* RU-KO */ "République des Komis", + /* ARK */ "Oblast d’Arkhangelsk", + /* RU-MO */ "République de Mordovie", + /* NIZ */ "Oblast de Nijni Novgorod", + /* PNZ */ "Oblast de Penza", + /* RU-KI */ "Oblast de Kirov", + /* RU-ME */ "République des Maris", + /* ORE */ "Oblast d’Orenbourg", + /* ULY */ "Oblast d’Oulianovsk", + /* RU-PM */ "Kraï de Perm", + /* RU-BA */ "République de Bachkirie", + /* RU-UD */ "Oudmourtie", + /* RU-TA */ "République du Tatarstan", + /* SAM */ "Oblast de Samara", + /* SAR */ "Oblast de Saratov", + /* YAN */ "Iamalo-Nénétsie", + /* RU-KM */ "Khantys-Mansis", + /* SVE */ "Oblast de Sverdlovsk", + /* TYU */ "Oblast de Tioumen", + /* KGN */ "Oblast de Kourgan", + /* RU-CH */ "Oblast de Tcheliabinsk", + /* RU-BU */ "République de Bouriatie", + /* ZAB */ "Kraï de Transbaïkalie", + /* IRK */ "Oblast d’Irkoutsk", + /* NVS */ "Oblast de Novossibirsk", + /* TOM */ "Oblast de Tomsk", + /* OMS */ "Oblast d’Omsk", + /* RU-KK */ "République de Khakassie", + /* KEM */ "Oblast de Kemerovo", + /* RU-AL */ "République de l’Altaï", + /* ALT */ "Kraï de l’Altaï", + /* RU-TY */ "République de Touva", + /* KYA */ "Kraï de Krasnoïarsk", + /* MAG */ "Oblast de Magadan", + /* CHU */ "Tchoukotka", + /* KAM */ "Kraï du Kamtchatka", + /* SAK */ "Oblast de Sakhaline", + /* RU-PO */ "Kraï du Krai", + /* YEV */ "Oblast autonome juif", + /* KHA */ "Kraï de Khabarovsk", + /* AMU */ "Oblast d’Amour", + /* RU-SA */ "République de Sakha|République de Yakoutie", + /* CAN */ "Canada", + /* RUS */ "Russie", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Pékin", + /* CN-HI */ "Hainan", + /* CN-NX */ "Hui du Ningxia", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Mongolie-intérieure", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Région autonome Zhuang du Guangxi", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Région autonome ouïghoure du Xinjiang", + /* CHN */ "Chine", + /* UMI */ "Îles mineures éloignées des États-Unis", + /* CPT */ "Île de Clipperton", + /* ATA */ "Antarctique", + /* AAA */ "International|Monde|Terre" +#else // MAPCODE_SUPPORT_LANGUAGE_FR + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_FR +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_FR_H__ diff --git a/mapcodelib/internal_territory_names_he.h b/mapcodelib/internal_territory_names_he.h new file mode 100644 index 0000000..b463d5a --- /dev/null +++ b/mapcodelib/internal_territory_names_he.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_HE_H__ +#define __INTERNAL_TERRITORY_NAMES_HE_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_HE[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_HE // Hebrew + /* VAT */ "הוותיקן|הכס הקדוש", + /* MCO */ "מונקו", + /* GIB */ "גיברלטר", + /* TKL */ "טוקלאו", + /* CCK */ "איי קוקוס|קילינג איי", + /* BLM */ "סנט ברתלמי", + /* NRU */ "נאורו", + /* TUV */ "טובאלו", + /* MAC */ "מקאו", + /* SXM */ "סן מרטן", + /* MAF */ "סנט מרטין אין", + /* NFK */ "נורפולק ופיליפ איילנד|פיליפ איילנד", + /* PCN */ "איי פיטקרן", + /* BVT */ "איי בובה", + /* BMU */ "ברמודה", + /* IOT */ "טריטוריה בריטית באוקיינוס ​​ההודי", + /* SMR */ "סן מרינו", + /* GGY */ "גרנזי", + /* AIA */ "אנגווילה", + /* MSR */ "מונטסראט", + /* JEY */ "ג`רזי", + /* CXR */ "אי חג המולד", + /* WLF */ "ואליס ופוטונה|ופוטונה", + /* VGB */ "איי הבתולה הבריטיים|איי הבתולה, בריטניה", + /* LIE */ "ליכטנשטיין", + /* ABW */ "ארובה", + /* MHL */ "איי מרשל", + /* ASM */ "סמואה האמריקאית|סמואה, אמריקאי", + /* COK */ "איי קוק", + /* SPM */ "סנט פייר ומיקלון|ומיקלון", + /* NIU */ "ניואה", + /* KNA */ "סנט קיטס ונוויס", + /* CYM */ "איי קיימן", + /* BES */ "בונייר, סנט ואת סבא|סבא", + /* MDV */ "האיים המלדיביים", + /* SHN */ "סנט הלנה, אסנשן וטריסטן דה קונה|טריסטן דה קונה", + /* MLT */ "מלטה", + /* GRD */ "גרנדה", + /* VIR */ "איי הבתולה של ארצות הברית", + /* MYT */ "מיוט", + /* SJM */ "סבאלברד ויאן מאיין|יאן מאיין", + /* VCT */ "סנט וינסנט והגרנדינים|והגרנדינים", + /* HMD */ "שמעתי איילנד ואיי מקדונלד", + /* BRB */ "ברבדוס", + /* ATG */ "אנטיגואה וברבודה|וברבודה", + /* CUW */ "קורסאו", + /* SYC */ "סיישל", + /* PLW */ "פלאו", + /* MNP */ "איי מריאנה הצפוניים", + /* AND */ "אנדורה", + /* GUM */ "גואם", + /* IMN */ "האי מאן", + /* LCA */ "סנט לוסיה", + /* FSM */ "מיקרונזיה", + /* SGP */ "סינגפור", + /* TON */ "טונגה", + /* DMA */ "דומיניקה", + /* BHR */ "בחריין", + /* KIR */ "קיריבטי", + /* TCA */ "איי טורקס וקאיקוס|וקאיקוס איי", + /* STP */ "סאו טומה ופרינסיפה", + /* HKG */ "הונג קונג", + /* MTQ */ "מרטיניק", + /* FRO */ "איי פרו", + /* GLP */ "גוואדלופ", + /* COM */ "קומורו", + /* MUS */ "מאוריציוס", + /* REU */ "איחוד", + /* LUX */ "לוקסמבורג", + /* WSM */ "סמואה", + /* SGS */ "ג`ורג`יה הדרומית ואיי סנדוויץ `הדרומיים|ואיי סנדוויץ` הדרומיים", + /* PYF */ "פולינזיה הצרפתית", + /* CPV */ "קייפ ורדה", + /* TTO */ "טרינידד וטובגו|וטובגו", + /* BRN */ "ברוניי", + /* ATF */ "מקרקעי דרום צרפתים באנטארקטיקה", + /* PRI */ "פוארטו ריקו", + /* CYP */ "קַפרִיסִין", + /* LBN */ "לבנון", + /* JAM */ "ג`מייקה", + /* GMB */ "גמביה", + /* QAT */ "קטאר", + /* FLK */ "איי פוקלנד", + /* VUT */ "ונואטו", + /* MNE */ "מונטנגרו", + /* BHS */ "איי בהאמה", + /* TLS */ "מזרח טימור", + /* SWZ */ "סווזילנד", + /* KWT */ "כווית", + /* FJI */ "איי פיג`י|פיג`י", + /* NCL */ "קלדוניה החדשה", + /* SVN */ "סלובניה", + /* ISR */ "ישראל", + /* PSE */ "השטח הפלסטיני", + /* SLV */ "אל סלבדור", + /* BLZ */ "בליז", + /* DJI */ "ג`יבוטי", + /* MKD */ "מוּקדוֹן", + /* RWA */ "רואנדה", + /* HTI */ "איטי", + /* BDI */ "בורונדי", + /* GNQ */ "גיניאה המשוונית", + /* ALB */ "אלבניה", + /* SLB */ "אי שלם", + /* ARM */ "אַרְמֶנִיָה", + /* LSO */ "לסוטו", + /* BEL */ "בלגיה", + /* MDA */ "מולדובה", + /* GNB */ "גינאה ביסאו", + /* TWN */ "טייוואן", + /* BTN */ "בהוטן", + /* CHE */ "שווייץ", + /* NLD */ "הולנד", + /* DNK */ "דנמרק", + /* EST */ "אסטוניה", + /* DOM */ "הרפובליקה הדומיניקנית", + /* SVK */ "סלובקיה", + /* CRI */ "קוסטה ריקה", + /* BIH */ "בוסניה והרצגובינה", + /* HRV */ "קרואטיה", + /* TGO */ "רפובליקת טוגו", + /* LVA */ "לטביה", + /* LTU */ "ליטא", + /* LKA */ "סרי לנקה", + /* GEO */ "גאורגיה", + /* IRL */ "אירלנד", + /* SLE */ "סיירה לאונה", + /* PAN */ "פנמה", + /* CZE */ "הרפובליקה הצ`כית", + /* GUF */ "גיאנה הצרפתית", + /* ARE */ "איחוד האמירויות הערביות", + /* AUT */ "אוֹסְטְרֵיָה", + /* AZE */ "אזרבייג`ן", + /* SRB */ "סרביה", + /* JOR */ "יַרדֵן", + /* PRT */ "פּוֹרטוּגָל", + /* HUN */ "הונגריה", + /* KOR */ "דרום קוריאה", + /* ISL */ "אִיסלַנד", + /* GTM */ "גואטמלה", + /* CUB */ "קובה", + /* BGR */ "בולגריה", + /* LBR */ "ליבריה", + /* HND */ "הונדורס", + /* BEN */ "בנין", + /* ERI */ "אריתריאה", + /* MWI */ "מלאווי", + /* PRK */ "צפון קוריאה", + /* NIC */ "ניקרגואה", + /* GRC */ "יָוָן", + /* TJK */ "טג`יקיסטן", + /* BGD */ "בנגלדש", + /* NPL */ "נפאל", + /* TUN */ "תוניסיה", + /* SUR */ "סורינאם", + /* URY */ "אורוגוואי", + /* KHM */ "קמבודיה", + /* SYR */ "סוּריָה", + /* SEN */ "סנגל", + /* KGZ */ "קירגיזסטן", + /* BLR */ "בלארוס", + /* GUY */ "גיאנה", + /* LAO */ "לאוס", + /* ROU */ "רומני", + /* GHA */ "גאנה", + /* UGA */ "אוגנדה", + /* GBR */ "בריטניה|סקוטלנד|הממלכה המאוחדת|צפון אירלנד|אירלנד, צפון", + /* GIN */ "גינאה", + /* ECU */ "אקוודור", + /* ESH */ "הסהרה המערבית|סהרה טוענת לבעלות", + /* GAB */ "גבון", + /* NZL */ "ניו זילנד", + /* BFA */ "בורקינה פאסו", + /* PHL */ "פיליפיני", + /* ITA */ "אִיטַלִיָה", + /* OMN */ "עומאן", + /* POL */ "פּוֹלִין", + /* CIV */ "חוף שנהב", + /* NOR */ "נורווגיה", + /* MYS */ "מלזיה", + /* VNM */ "וייטנאם", + /* FIN */ "פינלנד", + /* COG */ "קונגו-ברזוויל", + /* DEU */ "גֶרמָנִיָה", + /* JPN */ "יפן", + /* ZWE */ "זימבבואה", + /* PRY */ "פרגוואי", + /* IRQ */ "עִירַאק", + /* MAR */ "מָרוֹקוֹ", + /* UZB */ "אוזבקיסטן", + /* SWE */ "שוודיה", + /* PNG */ "פפואה גינאה החדשה", + /* CMR */ "קמרון", + /* TKM */ "טורקמניסטן", + /* ESP */ "סְפָרַד", + /* THA */ "תאילנד", + /* YEM */ "תֵימָן", + /* FRA */ "צָרְפַת", + /* ALA */ "איי אולנד", + /* KEN */ "קנייה", + /* BWA */ "בוטסואנה", + /* MDG */ "מדגסקר", + /* UKR */ "אוקראינה", + /* SSD */ "דרום סודן", + /* CAF */ "הרפובליקה המרכז - אפריקאית", + /* SOM */ "סומליה", + /* AFG */ "אפגניסטן", + /* MMR */ "מיאנמר|בורמה", + /* ZMB */ "זמביה", + /* CHL */ "צ`ילה", + /* TUR */ "טורקיה", + /* PAK */ "פקיסטן", + /* MOZ */ "מוזמביק", + /* NAM */ "נמיביה", + /* VEN */ "ונצואלה", + /* NGA */ "ניגריה", + /* TZA */ "טנזניה", + /* EGY */ "מִצְרַיִם", + /* MRT */ "מאוריטניה", + /* BOL */ "בוליביה", + /* ETH */ "אֶתִיוֹפִּיָה", + /* COL */ "קולומביה", + /* ZAF */ "דרום אפריקה", + /* MLI */ "מאלי", + /* AGO */ "אנגולה", + /* NER */ "ניז`ר", + /* TCD */ "צ`אד", + /* PER */ "פרו", + /* MNG */ "מונגוליה", + /* IRN */ "אִירָן", + /* LBY */ "לוב", + /* SDN */ "סודן", + /* IDN */ "אִינדוֹנֵזִיָה", + /* DIF */ "מחוז פדרלי", + /* TLA */ "טלאקסקאלה", + /* MOR */ "מורלוס", + /* AGU */ "אגואסקליינטס", + /* MX-CL */ "קולימה", + /* QUE */ "קרטארו", + /* HID */ "הידאלגו", + /* MX-MX */ "מדינת מקסיקו", + /* TAB */ "טָבַּסקוֹ", + /* NAY */ "נאיאריט", + /* GUA */ "גואנחואטו", + /* PUE */ "פואבלה", + /* YUC */ "יוקטן", + /* ROO */ "קווינטנה רו", + /* SIN */ "סינאלואה", + /* CAM */ "קמפצ`ה", + /* MIC */ "במיצ`ואקאן", + /* SLP */ "סן לואיס פוטוסי", + /* GRO */ "גררתי", + /* NLE */ "נואבו לאון", + /* BCN */ "באחה קליפורניה", + /* VER */ "וראקרוז", + /* CHP */ "צ`יאפס", + /* BCS */ "באחה קליפורניה הדרומית", + /* ZAC */ "זאקאטקאס", + /* JAL */ "חליסקו", + /* TAM */ "טמאוליפס", + /* OAX */ "אואחאקה", + /* DUR */ "דורנגו", + /* COA */ "קואהווילה", + /* SON */ "סונורה", + /* CHH */ "צ`יוואווה", + /* GRL */ "גרינלנד", + /* SAU */ "ערב הסעודית", + /* COD */ "קונגו-קינשאסה", + /* DZA */ "אלג`יריה", + /* KAZ */ "קזחסטן", + /* ARG */ "ארגנטינה", + /* IN-DD */ "דמאן ודיו", + /* IN-DN */ "דדרה ונגר הבלי", + /* IN-CH */ "צ`אנדיגאר", + /* IN-AN */ "אנדמן וניקובר", + /* IN-LD */ "לקשאדוויפ", + /* IN-DL */ "דלהי", + /* IN-ML */ "מאגאליה", + /* IN-NL */ "נאגאלנד", + /* IN-MN */ "מניפור", + /* IN-TR */ "טריפורה", + /* IN-MZ */ "מיזוראם", + /* IN-SK */ "סיקים", + /* IN-PB */ "פונג`אב", + /* IN-HR */ "האריאנה", + /* IN-AR */ "ארונצ`אל פראדש", + /* IN-AS */ "אסאם", + /* IN-BR */ "ביהאר", + /* IN-UT */ "אוטראקהאנד", + /* IN-GA */ "גואה", + /* IN-KL */ "קראלה", + /* IN-TN */ "טאמיל נאדו", + /* IN-HP */ "הימאצ`אל פראדש", + /* IN-JK */ "ג`אמו וקשמיר", + /* IN-CT */ "צ`האטיסגאר", + /* IN-JH */ "ג`הרקאנד", + /* IN-KA */ "קרנטקה", + /* IN-RJ */ "רג`סטאן", + /* IN-OR */ "אודסה|אוריסה", + /* IN-GJ */ "גוג`אראט", + /* IN-WB */ "מערב בנגל", + /* IN-MP */ "מאדהיה פראדש", + /* IN-TG */ "טלנגאנה", + /* IN-AP */ "אנדרה פראדש", + /* IN-MH */ "מהרשטרה", + /* IN-UP */ "אוטר פראדש", + /* IN-PY */ "פונדיצ`רי", + /* NSW */ "ניו סאות` ויילס", + /* ACT */ "טריטוריית הבירה האוסטרלית", + /* JBT */ "טריטוריית מפרץ ג`רביס", + /* AU-NT */ "הטריטוריה הצפונית", + /* AU-SA */ "דרום אוסטרליה", + /* TAS */ "טסמניה", + /* VIC */ "ויקטוריה", + /* AU-WA */ "מערב אוסטרליה", + /* QLD */ "קווינסלנד", + /* BR-DF */ "מחוז פדרלי", + /* BR-SE */ "סרגיפה", + /* BR-AL */ "אלאגאוס", + /* BR-RJ */ "ריו דה ז`נרו", + /* BR-ES */ "אספיריטו סנטו", + /* BR-RN */ "ריו גרנדה דו נורטה", + /* BR-PB */ "פרייבה", + /* BR-SC */ "סנטה קטרינה", + /* BR-PE */ "פרנמבוקו", + /* BR-AP */ "אמאפה", + /* BR-CE */ "סיארה", + /* BR-AC */ "עכו", + /* BR-PR */ "פאראנה", + /* BR-RR */ "רוראימה", + /* BR-RO */ "רונדוניה", + /* BR-SP */ "סאו פאולו", + /* BR-PI */ "פיאאוי", + /* BR-TO */ "טוקנטינס", + /* BR-RS */ "ריו גרנדה דו סול", + /* BR-MA */ "מרנאו", + /* BR-GO */ "גויאש", + /* BR-MS */ "מאטו גרוסו דו סול", + /* BR-BA */ "באהיה", + /* BR-MG */ "מינאס גראיס", + /* BR-MT */ "מאטו גרוסו", + /* BR-PA */ "פארה", + /* BR-AM */ "אמזונס", + /* US-DC */ "מחוז קולומביה", + /* US-RI */ "רוד איילנד", + /* US-DE */ "דלאוור", + /* US-CT */ "קונטיקט", + /* US-NJ */ "ניו ג`רזי", + /* US-NH */ "ניו המפשייר", + /* US-VT */ "ורמונט", + /* US-MA */ "מסצ`וסטס", + /* US-HI */ "הוואי", + /* US-MD */ "מרילנד", + /* US-WV */ "מערב וירג`יניה", + /* US-SC */ "דרום קרוליינה", + /* US-ME */ "מיין", + /* US-IN */ "אינדיאנה", + /* US-KY */ "קנטאקי", + /* US-TN */ "טנסי", + /* US-VA */ "וירג`יניה", + /* US-OH */ "אוהיו", + /* US-PA */ "פנסילבניה", + /* US-MS */ "מיסיסיפי", + /* US-LA */ "לואיזיאנה", + /* US-AL */ "אלבמה", + /* US-AR */ "ארקנסו", + /* US-NC */ "צפון קרוליינה", + /* US-NY */ "ניו יורק", + /* US-IA */ "איווה", + /* US-IL */ "אילינוי", + /* US-GA */ "גאורגיה", + /* US-WI */ "ויסקונסין", + /* US-FL */ "פלורידה", + /* US-MO */ "מיזורי", + /* US-OK */ "אוקלהומה", + /* US-ND */ "צפון דקוטה", + /* US-WA */ "וושינגטון", + /* US-SD */ "דרום דקוטה", + /* US-NE */ "נברסקה", + /* US-KS */ "קנזס", + /* US-ID */ "איידהו", + /* US-UT */ "יוטה", + /* US-MN */ "מינסוטה", + /* US-MI */ "מישיגן", + /* US-WY */ "ויומינג", + /* US-OR */ "אורגון", + /* US-CO */ "קולורדו", + /* US-NV */ "נבדה", + /* US-AZ */ "אריזונה", + /* US-NM */ "ניו מקסיקו", + /* US-MT */ "מונטנה", + /* US-CA */ "קליפורניה", + /* US-TX */ "טקסס", + /* US-AK */ "אלסקה", + /* CA-BC */ "קולומביה הבריטית", + /* CA-AB */ "אלברטה", + /* CA-ON */ "אונטריו", + /* CA-QC */ "קוויבק", + /* CA-SK */ "בססקצ`ואן", + /* CA-MB */ "מניטובה", + /* CA-NL */ "ניופאונדלנד", + /* CA-NB */ "ניו - ברונסוויק", + /* CA-NS */ "נובה סקוטיה", + /* CA-PE */ "אי הנסיך אדוארד", + /* CA-YT */ "יוקון", + /* CA-NT */ "הטריטוריות הצפון מערביות", + /* CA-NU */ "נונאווט", + /* IND */ "הוֹדוּ", + /* AUS */ "אוֹסטְרַלִיָה", + /* BRA */ "בְּרָזִיל", + /* USA */ "אַרצוֹת הַבְּרִית", + /* MEX */ "מקסיקו", + /* MOW */ "מוסקבה", + /* SPE */ "סנט פטרסבורג", + /* KGD */ "מחוז קלינינגרד", + /* RU-IN */ "אינגושטיה הרפובליקה", + /* RU-AD */ "אדיגיה הרפובליקה", + /* RU-SE */ "צפון אוסטיה-אלניה הרפובליקה", + /* RU-KB */ "קברדינו-בלקריה", + /* RU-KC */ "קאראצ`אי-צ`רקסיה", + /* RU-CE */ "הצ`צ`נים רפובליקה", + /* RU-CU */ "חבוש רפובליקה", + /* IVA */ "מחוז איוואנובו", + /* LIP */ "מחוז ליפצק", + /* ORL */ "מחוז אוריול", + /* TUL */ "מחוז טולה", + /* RU-BE */ "מחוז בלגורוד", + /* VLA */ "מחוז ולדימיר", + /* KRS */ "מחוז קורסק", + /* KLU */ "מחוז קלוגה", + /* RU-TT */ "מחוז טמבוב", + /* BRY */ "מחוז בריאנסק", + /* YAR */ "מחוז ירוסלבל", + /* RYA */ "מחוז ריאזאן", + /* AST */ "מחוז אסטרחן", + /* MOS */ "מחוז מוסקבה", + /* SMO */ "מחוז סמולנסק", + /* RU-DA */ "דאגסטן הרפובליקה", + /* VOR */ "מחוז וורונז `", + /* NGR */ "מחוז נובגורוד", + /* PSK */ "מחוז פסקוב", + /* KOS */ "מחוז קוסטרומה", + /* STA */ "מחוז סטברופול", + /* KDA */ "קרסנודר Krai", + /* RU-KL */ "קלמיקיה הרפובליקה", + /* TVE */ "מחוז טבר", + /* LEN */ "מחוז לנינגרד", + /* ROS */ "מחוז רוסטוב", + /* VGG */ "מחוז וולגוגרד", + /* VLG */ "מחוז וולוגדה", + /* MUR */ "מחוז מורמנסק", + /* RU-KR */ "קרליה הרפובליקה", + /* NEN */ "המחוז האוטונומי של הניינץ", + /* RU-KO */ "רפובליקה קומית", + /* ARK */ "מחוז ארכנגלסק", + /* RU-MO */ "מורדוביה הרפובליקה", + /* NIZ */ "מחוז ניז`ני נובגורוד", + /* PNZ */ "מחוז פנזה", + /* RU-KI */ "מחוז קירוב", + /* RU-ME */ "מארי אל הרפובליקה", + /* ORE */ "מחוז אורנבורג", + /* ULY */ "מחוז אולייאנובסק", + /* RU-PM */ "מחוז פרם", + /* RU-BA */ "הרפובליקה של בשקיריה", + /* RU-UD */ "אודמורט הרפובליקה", + /* RU-TA */ "טטרסטן הרפובליקה", + /* SAM */ "מחוז סמרה", + /* SAR */ "מחוז סראטוב", + /* YAN */ "ימלו-Nenets", + /* RU-KM */ "חאנטי-מנסי", + /* SVE */ "מחוז סברדלובסק", + /* TYU */ "מחוז טיומן", + /* KGN */ "מחוז קורגן", + /* RU-CH */ "מחוז צ`ליאבינסק", + /* RU-BU */ "בוריאטיה הרפובליקה", + /* ZAB */ "מחוז עבר הבאיקל", + /* IRK */ "מחוז אירקוטסק", + /* NVS */ "מחוז נובוסיבירסק", + /* TOM */ "מחוז טומסק", + /* OMS */ "מחוז אומסק", + /* RU-KK */ "חקסיה הרפובליקה", + /* KEM */ "מחוז קמרובו", + /* RU-AL */ "אלטאי", + /* ALT */ "מחוז אלטאי", + /* RU-TY */ "הרפובליקה של טובה", + /* KYA */ "מחוז קרסנויארסק", + /* MAG */ "מחוז מגדן", + /* CHU */ "צ`וקוטקה אוקרוג", + /* KAM */ "מחוז קמצ`טקה", + /* SAK */ "מחוז סחלין", + /* RU-PO */ "מחוז פרימוריה", + /* YEV */ "מחוז יהודי אוטונומי", + /* KHA */ "מחוז חברובסק", + /* AMU */ "מחוז אמור", + /* RU-SA */ "רפובליקת סאחה-יקוטיה|רפובליקה יאקוטיה", + /* CAN */ "קנדה", + /* RUS */ "רוּסִיָה", + /* CN-SH */ "שנחאי", + /* CN-TJ */ "טיאנג`ין", + /* CN-BJ */ "בייג`ינג", + /* CN-HI */ "האינאן", + /* CN-NX */ "נינגשיה הואי", + /* CN-CQ */ "צ`ונגצ`ינג", + /* CN-ZJ */ "ג`ה|ג`ג`יאנג", + /* CN-JS */ "ג`יאנגסו", + /* CN-FJ */ "פוג`יאן", + /* CN-AH */ "אנהוי", + /* CN-LN */ "ליאונינג", + /* CN-SD */ "שאנדונג", + /* CN-SX */ "שאנשי", + /* CN-JX */ "ג`יאנג", + /* CN-HA */ "הנאן", + /* CN-GZ */ "גוויג", + /* CN-GD */ "גואנגדונג", + /* CN-HB */ "הוביי", + /* CN-JL */ "ג`ילין", + /* CN-HE */ "הביי", + /* CN-SN */ "שאאנשי", + /* CN-NM */ "אינר מונגוליה", + /* CN-HL */ "היילונג", + /* CN-HN */ "הונאן", + /* CN-GX */ "גואנגשי ג`ואנג", + /* CN-SC */ "סצ`ואן", + /* CN-YN */ "יונאן", + /* CN-XZ */ "טיבט", + /* CN-GS */ "גאנסו", + /* CN-QH */ "צ`ינגהאי", + /* CN-XJ */ "אויגורים שינג`יאנג", + /* CHN */ "סין", + /* UMI */ "ארצות הברית האיים המרוחקים הקטנים", + /* CPT */ "קליפרטון", + /* ATA */ "אנטארקטיקה", + /* AAA */ "הבינלאומי|כדור הארץ" +#else // MAPCODE_SUPPORT_LANGUAGE_HE + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_HE +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_HE_H__ diff --git a/mapcodelib/internal_territory_names_hi.h b/mapcodelib/internal_territory_names_hi.h new file mode 100644 index 0000000..c301647 --- /dev/null +++ b/mapcodelib/internal_territory_names_hi.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_HI_H__ +#define __INTERNAL_TERRITORY_NAMES_HI_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_HI[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_HI // Hindi + /* VAT */ "वेटिकन सिटी|पवित्र देखें", + /* MCO */ "मोनाको", + /* GIB */ "जिब्राल्टर", + /* TKL */ "टोकेलाऊ", + /* CCK */ "कोकोस द्वीप|कीलिंग द्वीप समूह", + /* BLM */ "सेंट बार्थलेमी", + /* NRU */ "नाउरू", + /* TUV */ "तुवालु", + /* MAC */ "मकाओ", + /* SXM */ "सिंट मार्टेन", + /* MAF */ "सेंट मार्टिन", + /* NFK */ "नोरफोक द्वीप और फिलिप द्वीप|नोरफोक द्वीप|फिलिप द्वीप", + /* PCN */ "पिटकेर्न द्वीप समूह", + /* BVT */ "बुवेत आइलैंड", + /* BMU */ "बरमूडा", + /* IOT */ "ब्रिटिश हिंद महासागरीय क्षेत्र", + /* SMR */ "सैन मैरिनो", + /* GGY */ "ग्वेर्नसे", + /* AIA */ "एंगुइला", + /* MSR */ "मॉन्ट्सेराट", + /* JEY */ "जर्सी", + /* CXR */ "क्रिसमस द्वीप", + /* WLF */ "वालिस और फ़्यूचूना|फ़्यूचूना", + /* VGB */ "ब्रिटिश वर्जिन आइलैंड्स", + /* LIE */ "लिकटेंस्टीन", + /* ABW */ "अरूबा", + /* MHL */ "मार्शल द्वीप", + /* ASM */ "अमेरिकी समोआ|समोआ, अमेरिकी", + /* COK */ "कुक आइलैंड्स", + /* SPM */ "सेंट पियरे और मिकेलॉन|मिकेलॉन", + /* NIU */ "नीयू", + /* KNA */ "सेंट किट्स और नेविस|नेविस", + /* CYM */ "केमैन टापू", + /* BES */ "सबा", + /* MDV */ "मालदीव", + /* SHN */ "सेंट हेलेना, उदगम और त्रिस्टान दा कुन्हा|आरोहण", + /* MLT */ "माल्टा", + /* GRD */ "ग्रेनेडा", + /* VIR */ "वर्जिन आइलैंड्स|वर्जिन द्वीप समूह, संयुक्त राज्य अमरीका", + /* MYT */ "मैयट", + /* SJM */ "स्वालबार्ड और जैन मायेन|जैन मायेन", + /* VCT */ "सेंट विंसेंट और ग्रेनेडाइंस|ग्रेनेजियन्स", + /* HMD */ "हर्ड आइलैंड और मैकडोनाल्ड आइलैंड्स|मैकडोनाल्ड आइलैंड्स", + /* BRB */ "बारबाडोस", + /* ATG */ "एंटीगुआ और बारबुडा|बारबुडा", + /* CUW */ "कुराकाओ", + /* SYC */ "सेशेल्स", + /* PLW */ "पलाऊ", + /* MNP */ "उत्तरी मारियाना द्वीप", + /* AND */ "अंडोरा", + /* GUM */ "गुआम", + /* IMN */ "आइल ऑफ मैन", + /* LCA */ "सेंट लूसिया", + /* FSM */ "माइक्रोनेशिया", + /* SGP */ "सिंगापुर", + /* TON */ "टोंगा", + /* DMA */ "डोमिनिका", + /* BHR */ "बहरीन", + /* KIR */ "किरिबाती", + /* TCA */ "तुर्क्स ऐंड कैकोज़ आइलैंड्स|कोइकोस आइलैंड्स", + /* STP */ "साओ टोम और प्रिंसिपे", + /* HKG */ "हांगकांग", + /* MTQ */ "मार्टीनिक", + /* FRO */ "फ़ैरो आइलैंड्स", + /* GLP */ "ग्वाडेलोप", + /* COM */ "कोमोरोस", + /* MUS */ "मॉरीशस", + /* REU */ "रीयूनियन", + /* LUX */ "लक्समबर्ग", + /* WSM */ "समोआ", + /* SGS */ "दक्षिण जॉर्जिया और साउथ सैंडविच आइलैंड्स|साउथ सैंडविच आइलैंड्स", + /* PYF */ "फ्रेंच पोलिनेशिया", + /* CPV */ "केप वर्दे", + /* TTO */ "त्रिनिदाद एंड टोबेगो|टोबैगो", + /* BRN */ "ब्रुनेई", + /* ATF */ "फ्रेंच सदर्न एंड अंटार्कटिक लैंड्स", + /* PRI */ "पर्टो रीको", + /* CYP */ "साइप्रस", + /* LBN */ "लेबनान", + /* JAM */ "जमैका", + /* GMB */ "गाम्बिया", + /* QAT */ "कतर", + /* FLK */ "फ़ॉकलैंड द्वीप समूह", + /* VUT */ "वानुअतु", + /* MNE */ "मोंटेनेग्रो", + /* BHS */ "बहामा", + /* TLS */ "पूर्वी तिमोर", + /* SWZ */ "स्वाज़ीलैंड", + /* KWT */ "कुवैत", + /* FJI */ "फिजी द्वीप समूह|फ़िजी", + /* NCL */ "न्यू कैलेडोनिया", + /* SVN */ "स्लोवेनिया", + /* ISR */ "इसराइल", + /* PSE */ "फ़िलिस्तीन राष्ट्र", + /* SLV */ "अल साल्वाडोर", + /* BLZ */ "बेलीज", + /* DJI */ "जिबूती", + /* MKD */ "मैसिडोनिया", + /* RWA */ "रूआण्डा", + /* HTI */ "हैती", + /* BDI */ "बुस्र्न्दी", + /* GNQ */ "इक्वेटोरियल गिनी", + /* ALB */ "अल्बानिया", + /* SLB */ "सोलोमन द्वीप", + /* ARM */ "आर्मीनिया", + /* LSO */ "लेसोथो", + /* BEL */ "बेल्जियम", + /* MDA */ "मोल्दोवा", + /* GNB */ "गिनी - बिसाऊ", + /* TWN */ "ताइवान", + /* BTN */ "भूटान", + /* CHE */ "स्विटज़रलैंड", + /* NLD */ "नीदरलैंड", + /* DNK */ "डेनमार्क", + /* EST */ "एस्टोनिया", + /* DOM */ "डोमिनिकन गणराज्य", + /* SVK */ "स्लोवाकिया", + /* CRI */ "कोस्टा रिका", + /* BIH */ "बोस्निया और हर्जेगोविना", + /* HRV */ "क्रोएशिया", + /* TGO */ "टोगो", + /* LVA */ "लातविया", + /* LTU */ "लिथुआनिया", + /* LKA */ "श्रीलंका", + /* GEO */ "जॉर्जिया", + /* IRL */ "आयरलैंड", + /* SLE */ "सिएरा लियोन", + /* PAN */ "पनामा", + /* CZE */ "चेक गणराज्य", + /* GUF */ "फ्रेंच गयाना", + /* ARE */ "संयुक्त अरब अमीरात", + /* AUT */ "ऑस्ट्रिया", + /* AZE */ "आज़रबाइजान", + /* SRB */ "सर्बिया", + /* JOR */ "जॉर्डन", + /* PRT */ "पुर्तगाल", + /* HUN */ "हंगरी", + /* KOR */ "दक्षिण कोरिया", + /* ISL */ "आइसलैंड", + /* GTM */ "ग्वाटेमाला", + /* CUB */ "क्यूबा", + /* BGR */ "बुल्गारिया", + /* LBR */ "लाइबेरिया", + /* HND */ "हाण्डूरस", + /* BEN */ "बेनिन", + /* ERI */ "इरिट्रिया", + /* MWI */ "मलावी", + /* PRK */ "उत्तर कोरिया", + /* NIC */ "निकारागुआ", + /* GRC */ "ग्रीस", + /* TJK */ "ताजिकिस्तान", + /* BGD */ "बांग्लादेश", + /* NPL */ "नेपाल", + /* TUN */ "ट्यूनीशिया", + /* SUR */ "सूरीनाम", + /* URY */ "उरुग्वे", + /* KHM */ "कंबोडिया", + /* SYR */ "सीरिया", + /* SEN */ "सेनेगल", + /* KGZ */ "किरगिजस्तान", + /* BLR */ "बेलोरूस", + /* GUY */ "गुयाना", + /* LAO */ "लाओस", + /* ROU */ "रोमानिया", + /* GHA */ "घाना", + /* UGA */ "युगांडा", + /* GBR */ "यूनाइटेड किंगडम", + /* GIN */ "गिनी", + /* ECU */ "इक्वाडोर", + /* ESH */ "पश्चिमी सहारा", + /* GAB */ "गैबॉन", + /* NZL */ "न्यूजीलैंड", + /* BFA */ "बुर्किना फासो", + /* PHL */ "फिलीपींस", + /* ITA */ "इटली", + /* OMN */ "ओमान", + /* POL */ "पोलैंड", + /* CIV */ "आइवरी कोस्ट", + /* NOR */ "नॉर्वे", + /* MYS */ "मलेशिया", + /* VNM */ "वियतनाम", + /* FIN */ "फिनलैंड", + /* COG */ "कांगो ब्राज़ाविल", + /* DEU */ "जर्मनी", + /* JPN */ "जापान", + /* ZWE */ "जिम्बाब्वे", + /* PRY */ "पैराग्वे", + /* IRQ */ "इराक", + /* MAR */ "मोरक्को", + /* UZB */ "उजबेकिस्तान", + /* SWE */ "स्वीडन", + /* PNG */ "पापुआ न्यू गिनी", + /* CMR */ "कैमरून", + /* TKM */ "तुर्कमेनिस्तान", + /* ESP */ "स्पेन", + /* THA */ "थाईलैंड", + /* YEM */ "यमन", + /* FRA */ "फ़्रांस", + /* ALA */ "एलैंड द्वीप समूह", + /* KEN */ "केन्या", + /* BWA */ "बोत्सवाना", + /* MDG */ "मेडागास्कर", + /* UKR */ "यूक्रेन", + /* SSD */ "दक्षिण सूडान", + /* CAF */ "केंद्रीय अफ्रीकन गणराज्य", + /* SOM */ "सोमालिया", + /* AFG */ "अफ़ग़ानिस्तान", + /* MMR */ "म्यांमार|बर्मा", + /* ZMB */ "जाम्बिया", + /* CHL */ "चिली", + /* TUR */ "टर्की", + /* PAK */ "पाकिस्तान", + /* MOZ */ "मोजाम्बिक", + /* NAM */ "नामीबिया", + /* VEN */ "वेनेजुएला", + /* NGA */ "नाइजीरिया", + /* TZA */ "तंजानिया", + /* EGY */ "मिस्र", + /* MRT */ "मॉरिटानिया", + /* BOL */ "बोलीविया", + /* ETH */ "इथियोपिया", + /* COL */ "कोलम्बिया", + /* ZAF */ "दक्षिण अफ्रीका", + /* MLI */ "माली", + /* AGO */ "अंगोला", + /* NER */ "नाइजर", + /* TCD */ "चाड", + /* PER */ "पेरू", + /* MNG */ "मंगोलिया", + /* IRN */ "ईरान", + /* LBY */ "लीबिया", + /* SDN */ "सूडान", + /* IDN */ "इंडोनेशिया", + /* DIF */ "डिस्ट्रिटो फ़ेडरल", + /* TLA */ "त्लाक्सकाला", + /* MOR */ "मोरेलोस", + /* AGU */ "आग्वसकालिएंटस", + /* MX-CL */ "कोलीमा", + /* QUE */ "क्यूरेटारो", + /* HID */ "हिडलगो", + /* MX-MX */ "मेक्सिको राज्य", + /* TAB */ "टबैस्को", + /* NAY */ "नायारीट", + /* GUA */ "गुआनाग्वाटो", + /* PUE */ "प्यूब्ला", + /* YUC */ "युकाटन", + /* ROO */ "क्विंटाना रू", + /* SIN */ "सिनालोआ", + /* CAM */ "कैंपेक", + /* MIC */ "मिचोआकेन", + /* SLP */ "सैन लुइस पोटोसी", + /* GRO */ "ग्युरेरो", + /* NLE */ "नुएवो लियोन", + /* BCN */ "बाजा कैलिफोर्निया", + /* VER */ "वेराक्रूज", + /* CHP */ "चियापास", + /* BCS */ "बाजा कैलिफोर्निया सुर", + /* ZAC */ "ज़ाकाटेकस", + /* JAL */ "जलिस्को", + /* TAM */ "तामाउलिपास", + /* OAX */ "ओक्साका", + /* DUR */ "दुरंगो", + /* COA */ "कोवाविला", + /* SON */ "सोनोरा", + /* CHH */ "चिहुआहुआ", + /* GRL */ "ग्रीनलैंड", + /* SAU */ "सऊदी अरब", + /* COD */ "कांगो किंशासा", + /* DZA */ "एलजीरिया", + /* KAZ */ "कजाखस्तान", + /* ARG */ "अर्जेंटीना", + /* IN-DD */ "दमन और दीव", + /* IN-DN */ "दादरा और नगर हवेली", + /* IN-CH */ "चंडीगढ़", + /* IN-AN */ "अण्डमान और निकोबार", + /* IN-LD */ "लक्षद्वीप", + /* IN-DL */ "दिल्ली", + /* IN-ML */ "मेघालय", + /* IN-NL */ "नागालैंड", + /* IN-MN */ "मणिपुर", + /* IN-TR */ "त्रिपुरा", + /* IN-MZ */ "मिजोरम", + /* IN-SK */ "सिक्किम", + /* IN-PB */ "पंजाब", + /* IN-HR */ "हरियाणा", + /* IN-AR */ "अरुणाचल प्रदेश", + /* IN-AS */ "असम", + /* IN-BR */ "बिहार", + /* IN-UT */ "उत्तराखंड", + /* IN-GA */ "गोवा", + /* IN-KL */ "केरल", + /* IN-TN */ "तमिलनाडु", + /* IN-HP */ "हिमाचल प्रदेश", + /* IN-JK */ "जम्मू और कश्मीर", + /* IN-CT */ "छत्तीसगढ़", + /* IN-JH */ "झारखंड", + /* IN-KA */ "कर्नाटक", + /* IN-RJ */ "राजस्थान", + /* IN-OR */ "ओडिशा|उड़ीसा", + /* IN-GJ */ "गुजरात", + /* IN-WB */ "पश्चिम बंगाल", + /* IN-MP */ "मध्य प्रदेश", + /* IN-TG */ "तेलंगाना", + /* IN-AP */ "आंध्र प्रदेश", + /* IN-MH */ "महाराष्ट्र", + /* IN-UP */ "उत्तर प्रदेश", + /* IN-PY */ "पुडुचेरी", + /* NSW */ "न्यू साउथ वेल्स", + /* ACT */ "ऑस्ट्रेलियाई राजधानी क्षेत्र", + /* JBT */ "जर्विस बे टेरिटरी", + /* AU-NT */ "उत्तरी क्षेत्र", + /* AU-SA */ "दक्षिण ऑस्ट्रेलिया", + /* TAS */ "तस्मानिया", + /* VIC */ "विक्टोरिया", + /* AU-WA */ "पश्चिमी ऑस्ट्रेलिया", + /* QLD */ "क्वींसलैंड", + /* BR-DF */ "डिस्ट्रिटो फेडरल", + /* BR-SE */ "सर्जिप", + /* BR-AL */ "अलगोआस", + /* BR-RJ */ "रियो डी जनेरियो", + /* BR-ES */ "एस्पिरिटो सैंटो", + /* BR-RN */ "रियो ग्रांडे डो नॉर्ट", + /* BR-PB */ "पाराईबा", + /* BR-SC */ "सांता कैटरीना", + /* BR-PE */ "परनमबुको", + /* BR-AP */ "अमापा", + /* BR-CE */ "सेअरा", + /* BR-AC */ "अक्रे", + /* BR-PR */ "पाराना", + /* BR-RR */ "रोरैमा", + /* BR-RO */ "रोन्डोनिया", + /* BR-SP */ "साओ पाउलो", + /* BR-PI */ "पियाऊ", + /* BR-TO */ "टोकिण्टिन्स", + /* BR-RS */ "रियो ग्रांडे डो सुल", + /* BR-MA */ "मारेन्हो", + /* BR-GO */ "गोइयास", + /* BR-MS */ "माटो ग्रोसो डो सुल", + /* BR-BA */ "बाहिया", + /* BR-MG */ "मिना गेरियास", + /* BR-MT */ "माटो ग्रोसो", + /* BR-PA */ "पैरा", + /* BR-AM */ "एमेज़ोनस", + /* US-DC */ "जिला कोलंबिया के", + /* US-RI */ "रोड आइलैंड", + /* US-DE */ "डेलावेयर", + /* US-CT */ "कनेक्टिकट", + /* US-NJ */ "न्यू जर्सी", + /* US-NH */ "न्यू हैम्पशायर", + /* US-VT */ "वरमोंट", + /* US-MA */ "मैसाचुसेट्स", + /* US-HI */ "हवाई", + /* US-MD */ "मैरीलैंड", + /* US-WV */ "पश्चिम वर्जीनिया", + /* US-SC */ "दक्षिण कैरोलिना", + /* US-ME */ "मेन", + /* US-IN */ "इंडियाना", + /* US-KY */ "केंटकी", + /* US-TN */ "टेनेसी", + /* US-VA */ "वर्जीनिया", + /* US-OH */ "ओहियो", + /* US-PA */ "पेंसिल्वेनिया", + /* US-MS */ "मिसिसिपी", + /* US-LA */ "लुइसियाना", + /* US-AL */ "अलबामा", + /* US-AR */ "अर्कांसस", + /* US-NC */ "उत्तरी केरोलिना", + /* US-NY */ "न्यूयॉर्क", + /* US-IA */ "आयोवा", + /* US-IL */ "इलिनोइस", + /* US-GA */ "जॉर्जिया", + /* US-WI */ "विस्कॉन्सिन", + /* US-FL */ "फ्लोरिडा", + /* US-MO */ "मिसौरी", + /* US-OK */ "ओकलाहोमा", + /* US-ND */ "नॉर्थ डकोटा", + /* US-WA */ "वॉशिंगटन", + /* US-SD */ "दक्षिण डकोटा", + /* US-NE */ "नेब्रास्का", + /* US-KS */ "कान्सास", + /* US-ID */ "इडाहो", + /* US-UT */ "यूटा", + /* US-MN */ "मिनेसोटा", + /* US-MI */ "मिशिगन", + /* US-WY */ "व्योमिंग", + /* US-OR */ "ओरेगन", + /* US-CO */ "कोलोराडो", + /* US-NV */ "नेवादा", + /* US-AZ */ "एरिजोना", + /* US-NM */ "न्यू मेक्सिको", + /* US-MT */ "मोंताना", + /* US-CA */ "कैलिफोर्निया", + /* US-TX */ "टेक्सास", + /* US-AK */ "अलास्का", + /* CA-BC */ "ब्रिटिश कोलंबिया", + /* CA-AB */ "अलबर्टा", + /* CA-ON */ "ओंटारियो", + /* CA-QC */ "क्यूबेक", + /* CA-SK */ "सस्केचेवान", + /* CA-MB */ "मैनिटोबा", + /* CA-NL */ "न्यूफ़ाउन्डलंड", + /* CA-NB */ "नई ब्रंसविक", + /* CA-NS */ "नोवा स्कोटिया", + /* CA-PE */ "प्रिंस एडवर्ड द्वीप", + /* CA-YT */ "युकोन", + /* CA-NT */ "उत्तर पश्चिमी क्षेत्र", + /* CA-NU */ "नुनावुत", + /* IND */ "भारत", + /* AUS */ "ऑस्ट्रेलिया", + /* BRA */ "ब्राज़िल", + /* USA */ "अमेरिका|अमेरिका|अमेरिका", + /* MEX */ "मेक्सिको", + /* MOW */ "मास्को", + /* SPE */ "सेंट पीटर्सबर्ग", + /* KGD */ "कैलिनिनग्राद ओब्लास्ट", + /* RU-IN */ "इन्गुशेतिया गणराज्य", + /* RU-AD */ "एडिगेया गणराज्य", + /* RU-SE */ "उत्तर ओसेतिया-आलानिया गणराज्य", + /* RU-KB */ "कामार्डिनो- बल्कार गणराज्य", + /* RU-KC */ "कराचय गणराज्य", + /* RU-CE */ "चेचन गणराज्य", + /* RU-CU */ "चूवाश गणराज्य", + /* IVA */ "इवानोवो ओब्लास्ट", + /* LIP */ "लिपेत्स्क ओब्लास्त", + /* ORL */ "ओरयोल ओब्लास्त", + /* TUL */ "तुला ओब्लास्त", + /* RU-BE */ "बेल्गोरोद ओब्लास्त", + /* VLA */ "व्लादिमीर ओब्लास्त", + /* KRS */ "कुर्स्काया ओब्लास्ट", + /* KLU */ "कलुगा ओब्लास्त", + /* RU-TT */ "तांबोव ओब्लास्त", + /* BRY */ "ब्रांस्क ओब्लास्त", + /* YAR */ "यरोस्लाव ओब्लास्त", + /* RYA */ "रायाज़ान्स्काया ओब्लास्त", + /* AST */ "मास्को ओब्लास्त", + /* MOS */ "मास्को ओब्लास्त", + /* SMO */ "स्मोलेंस्क ओब्लास्त", + /* RU-DA */ "दागिस्तान गणराज्य", + /* VOR */ "वोरोनिश ओब्लास्त", + /* NGR */ "नोवगोरोदस्काया ओब्लास्त", + /* PSK */ "प्सकोव ओब्लास्त", + /* KOS */ "कॉस्ट्रोम्सकाया ओब्लास्ट", + /* STA */ "स्टावरोपोल क्राय", + /* KDA */ "क्रास्नोदार क्राय", + /* RU-KL */ "कल्मिकिया गणराज्य", + /* TVE */ "त्वेर्स्काया ओब्लास्त", + /* LEN */ "लेनिनग्राद ओब्लास्त", + /* ROS */ "रोस्तोव ओब्लास्त", + /* VGG */ "वोल्गोग्राड ओब्लास्त", + /* VLG */ "वोलोग्दा ओब्लास्त", + /* MUR */ "मरमंस्क ओब्लास्त", + /* RU-KR */ "करेलिया गणराज्य", + /* NEN */ "नेने स्वायत्त ऑक्रग", + /* RU-KO */ "कोमी गणराज्य", + /* ARK */ "आरख़ान्गेल्स्क ओब्लास्त", + /* RU-MO */ "मोर्दोविया गणराज्य", + /* NIZ */ "ज़र्ज़िस्क ओब्लास्त", + /* PNZ */ "पेंज़ा ओब्लास्त", + /* RU-KI */ "कीरॉफ़ ओब्लास्त", + /* RU-ME */ "मारी एल गणराज्य", + /* ORE */ "ऑरेनबर्ग ओब्लास्त", + /* ULY */ "मास्को में ओब्लास्त", + /* RU-PM */ "पेर्म क्राय", + /* RU-BA */ "बश्कोर्तोस्तान गणराज्य", + /* RU-UD */ "उदमुर्त गणराज्य", + /* RU-TA */ "तातारस्तान गणराज्य", + /* SAM */ "समारा ओब्लास्त", + /* SAR */ "सेराटोव ओब्लास्त", + /* YAN */ "यामालो", + /* RU-KM */ "खांटी-मानसी", + /* SVE */ "स्वर्डर्लोव्स्क ओब्लास्त", + /* TYU */ "मास्को ओब्लास्त", + /* KGN */ "कुर्गन ओब्लास्त", + /* RU-CH */ "चेल्याबिंस्क ओब्लास्त", + /* RU-BU */ "बुर्यातिया गणराज्य", + /* ZAB */ "ज़बायकाल्स्की क्राय", + /* IRK */ "इर्कुत्स्क Oblast", + /* NVS */ "नोवोसिबिर्स्क ओब्लास्त", + /* TOM */ "टॉम्स्क ओब्लास्त", + /* OMS */ "ओम्स्क ओब्लास्त", + /* RU-KK */ "खाकासिया गणराज्य", + /* KEM */ "केमरोवो ओब्लास्ट", + /* RU-AL */ "अल्ताई गणराज्य", + /* ALT */ "अल्ताई क्राय", + /* RU-TY */ "तुवा गणराज्य", + /* KYA */ "क्रास्नोयार्स्क क्राय", + /* MAG */ "मागादान ओब्लास्त", + /* CHU */ "चुकोटका ऑक्रग", + /* KAM */ "कमचातका क्राय", + /* SAK */ "सखालिन ओब्लास्त", + /* RU-PO */ "प्रिमोर्स्की क्रै", + /* YEV */ "यहूदी स्वायत्त ओब्लास्ट", + /* KHA */ "खाबरोवस्क क्रै", + /* AMU */ "अमूर ओब्लास्त", + /* RU-SA */ "साखा गणराज्य|याकूतिया गणराज्य", + /* CAN */ "कनाडा", + /* RUS */ "रूस", + /* CN-SH */ "शंघाई", + /* CN-TJ */ "तियानजिन", + /* CN-BJ */ "बीजिंग", + /* CN-HI */ "हैनान", + /* CN-NX */ "निंगसिया हुई", + /* CN-CQ */ "चूंगचींग", + /* CN-ZJ */ "झेजियांग", + /* CN-JS */ "जियांगसु", + /* CN-FJ */ "फ़ुज़ियान", + /* CN-AH */ "एन्हुई", + /* CN-LN */ "लिओनिंग", + /* CN-SD */ "शेडोंग", + /* CN-SX */ "शांक्सी", + /* CN-JX */ "यांग्शी", + /* CN-HA */ "हेनान", + /* CN-GZ */ "गुइझोऊ", + /* CN-GD */ "गुआंग्डोंग", + /* CN-HB */ "हुबेई", + /* CN-JL */ "जिलिन", + /* CN-HE */ "हेबेई", + /* CN-SN */ "शानक्सी", + /* CN-NM */ "भीतरी मंगोलिया|इनर मंगोलिया", + /* CN-HL */ "हेइलोंगजियांग", + /* CN-HN */ "हुनान", + /* CN-GX */ "ज़ुआंग स्वायत्त क्षेत्र", + /* CN-SC */ "सिचुआन", + /* CN-YN */ "युन्नान", + /* CN-XZ */ "तिब्बत", + /* CN-GS */ "गांसु", + /* CN-QH */ "किंघाई", + /* CN-XJ */ "झिंजियांग उईघुर", + /* CHN */ "चीन", + /* UMI */ "यूएस माइनर आउटलाइंग द्वीपसमूह", + /* CPT */ "क्लिपरटन द्वीप", + /* ATA */ "अंटार्कटिका", + /* AAA */ "अंतरराष्ट्रीय|अंतरराष्ट्रीय|पृथ्वी" +#else // MAPCODE_SUPPORT_LANGUAGE_HI + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_HI +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_HI_H__ diff --git a/mapcodelib/internal_territory_names_hr.h b/mapcodelib/internal_territory_names_hr.h new file mode 100644 index 0000000..9fc918c --- /dev/null +++ b/mapcodelib/internal_territory_names_hr.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_HR_H__ +#define __INTERNAL_TERRITORY_NAMES_HR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_HR[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_HR // Croatian + /* VAT */ "Vatikan|Sveta Stolica", + /* MCO */ "Monako", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Kokosovi otoci|Keeling otoci", + /* BLM */ "Sveti Bartolomej", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Makao", + /* SXM */ "Sveti Martin NLD", + /* MAF */ "Sveti Martin Otok FRA", + /* NFK */ "Norfolk i Filip Otoci|Filip Otok", + /* PCN */ "Pitcairn otoci", + /* BVT */ "Bouvetov otok", + /* BMU */ "Bermudi", + /* IOT */ "Britanski Indijskooceanski teritorij", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Božićni otok", + /* WLF */ "Wallis i Futuna|Futuna", + /* VGB */ "Britanski Djevičanski Otoci|Djevičanski Otoci, Britanski", + /* LIE */ "Lihtenštajn", + /* ABW */ "Aruba", + /* MHL */ "Maršalovi Otoci", + /* ASM */ "Američka Samoa|Samoa, Američka", + /* COK */ "Cookovi otoci", + /* SPM */ "Sveti Petar i Mikelon|Mikelon", + /* NIU */ "Niue", + /* KNA */ "Sveti Kristofor i Nevis|Nevis", + /* CYM */ "Kajmanski Otoci", + /* BES */ "Saba i karipski otoci Bonaire i Sveti Eustazije|Bonaire|Sveti Eustazije", + /* MDV */ "Maldivi", + /* SHN */ "Sveta Helena otok, Ascension i Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "SAD Djevičanski otoci|Djevičanski otoci, SAD", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard i Jan Mayen|Jan Mayen", + /* VCT */ "Sveti Vincent i Grenadini|Grenadini", + /* HMD */ "Otok Heard i otočje McDonald|Otočje McDonald", + /* BRB */ "Barbados", + /* ATG */ "Antigva i Barbuda|Barbuda", + /* CUW */ "Curaçao", + /* SYC */ "Sejšeli", + /* PLW */ "Palau", + /* MNP */ "Sjeverni Marijanski otoci", + /* AND */ "Andora", + /* GUM */ "Guam", + /* IMN */ "Otok Man", + /* LCA */ "Sveta Lucija", + /* FSM */ "Mikronezija|Savezne Države Mikronezije", + /* SGP */ "Singapur", + /* TON */ "Tonga", + /* DMA */ "Dominika", + /* BHR */ "Bahrein", + /* KIR */ "Kiribati", + /* TCA */ "Otoci Turks i Caicos|Otoki Caicos", + /* STP */ "Sveti Toma i Princip|Princip", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Farski Otoci", + /* GLP */ "Gvadalupe", + /* COM */ "Komori", + /* MUS */ "Mauricijus", + /* REU */ "Réunion Otok", + /* LUX */ "Luksemburg", + /* WSM */ "Samoa", + /* SGS */ "Južna Georgija i otočje Južni Sandwich", + /* PYF */ "Francuska Polinezija", + /* CPV */ "Zelenortska Republika", + /* TTO */ "Trinidad i Tobago|Tobago", + /* BRN */ "Brunej", + /* ATF */ "Francuski južni i antarktički teritoriji", + /* PRI */ "Portoriko", + /* CYP */ "Cipar", + /* LBN */ "Libanon", + /* JAM */ "Jamajka", + /* GMB */ "Gambija", + /* QAT */ "Katar", + /* FLK */ "Falklandski otoci", + /* VUT */ "Vanuatu", + /* MNE */ "Crna Gora", + /* BHS */ "Bahami", + /* TLS */ "Istočni Timor", + /* SWZ */ "Svazi", + /* KWT */ "Kuvajt", + /* FJI */ "Fidži", + /* NCL */ "Nova Kaledonija", + /* SVN */ "Slovenija", + /* ISR */ "Izrael", + /* PSE */ "Palestina", + /* SLV */ "Salvador", + /* BLZ */ "Belize", + /* DJI */ "Džibuti", + /* MKD */ "Makedonija", + /* RWA */ "Ruanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Ekvatorijalna Gvineja", + /* ALB */ "Albanija", + /* SLB */ "Salomonski Otoci", + /* ARM */ "Armenija", + /* LSO */ "Lesoto", + /* BEL */ "Belgija", + /* MDA */ "Moldavija", + /* GNB */ "Gvineja Bisao", + /* TWN */ "Tajvan", + /* BTN */ "Butan|Kraljevina Butan", + /* CHE */ "Švicarska", + /* NLD */ "Nizozemska|Holandija", + /* DNK */ "Danska", + /* EST */ "Estonija", + /* DOM */ "Dominikanska Republika", + /* SVK */ "Slovačka", + /* CRI */ "Kostarika", + /* BIH */ "Bosna i Hercegovina", + /* HRV */ "Hrvatska", + /* TGO */ "Togo", + /* LVA */ "Letonija", + /* LTU */ "Litva", + /* LKA */ "Šri Lanka", + /* GEO */ "Gruzija", + /* IRL */ "Irska", + /* SLE */ "Sijera Leone", + /* PAN */ "Panama", + /* CZE */ "Češka Republika", + /* GUF */ "Francuska Gvajana", + /* ARE */ "Ujedinjeni Arapski Emirati", + /* AUT */ "Austrija", + /* AZE */ "Azerbejdžan", + /* SRB */ "Srbija", + /* JOR */ "Jordan", + /* PRT */ "Portugal", + /* HUN */ "Mađarska", + /* KOR */ "Južna Koreja", + /* ISL */ "Island", + /* GTM */ "Gvatemala", + /* CUB */ "Kuba", + /* BGR */ "Bugarska", + /* LBR */ "Liberija", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritreja", + /* MWI */ "Malavi", + /* PRK */ "Sjeverna Koreja", + /* NIC */ "Nikaragva", + /* GRC */ "Grčka", + /* TJK */ "Tadžikistan", + /* BGD */ "Bangladeš", + /* NPL */ "Nepal", + /* TUN */ "Tunis", + /* SUR */ "Surinam", + /* URY */ "Urugvaj", + /* KHM */ "Kambodža", + /* SYR */ "Sirija", + /* SEN */ "Senegal", + /* KGZ */ "Kirgistan", + /* BLR */ "Bjelorusija", + /* GUY */ "Gvajana", + /* LAO */ "Laos", + /* ROU */ "Rumunjska", + /* GHA */ "Gana", + /* UGA */ "Uganda", + /* GBR */ "Ujedinjeno Kraljevstvo|Velika Britanija|Škotska|Sjeverna Irska|Irska, Sjeverna", + /* GIN */ "Gvineja", + /* ECU */ "Ekvador", + /* ESH */ "Zapadna Sahara", + /* GAB */ "Gabon", + /* NZL */ "Novi Zeland", + /* BFA */ "Burkina Faso", + /* PHL */ "Filipini", + /* ITA */ "Italija", + /* OMN */ "Oman", + /* POL */ "Poljska", + /* CIV */ "Obala Bjelokosti", + /* NOR */ "Norveška", + /* MYS */ "Malezija", + /* VNM */ "Vijetnam", + /* FIN */ "Finska", + /* COG */ "Kongo-Brazzaville", + /* DEU */ "Njemačka", + /* JPN */ "Japan", + /* ZWE */ "Zimbabve", + /* PRY */ "Paragvaj", + /* IRQ */ "Irak", + /* MAR */ "Maroko", + /* UZB */ "Uzbekistan", + /* SWE */ "Švedska", + /* PNG */ "Papua Nova Gvineja", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Španjolska", + /* THA */ "Tajland", + /* YEM */ "Jemen", + /* FRA */ "Francuska", + /* ALA */ "Alandski otoci", + /* KEN */ "Kenija", + /* BWA */ "Bocvana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukrajina", + /* SSD */ "Južni Sudan", + /* CAF */ "Srednjoafrička Republika", + /* SOM */ "Somalija", + /* AFG */ "Afganistan", + /* MMR */ "Mianmar|Burma", + /* ZMB */ "Zambija", + /* CHL */ "Čile", + /* TUR */ "Turska", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambik", + /* NAM */ "Namibija", + /* VEN */ "Venecuela", + /* NGA */ "Nigerija", + /* TZA */ "Tanzanija", + /* EGY */ "Egipat", + /* MRT */ "Mauritanija", + /* BOL */ "Bolivija", + /* ETH */ "Etiopija", + /* COL */ "Kolumbija", + /* ZAF */ "Južna Afrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Čad", + /* PER */ "Peru", + /* MNG */ "Mongolija", + /* IRN */ "Iran", + /* LBY */ "Libija", + /* SDN */ "Sudan", + /* IDN */ "Indonezija", + /* DIF */ "Savezna oblast", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Država Meksiko|Meksiko, Država", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grenland", + /* SAU */ "Saudijska Arabija", + /* COD */ "Kongo-Kinshasa", + /* DZA */ "Alžir", + /* KAZ */ "Kazahstan", + /* ARG */ "Argentina", + /* IN-DD */ "Daman and Diu", + /* IN-DN */ "Dadra i Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman and Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu i Kašmir|Kašmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Orissa|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Zapadni Bengal", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "Novi Južni Wales|New South Wales", + /* ACT */ "Australian Capital Territory|Australski Glavni Teritorij", + /* JBT */ "Jervis Bay teritorij", + /* AU-NT */ "Sjeverni teritorij|Northern Territory", + /* AU-SA */ "Južne Australije|South Australia", + /* TAS */ "Tasmanija", + /* VIC */ "Viktorija", + /* AU-WA */ "Zapadna Australija|Western Australia", + /* QLD */ "Queensland", + /* BR-DF */ "Savezna oblast", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Otok Rhode", + /* US-DE */ "Delaver", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Havaji", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "Južna Karolina", + /* US-ME */ "Maine", + /* US-IN */ "Indijana", + /* US-KY */ "Kentucky|Kentaki", + /* US-TN */ "Tennessee", + /* US-VA */ "Virdžinija", + /* US-OH */ "Ohio", + /* US-PA */ "Pensilvanija", + /* US-MS */ "Misisipi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkanzas", + /* US-NC */ "Sjeverna Karolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Ilinois", + /* US-GA */ "Gruzija", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Sjeverna Dakota", + /* US-WA */ "Vašington", + /* US-SD */ "Južna Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kanzas", + /* US-ID */ "Ajdaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Vajoming", + /* US-OR */ "Oregon", + /* US-CO */ "Kolorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Novi Meksiko", + /* US-MT */ "Montana", + /* US-CA */ "Kalifornija", + /* US-TX */ "Teksas", + /* US-AK */ "Aljaska", + /* CA-BC */ "Britanska Kolumbija", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Njufaundlend", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Škotska", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "Indija", + /* AUS */ "Australija", + /* BRA */ "Brazil", + /* USA */ "SAD|Sjedinjene Američke Države|Amerika", + /* MEX */ "Meksiko", + /* MOW */ "Moskva", + /* SPE */ "Saint Petersburg", + /* KGD */ "Kalinjingrad oblast", + /* RU-IN */ "Ingušetije Republika", + /* RU-AD */ "Adigejska Republika", + /* RU-SE */ "Sjeverna Osetija-Alanija Republika", + /* RU-KB */ "Kabardino-balkar Republika", + /* RU-KC */ "Karachay-Čerkezi Republika", + /* RU-CE */ "Čečenija Republika", + /* RU-CU */ "čuvaški Republika", + /* IVA */ "Ivanovska oblast", + /* LIP */ "Lipecka oblast", + /* ORL */ "Orelska oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod oblast", + /* VLA */ "Vladimir oblast", + /* KRS */ "Kurska oblast", + /* KLU */ "Kaluga oblast", + /* RU-TT */ "Tambovska oblast", + /* BRY */ "Brjanska oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Rjazanjska oblast", + /* AST */ "Astrahan oblast", + /* MOS */ "Moskovska oblast", + /* SMO */ "Smolenska oblast", + /* RU-DA */ "Dagestan Republic", + /* VOR */ "Voronješka oblast", + /* NGR */ "Novgorod oblast", + /* PSK */ "Pskovska oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropoljski kraj", + /* KDA */ "Krasnodar", + /* RU-KL */ "Kalmikiji Republika", + /* TVE */ "Tver oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov oblast", + /* VGG */ "Volgograd oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmanska oblast", + /* RU-KR */ "Karelia Republika", + /* NEN */ "Nenečki autonomni okrug", + /* RU-KO */ "Komi Republika", + /* ARK */ "Arhangelska oblast", + /* RU-MO */ "Mordvinska Republika", + /* NIZ */ "Nižnjenovgorodska oblast", + /* PNZ */ "Penza oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Republika", + /* ORE */ "Orenburg oblast", + /* ULY */ "Uljanovska oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan Republika", + /* RU-UD */ "Udmurtska Republika", + /* RU-TA */ "Tatarstan Republika", + /* SAM */ "Samara oblast", + /* SAR */ "Saratov oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk oblast", + /* TYU */ "Tyumen oblast", + /* KGN */ "Kurgan oblast", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Buryatia Republika", + /* ZAB */ "Zabajkalski kraj", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirska oblast", + /* TOM */ "Tomska oblast", + /* OMS */ "Omska oblast", + /* RU-KK */ "Khakassia Republika", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Altai Republic", + /* ALT */ "Altajski kraj", + /* RU-TY */ "Tuva Republika", + /* KYA */ "Krasnojarsk Krai", + /* MAG */ "Magadan oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamčatski kraj", + /* SAK */ "Sahalinska oblast", + /* RU-PO */ "Primorski kraj", + /* YEV */ "Židovska autonomna oblast", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur oblast", + /* RU-SA */ "Jakutska|Yakutia Republika", + /* CAN */ "Kanada", + /* RUS */ "Ruska Federacija", + /* CN-SH */ "Šangaj", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Peking", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Ujgurski", + /* CHN */ "Kina", + /* UMI */ "Mali udaljeni otoci SAD-a", + /* CPT */ "Otok Clipperton", + /* ATA */ "Antarktika", + /* AAA */ "International|Svijet|Zemlja" +#else // MAPCODE_SUPPORT_LANGUAGE_HR + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_HR +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_HR_H__ diff --git a/mapcodelib/internal_territory_names_id.h b/mapcodelib/internal_territory_names_id.h new file mode 100644 index 0000000..c5992f0 --- /dev/null +++ b/mapcodelib/internal_territory_names_id.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_ID_H__ +#define __INTERNAL_TERRITORY_NAMES_ID_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_ID[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_ID // Indonesian + /* VAT */ "Vatican City|Holy See", + /* MCO */ "Monako", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Kepulauan Cocos|Keeling Islands", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk dan Philip Island|Philip Island", + /* PCN */ "Kepulauan Pitcairn", + /* BVT */ "Bouvet Pulau", + /* BMU */ "Bermuda", + /* IOT */ "Britania di Samudra Hindia", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Christmas Island", + /* WLF */ "Wallis dan Futuna|Futuna", + /* VGB */ "British Virgin Islands|Kepulauan Virgin, Inggris", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Pulau Marshall", + /* ASM */ "Samoa Amerika|Samoa, Amerika", + /* COK */ "Kepulauan cook", + /* SPM */ "Saint Pierre dan Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts dan Nevis|Nevis", + /* CYM */ "Pulau Cayman", + /* BES */ "Bonaire, St Eustatuis dan Saba|Saba|St Eustatius", + /* MDV */ "Maladewa", + /* SHN */ "Saint Helena, Ascension dan Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "US Virgin Islands|Kepulauan Virgin, AS", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard dan Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent dan Grenadines|Grenadines", + /* HMD */ "Pulau Heard dan Kepulauan McDonald|McDonald Islands", + /* BRB */ "Barbados", + /* ATG */ "Antigua dan Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seychelles", + /* PLW */ "Palau", + /* MNP */ "Kepulauan Mariana Utara", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Pulau manusia", + /* LCA */ "Saint Lucia", + /* FSM */ "Mikronesia|Negara Federasi Mikronesia", + /* SGP */ "Singapura", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Kepulauan Turks dan Caicos|Caicos Islands", + /* STP */ "Sao Tome dan Principe|Principe", + /* HKG */ "Hongkong", + /* MTQ */ "Martinique", + /* FRO */ "Faroe|Kepulauan Faroe", + /* GLP */ "Guadeloupe", + /* COM */ "Komoro", + /* MUS */ "Mauritius", + /* REU */ "Reuni", + /* LUX */ "Luksemburg", + /* WSM */ "Samoa", + /* SGS */ "Georgia Selatan dan Kepulauan Sandwich Selatan|South Sandwich Islands", + /* PYF */ "Polinesia Perancis", + /* CPV */ "Cape Verde", + /* TTO */ "Trinidad dan Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Daratan Selatan dan Antarktika Perancis", + /* PRI */ "Puerto Rico", + /* CYP */ "Siprus", + /* LBN */ "Libanon", + /* JAM */ "Jamaika", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Falklands|Kepulauan Falkland", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahama", + /* TLS */ "Timor Timur", + /* SWZ */ "Swaziland", + /* KWT */ "Kuwait", + /* FJI */ "Fiji|Kepulauan Fiji", + /* NCL */ "Kaledonia Baru", + /* SVN */ "Slovenia", + /* ISR */ "Israel", + /* PSE */ "Wilayah Palestina", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Makedonia", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Guinea ekuator", + /* ALB */ "Albania", + /* SLB */ "Pulau Solomon", + /* ARM */ "Armenia", + /* LSO */ "Lesotho", + /* BEL */ "Belgium", + /* MDA */ "Moldova", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Swiss", + /* NLD */ "Belanda", + /* DNK */ "Denmark", + /* EST */ "Estonia", + /* DOM */ "Republik Dominika", + /* SVK */ "Slovakia", + /* CRI */ "Kosta Rika", + /* BIH */ "Bosnia dan Herzegovina", + /* HRV */ "Kroasia", + /* TGO */ "Togo", + /* LVA */ "Latvia", + /* LTU */ "Lithuania", + /* LKA */ "Srilanka", + /* GEO */ "Georgia", + /* IRL */ "Irlandia", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Republik Ceko", + /* GUF */ "Guyana Perancis", + /* ARE */ "Uni Emirat Arab", + /* AUT */ "Austria", + /* AZE */ "Azerbaijan", + /* SRB */ "Serbia", + /* JOR */ "Jordan", + /* PRT */ "Portugal", + /* HUN */ "Hongaria", + /* KOR */ "Korea Selatan", + /* ISL */ "Islandia", + /* GTM */ "Guatemala", + /* CUB */ "Kuba", + /* BGR */ "Bulgaria", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Korea Utara", + /* NIC */ "Nikaragua", + /* GRC */ "Yunani", + /* TJK */ "Tajikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunisia", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Kamboja", + /* SYR */ "Suriah", + /* SEN */ "Senegal", + /* KGZ */ "Kyrgyzstan", + /* BLR */ "Belarus", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Rumania", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Inggris Raya|Skotlandia|Inggris|Irlandia Utara|Irlandia, Northern", + /* GIN */ "Guinea", + /* ECU */ "Ekuador", + /* ESH */ "Sahara Barat|Sahrawi", + /* GAB */ "Gabon", + /* NZL */ "Selandia Baru", + /* BFA */ "Burkina Faso", + /* PHL */ "Pilipina", + /* ITA */ "Italia", + /* OMN */ "Oman", + /* POL */ "Polandia", + /* CIV */ "Pantai Gading", + /* NOR */ "Norway", + /* MYS */ "Malaysia", + /* VNM */ "Vietnam", + /* FIN */ "Finlandia", + /* COG */ "Kongo-Brazzaville", + /* DEU */ "Jerman", + /* JPN */ "Jepang", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguai", + /* IRQ */ "Irak", + /* MAR */ "Maroko", + /* UZB */ "Uzbekistan", + /* SWE */ "Swedia", + /* PNG */ "Papua Nugini", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Spanyol", + /* THA */ "Thailand", + /* YEM */ "Yaman", + /* FRA */ "Perancis", + /* ALA */ "Kepulauan Aaland", + /* KEN */ "Kenya", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukraina", + /* SSD */ "Sudan Selatan", + /* CAF */ "Republik Afrika Tengah", + /* SOM */ "Somalia", + /* AFG */ "Afganistan", + /* MMR */ "Myanmar|Burma", + /* ZMB */ "Zambia", + /* CHL */ "Chili", + /* TUR */ "Turki", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambik", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Mesir", + /* MRT */ "Mauritania", + /* BOL */ "Bolivia", + /* ETH */ "Etiopia", + /* COL */ "Kolumbia", + /* ZAF */ "Afrika Selatan", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Chad", + /* PER */ "Peru", + /* MNG */ "Mongolia", + /* IRN */ "Iran", + /* LBY */ "Libya", + /* SDN */ "Sudan", + /* IDN */ "Indonesia", + /* DIF */ "Distrik Federal", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Tanah penggembalaan", + /* SAU */ "Arab Saudi", + /* COD */ "Kongo-Kinshasa", + /* DZA */ "Aljazair", + /* KAZ */ "Kazakhstan", + /* ARG */ "Argentina", + /* IN-DD */ "Daman dan Diu", + /* IN-DN */ "Dadra dan Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman dan Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu dan Kashmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Benggala barat", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Wilayah Ibu Kota Australia", + /* JBT */ "Jervis Bay Wilayah", + /* AU-NT */ "Wilayah utara", + /* AU-SA */ "Australia Selatan", + /* TAS */ "Tasmania", + /* VIC */ "Victoria", + /* AU-WA */ "Australia Barat", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapá", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondônia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piauí", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "South Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "North Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "California", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Pulau Pangeran Edward", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "India", + /* AUS */ "Australia", + /* BRA */ "Brazil", + /* USA */ "USA|Amerika Serikat|Amerika", + /* MEX */ "Mexico", + /* MOW */ "Moskow", + /* SPE */ "Saint Petersburg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingushetia Republik", + /* RU-AD */ "Adygea Republik", + /* RU-SE */ "Ossetia-Alania Republik utara", + /* RU-KB */ "Kabardino-Balkar Republic", + /* RU-KC */ "Karachay-Cherkess Republic", + /* RU-CE */ "Republik Chechnya", + /* RU-CU */ "Chuvash Republic", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrakhan Oblast", + /* MOS */ "Moscow Oblast", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "Dagestan Republik", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia Republik", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Karelia Republik", + /* NEN */ "Nenetsia", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovia Republik", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Republic", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan Republic", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Republik Tatarstan", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Buryatia Republic", + /* ZAB */ "Krai Zabaykalsky", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Khakassia Republik", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Republik Altai", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republic", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Oblast Otonom Yahudi", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Republik Sakha|Yakutia Republic", + /* CAN */ "Kanada", + /* RUS */ "Rusia", + /* CN-SH */ "Menculik", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Beijing", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Mongolia Dalam", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "Cina", + /* UMI */ "Kepulauan Terluar Kecil Amerika Serikat", + /* CPT */ "Pulau Clipperton", + /* ATA */ "Antartika", + /* AAA */ "Internasional|Dunia|Bumi" +#else // MAPCODE_SUPPORT_LANGUAGE_ID + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_ID +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_ID_H__ diff --git a/mapcodelib/internal_territory_names_it.h b/mapcodelib/internal_territory_names_it.h new file mode 100644 index 0000000..efe6524 --- /dev/null +++ b/mapcodelib/internal_territory_names_it.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_IT_H__ +#define __INTERNAL_TERRITORY_NAMES_IT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_IT[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_IT // Italian + /* VAT */ "Vaticano|Città del Vaticano|Santa Sede", + /* MCO */ "Monaco", + /* GIB */ "Gibilterra", + /* TKL */ "Tokelau", + /* CCK */ "Isole Cocos|Isole Keeling", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk e Phillip Island|Phillip Island", + /* PCN */ "Isole Pitcairn", + /* BVT */ "Isola Bouvet", + /* BMU */ "Bermuda", + /* IOT */ "Territorio Britannico dell`Oceano Indiano", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Isola di Natale", + /* WLF */ "Wallis e Futuna|Futuna", + /* VGB */ "Isole Vergini Britanniche", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Isole Marshall", + /* ASM */ "Samoa Americane", + /* COK */ "Isole Cook", + /* SPM */ "Saint Pierre e Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts e Nevis|Nevis", + /* CYM */ "Isole Cayman", + /* BES */ "Bonaire, St Eustatuis e Saba|Saba|St Eustatius", + /* MDV */ "Maldive", + /* SHN */ "Sant`Elena, Ascensione e Tristan da Cunha|Ascensione|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "US Virgin Islands|Isole Vergini, USA", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard e Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent e Grenadine|Grenadine", + /* HMD */ "Isole Heard e McDonald|Isole McDonald", + /* BRB */ "Barbados", + /* ATG */ "Antigua e Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seychelles", + /* PLW */ "Palau", + /* MNP */ "Isole Marianne settentrionali", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Isola di Man", + /* LCA */ "Santa Lucia", + /* FSM */ "Micronesia|Stati Federati di Micronesia", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks e Caicos|Caicos", + /* STP */ "Sao Tome e Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinica", + /* FRO */ "Isole Faroe", + /* GLP */ "Guadeloupe", + /* COM */ "Comore", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Lussemburgo", + /* WSM */ "Samoa", + /* SGS */ "Georgia del Sud e isole Sandwich del Sud|Isole Sandwich Meridionali", + /* PYF */ "Polinesia francese", + /* CPV */ "Capo Verde", + /* TTO */ "Trinidad e Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Terre australi e antartiche francesi", + /* PRI */ "Puerto Rico", + /* CYP */ "Cipro", + /* LBN */ "Libano", + /* JAM */ "Giamaica", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Isole Falkland", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Timor Est", + /* SWZ */ "Swaziland", + /* KWT */ "Kuwait", + /* FJI */ "Isole Figi", + /* NCL */ "Nuova Caledonia", + /* SVN */ "Slovenia", + /* ISR */ "Israele", + /* PSE */ "Territorio Palestinese", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Macedonia", + /* RWA */ "Ruanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Guinea Equatoriale", + /* ALB */ "Albania", + /* SLB */ "Isole Salomone", + /* ARM */ "Armenia", + /* LSO */ "Lesoto", + /* BEL */ "Belgio", + /* MDA */ "Moldova", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Svizzera", + /* NLD */ "Olanda", + /* DNK */ "Danimarca", + /* EST */ "Estonia", + /* DOM */ "Repubblica Dominicana", + /* SVK */ "Slovacchia", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnia-Erzegovina", + /* HRV */ "Croazia", + /* TGO */ "Togo", + /* LVA */ "Lettonia", + /* LTU */ "Lituania", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgia", + /* IRL */ "Irlanda", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Repubblica Ceca", + /* GUF */ "Guiana francese", + /* ARE */ "Emirati Arabi Uniti", + /* AUT */ "Austria", + /* AZE */ "Azerbaijan", + /* SRB */ "Serbia", + /* JOR */ "Giordania", + /* PRT */ "Portogallo", + /* HUN */ "Ungheria", + /* KOR */ "Corea del Sud", + /* ISL */ "Islanda", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgaria", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "L`Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Corea del nord", + /* NIC */ "Nicaragua", + /* GRC */ "Grecia", + /* TJK */ "Tajikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunisia", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Cambogia", + /* SYR */ "Siria", + /* SEN */ "Senegal", + /* KGZ */ "Kyrgyzstan", + /* BLR */ "Bielorussia", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Romania", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Regno Unito|Scozia|Gran Bretagna|Irlanda del Nord|Irlanda, del Nord", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Sahara occidentale|Saharawi", + /* GAB */ "Gabon", + /* NZL */ "Nuova Zelanda", + /* BFA */ "Burkina Faso", + /* PHL */ "Filippine", + /* ITA */ "Italia", + /* OMN */ "Oman", + /* POL */ "Polonia", + /* CIV */ "Costa d`Avorio", + /* NOR */ "Norvegia", + /* MYS */ "Malaysia", + /* VNM */ "Vietnam", + /* FIN */ "Finlandia", + /* COG */ "Congo-Brazzaville", + /* DEU */ "Germania", + /* JPN */ "Giappone", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Iraq", + /* MAR */ "Marocco", + /* UZB */ "Uzbekistan", + /* SWE */ "Svezia", + /* PNG */ "Papua Nuova Guinea", + /* CMR */ "Camerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Spagna", + /* THA */ "Tailandia", + /* YEM */ "Yemen", + /* FRA */ "Francia", + /* ALA */ "Isole Åland", + /* KEN */ "Kenia", + /* BWA */ "Botswana", + /* MDG */ "Madagascar", + /* UKR */ "Ucraina", + /* SSD */ "Sudan del Sud", + /* CAF */ "Repubblica Centrafricana", + /* SOM */ "Somalia", + /* AFG */ "afghanistan", + /* MMR */ "Myanmar|Birmania", + /* ZMB */ "Zambia", + /* CHL */ "Chile", + /* TUR */ "Turchia", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambico", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Egitto", + /* MRT */ "Mauritania", + /* BOL */ "Bolivia", + /* ETH */ "Etiopia", + /* COL */ "Colombia", + /* ZAF */ "Sud Africa", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Chad", + /* PER */ "Perù", + /* MNG */ "Mongolia", + /* IRN */ "Iran", + /* LBY */ "Libia", + /* SDN */ "Sudan", + /* IDN */ "Indonesia", + /* DIF */ "Distretto Federale", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Stato del Messico", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Bassa California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Bassa California del Sud", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Groenlandia", + /* SAU */ "Arabia Saudita", + /* COD */ "Congo-Kinshasa", + /* DZA */ "Algeria", + /* KAZ */ "Kazakhstan", + /* ARG */ "Argentina", + /* IN-DD */ "Daman and Diu", + /* IN-DN */ "Dadra e Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andamane e Nicobar", + /* IN-LD */ "Lakshadweep|Laccadive", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu e Kashmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "West Bengal", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "Nuovo Galles del Sud", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territorio", + /* AU-NT */ "Territori del Nord", + /* AU-SA */ "Australia del sud", + /* TAS */ "Tasmania", + /* VIC */ "Vittoria", + /* AU-WA */ "Australia Occidentale", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "San Paolo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Parà", + /* BR-AM */ "Amazonas", + /* US-DC */ "Distretto della Colombia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "Virginia Occidentale", + /* US-SC */ "Carolina del Sud", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Carolina del Nord", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Dakota del Nord", + /* US-WA */ "Washington", + /* US-SD */ "Dakota del Sud", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Nuovo Messico", + /* US-MT */ "Montana", + /* US-CA */ "California", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Terranova", + /* CA-NB */ "New Brunswick|Nuovo Brunswick", + /* CA-NS */ "Nuova Scozia", + /* CA-PE */ "Isola del Principe Edoardo", + /* CA-YT */ "Yukon", + /* CA-NT */ "Territori del Nordovest", + /* CA-NU */ "Nunavut", + /* IND */ "India", + /* AUS */ "Australia", + /* BRA */ "Brasile", + /* USA */ "USA|Stati Uniti d`America|America", + /* MEX */ "Messico", + /* MOW */ "Mosca", + /* SPE */ "San Pietroburgo", + /* KGD */ "Kaliningrad", + /* RU-IN */ "Repubblica Inguscezia", + /* RU-AD */ "Repubblica Adygea", + /* RU-SE */ "Ossezia del Nord-Alania Repubblica", + /* RU-KB */ "Kabardino-Balkar Republic", + /* RU-KC */ "Karachay-Cherkess Republic", + /* RU-CE */ "Repubblica cecena", + /* RU-CU */ "Chuvash Republic", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula", + /* RU-BE */ "Oblast `di Belgorod", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Oblast `di Astrachan", + /* MOS */ "Moscow Oblast", + /* SMO */ "Smolensk", + /* RU-DA */ "Repubblica del Daghestan", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov", + /* KOS */ "Kostroma Oblast", + /* STA */ "Kraj di Stavropol `", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Repubblica Kalmykia", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Oblast `di Volgograd", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Repubblica Carelia", + /* NEN */ "Okrug autonoma Nenets", + /* RU-KO */ "Repubblica di Komi", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Repubblica Mordovia", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Republic", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Repubblica Bashkortostan", + /* RU-UD */ "Repubblica di Udmurtia", + /* RU-TA */ "Repubblica Tatarstan", + /* SAM */ "Samara Oblast", + /* SAR */ "Oblast `di Saratov", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Repubblica Buryatia", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Oblast `di Irkutsk", + /* NVS */ "Oblast `di Novosibirsk", + /* TOM */ "Tomsk", + /* OMS */ "Oblast `di Omsk", + /* RU-KK */ "Repubblica Khakassia", + /* KEM */ "Oblast `di Kemerovo", + /* RU-AL */ "Repubblica dell`Altaj", + /* ALT */ "Altai Krai", + /* RU-TY */ "Repubblica Tuva", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Oblast `autonoma ebraica", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Oblast", + /* RU-SA */ "Repubblica di Sakha|Yakutia Repubblica", + /* CAN */ "Canada", + /* RUS */ "Russia", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Pechino", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Mongolia Interna", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "Cina", + /* UMI */ "Isole minori esterne degli Stati Uniti d`America", + /* CPT */ "Isola Clipperton", + /* ATA */ "Antartide", + /* AAA */ "Internazionale|Il mondo|Terra" +#else // MAPCODE_SUPPORT_LANGUAGE_IT + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_IT +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_IT_H__ diff --git a/mapcodelib/internal_territory_names_ja.h b/mapcodelib/internal_territory_names_ja.h new file mode 100644 index 0000000..906bd1d --- /dev/null +++ b/mapcodelib/internal_territory_names_ja.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_JA_H__ +#define __INTERNAL_TERRITORY_NAMES_JA_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_JA[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_JA // Japanese + /* VAT */ "バチカン市国|教皇庁", + /* MCO */ "モナコ", + /* GIB */ "ジブラルタル", + /* TKL */ "トケラウ諸島", + /* CCK */ "ココス諸島|キーリング諸島", + /* BLM */ "サン・バルテルミー島", + /* NRU */ "ナウル", + /* TUV */ "ツバル", + /* MAC */ "マカオ", + /* SXM */ "シントマールテン島", + /* MAF */ "サン・マルタン", + /* NFK */ "ノーフォークとフィリップ島|フィリップアイランド", + /* PCN */ "ピトケアン諸島", + /* BVT */ "ブーヴェ島", + /* BMU */ "バミューダ", + /* IOT */ "イギリス領インド洋地域", + /* SMR */ "サン・マリノ", + /* GGY */ "ガーンジー島", + /* AIA */ "アングィラ", + /* MSR */ "モントセラト", + /* JEY */ "ジャージー", + /* CXR */ "クリスマス島", + /* WLF */ "ウォリス・フツナ|フツナ", + /* VGB */ "英領バージン諸島|イギリス領バージン諸島", + /* LIE */ "リヒテンシュタイン", + /* ABW */ "アルバ", + /* MHL */ "マーシャル諸島", + /* ASM */ "アメリカ領サモア|サモア、アメリカ", + /* COK */ "クック諸島", + /* SPM */ "サンピエール島・ミクロン島|ミクロン島", + /* NIU */ "ニウエ", + /* KNA */ "セントクリストファー・ネイビス|ネビス島", + /* CYM */ "ケイマン諸島", + /* BES */ "ボネール、セントEustatuisとサバ|サバ|セントユースタティウス", + /* MDV */ "モルディブ", + /* SHN */ "セントヘレナ、アセンションおよびトリスタン・ダ・クーニャ|アセンション|トリスタン・ダ・クーニャ", + /* MLT */ "マルタ", + /* GRD */ "グレナダ", + /* VIR */ "米領バージン諸島|米領バージン諸島", + /* MYT */ "マヨット島", + /* SJM */ "スバールバル諸島とヤンマイエン島|ヤンマイエン島", + /* VCT */ "セントビンセント・グレナディーン|グレナディーン諸島", + /* HMD */ "ハード島とマクドナルド諸島|マクドナルド諸島", + /* BRB */ "バルバドス", + /* ATG */ "アンティグアバーブーダ|バーブーダ", + /* CUW */ "キュラソー", + /* SYC */ "セイシェル", + /* PLW */ "パラオ", + /* MNP */ "北マリアナ諸島", + /* AND */ "アンドラ", + /* GUM */ "グアム", + /* IMN */ "マン島", + /* LCA */ "セントルシア", + /* FSM */ "ミクロネシア|ミクロネシア連邦", + /* SGP */ "シンガポール", + /* TON */ "トンガ", + /* DMA */ "ドミニカ", + /* BHR */ "バーレーン", + /* KIR */ "キリバス", + /* TCA */ "タークス・カイコス諸島|カイコス諸島", + /* STP */ "サントメ・プリンシペ|プリンシペ", + /* HKG */ "香港", + /* MTQ */ "マルティニーク島", + /* FRO */ "フェロー諸島", + /* GLP */ "グアドループ島", + /* COM */ "コモロ", + /* MUS */ "モーリシャス", + /* REU */ "再会", + /* LUX */ "ルクセンブルク", + /* WSM */ "サモア", + /* SGS */ "サウスジョージア・サウスサンドウィッチ諸島|サウスサンドウィッチ諸島", + /* PYF */ "フランス領ポリネシア", + /* CPV */ "カーボベルデ", + /* TTO */ "トリニダード・トバゴ|トバゴ", + /* BRN */ "ブルネイ", + /* ATF */ "フランス領南方・南極地域", + /* PRI */ "プエルトリコ", + /* CYP */ "キプロス", + /* LBN */ "レバノン", + /* JAM */ "ジャマイカ", + /* GMB */ "ガンビア", + /* QAT */ "カタール", + /* FLK */ "フォークランド諸島", + /* VUT */ "バヌアツ", + /* MNE */ "モンテネグロ", + /* BHS */ "バハマ", + /* TLS */ "東ティモール", + /* SWZ */ "スワジランド", + /* KWT */ "クウェート", + /* FJI */ "フィジー", + /* NCL */ "ニューカレドニア", + /* SVN */ "スロベニア", + /* ISR */ "イスラエル", + /* PSE */ "パレスチナ領土", + /* SLV */ "エルサルバドル", + /* BLZ */ "ベリーズ", + /* DJI */ "ジブチ", + /* MKD */ "マケドニア", + /* RWA */ "ルワンダ", + /* HTI */ "ハイチ", + /* BDI */ "ブルンジ", + /* GNQ */ "赤道ギニア", + /* ALB */ "アルバニア", + /* SLB */ "ソロモン諸島", + /* ARM */ "アルメニア", + /* LSO */ "レソト", + /* BEL */ "ベルギー", + /* MDA */ "モルドバ", + /* GNB */ "ギニアビサウ", + /* TWN */ "台湾", + /* BTN */ "ブータン", + /* CHE */ "スイス", + /* NLD */ "オランダ", + /* DNK */ "デンマーク", + /* EST */ "エストニア", + /* DOM */ "ドミニカ共和国", + /* SVK */ "スロバキア", + /* CRI */ "コスタリカ", + /* BIH */ "ボスニア・ヘルツェゴビナ", + /* HRV */ "クロアチア", + /* TGO */ "トーゴ", + /* LVA */ "ラトビア", + /* LTU */ "リトアニア", + /* LKA */ "スリランカ", + /* GEO */ "ジョージア", + /* IRL */ "アイルランド", + /* SLE */ "シエラレオネ", + /* PAN */ "パナマ", + /* CZE */ "チェコ共和国", + /* GUF */ "仏領ギアナ", + /* ARE */ "アラブ首長国連邦", + /* AUT */ "オーストリア", + /* AZE */ "アゼルバイジャン", + /* SRB */ "セルビア", + /* JOR */ "ヨルダン", + /* PRT */ "ポルトガル", + /* HUN */ "ハンガリー", + /* KOR */ "韓国", + /* ISL */ "アイスランド", + /* GTM */ "グアテマラ", + /* CUB */ "キューバ", + /* BGR */ "ブルガリア", + /* LBR */ "リベリア", + /* HND */ "ホンジュラス", + /* BEN */ "ベニン", + /* ERI */ "エリトリア", + /* MWI */ "マラウイ", + /* PRK */ "北朝鮮", + /* NIC */ "ニカラグア", + /* GRC */ "ギリシャ", + /* TJK */ "タジキスタン", + /* BGD */ "バングラデシュ", + /* NPL */ "ネパール", + /* TUN */ "チュニジア", + /* SUR */ "スリナム", + /* URY */ "ウルグアイ", + /* KHM */ "カンボジア", + /* SYR */ "シリア", + /* SEN */ "セネガル", + /* KGZ */ "キルギスタン", + /* BLR */ "ベラルーシ", + /* GUY */ "ガイアナ", + /* LAO */ "ラオス", + /* ROU */ "ルーマニア", + /* GHA */ "ガーナ", + /* UGA */ "ウガンダ", + /* GBR */ "イギリス|スコットランド|イギリス|北アイルランド|アイルランド、北", + /* GIN */ "ギニア", + /* ECU */ "エクアドル", + /* ESH */ "西サハラ|サハラ", + /* GAB */ "ガボン", + /* NZL */ "ニュージーランド", + /* BFA */ "ブルキナファソ", + /* PHL */ "フィリピン", + /* ITA */ "イタリア", + /* OMN */ "オマーン", + /* POL */ "ポーランド", + /* CIV */ "コートジボワール", + /* NOR */ "ノルウェー", + /* MYS */ "マレーシア", + /* VNM */ "ベトナム", + /* FIN */ "フィンランド", + /* COG */ "コンゴ - ブラザビル", + /* DEU */ "ドイツ", + /* JPN */ "日本", + /* ZWE */ "ジンバブエ", + /* PRY */ "パラグアイ", + /* IRQ */ "イラク", + /* MAR */ "モロッコ", + /* UZB */ "ウズベキスタン", + /* SWE */ "スウェーデン", + /* PNG */ "パプアニューギニア", + /* CMR */ "カメルーン", + /* TKM */ "トルクメニスタン", + /* ESP */ "スペイン", + /* THA */ "タイ", + /* YEM */ "イエメン", + /* FRA */ "フランス", + /* ALA */ "オーランド諸島", + /* KEN */ "ケニア", + /* BWA */ "ボツワナ", + /* MDG */ "マダガスカル", + /* UKR */ "ウクライナ", + /* SSD */ "南スーダン", + /* CAF */ "中央アフリカ共和国", + /* SOM */ "ソマリア", + /* AFG */ "アフガニスタン", + /* MMR */ "ミャンマー|ビルマ", + /* ZMB */ "ザンビア", + /* CHL */ "チリ", + /* TUR */ "トルコ", + /* PAK */ "パキスタン", + /* MOZ */ "モザンビーク", + /* NAM */ "ナミビア", + /* VEN */ "ベネズエラ", + /* NGA */ "ナイジェリア", + /* TZA */ "タンザニア", + /* EGY */ "エジプト", + /* MRT */ "モーリタニア", + /* BOL */ "ボリビア", + /* ETH */ "エチオピア", + /* COL */ "コロンビア", + /* ZAF */ "南アフリカ", + /* MLI */ "マリ", + /* AGO */ "アンゴラ", + /* NER */ "ニジェール", + /* TCD */ "チャド", + /* PER */ "ペルー", + /* MNG */ "モンゴル", + /* IRN */ "イラン", + /* LBY */ "リビア", + /* SDN */ "スーダン", + /* IDN */ "インドネシア", + /* DIF */ "連邦区", + /* TLA */ "トラスカラ", + /* MOR */ "モレロス州", + /* AGU */ "アグアスカリエンテス", + /* MX-CL */ "コリマ", + /* QUE */ "ケレタロ", + /* HID */ "イダルゴ", + /* MX-MX */ "メキシコ州", + /* TAB */ "タバスコ", + /* NAY */ "ナヤリット", + /* GUA */ "グアナファト", + /* PUE */ "プエブラ", + /* YUC */ "ユカタン州", + /* ROO */ "キンタナロー州", + /* SIN */ "シナロア州", + /* CAM */ "カンペチェ", + /* MIC */ "ミチョアカン州", + /* SLP */ "サンルイスポトシ", + /* GRO */ "ゲレロ", + /* NLE */ "ヌエボレオン州", + /* BCN */ "バハカリフォルニア", + /* VER */ "ベラクルス州", + /* CHP */ "チアパス州", + /* BCS */ "バハ・カリフォルニア・スル州", + /* ZAC */ "サカテカス", + /* JAL */ "ハリスコ州", + /* TAM */ "タマウリパス州", + /* OAX */ "オアハカ", + /* DUR */ "ドゥランゴ", + /* COA */ "コアウイラ州", + /* SON */ "ソノラ州", + /* CHH */ "チワワ", + /* GRL */ "グリーンランド", + /* SAU */ "サウジアラビア", + /* COD */ "コンゴ - キンシャサ", + /* DZA */ "アルジェリア", + /* KAZ */ "カザフスタン", + /* ARG */ "アルゼンチン", + /* IN-DD */ "ダマンディウ", + /* IN-DN */ "ダードラーとナガルハベリ", + /* IN-CH */ "チャンディーガル", + /* IN-AN */ "アンダマン・ニコバル", + /* IN-LD */ "ラクシャドウィープ", + /* IN-DL */ "デリー", + /* IN-ML */ "メガラヤ州", + /* IN-NL */ "ナガランド", + /* IN-MN */ "マニプール", + /* IN-TR */ "トリプラ", + /* IN-MZ */ "ミゾラム", + /* IN-SK */ "シッキム", + /* IN-PB */ "パンジャブ", + /* IN-HR */ "ハリヤナ州", + /* IN-AR */ "アルナチャル・パラデシュ", + /* IN-AS */ "アッサム", + /* IN-BR */ "ビハール州", + /* IN-UT */ "ウッタラーカンド州", + /* IN-GA */ "ゴア", + /* IN-KL */ "ケララ", + /* IN-TN */ "タミル・ナードゥ州", + /* IN-HP */ "ヒマチャル・プラデシュ", + /* IN-JK */ "ジャム・カシミール", + /* IN-CT */ "チャッティースガル州", + /* IN-JH */ "ジャールカンド州", + /* IN-KA */ "カルナタカ", + /* IN-RJ */ "ラジャスタン", + /* IN-OR */ "オリッサ州|オリッサ", + /* IN-GJ */ "グジャラート", + /* IN-WB */ "西ベンガル", + /* IN-MP */ "マディヤプラデシュ州", + /* IN-TG */ "テランガーナ州", + /* IN-AP */ "アンドラプラデシ", + /* IN-MH */ "マハラシュトラ", + /* IN-UP */ "ウッタルプラデシ州", + /* IN-PY */ "ポンディシェリ", + /* NSW */ "ニューサウスウェールズ州", + /* ACT */ "オーストラリア首都特別地域", + /* JBT */ "ジャービス湾特別地域", + /* AU-NT */ "ノーザン・テリトリー", + /* AU-SA */ "南オーストラリア州", + /* TAS */ "タスマニア州", + /* VIC */ "ビクトリア", + /* AU-WA */ "西オーストラリア州", + /* QLD */ "クイーンズランド州", + /* BR-DF */ "連邦区", + /* BR-SE */ "セルジペ州", + /* BR-AL */ "アラゴアス州", + /* BR-RJ */ "リオデジャネイロ", + /* BR-ES */ "エスピリトサント州", + /* BR-RN */ "リオ・グランデ・ド・ノルテ", + /* BR-PB */ "パライバ州", + /* BR-SC */ "サンタカタリナ州", + /* BR-PE */ "ペルナンブコ州", + /* BR-AP */ "アマパ", + /* BR-CE */ "セアラ州", + /* BR-AC */ "アクレ州", + /* BR-PR */ "パラナ", + /* BR-RR */ "ロライマ", + /* BR-RO */ "ロンドニア", + /* BR-SP */ "サンパウロ", + /* BR-PI */ "ピアウイ", + /* BR-TO */ "トカンチンス", + /* BR-RS */ "リオグランデ・ド・スル", + /* BR-MA */ "マラニャン州", + /* BR-GO */ "ゴイアス州", + /* BR-MS */ "マット・グロッソ・ド・スル", + /* BR-BA */ "バイア州", + /* BR-MG */ "ミナスジェライス州", + /* BR-MT */ "マトグロッソ州", + /* BR-PA */ "パラ", + /* BR-AM */ "アマゾナス", + /* US-DC */ "アラスカ州", + /* US-RI */ "ロードアイランド州", + /* US-DE */ "デラウェア州", + /* US-CT */ "コネティカット州", + /* US-NJ */ "ニュージャージー州", + /* US-NH */ "ニューハンプシャー州", + /* US-VT */ "バーモント州", + /* US-MA */ "マサチューセッツ州", + /* US-HI */ "ハワイ州", + /* US-MD */ "メリーランド州", + /* US-WV */ "ウェストバージニア州", + /* US-SC */ "サウスカロライナ州", + /* US-ME */ "メイン州", + /* US-IN */ "インディアナ州", + /* US-KY */ "ケンタッキー州", + /* US-TN */ "テネシー州", + /* US-VA */ "バージニア州", + /* US-OH */ "オハイオ州", + /* US-PA */ "ペンシルベニア州", + /* US-MS */ "ミシシッピ州", + /* US-LA */ "ルイジアナ州", + /* US-AL */ "アラバマ州", + /* US-AR */ "アーカンソー州", + /* US-NC */ "ノースカロライナ州", + /* US-NY */ "ニューヨーク州", + /* US-IA */ "アイオワ州", + /* US-IL */ "イリノイ州", + /* US-GA */ "ジョージア", + /* US-WI */ "ウィスコンシン州", + /* US-FL */ "フロリダ州", + /* US-MO */ "ミズーリ州", + /* US-OK */ "オクラホマ州", + /* US-ND */ "ノースダコタ州", + /* US-WA */ "ワシントン州", + /* US-SD */ "サウスダコタ州", + /* US-NE */ "ネブラスカ州", + /* US-KS */ "カンザス州", + /* US-ID */ "アイダホ州", + /* US-UT */ "ユタ州", + /* US-MN */ "ミネソタ州", + /* US-MI */ "ミシガン州", + /* US-WY */ "ワイオミング州", + /* US-OR */ "オレゴン州", + /* US-CO */ "コロラド州", + /* US-NV */ "ネバダ州", + /* US-AZ */ "アリゾナ州", + /* US-NM */ "ニューメキシコ州", + /* US-MT */ "モンタナ州", + /* US-CA */ "カリフォルニア州", + /* US-TX */ "テキサス州", + /* US-AK */ "アラスカ州", + /* CA-BC */ "ブリティッシュコロンビア", + /* CA-AB */ "アルバータ州", + /* CA-ON */ "オンタリオ", + /* CA-QC */ "ケベック", + /* CA-SK */ "サスカチュワン州", + /* CA-MB */ "マニトバ州", + /* CA-NL */ "ニューファンドランド島", + /* CA-NB */ "ニューブランズウィック", + /* CA-NS */ "ノバスコシア州", + /* CA-PE */ "プリンスエドワードアイランド", + /* CA-YT */ "ユーコン州", + /* CA-NT */ "ノースウェスト準州", + /* CA-NU */ "ヌナブト", + /* IND */ "インド", + /* AUS */ "オーストラリア", + /* BRA */ "ブラジル", + /* USA */ "アメリカ|米国|アメリカ合衆国", + /* MEX */ "メキシコ", + /* MOW */ "モスクワ", + /* SPE */ "セントピーターズバーグ", + /* KGD */ "カリーニングラード州", + /* RU-IN */ "イングーシ共和国", + /* RU-AD */ "アディゲ共和国共和国", + /* RU-SE */ "北オセチア共和国共和国", + /* RU-KB */ "カバルダ・バルカル共和国", + /* RU-KC */ "カラチャイ-Cherkess共和国", + /* RU-CE */ "チェチェン共和国", + /* RU-CU */ "チュヴァシュ共和国", + /* IVA */ "イヴァノヴォ州", + /* LIP */ "リペツク州", + /* ORL */ "オリョール州", + /* TUL */ "トゥーラ州", + /* RU-BE */ "ベルゴロド州", + /* VLA */ "ヴラジーミル州", + /* KRS */ "クルスク州", + /* KLU */ "カルーガ州", + /* RU-TT */ "タンボフ州", + /* BRY */ "ブリャンスク州", + /* YAR */ "ヤロスラヴリ州", + /* RYA */ "リャザン州", + /* AST */ "アストラハン州", + /* MOS */ "モスクワ州", + /* SMO */ "スモレンスク州", + /* RU-DA */ "ダゲスタン共和国", + /* VOR */ "ヴォロネジ州", + /* NGR */ "ノヴゴロド州", + /* PSK */ "プスコフ州", + /* KOS */ "コストロマ州", + /* STA */ "スタヴロポリ地方", + /* KDA */ "クラスノダール地方", + /* RU-KL */ "カルムイク共和国", + /* TVE */ "トヴェリ州", + /* LEN */ "レニングラード州", + /* ROS */ "ロストフ州", + /* VGG */ "ヴォルゴグラード州", + /* VLG */ "ヴォログダ州", + /* MUR */ "ムルマンスク州", + /* RU-KR */ "カレリア共和国", + /* NEN */ "ネネツ自治管区", + /* RU-KO */ "コミ共和国", + /* ARK */ "アルハンゲリスク州", + /* RU-MO */ "モルドヴィア共和国", + /* NIZ */ "ニジニ・ノヴゴロド州", + /* PNZ */ "ペンザ州", + /* RU-KI */ "キーロフ州", + /* RU-ME */ "マリ・エル共和国共和国", + /* ORE */ "オレンブルク州", + /* ULY */ "ウリヤノフスク州", + /* RU-PM */ "ペルミ地方", + /* RU-BA */ "バシコルトスタン共和国", + /* RU-UD */ "ウドムルト共和国", + /* RU-TA */ "タタルスタン共和国", + /* SAM */ "サマラ州", + /* SAR */ "サラトフ州", + /* YAN */ "ヤマロ・ネネツ自治管区", + /* RU-KM */ "ハンティ・マンシ", + /* SVE */ "スヴェルドロフスク州", + /* TYU */ "チュメニ州", + /* KGN */ "クルガン州", + /* RU-CH */ "チェリャビンスク州", + /* RU-BU */ "ブリヤート共和国", + /* ZAB */ "ザバイカリエ地方", + /* IRK */ "イルクーツク州", + /* NVS */ "ノヴォシビルスク州", + /* TOM */ "トムスク州", + /* OMS */ "オムスク州", + /* RU-KK */ "ハカス共和国共和国", + /* KEM */ "ケメロヴォ州", + /* RU-AL */ "アルタイ共和国", + /* ALT */ "アルタイ地方", + /* RU-TY */ "トゥヴァ共和国", + /* KYA */ "クラスノヤルスク地方", + /* MAG */ "マガダン州", + /* CHU */ "チュクチ管区", + /* KAM */ "カムチャツカ地方", + /* SAK */ "サハリン州", + /* RU-PO */ "沿海州", + /* YEV */ "ユダヤ自治州", + /* KHA */ "ハバロフスク地方", + /* AMU */ "アムール州", + /* RU-SA */ "サハ共和国|ヤクート共和国", + /* CAN */ "カナダ", + /* RUS */ "ロシア", + /* CN-SH */ "上海", + /* CN-TJ */ "天津", + /* CN-BJ */ "北京", + /* CN-HI */ "海南", + /* CN-NX */ "寧夏ホイ", + /* CN-CQ */ "重慶市", + /* CN-ZJ */ "浙江省", + /* CN-JS */ "江蘇省", + /* CN-FJ */ "福建省", + /* CN-AH */ "安徽省", + /* CN-LN */ "遼寧", + /* CN-SD */ "山東省", + /* CN-SX */ "山西", + /* CN-JX */ "江西省", + /* CN-HA */ "河南省", + /* CN-GZ */ "貴州省", + /* CN-GD */ "広東", + /* CN-HB */ "湖北省", + /* CN-JL */ "吉林", + /* CN-HE */ "河北省", + /* CN-SN */ "陝西", + /* CN-NM */ "内モンゴル|内蒙古", + /* CN-HL */ "黒竜江省", + /* CN-HN */ "湖南省", + /* CN-GX */ "広西チワン族自治区", + /* CN-SC */ "四川省", + /* CN-YN */ "雲南", + /* CN-XZ */ "西蔵|チベット", + /* CN-GS */ "甘粛省", + /* CN-QH */ "青海", + /* CN-XJ */ "新疆ウイグル", + /* CHN */ "中国", + /* UMI */ "アメリカ合衆国外諸島", + /* CPT */ "クリッパートン島", + /* ATA */ "南極大陸", + /* AAA */ "インターナショナル|世界|地球" +#else // MAPCODE_SUPPORT_LANGUAGE_JA + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_JA +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_JA_H__ diff --git a/mapcodelib/internal_territory_names_ko.h b/mapcodelib/internal_territory_names_ko.h new file mode 100644 index 0000000..4fbe25a --- /dev/null +++ b/mapcodelib/internal_territory_names_ko.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_KO_H__ +#define __INTERNAL_TERRITORY_NAMES_KO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_KO[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_KO // Korean + /* VAT */ "바티칸 시국|교황청", + /* MCO */ "모나코", + /* GIB */ "지브롤터", + /* TKL */ "토켈라우", + /* CCK */ "코코스 제도|킬링 제도", + /* BLM */ "생바르텔레미", + /* NRU */ "나우루", + /* TUV */ "투발루", + /* MAC */ "마카오", + /* SXM */ "신트마르턴", + /* MAF */ "세인트 마틴", + /* NFK */ "노퍽 섬|필립 섬", + /* PCN */ "핏케언 제도", + /* BVT */ "부베 섬", + /* BMU */ "버뮤다", + /* IOT */ "영국령 인도양 지역", + /* SMR */ "산마리노", + /* GGY */ "건지 섬", + /* AIA */ "앵귈라", + /* MSR */ "몬트세랫", + /* JEY */ "저지 섬", + /* CXR */ "크리스마스 섬", + /* WLF */ "월리스 푸투나|푸투나", + /* VGB */ "영국령 버진아일랜드|버진아일랜드 영국령", + /* LIE */ "리히텐슈타인", + /* ABW */ "아루바", + /* MHL */ "마셜 제도", + /* ASM */ "아메리칸사모아", + /* COK */ "쿡 제도", + /* SPM */ "생피에르 미클롱", + /* NIU */ "니우에", + /* KNA */ "세인트키츠 네비스|네비스", + /* CYM */ "케이맨 제도", + /* BES */ "보네르, 세인트 유스 타티 우스 및 사바|사바|세인트 유스 타티 우스", + /* MDV */ "몰디브", + /* SHN */ "세인트헬레나, 승천과 트리스탄 다 쿠냐|승천|트리스탄 다 쿠냐", + /* MLT */ "몰타", + /* GRD */ "그레나다", + /* VIR */ "미국령 버진아일랜드|버진아일랜드 미국령", + /* MYT */ "마요트", + /* SJM */ "스발바르 얀마옌|얀마옌", + /* VCT */ "세인트빈센트 그레나딘|그레나딘", + /* HMD */ "허드 맥도널드 제도", + /* BRB */ "바베이도스", + /* ATG */ "앤티가 바부 다|바부 다", + /* CUW */ "쿠라 카오", + /* SYC */ "세이셸", + /* PLW */ "팔라우", + /* MNP */ "북마리아나 제도", + /* AND */ "안도라", + /* GUM */ "괌", + /* IMN */ "맨 섬", + /* LCA */ "세인트루시아", + /* FSM */ "미크로네시아 연방", + /* SGP */ "싱가포르", + /* TON */ "통가", + /* DMA */ "도미니카 연방", + /* BHR */ "바레인", + /* KIR */ "키리바시", + /* TCA */ "터크스 케이커스 제도", + /* STP */ "상투메 프린시페|프린시페", + /* HKG */ "홍콩", + /* MTQ */ "마르티니크", + /* FRO */ "페로 제도", + /* GLP */ "과들루프", + /* COM */ "코모로", + /* MUS */ "모리셔스", + /* REU */ "레위니옹", + /* LUX */ "룩셈부르크", + /* WSM */ "사모아", + /* SGS */ "사우스조지아 및 사우스 샌드위치 제도|사우스 샌드위치 제도", + /* PYF */ "프랑스령 폴리네시아", + /* CPV */ "카보베르데", + /* TTO */ "트리니다드 토바고", + /* BRN */ "브루나이", + /* ATF */ "프랑스령 남방 및 남극", + /* PRI */ "푸에르토리코", + /* CYP */ "키프로스", + /* LBN */ "레바논", + /* JAM */ "자메이카", + /* GMB */ "감비아", + /* QAT */ "카타르", + /* FLK */ "포클랜드 제도", + /* VUT */ "바누아투", + /* MNE */ "몬테네그로", + /* BHS */ "바하마", + /* TLS */ "동티모르", + /* SWZ */ "스와질란드", + /* KWT */ "쿠웨이트", + /* FJI */ "피지", + /* NCL */ "누벨칼레도니|뉴 칼레도니아", + /* SVN */ "슬로베니아", + /* ISR */ "이스라엘", + /* PSE */ "팔레스타인 자치", + /* SLV */ "엘살바도르", + /* BLZ */ "벨리즈", + /* DJI */ "지부티", + /* MKD */ "마케도니아 공화국", + /* RWA */ "르완다", + /* HTI */ "아이티", + /* BDI */ "부룬디", + /* GNQ */ "적도 기니", + /* ALB */ "알바니아", + /* SLB */ "솔로몬 제도", + /* ARM */ "아르메니아", + /* LSO */ "레소토", + /* BEL */ "벨기에", + /* MDA */ "몰도바", + /* GNB */ "기니비사우", + /* TWN */ "타이완", + /* BTN */ "부탄", + /* CHE */ "스위스", + /* NLD */ "네덜란드", + /* DNK */ "덴마크", + /* EST */ "에스토니아", + /* DOM */ "도미니카 공화국", + /* SVK */ "슬로바키아", + /* CRI */ "코스타리카", + /* BIH */ "보스니아 헤르체고비나", + /* HRV */ "크로아티아", + /* TGO */ "토고", + /* LVA */ "라트비아", + /* LTU */ "리투아니아", + /* LKA */ "스리랑카", + /* GEO */ "조지아", + /* IRL */ "아일랜드", + /* SLE */ "시에라리온", + /* PAN */ "파나마", + /* CZE */ "체코", + /* GUF */ "프랑스령 기아나", + /* ARE */ "아랍에미리트", + /* AUT */ "오스트리아", + /* AZE */ "아제르바이잔", + /* SRB */ "세르비아", + /* JOR */ "요르단", + /* PRT */ "포르투갈", + /* HUN */ "헝가리", + /* KOR */ "대한민국", + /* ISL */ "아이슬란드", + /* GTM */ "과테말라", + /* CUB */ "쿠바", + /* BGR */ "불가리아", + /* LBR */ "라이베리아", + /* HND */ "온두라스", + /* BEN */ "베냉", + /* ERI */ "에리트레아", + /* MWI */ "말라위", + /* PRK */ "조선민주주의인민공화국", + /* NIC */ "니카라과", + /* GRC */ "그리스", + /* TJK */ "타지키스탄", + /* BGD */ "방글라데시", + /* NPL */ "네팔", + /* TUN */ "튀니지", + /* SUR */ "수리남", + /* URY */ "우루과이", + /* KHM */ "캄보디아", + /* SYR */ "시리아", + /* SEN */ "세네갈", + /* KGZ */ "키르기스스탄", + /* BLR */ "벨라루스", + /* GUY */ "가이아나", + /* LAO */ "라오스", + /* ROU */ "루마니아", + /* GHA */ "가나", + /* UGA */ "우간다", + /* GBR */ "영국|스코틀랜드|북 아일랜드|아일랜드, 북", + /* GIN */ "기니", + /* ECU */ "에콰도르", + /* ESH */ "서부 사하라", + /* GAB */ "가봉", + /* NZL */ "뉴질랜드", + /* BFA */ "부르키나파소", + /* PHL */ "필리핀", + /* ITA */ "이탈리아", + /* OMN */ "오만", + /* POL */ "폴란드", + /* CIV */ "코트디부아르", + /* NOR */ "노르웨이", + /* MYS */ "말레이시아", + /* VNM */ "베트남", + /* FIN */ "핀란드", + /* COG */ "콩고 공화국", + /* DEU */ "독일", + /* JPN */ "일본", + /* ZWE */ "짐바브웨", + /* PRY */ "파라과이", + /* IRQ */ "이라크", + /* MAR */ "모로코", + /* UZB */ "우즈베키스탄", + /* SWE */ "스웨덴", + /* PNG */ "파푸아뉴기니", + /* CMR */ "카메룬", + /* TKM */ "투르크메니스탄", + /* ESP */ "스페인", + /* THA */ "태국", + /* YEM */ "예멘", + /* FRA */ "프랑스", + /* ALA */ "올란드 제도", + /* KEN */ "케냐", + /* BWA */ "보츠와나", + /* MDG */ "마다가스카르", + /* UKR */ "우크라이나", + /* SSD */ "남수단", + /* CAF */ "중앙아프리카 공화국", + /* SOM */ "소말리아", + /* AFG */ "아프가니스탄", + /* MMR */ "미얀마|버마", + /* ZMB */ "잠비아", + /* CHL */ "칠레", + /* TUR */ "터키", + /* PAK */ "파키스탄", + /* MOZ */ "모잠비크", + /* NAM */ "나미비아", + /* VEN */ "베네수엘라", + /* NGA */ "나이지리아", + /* TZA */ "탄자니아", + /* EGY */ "이집트", + /* MRT */ "모리타니", + /* BOL */ "볼리비아", + /* ETH */ "에티오피아", + /* COL */ "콜롬비아", + /* ZAF */ "남아프리카 공화국", + /* MLI */ "말리", + /* AGO */ "앙골라", + /* NER */ "니제르", + /* TCD */ "차드", + /* PER */ "페루", + /* MNG */ "몽골", + /* IRN */ "이란", + /* LBY */ "리비아", + /* SDN */ "수단", + /* IDN */ "인도네시아", + /* DIF */ "연방 지구", + /* TLA */ "틀 락스 칼라", + /* MOR */ "모렐 로스", + /* AGU */ "아과 스 칼리 엔 테스", + /* MX-CL */ "콜리 마", + /* QUE */ "케 레타로", + /* HID */ "이달고 주", + /* MX-MX */ "멕시코 주", + /* TAB */ "타바스코", + /* NAY */ "나야 릿", + /* GUA */ "과 나후 아토", + /* PUE */ "푸에블라", + /* YUC */ "유카탄", + /* ROO */ "킨 타나로", + /* SIN */ "시날로아", + /* CAM */ "캄 페체", + /* MIC */ "미초 아깐", + /* SLP */ "산 루이스 포토", + /* GRO */ "게레로", + /* NLE */ "누에 보 레온", + /* BCN */ "바하 캘리포니아", + /* VER */ "베라 크루즈", + /* CHP */ "치아파스", + /* BCS */ "바하 칼리 포르 니아 수르", + /* ZAC */ "사 카테 카스", + /* JAL */ "할리 스코", + /* TAM */ "타마 울리 파스", + /* OAX */ "오악 사카", + /* DUR */ "두 랑고", + /* COA */ "코아 우일", + /* SON */ "노라", + /* CHH */ "치와와", + /* GRL */ "그린란드", + /* SAU */ "사우디아라비아", + /* COD */ "콩고 민주 공화국", + /* DZA */ "알제리", + /* KAZ */ "카자흐스탄", + /* ARG */ "아르헨티나", + /* IN-DD */ "다만 디우", + /* IN-DN */ "다 드라 나가르 하 벨리", + /* IN-CH */ "찬디 가르", + /* IN-AN */ "안다만 니코 바르", + /* IN-LD */ "락 샤드 윕", + /* IN-DL */ "델리", + /* IN-ML */ "메갈 라야", + /* IN-NL */ "나갈 랜드", + /* IN-MN */ "마니 푸르", + /* IN-TR */ "트리 푸라", + /* IN-MZ */ "미조람", + /* IN-SK */ "시킴", + /* IN-PB */ "펀 자브", + /* IN-HR */ "하리 아나", + /* IN-AR */ "아루나 찰 프라데시", + /* IN-AS */ "아삼", + /* IN-BR */ "비하르", + /* IN-UT */ "우타 라칸", + /* IN-GA */ "고아", + /* IN-KL */ "케 랄라", + /* IN-TN */ "타밀 나두", + /* IN-HP */ "히 마찰 프라데시", + /* IN-JK */ "카슈미르", + /* IN-CT */ "차 티스 가르", + /* IN-JH */ "즈 하르 한드", + /* IN-KA */ "카르 나 타카", + /* IN-RJ */ "라자스탄", + /* IN-OR */ "오리사 주|오리", + /* IN-GJ */ "구자라트", + /* IN-WB */ "웨스트 벵갈", + /* IN-MP */ "마디 아 프라데시", + /* IN-TG */ "텔랑 가나 주", + /* IN-AP */ "안드라 프라데시", + /* IN-MH */ "마하라 슈트라", + /* IN-UP */ "우타르 프라데시", + /* IN-PY */ "푸두 체리|폰디 체리", + /* NSW */ "뉴 사우스 웨일즈", + /* ACT */ "호주 수도 특별 자치구", + /* JBT */ "저비스 베이 준주", + /* AU-NT */ "노던 테리토리", + /* AU-SA */ "사우스 오스트레일리아", + /* TAS */ "태즈 메이 니아", + /* VIC */ "빅토리아", + /* AU-WA */ "웨스턴 오스트레일리아", + /* QLD */ "퀸즐랜드", + /* BR-DF */ "디스트 리토 페데 랄", + /* BR-SE */ "세르 지페", + /* BR-AL */ "알라고 아스", + /* BR-RJ */ "리오 데 자네이로", + /* BR-ES */ "에스피 리토 산토", + /* BR-RN */ "리오 그란데 노르 테", + /* BR-PB */ "파라이", + /* BR-SC */ "산타 카타리나", + /* BR-PE */ "페르 남부 쿠", + /* BR-AP */ "아마 파", + /* BR-CE */ "아라", + /* BR-AC */ "아크리 주", + /* BR-PR */ "파라나", + /* BR-RR */ "로라 이마", + /* BR-RO */ "론도", + /* BR-SP */ "상 파울로", + /* BR-PI */ "피아 우이", + /* BR-TO */ "토칸 틴스", + /* BR-RS */ "리오 그란데도 술을", + /* BR-MA */ "마라 냐웅", + /* BR-GO */ "고이 아스", + /* BR-MS */ "마투 그로 수두 술 주", + /* BR-BA */ "바이아", + /* BR-MG */ "미나스 제 라이스", + /* BR-MT */ "마투 그로 수", + /* BR-PA */ "파라", + /* BR-AM */ "아마 조나스", + /* US-DC */ "워싱턴 D.C.", + /* US-RI */ "로드아일랜드", + /* US-DE */ "델라웨어", + /* US-CT */ "코네티컷", + /* US-NJ */ "뉴저지", + /* US-NH */ "뉴햄프셔", + /* US-VT */ "버몬트", + /* US-MA */ "매사추세츠", + /* US-HI */ "하와이", + /* US-MD */ "메릴랜드", + /* US-WV */ "웨스트버지니아", + /* US-SC */ "사우스캐롤라이나", + /* US-ME */ "메인", + /* US-IN */ "인디애나", + /* US-KY */ "켄터키", + /* US-TN */ "테네시", + /* US-VA */ "버지니아", + /* US-OH */ "오하이오", + /* US-PA */ "펜실베이니아", + /* US-MS */ "미시시피", + /* US-LA */ "루이지애나", + /* US-AL */ "앨라배마", + /* US-AR */ "아칸소", + /* US-NC */ "노스캐롤라이나", + /* US-NY */ "뉴욕", + /* US-IA */ "아이오와", + /* US-IL */ "일리노이", + /* US-GA */ "조지아", + /* US-WI */ "위스콘신", + /* US-FL */ "플로리다", + /* US-MO */ "미주리", + /* US-OK */ "오클라호마", + /* US-ND */ "노스다코타", + /* US-WA */ "워싱턴", + /* US-SD */ "사우스다코타", + /* US-NE */ "네브래스카", + /* US-KS */ "캔자스", + /* US-ID */ "아이다호", + /* US-UT */ "유타", + /* US-MN */ "미네소타", + /* US-MI */ "미시간", + /* US-WY */ "와이오밍", + /* US-OR */ "오리건", + /* US-CO */ "콜로라도", + /* US-NV */ "네바다", + /* US-AZ */ "애리조나", + /* US-NM */ "뉴멕시코", + /* US-MT */ "몬태나", + /* US-CA */ "캘리포니아", + /* US-TX */ "텍사스", + /* US-AK */ "알래스카", + /* CA-BC */ "브리티시 컬럼비아", + /* CA-AB */ "앨버타", + /* CA-ON */ "온타리오", + /* CA-QC */ "퀘벡", + /* CA-SK */ "서스 캐처 원", + /* CA-MB */ "매니토바", + /* CA-NL */ "뉴 펀들 랜드", + /* CA-NB */ "뉴 브런 즈윅", + /* CA-NS */ "노바 스코샤", + /* CA-PE */ "프린스 에드워드 아일랜드", + /* CA-YT */ "유콘", + /* CA-NT */ "노스 웨스트 준주", + /* CA-NU */ "누나 부트 준주", + /* IND */ "인도", + /* AUS */ "오스트레일리아", + /* BRA */ "브라질", + /* USA */ "미국", + /* MEX */ "멕시코", + /* MOW */ "모스크바", + /* SPE */ "상트 페테르부르크", + /* KGD */ "칼리닌그라드 주", + /* RU-IN */ "잉 구세 티아 공화국", + /* RU-AD */ "아디 게야 공화국", + /* RU-SE */ "세 베로 오 세티 야 공화국 공화국", + /* RU-KB */ "카 바르 디노 발 카르 공화국", + /* RU-KC */ "카라 차 예보 체르 케스 카야 공화국", + /* RU-CE */ "체첸어 공화국", + /* RU-CU */ "추바슈어 공화국", + /* IVA */ "이바노 보 주", + /* LIP */ "리페 츠크 주", + /* ORL */ "오룔 주", + /* TUL */ "툴라 주", + /* RU-BE */ "벨고로드 주", + /* VLA */ "블라디미르 주", + /* KRS */ "쿠르스크 주", + /* KLU */ "칼루가 주", + /* RU-TT */ "탐 보프 주", + /* BRY */ "브랸 스크 주", + /* YAR */ "야로 슬라 블 주", + /* RYA */ "랴잔 주", + /* AST */ "아스트라한 주", + /* MOS */ "모스크바 주", + /* SMO */ "스몰 렌 스크 주", + /* RU-DA */ "다게 스탄 공화국", + /* VOR */ "보 로네시 주", + /* NGR */ "노브 고로드 주", + /* PSK */ "프 스코프 주", + /* KOS */ "코스트 로마 주", + /* STA */ "스타 브로 폴 크라이", + /* KDA */ "크라 스노 다르 크라이", + /* RU-KL */ "칼 미크 공화국", + /* TVE */ "트 베리 주", + /* LEN */ "레닌 그라드 주", + /* ROS */ "로스토프 주", + /* VGG */ "볼고그라드 주", + /* VLG */ "볼 로그 다 주", + /* MUR */ "무르만스크 주", + /* RU-KR */ "카렐 리야 공화국", + /* NEN */ "네 네츠 자치구", + /* RU-KO */ "코미 공화국", + /* ARK */ "아르 한 겔 스크 주", + /* RU-MO */ "모르도 바 공화국", + /* NIZ */ "니즈니 노브 고로드 주", + /* PNZ */ "펜자 주", + /* RU-KI */ "키로프 주", + /* RU-ME */ "마리 엘 공화국", + /* ORE */ "오렌 부르크 주", + /* ULY */ "울리 야놉 스크 주", + /* RU-PM */ "페름 지방", + /* RU-BA */ "바시 키르 공화국", + /* RU-UD */ "우드 무 르트 공화국", + /* RU-TA */ "타타르 공화국", + /* SAM */ "사마라 주", + /* SAR */ "사라 토프 주", + /* YAN */ "야말로 - 네 네츠", + /* RU-KM */ "한티 Mansi", + /* SVE */ "스 베르들 롭 스크 주", + /* TYU */ "튜멘 주", + /* KGN */ "쿠 르간 주", + /* RU-CH */ "첼 랴빈 스크 주", + /* RU-BU */ "부랴 트 공화국", + /* ZAB */ "치타 지역", + /* IRK */ "이르쿠츠크 주", + /* NVS */ "노보시비르스크 주", + /* TOM */ "톰 스크 주", + /* OMS */ "옴 스크 주", + /* RU-KK */ "하 카스 공화국", + /* KEM */ "케메 로보 주", + /* RU-AL */ "알타이 공화국", + /* ALT */ "알타이 크라이", + /* RU-TY */ "투바 공화국", + /* KYA */ "크라스 노야 르 스크 크라이", + /* MAG */ "마가 단 주", + /* CHU */ "추 코트 카 자치구", + /* KAM */ "캄차카 지방", + /* SAK */ "사할린 주", + /* RU-PO */ "프리 모르 스키 크라이", + /* YEV */ "유대인 자치주", + /* KHA */ "하바롭스크 지방", + /* AMU */ "아무르 주", + /* RU-SA */ "사하 공화국|야쿠 티아 공화국", + /* CAN */ "캐나다", + /* RUS */ "러시아", + /* CN-SH */ "상하이", + /* CN-TJ */ "천진", + /* CN-BJ */ "베이징", + /* CN-HI */ "하이난", + /* CN-NX */ "닝샤 후이족", + /* CN-CQ */ "충칭", + /* CN-ZJ */ "절강", + /* CN-JS */ "강소", + /* CN-FJ */ "복건", + /* CN-AH */ "안후이", + /* CN-LN */ "랴오닝", + /* CN-SD */ "산동", + /* CN-SX */ "산서", + /* CN-JX */ "장시", + /* CN-HA */ "허난", + /* CN-GZ */ "구이 저우", + /* CN-GD */ "광동", + /* CN-HB */ "호북", + /* CN-JL */ "길림", + /* CN-HE */ "허베이", + /* CN-SN */ "산시", + /* CN-NM */ "내몽골|네이 몽골", + /* CN-HL */ "헤이룽장", + /* CN-HN */ "호남", + /* CN-GX */ "광시 좡어", + /* CN-SC */ "쓰촨", + /* CN-YN */ "운남", + /* CN-XZ */ "서장|티베트", + /* CN-GS */ "간쑤", + /* CN-QH */ "칭하이", + /* CN-XJ */ "신장 위구르어", + /* CHN */ "중국", + /* UMI */ "미국령 군소 제도", + /* CPT */ "클리퍼 턴 섬", + /* ATA */ "남극", + /* AAA */ "국제|세계|지구" +#else // MAPCODE_SUPPORT_LANGUAGE_KO + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_KO +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_KO_H__ diff --git a/mapcodelib/internal_territory_names_local.h b/mapcodelib/internal_territory_names_local.h index 5256200..5dc0fa9 100644 --- a/mapcodelib/internal_territory_names_local.h +++ b/mapcodelib/internal_territory_names_local.h @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __INTERNAL_TERRITORY_NAMES_LOCAL_H__ #define __INTERNAL_TERRITORY_NAMES_LOCAL_H__ @@ -21,7 +19,7 @@ extern "C" { #endif // *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** -static const char *TERRITORY_LOCAL_NAME_UTF8[] = { +static const char *TERRITORY_FULL_NAME_LOCAL[] = { "Sancta Sedes|Holy See", "Monaco", "Gibraltar", @@ -554,8 +552,8 @@ static const char *TERRITORY_LOCAL_NAME_UTF8[] = { "United States Minor Outlying Islands|USMOI", "Île de Clipperton|Isla de la Pasión", "Antarctica", - "Earth", - "?"}; + "Earth" +}; #ifdef __cplusplus } diff --git a/mapcodelib/internal_territory_names_nl.h b/mapcodelib/internal_territory_names_nl.h new file mode 100644 index 0000000..1527b92 --- /dev/null +++ b/mapcodelib/internal_territory_names_nl.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_NL_H__ +#define __INTERNAL_TERRITORY_NAMES_NL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_NL[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_NL // Dutch + /* VAT */ "Vaticaanstad|Heilige Stoel", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Cocos Eilanden|Keeling Islands", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk en Philip Island|Philip Island", + /* PCN */ "Pitcairn Islands", + /* BVT */ "Bouvet Island", + /* BMU */ "Bermuda", + /* IOT */ "British Indian Ocean Territory", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Christmas Island", + /* WLF */ "Wallis en Futuna|Futuna", + /* VGB */ "Britse Maagdeneilanden|Britse Maagdeneilanden", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Marshall Eilanden", + /* ASM */ "Amerikaans Samoa|Samoa, Amerikaans", + /* COK */ "Cook eilanden", + /* SPM */ "Saint-Pierre en Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts en Nevis|Nevis", + /* CYM */ "Cayman eilanden", + /* BES */ "Bonaire, Sint Eustasuis en Saba|Saba|St Eustasius", + /* MDV */ "Malediven", + /* SHN */ "Sint-Helena, Ascension en Tristan da Cunha|Hemelvaart|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Amerikaanse Maagdeneilanden|Maagdeneilanden, USA", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard and Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent en de Grenadines|Grenadines", + /* HMD */ "Heard Eiland en McDonald Eilanden|McDonald Islands", + /* BRB */ "Barbados", + /* ATG */ "Antigua en Barbuda|Barbuda", + /* CUW */ "Curaçao", + /* SYC */ "Seychellen", + /* PLW */ "Palau", + /* MNP */ "Northern Mariana Islands", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Isle of Man|Mann", + /* LCA */ "Saint Lucia", + /* FSM */ "Micronesia|Federated States of Micronesia", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrein", + /* KIR */ "Kiribati", + /* TCA */ "Turks-en Caicoseilanden|Caicoseilanden", + /* STP */ "Sao Tome en Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Faeröer", + /* GLP */ "Guadeloupe", + /* COM */ "Comoren", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Luxemburg", + /* WSM */ "Samoa", + /* SGS */ "Zuid-Georgië en de Zuidelijke Sandwicheilanden|Zuid-Sandwicheilanden", + /* PYF */ "Frans-Polynesië", + /* CPV */ "Kaapverdië", + /* TTO */ "Trinidad en Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Franse Zuidelijke en Antarctische Gebieden", + /* PRI */ "Puerto Rico", + /* CYP */ "Cyprus", + /* LBN */ "Libanon", + /* JAM */ "Jamaica", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Falkland eilanden", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Oost-Timor", + /* SWZ */ "Swaziland", + /* KWT */ "Koeweit", + /* FJI */ "Fiji-eilanden", + /* NCL */ "New Caledonia", + /* SVN */ "Slovenië", + /* ISR */ "Israël", + /* PSE */ "Palestinian territory", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Macedonië", + /* RWA */ "Rwanda", + /* HTI */ "Haïti", + /* BDI */ "Burundi", + /* GNQ */ "Equatoriaal-Guinea", + /* ALB */ "Albanië", + /* SLB */ "Solomon eilanden", + /* ARM */ "Armenië", + /* LSO */ "Lesotho", + /* BEL */ "België", + /* MDA */ "Moldavië", + /* GNB */ "Guinee-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Zwitserland", + /* NLD */ "Nederland", + /* DNK */ "Denemarken", + /* EST */ "Estland", + /* DOM */ "Dominicaanse Republiek", + /* SVK */ "Slowakije", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnië en Herzegovina", + /* HRV */ "Kroatië", + /* TGO */ "Togo", + /* LVA */ "Letland", + /* LTU */ "Litouwen", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgië", + /* IRL */ "Ierland", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Tsjechische Republiek", + /* GUF */ "Frans-Guyana", + /* ARE */ "Verenigde Arabische Emiraten", + /* AUT */ "Oostenrijk", + /* AZE */ "Azerbeidzjan", + /* SRB */ "Serbia", + /* JOR */ "Jordan", + /* PRT */ "Portugal", + /* HUN */ "Hongarije", + /* KOR */ "Zuid-Korea", + /* ISL */ "IJsland", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgarije", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Noord-Korea", + /* NIC */ "Nicaragua", + /* GRC */ "Griekenland", + /* TJK */ "Tadzjikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunesië", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Cambodja", + /* SYR */ "Syrië", + /* SEN */ "Senegal", + /* KGZ */ "Kirgizië", + /* BLR */ "Wit-Rusland", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Roemenië", + /* GHA */ "Ghana", + /* UGA */ "Oeganda", + /* GBR */ "Verenigd Koninkrijk|Schotland|Groot Brittannië|Noord Ierland|Ierland, Noord", + /* GIN */ "Guinee", + /* ECU */ "Ecuador", + /* ESH */ "Western Sahara|Sahrawi", + /* GAB */ "Gabon", + /* NZL */ "Nieuw-Zeeland", + /* BFA */ "Burkina Faso", + /* PHL */ "Filippijnen", + /* ITA */ "Italië", + /* OMN */ "Oman", + /* POL */ "Polen", + /* CIV */ "Ivoorkust", + /* NOR */ "Noorwegen", + /* MYS */ "Maleisië", + /* VNM */ "Vietnam", + /* FIN */ "Finland", + /* COG */ "Congo-Brazzaville", + /* DEU */ "Duitsland", + /* JPN */ "Japan", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Marokko", + /* UZB */ "Oezbekistan", + /* SWE */ "Zweden", + /* PNG */ "Papoea-Nieuw-Guinea", + /* CMR */ "Kameroen", + /* TKM */ "Turkmenistan", + /* ESP */ "Spanje", + /* THA */ "Thailand", + /* YEM */ "Jemen", + /* FRA */ "Frankrijk", + /* ALA */ "Aaland-eilanden", + /* KEN */ "Kenia", + /* BWA */ "Botswana", + /* MDG */ "Madagascar", + /* UKR */ "Oekraïne", + /* SSD */ "Zuid-Soedan", + /* CAF */ "Centraal-Afrikaanse Republiek", + /* SOM */ "Somalië", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Birma", + /* ZMB */ "Zambia", + /* CHL */ "Chili", + /* TUR */ "Turkije", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambique", + /* NAM */ "Namibië", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Egypte", + /* MRT */ "Mauritanië", + /* BOL */ "Bolivia", + /* ETH */ "Ethiopië", + /* COL */ "Colombia", + /* ZAF */ "Zuid-Afrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Tsjaad", + /* PER */ "Peru", + /* MNG */ "Mongolië", + /* IRN */ "Iran", + /* LBY */ "Libië", + /* SDN */ "Soedan", + /* IDN */ "Indonesië", + /* DIF */ "Federal District", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Groenland", + /* SAU */ "Saudi-Arabië", + /* COD */ "Congo-Kinshasa", + /* DZA */ "Algerije", + /* KAZ */ "Kazachstan", + /* ARG */ "Argentinië", + /* IN-DD */ "Daman en Diu", + /* IN-DN */ "Dadra en Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman en Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu en Kasjmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "West-Bengalen", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territorium", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "South Australia", + /* TAS */ "Tasmanië", + /* VIC */ "Victoria", + /* AU-WA */ "West-Australië", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapá", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaï", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "South Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "North Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "Californië", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "India", + /* AUS */ "Australië", + /* BRA */ "Brazilië", + /* USA */ "VS|Verenigde Staten|Amerika", + /* MEX */ "Mexico", + /* MOW */ "Moskou", + /* SPE */ "Sint-Petersburg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingoesjetië Republiek", + /* RU-AD */ "Adygea Republiek", + /* RU-SE */ "Noord-Ossetië-Alania Republiek", + /* RU-KB */ "Kabardino-Balkar Republiek", + /* RU-KC */ "Karachay-Cherkess Republiek", + /* RU-CE */ "Tsjetsjeense Republiek", + /* RU-CU */ "Chuvash Republiek", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrakhan Oblast", + /* MOS */ "Moskou Oblast", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "Dagestan Republiek", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmukkië Republiek", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Karelia Republiek", + /* NEN */ "Nenets Autonome Okrug", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovië Republiek", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Republiek Mari El", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan Republiek", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Tatarstan Republiek", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Buryatia Republic", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkoetsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Khakassia Republiek", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Altai Republiek", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republiek", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Joodse Autonome Oblast", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Sakha Republiek|Yakutia Republic", + /* CAN */ "Canada", + /* RUS */ "Rusland", + /* CN-SH */ "Sjanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Beijing", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Oeigoerse", + /* CHN */ "China", + /* UMI */ "United States Minor Outlying Islands", + /* CPT */ "Clipperton Island", + /* ATA */ "Antarctica", + /* AAA */ "Internationaal|Wereldwijd|Aarde" +#else // MAPCODE_SUPPORT_LANGUAGE_NL + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_NL +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_NL_H__ diff --git a/mapcodelib/internal_territory_names_no.h b/mapcodelib/internal_territory_names_no.h new file mode 100644 index 0000000..b178446 --- /dev/null +++ b/mapcodelib/internal_territory_names_no.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_NO_H__ +#define __INTERNAL_TERRITORY_NAMES_NO_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_NO[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_NO // Norwegian + /* VAT */ "Vatikanstaten", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Kokosøyene|Keeling Islands", + /* BLM */ "Saint-Barthélemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macao", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolkøya|Philip Island", + /* PCN */ "Pitcairnøyene", + /* BVT */ "Bouvetøya", + /* BMU */ "Bermuda", + /* IOT */ "Britiske Territoriet i Indiahavet", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Christmasøya", + /* WLF */ "Wallis- og Futunaøyene|Futunaøyene", + /* VGB */ "Britiske Jomfruøyer|Jomfruøyer, Britiske", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Marshalløyene", + /* ASM */ "Amerikansk Samoa|Samoa, Amerikansk", + /* COK */ "Cookøyene", + /* SPM */ "Saint-Pierre og Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts og Nevis|Nevis", + /* CYM */ "Caymanøyene", + /* BES */ "Bonaire, Sint Eustatius og Saba|Saba|Sint Eustatius", + /* MDV */ "Maldivene", + /* SHN */ "Saint Helena, Ascension og Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Amerikanske Jomfruøyer|Jomfruøyer, Amerikanske", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard og Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent og Grenadinene|Grenadinene", + /* HMD */ "Heard- og McDonaldøyene|McDonaldøyene", + /* BRB */ "Barbados", + /* ATG */ "Antigua og Barbuda|Barbuda", + /* CUW */ "Curaçao", + /* SYC */ "Seychellene", + /* PLW */ "Palau", + /* MNP */ "Nord-Marianene", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Isle of Man", + /* LCA */ "Saint Lucia", + /* FSM */ "Mikronesiaføderasjonen", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks- og Caicosøyene|Caicosøyene", + /* STP */ "São Tomé og Príncipe|Príncipe", + /* HKG */ "Hongkong", + /* MTQ */ "Martinique", + /* FRO */ "Færøyene", + /* GLP */ "Guadeloupe", + /* COM */ "Komorene", + /* MUS */ "Mauritius", + /* REU */ "Réunion", + /* LUX */ "Luxembourg", + /* WSM */ "Samoa", + /* SGS */ "Sør-Georgia og Sør-Sandwichøyene|Sør-Sandwichøyene", + /* PYF */ "Fransk Polynesia", + /* CPV */ "Kapp Verde", + /* TTO */ "Trinidad og Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Franske Sørterritorier", + /* PRI */ "Puerto Rico", + /* CYP */ "Kypros", + /* LBN */ "Libanon", + /* JAM */ "Jamaica", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Falklandsøyene", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Øst-Timor", + /* SWZ */ "Swaziland", + /* KWT */ "Kuwait", + /* FJI */ "Fiji", + /* NCL */ "Ny-Caledonia", + /* SVN */ "Slovenia", + /* ISR */ "Israel", + /* PSE */ "Palestinske territoriene", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Makedonia", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Ekvatorial-Guinea", + /* ALB */ "Albania", + /* SLB */ "Salomonøyene", + /* ARM */ "Armenia", + /* LSO */ "Lesotho", + /* BEL */ "Belgia", + /* MDA */ "Moldova", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Sveits", + /* NLD */ "Nederland", + /* DNK */ "Danmark", + /* EST */ "Estland", + /* DOM */ "Dominikanske Republikk", + /* SVK */ "Slovakia", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnia-Hercegovina", + /* HRV */ "Kroatia", + /* TGO */ "Togo", + /* LVA */ "Latvia", + /* LTU */ "Litauen", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgia", + /* IRL */ "Irland", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Tsjekkia", + /* GUF */ "Fransk Guyana", + /* ARE */ "Forente Arabiske Emirater", + /* AUT */ "Østerrike", + /* AZE */ "Aserbajdsjan", + /* SRB */ "Serbia", + /* JOR */ "Jordan", + /* PRT */ "Portugal", + /* HUN */ "Ungarn", + /* KOR */ "Sør-Korea", + /* ISL */ "Island", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgaria", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Nord-Korea", + /* NIC */ "Nicaragua", + /* GRC */ "Hellas", + /* TJK */ "Tadsjikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunisia", + /* SUR */ "Surinam", + /* URY */ "Uruguay", + /* KHM */ "Kambodsja", + /* SYR */ "Syria", + /* SEN */ "Senegal", + /* KGZ */ "Kirgisistan", + /* BLR */ "Hviterussland", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Romania", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Storbritannia|Skottland|Nord-Irland|Irland, Nord", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Vest-Sahara|Saharawiske", + /* GAB */ "Gabon", + /* NZL */ "Ny-Zealand", + /* BFA */ "Burkina Faso", + /* PHL */ "Filippinene", + /* ITA */ "Italia", + /* OMN */ "Oman", + /* POL */ "Polen", + /* CIV */ "Elfenbenskysten", + /* NOR */ "Norge", + /* MYS */ "Malaysia", + /* VNM */ "Vietnam", + /* FIN */ "Finland", + /* COG */ "Kongo-Brazzaville|Republikken Kongo", + /* DEU */ "Tyskland", + /* JPN */ "Japan", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Marokko", + /* UZB */ "Usbekistan", + /* SWE */ "Sverige", + /* PNG */ "Papua Ny-Guinea", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Spania", + /* THA */ "Thailand", + /* YEM */ "Jemen", + /* FRA */ "Frankrike", + /* ALA */ "Åland", + /* KEN */ "Kenya", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukraina", + /* SSD */ "Sør-Sudan", + /* CAF */ "Den sentralafrikanske republikk", + /* SOM */ "Somalia", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Burma", + /* ZMB */ "Zambia", + /* CHL */ "Chile", + /* TUR */ "Tyrkia", + /* PAK */ "Pakistan", + /* MOZ */ "Mosambik", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Egypt", + /* MRT */ "Mauritania", + /* BOL */ "Bolivia", + /* ETH */ "Etiopia", + /* COL */ "Colombia", + /* ZAF */ "Sør-Afrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Tsjad", + /* PER */ "Peru", + /* MNG */ "Mongolia", + /* IRN */ "Iran", + /* LBY */ "Libya", + /* SDN */ "Sudan", + /* IDN */ "Indonesia", + /* DIF */ "Federal District", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grønland", + /* SAU */ "Saudi-Arabia", + /* COD */ "Kongo-Kinshasa|Demokratiske Republikken Kongo", + /* DZA */ "Algerie", + /* KAZ */ "Kasakhstan", + /* ARG */ "Argentina", + /* IN-DD */ "Daman og Diu", + /* IN-DN */ "Dadra og Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman og Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu og Kashmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Vest-Bengal", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territory", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "South Australia", + /* TAS */ "Tasmania", + /* VIC */ "Victoria", + /* AU-WA */ "Western Australia", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "São Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "Vest-Virginia", + /* US-SC */ "Sør-Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Nord-Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Nord-Dakota", + /* US-WA */ "Washington", + /* US-SD */ "Sør-Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "California", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "India", + /* AUS */ "Australia", + /* BRA */ "Brasil", + /* USA */ "USA|America", + /* MEX */ "Mexico", + /* MOW */ "Moskva", + /* SPE */ "Saint Petersburg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingusjetia republikk", + /* RU-AD */ "Adygia republikk", + /* RU-SE */ "Nord-Ossetia republikk", + /* RU-KB */ "Kabardino-Balkar Republic", + /* RU-KC */ "Karachay-Cherkess republikk", + /* RU-CE */ "Tsjetsjenia", + /* RU-CU */ "Chuvash Republic", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrakhan oblast", + /* MOS */ "Moscow Oblast", + /* SMO */ "Smolensk oblast", + /* RU-DA */ "Dagestan republikk", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov oblast", + /* KOS */ "Kostroma oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia republikk", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Karelia republikk", + /* NEN */ "Nenetsk", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovia republikk", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El republikk", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan republikk", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Tatarstan republikk", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan oblast", + /* RU-CH */ "Tsjeljabinsk oblast", + /* RU-BU */ "Buryatia republikk", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Khakassia republikk", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Altai Republic", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republic", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Den jødiske autonome oblast", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Sakha Republikk|Yakutia republikk", + /* CAN */ "Canada", + /* RUS */ "Russland", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Beijing", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Indre Mongolia", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "Kina", + /* UMI */ "USAs ytre småøyer", + /* CPT */ "Clippertonøya", + /* ATA */ "Antarktis", + /* AAA */ "Internasjonal|Verden|Jorden" +#else // MAPCODE_SUPPORT_LANGUAGE_NO + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_NO +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_NO_H__ diff --git a/mapcodelib/internal_territory_names_pl.h b/mapcodelib/internal_territory_names_pl.h new file mode 100644 index 0000000..b2aa80e --- /dev/null +++ b/mapcodelib/internal_territory_names_pl.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_PL_H__ +#define __INTERNAL_TERRITORY_NAMES_PL_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_PL[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_PL // Polish + /* VAT */ "Watykan", + /* MCO */ "Monako", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Wyspy Kokosowe|Kokosowe, Wyspy", + /* BLM */ "Saint-Barthélemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Makau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk", + /* PCN */ "Pitcairn", + /* BVT */ "Wyspa Bouveta|Bouveta, Wyspy", + /* BMU */ "Bermudy", + /* IOT */ "Brytyjskie Terytorium Oceanu Indyjskiego", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Wyspa Bożego Narodzenia|Bożego Narodzenia, Wyspy", + /* WLF */ "Wallis i Futuna", + /* VGB */ "Brytyjskie Wyspy Dziewicze|Wyspy Dziewicze, Brytyjskie|Dziewicze, Brytyjskie Wyspy", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Wyspy Marshalla|Marshalla, Wyspy", + /* ASM */ "Samoa Amerykańskie", + /* COK */ "Wyspy Cooka|Cooka, Wyspy", + /* SPM */ "Saint-Pierre i Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts i Nevis", + /* CYM */ "Kajmany", + /* BES */ "Bonaire, Sint Eustatius i Saba", + /* MDV */ "Malediwy", + /* SHN */ "Wyspa Świętej Heleny, Wniebowstąpienia i Tristan da Cunha|Wniebowstąpienia, Wyspy|Tristan da Cunha, Wyspy", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Wyspy Dziewicze Stanów Zjednoczonych", + /* MYT */ "Majotta", + /* SJM */ "Svalbard i Jan Mayen", + /* VCT */ "Saint Vincent i Grenadyny", + /* HMD */ "Wyspy Heard i McDonalda|Heard, Wyspy|McDonalda, Wyspy", + /* BRB */ "Barbados", + /* ATG */ "Antigua i Barbuda", + /* CUW */ "Curaçao", + /* SYC */ "Seszele", + /* PLW */ "Palau", + /* MNP */ "Mariany Północne", + /* AND */ "Andora", + /* GUM */ "Guam", + /* IMN */ "Wyspa Man|Man, Wyspa", + /* LCA */ "Saint Lucia", + /* FSM */ "Mikronezja", + /* SGP */ "Singapur", + /* TON */ "Tonga", + /* DMA */ "Dominika", + /* BHR */ "Bahrajn", + /* KIR */ "Kiribati", + /* TCA */ "Turks i Caicos", + /* STP */ "Wyspy Świętego Tomasza i Książęca|Świętego Tomasza i Książęca, Wyspy|Książęca, Wyspy", + /* HKG */ "Hongkong", + /* MTQ */ "Martynika", + /* FRO */ "Wyspy Owcze|Owcze, Wyspy", + /* GLP */ "Gwadelupa", + /* COM */ "Komory", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Luksemburg", + /* WSM */ "Samoa", + /* SGS */ "Georgia Południowa i Sandwich Południowy|Sandwich Południowy", + /* PYF */ "Polinezja Francuska", + /* CPV */ "Republika Zielonego Przylądka|Zielonego Przylądka", + /* TTO */ "Trynidad i Tobago", + /* BRN */ "Brunei", + /* ATF */ "Francuskie Terytoria Południowe i Antarktyczne", + /* PRI */ "Portoryko", + /* CYP */ "Cypr", + /* LBN */ "Liban", + /* JAM */ "Jamajka", + /* GMB */ "Gambia", + /* QAT */ "Katar", + /* FLK */ "Falklandy", + /* VUT */ "Vanuatu", + /* MNE */ "Czarnogóra", + /* BHS */ "Bahamy", + /* TLS */ "Timor Wschodni", + /* SWZ */ "Suazi", + /* KWT */ "Kuwejt", + /* FJI */ "Fidżi", + /* NCL */ "Nowa Kaledonia", + /* SVN */ "Słowenia", + /* ISR */ "Izrael", + /* PSE */ "Palestyna", + /* SLV */ "Salwador", + /* BLZ */ "Belize", + /* DJI */ "Dżibuti", + /* MKD */ "Macedonia", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Gwinea Równikowa", + /* ALB */ "Albania", + /* SLB */ "Wyspy Salomona|Salomona, Wyspy", + /* ARM */ "Armenia", + /* LSO */ "Lesotho", + /* BEL */ "Belgia", + /* MDA */ "Mołdawia", + /* GNB */ "Gwinea Bissau", + /* TWN */ "Tajwan", + /* BTN */ "Bhutan", + /* CHE */ "Szwajcaria", + /* NLD */ "Holandia", + /* DNK */ "Dania", + /* EST */ "Estonia", + /* DOM */ "Dominikana", + /* SVK */ "Słowacja", + /* CRI */ "Kostaryka", + /* BIH */ "Bośnia i Hercegowina", + /* HRV */ "Chorwacja", + /* TGO */ "Togo", + /* LVA */ "Łotwa", + /* LTU */ "Litwa", + /* LKA */ "Sri Lanka", + /* GEO */ "Gruzja", + /* IRL */ "Irlandia", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Czechy", + /* GUF */ "Gujana Francuska", + /* ARE */ "Zjednoczone Emiraty Arabskie", + /* AUT */ "Austria", + /* AZE */ "Azerbejdżan", + /* SRB */ "Serbia", + /* JOR */ "Jordania", + /* PRT */ "Portugalia", + /* HUN */ "Węgry", + /* KOR */ "Korea Południowa", + /* ISL */ "Islandia", + /* GTM */ "Gwatemala", + /* CUB */ "Kuba", + /* BGR */ "Bułgaria", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Erytrea", + /* MWI */ "Malawi", + /* PRK */ "Korea Północna", + /* NIC */ "Nikaragua", + /* GRC */ "Grecja", + /* TJK */ "Tadżykistan", + /* BGD */ "Bangladesz", + /* NPL */ "Nepal", + /* TUN */ "Tunezja", + /* SUR */ "Surinam", + /* URY */ "Urugwaj", + /* KHM */ "Kambodża", + /* SYR */ "Syria", + /* SEN */ "Senegal", + /* KGZ */ "Kirgistan", + /* BLR */ "Białoruś", + /* GUY */ "Gujana", + /* LAO */ "Laos", + /* ROU */ "Rumunia", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Wielka Brytania", + /* GIN */ "Gwinea", + /* ECU */ "Ekwador", + /* ESH */ "Sahara Zachodnia", + /* GAB */ "Gabon", + /* NZL */ "Nowa Zelandia", + /* BFA */ "Burkina Faso", + /* PHL */ "Filipiny", + /* ITA */ "Włochy", + /* OMN */ "Oman", + /* POL */ "Polska", + /* CIV */ "Wybrzeże Kości Słoniowej", + /* NOR */ "Norwegia", + /* MYS */ "Malezja", + /* VNM */ "Wietnam", + /* FIN */ "Finlandia", + /* COG */ "Kongo", + /* DEU */ "Niemcy", + /* JPN */ "Japonia", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paragwaj", + /* IRQ */ "Irak", + /* MAR */ "Maroko", + /* UZB */ "Uzbekistan", + /* SWE */ "Szwecja", + /* PNG */ "Papua-Nowa Gwinea", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Hiszpania", + /* THA */ "Tajlandia", + /* YEM */ "Jemen", + /* FRA */ "Francja", + /* ALA */ "Wyspy Alandzkie|Alandzkie, Wyspy", + /* KEN */ "Kenia", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukraina", + /* SSD */ "Sudan Południowy", + /* CAF */ "Republika Środkowoafrykańska|Środkowoafrykańska, Republika", + /* SOM */ "Somalia", + /* AFG */ "Afganistan", + /* MMR */ "Mjanma", + /* ZMB */ "Zambia", + /* CHL */ "Chile", + /* TUR */ "Turcja", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambik", + /* NAM */ "Namibia", + /* VEN */ "Wenezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Egipt", + /* MRT */ "Mauretania", + /* BOL */ "Boliwia", + /* ETH */ "Etiopia", + /* COL */ "Kolumbia", + /* ZAF */ "Południowa Afryka", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Czad", + /* PER */ "Peru", + /* MNG */ "Mongolia", + /* IRN */ "Iran", + /* LBY */ "Libia", + /* SDN */ "Sudan", + /* IDN */ "Indonezja", + /* DIF */ "Federal District", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "sos Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grenlandia", + /* SAU */ "Arabia Saudyjska", + /* COD */ "Demokratyczna Republika Konga|Konga-Kinshasa", + /* DZA */ "Algieria", + /* KAZ */ "Kazachstan", + /* ARG */ "Argentyna", + /* IN-DD */ "Daman i Diu", + /* IN-DN */ "Dadra i Nagarhaweli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman i Nicobar", + /* IN-LD */ "Lakszadiwy", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Pendżab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Dżammu i Kaszmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Bengal Zachodni", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharasztra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "Nowa Południowa Walia", + /* ACT */ "Australijskie Terytorium Stołeczne", + /* JBT */ "Terytorium Jervis Bay", + /* AU-NT */ "Północne terytorium", + /* AU-SA */ "Południowa Australia", + /* TAS */ "Tasmania", + /* VIC */ "Wiktoria", + /* AU-WA */ "Zachodnia australia", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Akr", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "San Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "para", + /* BR-AM */ "Amazonas", + /* US-DC */ "Dystrykt Kolumbii", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaje", + /* US-MD */ "Maryland", + /* US-WV */ "Wirginia Zachodnia", + /* US-SC */ "Karolina Południowa", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Wirginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pensylwania", + /* US-MS */ "Missisipi", + /* US-LA */ "Luizjana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Karolina Północna", + /* US-NY */ "Nowy Jork", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Gruzja", + /* US-WI */ "Wisconsin", + /* US-FL */ "Floryda", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Dakota Północna", + /* US-WA */ "Waszyngton", + /* US-SD */ "Dakota Południowa", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Kolorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Nowy Meksyk", + /* US-MT */ "Montana", + /* US-CA */ "Kalifornia", + /* US-TX */ "Teksas", + /* US-AK */ "Alaska", + /* CA-BC */ "Brytyjska Kolumbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Nowa Fundlandia", + /* CA-NB */ "Nowy Brunszwik", + /* CA-NS */ "Nowa Szkocja", + /* CA-PE */ "Wyspa Księcia Edwarda", + /* CA-YT */ "Yukon", + /* CA-NT */ "Północno - zachodnie terytoria", + /* CA-NU */ "Nunavut", + /* IND */ "Indie", + /* AUS */ "Australia", + /* BRA */ "Brazylia", + /* USA */ "Stany Zjednoczone", + /* MEX */ "Meksyk", + /* MOW */ "Moskwa", + /* SPE */ "Sankt Petersburg", + /* KGD */ "Obwód Kaliningradzki", + /* RU-IN */ "Republika Inguszetii", + /* RU-AD */ "Republika Adygeja", + /* RU-SE */ "Osetia Północna Republika", + /* RU-KB */ "Kabardyno-Balkar Republic", + /* RU-KC */ "Karaczajo-Cherkess Republic", + /* RU-CE */ "Czeczenia", + /* RU-CU */ "Chuvash Republic", + /* IVA */ "Iwanowo Oblast", + /* LIP */ "Obwód lipiecki", + /* ORL */ "Obwód Orłowski", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Biełgorod Oblast", + /* VLA */ "Obwód włodzimierski", + /* KRS */ "Kursk Oblast", + /* KLU */ "Obwód Kałuski", + /* RU-TT */ "Obwód tambowski", + /* BRY */ "Briańsk Oblast", + /* YAR */ "Jarosław Oblast", + /* RYA */ "Obwód riazański", + /* AST */ "Astrachań Oblast", + /* MOS */ "Obwód moskiewski", + /* SMO */ "Obwód smoleński", + /* RU-DA */ "Republiki Dagestan", + /* VOR */ "Obwód woroneski", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Obwód Psków", + /* KOS */ "Obwód kostromski", + /* STA */ "Kraj Stawropolski", + /* KDA */ "Kraj Krasnodarski", + /* RU-KL */ "Republika Kałmucji", + /* TVE */ "Obwód twerski", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Obwód rostowski", + /* VGG */ "Obwód wołgogradzki", + /* VLG */ "Wołogziański", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Republika Karelia", + /* NEN */ "Nieniecki Okręg Autonomiczny", + /* RU-KO */ "Republika Komi", + /* ARK */ "Archangielsk Oblast", + /* RU-MO */ "Republika Mordowia", + /* NIZ */ "Obwód niżnonowogrodzki", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Republika Mari Eł", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Obwód uljanowski", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Republika Baszkirii", + /* RU-UD */ "Republika Udmurt", + /* RU-TA */ "Republika Tatarstan", + /* SAM */ "Samara Oblast", + /* SAR */ "Obwód saratowski", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Chanty-Mansi", + /* SVE */ "Obwód swierdłowski", + /* TYU */ "Obwód Tiumeń", + /* KGN */ "Obwód kurgański", + /* RU-CH */ "Obwód czelabiński", + /* RU-BU */ "Republika Buriacja", + /* ZAB */ "Kraj Zabajkalski", + /* IRK */ "Obwód irkucki", + /* NVS */ "Obwód Nowosybirsk", + /* TOM */ "Obwód Tomski", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Republika Chakasja", + /* KEM */ "Kemerowo Oblast", + /* RU-AL */ "Republika Ałtaju", + /* ALT */ "Kraj Ałtajski", + /* RU-TY */ "Republika Tuwy", + /* KYA */ "Kraj Krasnojarski", + /* MAG */ "Obwód magadański", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kraj Kamczacki", + /* SAK */ "Obwód sachaliński", + /* RU-PO */ "Nadmorskim", + /* YEV */ "Żydowski Obwód Autonomiczny", + /* KHA */ "Kraj Chabarowski", + /* AMU */ "Obwód amurski", + /* RU-SA */ "Republika Sacha|Jakucja Republika", + /* CAN */ "Kanada", + /* RUS */ "Rosja", + /* CN-SH */ "Szanghaj", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Pekin", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Mongolia Wewnętrzna", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Syczuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tybet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Ujgur", + /* CHN */ "Chiny", + /* UMI */ "Dalekie Wyspy Mniejsze Stanów Zjednoczonych", + /* CPT */ "Wyspa Clippertona", + /* ATA */ "Antarktyka", + /* AAA */ "International|Worldwide|Ziemia" +#else // MAPCODE_SUPPORT_LANGUAGE_PL + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_PL +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_PL_H__ diff --git a/mapcodelib/internal_territory_names_pt.h b/mapcodelib/internal_territory_names_pt.h new file mode 100644 index 0000000..02985ca --- /dev/null +++ b/mapcodelib/internal_territory_names_pt.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_PT_H__ +#define __INTERNAL_TERRITORY_NAMES_PT_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_PT[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_PT // Portuguese + /* VAT */ "Vaticano|Cidade do Vaticano|Santa Sé", + /* MCO */ "Mónaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Ilhas Cocos|Ilhas Keeling", + /* BLM */ "Saint-Barthelemy|São Bartolomeu", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint Martin", + /* NFK */ "Ilhas Norfolk e Philip|Ilha de Philip", + /* PCN */ "Ilhas Pitcairn", + /* BVT */ "Ilha de Bouvet", + /* BMU */ "Bermudas", + /* IOT */ "Território Britânico do Oceano Índico", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Ilha do Natal", + /* WLF */ "Wallis e Futuna|Futuna", + /* VGB */ "Ilhas Virgens Britânicas", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Ilhas Marshall", + /* ASM */ "Samoa Americana", + /* COK */ "Ilhas Cook", + /* SPM */ "Saint Pierre e Miquelon|Miquelon|São Pierre e Miquelon", + /* NIU */ "Niue", + /* KNA */ "São Cristóvão e Névis|Névis", + /* CYM */ "Ilhas Cayman", + /* BES */ "Bonaire, St Eustatuis e Saba|Saba|St Eustatius", + /* MDV */ "Maldivas", + /* SHN */ "Santa Helena, Ascensão e Tristão da Cunha|Ascensão|Tristão da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Ilhas Virgens Americanas", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard e Jan Mayen|Jan Mayen", + /* VCT */ "São Vicente e Granadinas|Grenadines", + /* HMD */ "Ilhas Heard e Ilhas McDonald|Ilhas McDonald", + /* BRB */ "Barbados", + /* ATG */ "Antígua e Barbuda|Barbuda", + /* CUW */ "Curaçao", + /* SYC */ "Seychelles", + /* PLW */ "Palau", + /* MNP */ "Marianas Setentrionais", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Ilha de Man", + /* LCA */ "Santa Lúcia", + /* FSM */ "Micronésia|Estados Federados da Micronésia", + /* SGP */ "Cingapura", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrein", + /* KIR */ "Quiribati", + /* TCA */ "Ilhas Turcas e Caicos|Ilhas Caicos", + /* STP */ "São Tomé e Príncipe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinica", + /* FRO */ "Ilhas Faroe", + /* GLP */ "Guadalupe", + /* COM */ "Comores", + /* MUS */ "Maurício", + /* REU */ "Reunião", + /* LUX */ "Luxemburgo", + /* WSM */ "Samoa", + /* SGS */ "Geórgia do Sul e Ilhas Sandwich do Sul|Ilhas Sandwich do Sul", + /* PYF */ "Polinésia Francesa", + /* CPV */ "Cabo Verde", + /* TTO */ "Trinidad e Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Territórios Franceses do Sul e Antárctico", + /* PRI */ "Porto Rico", + /* CYP */ "Chipre", + /* LBN */ "Líbano", + /* JAM */ "Jamaica", + /* GMB */ "Gâmbia", + /* QAT */ "Catar", + /* FLK */ "Ilhas Falkland", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Timor Leste", + /* SWZ */ "Suazilândia", + /* KWT */ "Kuwait", + /* FJI */ "Ilhas Fiji|Fiji", + /* NCL */ "Nova Caledônia", + /* SVN */ "Eslovênia", + /* ISR */ "Israel", + /* PSE */ "Território Palestino", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Macedônia", + /* RWA */ "Ruanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Guiné Equatorial", + /* ALB */ "Albânia", + /* SLB */ "Ilhas Salomão", + /* ARM */ "Armênia", + /* LSO */ "Lesoto", + /* BEL */ "Bélgica", + /* MDA */ "Moldávia", + /* GNB */ "Guiné-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Butão", + /* CHE */ "Suíça", + /* NLD */ "Holanda", + /* DNK */ "Dinamarca", + /* EST */ "Estônia", + /* DOM */ "República Dominicana", + /* SVK */ "Eslováquia", + /* CRI */ "Costa Rica", + /* BIH */ "Bósnia e Herzegovina", + /* HRV */ "Croácia", + /* TGO */ "Togo", + /* LVA */ "Letônia", + /* LTU */ "Lituânia", + /* LKA */ "Sri Lanka", + /* GEO */ "Geórgia", + /* IRL */ "Irlanda", + /* SLE */ "Serra Leoa", + /* PAN */ "Panamá", + /* CZE */ "República Checa", + /* GUF */ "Guiana Francesa", + /* ARE */ "Emirados Árabes Unidos", + /* AUT */ "Áustria", + /* AZE */ "Azerbaijão", + /* SRB */ "Sérvia", + /* JOR */ "Jordânia", + /* PRT */ "Portugal", + /* HUN */ "Hungria", + /* KOR */ "Coreia do Sul", + /* ISL */ "Islândia", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgária", + /* LBR */ "Libéria", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritreia", + /* MWI */ "Malawi", + /* PRK */ "Coreia do Norte", + /* NIC */ "Nicarágua", + /* GRC */ "Grécia", + /* TJK */ "Tajiquistão", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunísia", + /* SUR */ "Suriname", + /* URY */ "Uruguai", + /* KHM */ "Camboja", + /* SYR */ "Síria", + /* SEN */ "Senegal", + /* KGZ */ "Quirguistão", + /* BLR */ "Bielorrússia", + /* GUY */ "Guiana", + /* LAO */ "Laos", + /* ROU */ "Roménia", + /* GHA */ "Gana", + /* UGA */ "Uganda", + /* GBR */ "Reino Unido|Escócia|Grã-Bretanha|Irlanda do Norte", + /* GIN */ "Guiné", + /* ECU */ "Equador", + /* ESH */ "Sahara Ocidental|Saharaui", + /* GAB */ "Gabão", + /* NZL */ "Nova Zelândia", + /* BFA */ "Burkina Faso", + /* PHL */ "Filipinas", + /* ITA */ "Itália", + /* OMN */ "Omã", + /* POL */ "Polônia", + /* CIV */ "Costa do Marfim", + /* NOR */ "Noruega", + /* MYS */ "Malásia", + /* VNM */ "Vietnã", + /* FIN */ "Finlândia", + /* COG */ "Congo-Brazzaville", + /* DEU */ "Alemanha", + /* JPN */ "Japão", + /* ZWE */ "Zimbábue", + /* PRY */ "Paraguai", + /* IRQ */ "Iraque", + /* MAR */ "Marrocos", + /* UZB */ "Uzbequistão", + /* SWE */ "Suécia", + /* PNG */ "Papua Nova Guiné", + /* CMR */ "Camarões", + /* TKM */ "Turcomenistão", + /* ESP */ "Espanha", + /* THA */ "Tailândia", + /* YEM */ "Iémen", + /* FRA */ "França", + /* ALA */ "Ilhas Aaland", + /* KEN */ "Quênia", + /* BWA */ "Botswana", + /* MDG */ "Madagáscar", + /* UKR */ "Ucrânia", + /* SSD */ "Sudão do Sul", + /* CAF */ "República Centro-Africana", + /* SOM */ "Somália", + /* AFG */ "Afeganistão", + /* MMR */ "Mianmar|Birmânia", + /* ZMB */ "Zâmbia", + /* CHL */ "Chile", + /* TUR */ "Turquia", + /* PAK */ "Paquistão", + /* MOZ */ "Moçambique", + /* NAM */ "Namíbia", + /* VEN */ "Venezuela", + /* NGA */ "Nigéria", + /* TZA */ "Tanzânia", + /* EGY */ "Egito", + /* MRT */ "Mauritânia", + /* BOL */ "Bolívia", + /* ETH */ "Etiópia", + /* COL */ "Colômbia", + /* ZAF */ "África do Sul", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Níger", + /* TCD */ "Chade", + /* PER */ "Peru", + /* MNG */ "Mongólia", + /* IRN */ "Irã", + /* LBY */ "Líbia", + /* SDN */ "Sudão", + /* IDN */ "Indonésia", + /* DIF */ "Distrito Federal", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Estado do México|México, Estado do", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Iucatã", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosí", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Gronelândia", + /* SAU */ "Arábia Saudita", + /* COD */ "Congo-Kinshasa", + /* DZA */ "Argélia", + /* KAZ */ "Cazaquistão", + /* ARG */ "Argentina", + /* IN-DD */ "Damão e Diu", + /* IN-DN */ "Dadra e Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman e Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Délhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu e Caxemira|Caxemira", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Bengala Ocidental", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "Nova Gales do Sul", + /* ACT */ "Território Capital da Australia", + /* JBT */ "Território de Jervis Bay", + /* AU-NT */ "Território do Norte", + /* AU-SA */ "Sul da Austrália", + /* TAS */ "Tasmânia", + /* VIC */ "Victoria", + /* AU-WA */ "Austrália Ocidental", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraíba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceará", + /* BR-AC */ "Acre", + /* BR-PR */ "Paraná", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondônia", + /* BR-SP */ "São Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhão", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Pára", + /* BR-AM */ "Amazonas", + /* US-DC */ "Distrito de Colúmbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "Nova Jérsei", + /* US-NH */ "Nova Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Havaí", + /* US-MD */ "Maryland", + /* US-WV */ "Virgínia Ocidental", + /* US-SC */ "Carolina do Sul", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virgínia", + /* US-OH */ "Ohio", + /* US-PA */ "Pensilvânia", + /* US-MS */ "Mississippi", + /* US-LA */ "Luisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Carolina do Norte", + /* US-NY */ "Nova Iorque", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Geórgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Flórida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Dakota do Norte", + /* US-WA */ "Washington", + /* US-SD */ "Dakota do Sul", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "Novo México", + /* US-MT */ "Montana", + /* US-CA */ "Califórnia", + /* US-TX */ "Texas", + /* US-AK */ "Alasca", + /* CA-BC */ "Columbia Britânica", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontário", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Terra Nova", + /* CA-NB */ "Novo Brunswick", + /* CA-NS */ "Nova Escócia", + /* CA-PE */ "Ilha Principe Edward", + /* CA-YT */ "Yukon", + /* CA-NT */ "Territórios do Noroeste", + /* CA-NU */ "Nunavut", + /* IND */ "Índia", + /* AUS */ "Austrália", + /* BRA */ "Brasil", + /* USA */ "EUA|Estados Unidos da América|América", + /* MEX */ "México", + /* MOW */ "Moscou", + /* SPE */ "São Petersburgo", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingushetia Republic", + /* RU-AD */ "República de Adygea", + /* RU-SE */ "República da Ossétia do Norte-Alania", + /* RU-KB */ "República de Kabardino-Balkar", + /* RU-KC */ "República Karachay-Cherkess", + /* RU-CE */ "República Chechena", + /* RU-CU */ "República de Chuvash", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Oblast de Kursk", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Oblast de Bryansk", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Oblast de Astrakhan", + /* MOS */ "Oblast de Moscou", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "República do Daguestão", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Oblast de Novgorod", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "República da Kalmukia", + /* TVE */ "Tver Oblast", + /* LEN */ "Oblast de Leningrado", + /* ROS */ "Oblast de Rostov", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "República da Carélia", + /* NEN */ "Nenets Autonomous Okrug", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "República da Mordovia", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Republic", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "República da Bashkortostã", + /* RU-UD */ "República Udmurt", + /* RU-TA */ "República Tatarstan", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Oblast de Sverdlovsk", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Oblast de Kurgan", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "República da Buryatia", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Oblast de Irkutsk", + /* NVS */ "Oblast de Novosibirsk", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Oblast de Omsk", + /* RU-KK */ "República Khakassia", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "República Altai", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Republic", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Oblast autônomo judaico", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Oblast de Amur", + /* RU-SA */ "República de Sakha|república de Yakutia", + /* CAN */ "Canadá", + /* RUS */ "Rússia", + /* CN-SH */ "Xangai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Pequim", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Mongólia Interior", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "China", + /* UMI */ "Ilhas Menores Distantes dos Estados Unidos", + /* CPT */ "Ilha de Clipperton", + /* ATA */ "Antártica", + /* AAA */ "Internacional|Mundo|Terra" +#else // MAPCODE_SUPPORT_LANGUAGE_PT + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_PT +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_PT_H__ diff --git a/mapcodelib/internal_territory_names_ru.h b/mapcodelib/internal_territory_names_ru.h new file mode 100644 index 0000000..be8ec75 --- /dev/null +++ b/mapcodelib/internal_territory_names_ru.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_RU_H__ +#define __INTERNAL_TERRITORY_NAMES_RU_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_RU[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_RU // Russian + /* VAT */ "Город Ватикан|Святейший Престол", + /* MCO */ "Монако", + /* GIB */ "Гибралтар", + /* TKL */ "Токелау", + /* CCK */ "Кокосовые острова|Килинг острова", + /* BLM */ "Сен-Бартельми", + /* NRU */ "Науру", + /* TUV */ "Тувалу", + /* MAC */ "Макао", + /* SXM */ "Синт-Маартен", + /* MAF */ "Сен-Мартен", + /* NFK */ "Норфолк и Филип-Айленд|Филип-Айленд", + /* PCN */ "Питкэрн", + /* BVT */ "Остров Буве", + /* BMU */ "Бермудские острова|Бермуды", + /* IOT */ "Британская территория Индийского океана", + /* SMR */ "Сан - Марино", + /* GGY */ "Гернси", + /* AIA */ "Ангилья", + /* MSR */ "Монсеррат", + /* JEY */ "Джерси", + /* CXR */ "Остров Рождества", + /* WLF */ "Уоллис и Футуна|Южная Африка", + /* VGB */ "Британские Виргинские острова|Виргинские острова, Британские", + /* LIE */ "Лихтенштейн", + /* ABW */ "Аруба", + /* MHL */ "Маршалловы острова", + /* ASM */ "Американское Самоа|Самоа, Американское", + /* COK */ "Острова Кука", + /* SPM */ "Сен-Пьер и Микелон|Микелон", + /* NIU */ "Ниуэ", + /* KNA */ "Сент-Китс и Невис|Невис", + /* CYM */ "Каймановы острова", + /* BES */ "Бонайре, Сент-Эстатиус и Саба|Саба|Сент-Эстатиус", + /* MDV */ "Мальдивы", + /* SHN */ "Святой Елены, Вознесения и Тристан-да-Кунья|Вознесение|Тристан-да-Кунья", + /* MLT */ "Мальта", + /* GRD */ "Гренада", + /* VIR */ "Американские Виргинские острова|Виргинские острова, США", + /* MYT */ "Майотта", + /* SJM */ "Шпицберген и Ян-Майен|Ян-Майен", + /* VCT */ "Сент-Винсент и Гренадины|Гренадины", + /* HMD */ "Остров Херд и острова Макдональд|Макдональд", + /* BRB */ "Барбадос", + /* ATG */ "Антигуа и Барбуда|Барбуда", + /* CUW */ "ликер кюрасо", + /* SYC */ "Сейшельские острова", + /* PLW */ "Палау", + /* MNP */ "Северные Марианские острова", + /* AND */ "андорра", + /* GUM */ "Гуам", + /* IMN */ "Остров Мэн", + /* LCA */ "Санкт-Люсия", + /* FSM */ "Микронезия|Федеративные Штаты Микронезии", + /* SGP */ "Сингапур", + /* TON */ "Тонга", + /* DMA */ "Доминика", + /* BHR */ "Бахрейн", + /* KIR */ "Кирибати", + /* TCA */ "Острова Теркс и Кайкос|Кайкос", + /* STP */ "Сан-Томе и Принсипи|Принсипи", + /* HKG */ "Гонконг", + /* MTQ */ "Мартиника", + /* FRO */ "Фарерские острова", + /* GLP */ "Гваделупа", + /* COM */ "Коморские острова", + /* MUS */ "Маврикий", + /* REU */ "воссоединение", + /* LUX */ "Люксембург", + /* WSM */ "Самоа", + /* SGS */ "Южная Джорджия и Южные Сандвичевы острова|Южные Сандвичевы острова", + /* PYF */ "Французская Полинезия", + /* CPV */ "Кабо-Верде", + /* TTO */ "Тринидад и Тобаго|Тобаго", + /* BRN */ "Бруней", + /* ATF */ "Французские Южные и Антарктические земли", + /* PRI */ "Пуэрто-Рико", + /* CYP */ "Кипр", + /* LBN */ "Ливан", + /* JAM */ "Ямайка", + /* GMB */ "Гамбия", + /* QAT */ "Катар", + /* FLK */ "Фолклендские острова", + /* VUT */ "Вануату", + /* MNE */ "Черногория", + /* BHS */ "Багамские о-ва", + /* TLS */ "Восточный Тимор", + /* SWZ */ "Свазиленд", + /* KWT */ "Кувейт", + /* FJI */ "Фиджи|острова Фиджи", + /* NCL */ "Новая Каледония", + /* SVN */ "Словения", + /* ISR */ "Израиль", + /* PSE */ "Территории Палестины", + /* SLV */ "Сальвадор", + /* BLZ */ "Белиз", + /* DJI */ "Джибути", + /* MKD */ "Македония", + /* RWA */ "Руанда", + /* HTI */ "Гаити", + /* BDI */ "Бурунди", + /* GNQ */ "Экваториальная Гвинея", + /* ALB */ "Албания", + /* SLB */ "Соломоновы острова", + /* ARM */ "Армения", + /* LSO */ "Лесото", + /* BEL */ "Бельгия", + /* MDA */ "Молдова", + /* GNB */ "Гвинея-Бисау", + /* TWN */ "Тайвань", + /* BTN */ "Бутан", + /* CHE */ "Швейцария", + /* NLD */ "Нидерланды", + /* DNK */ "Дания", + /* EST */ "Эстония", + /* DOM */ "Доминиканская Республика", + /* SVK */ "Словакия", + /* CRI */ "Коста-Рика", + /* BIH */ "Босния и Герцеговина", + /* HRV */ "Хорватия", + /* TGO */ "Того", + /* LVA */ "Латвия", + /* LTU */ "Литва", + /* LKA */ "Шри Ланка", + /* GEO */ "Грузия", + /* IRL */ "Ирландия", + /* SLE */ "Сьерра-Леоне", + /* PAN */ "Панама", + /* CZE */ "Чешская Республика", + /* GUF */ "Французская Гвиана", + /* ARE */ "Объединенные Арабские Эмираты", + /* AUT */ "Австрия", + /* AZE */ "Азербайджан", + /* SRB */ "Сербия", + /* JOR */ "Иордания", + /* PRT */ "Португалия", + /* HUN */ "Венгрия", + /* KOR */ "Южная Корея", + /* ISL */ "Исландия", + /* GTM */ "Гватемала", + /* CUB */ "Куба", + /* BGR */ "Болгария", + /* LBR */ "Либерия", + /* HND */ "Гондурас", + /* BEN */ "Бенин", + /* ERI */ "Эритрея", + /* MWI */ "Малави", + /* PRK */ "Северная Корея", + /* NIC */ "Никарагуа", + /* GRC */ "Греция", + /* TJK */ "Таджикистан", + /* BGD */ "Бангладеш", + /* NPL */ "Непал", + /* TUN */ "Тунис", + /* SUR */ "Суринам", + /* URY */ "Уругвай", + /* KHM */ "Камбоджа", + /* SYR */ "Сирия", + /* SEN */ "Сенегал", + /* KGZ */ "Киргизия", + /* BLR */ "Беларусь", + /* GUY */ "Гайана", + /* LAO */ "Лаос", + /* ROU */ "Румыния", + /* GHA */ "Гана", + /* UGA */ "Уганда", + /* GBR */ "Соединенное Королевство|Шотландия|Великобритания|Северная Ирландия|Ирландия, Северная", + /* GIN */ "Гвинея", + /* ECU */ "Эквадор", + /* ESH */ "Западная Сахара|сахрави", + /* GAB */ "Габон", + /* NZL */ "Новая Зеландия", + /* BFA */ "Буркина-Фасо", + /* PHL */ "Филиппины", + /* ITA */ "Италия", + /* OMN */ "Оман", + /* POL */ "Польша", + /* CIV */ "Кот-д`Ивуар", + /* NOR */ "Норвегия", + /* MYS */ "Малайзия", + /* VNM */ "Вьетнам", + /* FIN */ "Финляндия", + /* COG */ "Конго-Браззавиль", + /* DEU */ "Германия", + /* JPN */ "Япония", + /* ZWE */ "Зимбабве", + /* PRY */ "Парагвай", + /* IRQ */ "Ирак", + /* MAR */ "Марокко", + /* UZB */ "Узбекистан", + /* SWE */ "Швеция", + /* PNG */ "Папуа - Новая Гвинея", + /* CMR */ "Камерун", + /* TKM */ "Туркменистан", + /* ESP */ "Испания", + /* THA */ "Таиланд", + /* YEM */ "Йемен", + /* FRA */ "Франция", + /* ALA */ "Аландские острова", + /* KEN */ "Кения", + /* BWA */ "Ботсвана", + /* MDG */ "Мадагаскар", + /* UKR */ "Украина", + /* SSD */ "южный Судан", + /* CAF */ "Центрально-Африканская Республика", + /* SOM */ "Сомали", + /* AFG */ "Афганистан", + /* MMR */ "Мьянма|Бирма", + /* ZMB */ "Замбия", + /* CHL */ "Чили", + /* TUR */ "Турция", + /* PAK */ "Пакистан", + /* MOZ */ "Мозамбик", + /* NAM */ "Намибия", + /* VEN */ "Венесуэла", + /* NGA */ "Нигерия", + /* TZA */ "Танзания", + /* EGY */ "Египет", + /* MRT */ "Мавритания", + /* BOL */ "Боливия", + /* ETH */ "Эфиопия", + /* COL */ "Колумбия", + /* ZAF */ "Южная Африка", + /* MLI */ "Мали", + /* AGO */ "Ангола", + /* NER */ "Нигер", + /* TCD */ "Чад", + /* PER */ "Перу", + /* MNG */ "Монголия", + /* IRN */ "Я побежал", + /* LBY */ "Ливия", + /* SDN */ "Судан", + /* IDN */ "Индонезия", + /* DIF */ "Федеральный район", + /* TLA */ "Тлашкала", + /* MOR */ "Морелос", + /* AGU */ "Агуаскальентес", + /* MX-CL */ "Колима", + /* QUE */ "Керетаро", + /* HID */ "Идальго", + /* MX-MX */ "Штат Мексика", + /* TAB */ "табаско", + /* NAY */ "Наярит", + /* GUA */ "Гуанахуато", + /* PUE */ "Пуэбла", + /* YUC */ "Юкатан", + /* ROO */ "Кинтана-Роо", + /* SIN */ "Синалоа", + /* CAM */ "Кампече", + /* MIC */ "Мичоакан", + /* SLP */ "Сан - Луис-Потоси", + /* GRO */ "Герреро", + /* NLE */ "Нуэво-Леон", + /* BCN */ "Нижняя Калифорния", + /* VER */ "Веракрус", + /* CHP */ "Чьяпас", + /* BCS */ "Южная Нижняя Калифорния", + /* ZAC */ "Сакатекас", + /* JAL */ "Халиско", + /* TAM */ "Тамаулипас", + /* OAX */ "Оахака", + /* DUR */ "Дуранго", + /* COA */ "Коахуила", + /* SON */ "Сонора", + /* CHH */ "Чихуахуа", + /* GRL */ "Гренландия", + /* SAU */ "Саудовская Аравия", + /* COD */ "Конго-Киншаса", + /* DZA */ "Алжир", + /* KAZ */ "Казахстан", + /* ARG */ "Аргентина", + /* IN-DD */ "Даман и Диу", + /* IN-DN */ "Дадра и Нагархавели", + /* IN-CH */ "Чандигарх", + /* IN-AN */ "Андаманские и Никобарские", + /* IN-LD */ "Лакшадвип", + /* IN-DL */ "Дели", + /* IN-ML */ "Мегхалая", + /* IN-NL */ "Нагаленд", + /* IN-MN */ "Манипур", + /* IN-TR */ "Трипура", + /* IN-MZ */ "Мизорам", + /* IN-SK */ "Сикким", + /* IN-PB */ "Пенджаб", + /* IN-HR */ "Харьяна", + /* IN-AR */ "Аруначал-Прадеш", + /* IN-AS */ "Ассам", + /* IN-BR */ "Бихар", + /* IN-UT */ "Уттаракханд", + /* IN-GA */ "Гоа", + /* IN-KL */ "Керала", + /* IN-TN */ "Тамилнад", + /* IN-HP */ "Химачал-Прадеш", + /* IN-JK */ "Джамму и Кашмир", + /* IN-CT */ "Чхаттисгарх", + /* IN-JH */ "Джаркханд", + /* IN-KA */ "Карнатака", + /* IN-RJ */ "Раджастхан", + /* IN-OR */ "Орисса", + /* IN-GJ */ "Гуджарат", + /* IN-WB */ "Западная Бенгалия", + /* IN-MP */ "Мадхья-Прадеш", + /* IN-TG */ "Телингана", + /* IN-AP */ "Андхра-Прадеш", + /* IN-MH */ "Махараштра", + /* IN-UP */ "Уттар-Прадеш", + /* IN-PY */ "Пондичерри", + /* NSW */ "Новый Южный Уэльс", + /* ACT */ "территория столицы Австралии", + /* JBT */ "Территория Джервис-Бей", + /* AU-NT */ "Северная территория", + /* AU-SA */ "Южная Австралия", + /* TAS */ "Тасмания", + /* VIC */ "Виктория", + /* AU-WA */ "Западная Австралия", + /* QLD */ "Квинсленд", + /* BR-DF */ "Федеральный округ", + /* BR-SE */ "Сержипи", + /* BR-AL */ "Алагоас", + /* BR-RJ */ "Рио де Жанейро", + /* BR-ES */ "Эспириту-Санту", + /* BR-RN */ "Рио-Гранде-ду-Норти", + /* BR-PB */ "Параибы", + /* BR-SC */ "Санта-Катарина", + /* BR-PE */ "Пернамбуку", + /* BR-AP */ "Амапа", + /* BR-CE */ "Сеара", + /* BR-AC */ "Акри", + /* BR-PR */ "Парана", + /* BR-RR */ "Рорайма", + /* BR-RO */ "Рондония", + /* BR-SP */ "Сан-Паулу", + /* BR-PI */ "Пиауи", + /* BR-TO */ "Токантинс", + /* BR-RS */ "Рио-Гранде-ду-Сул", + /* BR-MA */ "Мараньян", + /* BR-GO */ "Гояс", + /* BR-MS */ "Мату-Гросу-ду-Сул", + /* BR-BA */ "Баия", + /* BR-MG */ "Минас-Жерайс", + /* BR-MT */ "Мату-Гросу", + /* BR-PA */ "Пара", + /* BR-AM */ "Амазонас", + /* US-DC */ "Округ Колумбия", + /* US-RI */ "Род-Айленд", + /* US-DE */ "Делавэр", + /* US-CT */ "Коннектикут", + /* US-NJ */ "Нью-Джерси", + /* US-NH */ "Нью-Гемпшир", + /* US-VT */ "Вермонт", + /* US-MA */ "Массачусетс", + /* US-HI */ "Гавайи", + /* US-MD */ "Мэриленд", + /* US-WV */ "Западная Виргиния", + /* US-SC */ "Южная Каролина", + /* US-ME */ "Мэн", + /* US-IN */ "Индиана", + /* US-KY */ "Кентукки", + /* US-TN */ "Теннесси", + /* US-VA */ "Виргиния", + /* US-OH */ "Огайо", + /* US-PA */ "Пенсильвания", + /* US-MS */ "Миссисипи", + /* US-LA */ "Луизиана", + /* US-AL */ "Алабама", + /* US-AR */ "Арканзас", + /* US-NC */ "Северная Каролина", + /* US-NY */ "Нью-Йорк", + /* US-IA */ "Айова", + /* US-IL */ "Иллинойс", + /* US-GA */ "Грузия", + /* US-WI */ "Висконсин", + /* US-FL */ "Флорида", + /* US-MO */ "Миссури", + /* US-OK */ "Оклахома", + /* US-ND */ "Северная Дакота", + /* US-WA */ "Вашингтон", + /* US-SD */ "Южная Дакота", + /* US-NE */ "Небраска", + /* US-KS */ "Канзас", + /* US-ID */ "Айдахо", + /* US-UT */ "Юта", + /* US-MN */ "Миннесота", + /* US-MI */ "Мичиган", + /* US-WY */ "Вайоминг", + /* US-OR */ "Орегон", + /* US-CO */ "Колорадо", + /* US-NV */ "Невада", + /* US-AZ */ "Аризона", + /* US-NM */ "Нью-Мексико", + /* US-MT */ "Монтана", + /* US-CA */ "Калифорния", + /* US-TX */ "Техас", + /* US-AK */ "Аляска", + /* CA-BC */ "британская Колумбия", + /* CA-AB */ "альберта", + /* CA-ON */ "Онтарио", + /* CA-QC */ "Квебек", + /* CA-SK */ "Саскачеван", + /* CA-MB */ "Манитоба", + /* CA-NL */ "Ньюфаундленд", + /* CA-NB */ "Новый Брансвик", + /* CA-NS */ "Новая Шотландия", + /* CA-PE */ "Остров Принца Эдуарда", + /* CA-YT */ "Юкон", + /* CA-NT */ "Северо-западные территории", + /* CA-NU */ "Нунавут", + /* IND */ "Индия", + /* AUS */ "Австралия", + /* BRA */ "Бразилия", + /* USA */ "США|Соединенные Штаты Америки|Америка", + /* MEX */ "Мексика", + /* MOW */ "Москва", + /* SPE */ "Санкт-Петербург", + /* KGD */ "Калининградская область", + /* RU-IN */ "Республика Ингушетия", + /* RU-AD */ "Республика Адыгея", + /* RU-SE */ "Северная Осетия-Алания", + /* RU-KB */ "Кабардино-Балкарская Республика", + /* RU-KC */ "Карачаево-Черкесская Республика", + /* RU-CE */ "Чеченская Республика", + /* RU-CU */ "Чувашская Республика", + /* IVA */ "Ивановская область", + /* LIP */ "Липецкая область", + /* ORL */ "Орловская область", + /* TUL */ "Тульская область", + /* RU-BE */ "Белгородская область", + /* VLA */ "Владимирская область", + /* KRS */ "Курская область", + /* KLU */ "Калужская область", + /* RU-TT */ "Тамбовская область", + /* BRY */ "Брянская область", + /* YAR */ "Ярославская область", + /* RYA */ "Рязанская область", + /* AST */ "Астраханская область", + /* MOS */ "Московская область", + /* SMO */ "Смоленская область", + /* RU-DA */ "Республика Дагестан", + /* VOR */ "Воронежская область", + /* NGR */ "Новгородская область", + /* PSK */ "Псковская область", + /* KOS */ "Костромская область", + /* STA */ "Ставропольский край", + /* KDA */ "Краснодарский край", + /* RU-KL */ "Республика Калмыкия", + /* TVE */ "Тверская область", + /* LEN */ "Ленинградская область", + /* ROS */ "Ростовская область", + /* VGG */ "Волгоградская область", + /* VLG */ "Вологодская область", + /* MUR */ "Мурманская область", + /* RU-KR */ "Республика Карелия", + /* NEN */ "Ненецкий автономный округ", + /* RU-KO */ "Республика Коми", + /* ARK */ "Архангельская область", + /* RU-MO */ "Республика Мордовия", + /* NIZ */ "Нижегородская область", + /* PNZ */ "Пензенская область", + /* RU-KI */ "Кировская область", + /* RU-ME */ "Республика Марий Эл", + /* ORE */ "Оренбургская область", + /* ULY */ "Ульяновская область", + /* RU-PM */ "Пермский край", + /* RU-BA */ "Республика Башкортостан", + /* RU-UD */ "Удмуртская Республика", + /* RU-TA */ "Республика Татарстан", + /* SAM */ "Самарская область", + /* SAR */ "Саратовская область", + /* YAN */ "Ямало-Ненецкий", + /* RU-KM */ "Ханты-Мансийский", + /* SVE */ "Свердловская область", + /* TYU */ "Тюменская область", + /* KGN */ "Курганская область", + /* RU-CH */ "Челябинская область", + /* RU-BU */ "Республика Бурятия", + /* ZAB */ "Забайкальский край", + /* IRK */ "Иркутская область", + /* NVS */ "Новосибирская область", + /* TOM */ "Томская область", + /* OMS */ "Омская область", + /* RU-KK */ "Республика Хакасия", + /* KEM */ "Кемеровская область", + /* RU-AL */ "Республика Алтай", + /* ALT */ "Алтайский край", + /* RU-TY */ "Респу́блика Тыва́", + /* KYA */ "Красноярский край", + /* MAG */ "Магаданская область", + /* CHU */ "Чукотский округ", + /* KAM */ "Камчатский край", + /* SAK */ "Сахалинская область", + /* RU-PO */ "Приморский край", + /* YEV */ "Еврейская автономная область", + /* KHA */ "Хабаровский край", + /* AMU */ "Амурская область", + /* RU-SA */ "Республика Саха|Якутия", + /* CAN */ "Канада", + /* RUS */ "Россия", + /* CN-SH */ "Шанхай", + /* CN-TJ */ "Тяньцзинь", + /* CN-BJ */ "Пекин", + /* CN-HI */ "Хайнань", + /* CN-NX */ "Нинся-Хуэйский", + /* CN-CQ */ "Чунцин", + /* CN-ZJ */ "Чжэцзян", + /* CN-JS */ "Цзянсу", + /* CN-FJ */ "Фуцзянь", + /* CN-AH */ "Аньхой", + /* CN-LN */ "Ляонин", + /* CN-SD */ "Шаньдун", + /* CN-SX */ "Шаньси", + /* CN-JX */ "Цзянси", + /* CN-HA */ "Хэнань", + /* CN-GZ */ "Гуйчжоу", + /* CN-GD */ "Гуандун", + /* CN-HB */ "Хубэй", + /* CN-JL */ "Цзилинь", + /* CN-HE */ "хэбэй", + /* CN-SN */ "Шэньси", + /* CN-NM */ "Внутренняя Монголия", + /* CN-HL */ "Хэйлунцзян", + /* CN-HN */ "Хунань", + /* CN-GX */ "Гуанси-Чжуанский", + /* CN-SC */ "Сычуань", + /* CN-YN */ "Юньнань", + /* CN-XZ */ "Тибетский автономный район|Тибет", + /* CN-GS */ "Ганьсу", + /* CN-QH */ "Цинхай", + /* CN-XJ */ "Синьцзян-Уйгурский", + /* CHN */ "Китай", + /* UMI */ "США Внешние малые острова", + /* CPT */ "Остров Клиппертон", + /* ATA */ "Антарктида", + /* AAA */ "Международный|Мир|Земля" +#else // MAPCODE_SUPPORT_LANGUAGE_RU + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_RU +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_RU_H__ diff --git a/mapcodelib/internal_territory_names_sv.h b/mapcodelib/internal_territory_names_sv.h new file mode 100644 index 0000000..4c7f88f --- /dev/null +++ b/mapcodelib/internal_territory_names_sv.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_SV_H__ +#define __INTERNAL_TERRITORY_NAMES_SV_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_SV[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_SV // Swedish + /* VAT */ "Vatikanstaten|Heliga stolen", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Kokosöarna|Keeling Islands", + /* BLM */ "Saint-Barthélemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk och Philip Island|Philip Island", + /* PCN */ "Pitcairn Islands", + /* BVT */ "Bouvetön", + /* BMU */ "Bermuda", + /* IOT */ "Brittiska territoriet i Indiska oceanen", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Julön", + /* WLF */ "Wallis och Futuna|Futuna", + /* VGB */ "Brittiska Jungfruöarna|Brittiska Jungfruöarna", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Marshallöarna", + /* ASM */ "Amerikanska Samoa|Samoa, amerikansk", + /* COK */ "Cook öarna", + /* SPM */ "Saint Pierre och Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts och Nevis|Nevis", + /* CYM */ "Caymanöarna", + /* BES */ "Bonaire, St Eustatuis och Saba|Saba|St Eustatius", + /* MDV */ "Maldiverna", + /* SHN */ "Saint Helena, Ascension och Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Amerikanska Jungfruöarna", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard och Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent och Grenadinerna|Grenadinerna", + /* HMD */ "Heard- och Mcdonaldöarna|McDonald öar", + /* BRB */ "Barbados", + /* ATG */ "Antigua och Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seychellerna", + /* PLW */ "Palau", + /* MNP */ "Nordmarianerna", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Ö av man", + /* LCA */ "Saint Lucia", + /* FSM */ "Mikronesiska federationen", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks- och Caicosöarna|Caicosöarna", + /* STP */ "Sao Tomé och Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Färöarna", + /* GLP */ "Guadeloupe", + /* COM */ "Comoros", + /* MUS */ "Mauritius", + /* REU */ "Återförening", + /* LUX */ "Luxemburg", + /* WSM */ "Samoa", + /* SGS */ "Sydgeorgien och Sydsandwichöarna|Sydsandwichöarna", + /* PYF */ "Franska Polynesien", + /* CPV */ "Cap Verde", + /* TTO */ "Trinidad och Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Franska sydliga och antarktiska Lands", + /* PRI */ "Puerto Rico", + /* CYP */ "Cypern", + /* LBN */ "Libanon", + /* JAM */ "Jamaica", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Falklandsöarna", + /* VUT */ "Vanuatu", + /* MNE */ "Monte~~POS=TRUNC", + /* BHS */ "Bahamas", + /* TLS */ "Östtimor", + /* SWZ */ "Swaziland", + /* KWT */ "Kuwait", + /* FJI */ "Fiji", + /* NCL */ "Nya Kaledonien", + /* SVN */ "Slovenien", + /* ISR */ "Israel", + /* PSE */ "Palestinska Territorier", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Makedonien", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Ekvatorialguinea", + /* ALB */ "Albanien", + /* SLB */ "Salomonöarna", + /* ARM */ "Armenien", + /* LSO */ "Lesotho", + /* BEL */ "Belgien", + /* MDA */ "Moldavien", + /* GNB */ "GUINEA-BISSAU", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Schweiz", + /* NLD */ "Nederländerna", + /* DNK */ "Danmark", + /* EST */ "Estland", + /* DOM */ "Dominikanska republiken", + /* SVK */ "Slovakien", + /* CRI */ "Costa rica", + /* BIH */ "Bosnien och Hercegovina", + /* HRV */ "Kroatien", + /* TGO */ "Togo", + /* LVA */ "Lettland", + /* LTU */ "Litauen", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgien", + /* IRL */ "Irland", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Tjeckien", + /* GUF */ "Franska Guyana", + /* ARE */ "Förenade Arabemiraten", + /* AUT */ "Österrike", + /* AZE */ "Azerbaijan", + /* SRB */ "Serbien", + /* JOR */ "Jordanien", + /* PRT */ "Portugal", + /* HUN */ "Ungern", + /* KOR */ "Sydkorea", + /* ISL */ "Island", + /* GTM */ "Guatemala", + /* CUB */ "Kuba", + /* BGR */ "Bulgarien", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Nordkorea", + /* NIC */ "Nicaragua", + /* GRC */ "Grekland", + /* TJK */ "Tadzjikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunisien", + /* SUR */ "Suriname", + /* URY */ "Uruguay", + /* KHM */ "Kambodja", + /* SYR */ "Syrien", + /* SEN */ "Senegal", + /* KGZ */ "Kyrgyzstan", + /* BLR */ "Vitryssland", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Rumänien", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Storbritannien|Skottland|Nordirland|Irland, Northern", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Västsahara|Sahrawi", + /* GAB */ "Gabon", + /* NZL */ "Nya Zeeland", + /* BFA */ "Burkina Faso", + /* PHL */ "Filippinerna", + /* ITA */ "Italien", + /* OMN */ "Oman", + /* POL */ "Polen", + /* CIV */ "Elfenbenskusten", + /* NOR */ "Norge", + /* MYS */ "Malaysia", + /* VNM */ "Vietnam", + /* FIN */ "Finland", + /* COG */ "Kongo-Brazzaville", + /* DEU */ "Tyskland", + /* JPN */ "Japan", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Marocko", + /* UZB */ "Uzbekistan", + /* SWE */ "Sverige", + /* PNG */ "Papua Nya Guinea", + /* CMR */ "Kamerun", + /* TKM */ "Turkmenistan", + /* ESP */ "Spanien", + /* THA */ "Thailand", + /* YEM */ "Jemen", + /* FRA */ "Frankrike", + /* ALA */ "Åland", + /* KEN */ "Kenya", + /* BWA */ "Botswana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukraina", + /* SSD */ "Södra Sudan", + /* CAF */ "Centralafrikanska republiken", + /* SOM */ "Somalia", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Burma", + /* ZMB */ "Zambia", + /* CHL */ "Chile", + /* TUR */ "Turkiet", + /* PAK */ "Pakistan", + /* MOZ */ "Moçambique", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Egypten", + /* MRT */ "Mauretanien", + /* BOL */ "Bolivia", + /* ETH */ "Etiopien", + /* COL */ "Colombia", + /* ZAF */ "Sydafrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Tchad", + /* PER */ "Peru", + /* MNG */ "Mongoliet", + /* IRN */ "Iran", + /* LBY */ "Libyen", + /* SDN */ "Sudan", + /* IDN */ "Indonesien", + /* DIF */ "Federal District", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Vera", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grönland", + /* SAU */ "Saudiarabien", + /* COD */ "Kongo-Kinshasa", + /* DZA */ "Algeriet", + /* KAZ */ "Kazakstan", + /* ARG */ "Argentina", + /* IN-DD */ "Daman och Diu", + /* IN-DN */ "Dadra and Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman and Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu och Kashmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnatakaen", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Västbengalen", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Territory", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "South Australia", + /* TAS */ "Tasmanien", + /* VIC */ "Victoria", + /* AU-WA */ "Västra Australien", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "District of Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "Västra Virginia|West Virginia", + /* US-SC */ "South Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania sylvania~~POS=HEADCOMP", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "Norra Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgien", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "Norra Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "Kalifornien", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prins Edward ö", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "Indien", + /* AUS */ "Australien", + /* BRA */ "Brasilien", + /* USA */ "USA|Amerikas förenta stater|Amerika", + /* MEX */ "Mexico", + /* MOW */ "Moskva", + /* SPE */ "Sankt Petersburg", + /* KGD */ "Kaliningrad", + /* RU-IN */ "Ingushetia republiken", + /* RU-AD */ "Adygea Republic", + /* RU-SE */ "Nordossetien republiken", + /* RU-KB */ "Kabardino-Balkar Republic", + /* RU-KC */ "Karachay-Cherkess Republic", + /* RU-CE */ "Tjetjenien", + /* RU-CU */ "Chuvash Republic", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula", + /* RU-BE */ "Belgorod oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga oblast", + /* RU-TT */ "Tambov oblast", + /* BRY */ "Brjansk oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrachan oblast", + /* MOS */ "Moscow Oblast", + /* SMO */ "Smolensk oblast", + /* RU-DA */ "Dagestan republiken", + /* VOR */ "Voronezj oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykiarepubliken", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda oblast", + /* MUR */ "Murmansk", + /* RU-KR */ "Karelia republiken", + /* NEN */ "Nentsien", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk", + /* RU-MO */ "Mordovia Republic", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Republic", + /* ORE */ "Oren Oblast", + /* ULY */ "Uljanovsk oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan Republic", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Tatarstan", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Tjeljabinsk", + /* RU-BU */ "Republiken Burjatien", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Chakassien Republiken", + /* KEM */ "Kemerovo oblast", + /* RU-AL */ "Altajrepubliken", + /* ALT */ "Altaj kraj", + /* RU-TY */ "Tuva republiken", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Judiska autonoma länet", + /* KHA */ "Chabarovsk", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Sacha Republiken|Yakutia republiken", + /* CAN */ "Kanada", + /* RUS */ "Ryssland", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Peking", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inre Mongoliet", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "Kina", + /* UMI */ "Förenta staternas avlägset belägna öar", + /* CPT */ "Clipperton", + /* ATA */ "Antarktis", + /* AAA */ "Internationell|Världen|Jorden" +#else // MAPCODE_SUPPORT_LANGUAGE_SV + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_SV +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_SV_H__ diff --git a/mapcodelib/internal_territory_names_sw.h b/mapcodelib/internal_territory_names_sw.h new file mode 100644 index 0000000..9f5c3c8 --- /dev/null +++ b/mapcodelib/internal_territory_names_sw.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_SW_H__ +#define __INTERNAL_TERRITORY_NAMES_SW_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_SW[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_SW // Swahili + /* VAT */ "Vatican City|Kitakatifu", + /* MCO */ "Monaco", + /* GIB */ "Gibraltar", + /* TKL */ "Tokelau", + /* CCK */ "Cocos Visiwa vya|Keeling Islands", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Macau", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk na Philip Island|Philip Island", + /* PCN */ "Visiwa vya Pitcairn", + /* BVT */ "Bouvet Island", + /* BMU */ "Bermuda", + /* IOT */ "Uingereza katika Bahari Hindi", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Kisiwa cha Krismasi", + /* WLF */ "Wallis na Futuna|Futuna", + /* VGB */ "British Virgin Islands|Virgin Islands, British", + /* LIE */ "Liechtenstein", + /* ABW */ "Aruba", + /* MHL */ "Visiwa vya Marshall", + /* ASM */ "American Samoa|Samoa, American", + /* COK */ "Visiwa Cook", + /* SPM */ "Saint Pierre na Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts na Nevis|Nevis", + /* CYM */ "Visiwa Cayman", + /* BES */ "Bonaire, St Eustatuis na Saba|Saba|St Eustatius", + /* MDV */ "Maldives", + /* SHN */ "Saint Helena, Ascension na Tristan da Cunha|Ascension|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "Visiwa vya Virgin vya Marekani|Visiwa vya Virgin, Marekani", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard na Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent na Grenadines|Grenadines", + /* HMD */ "Kusikia Kisiwa na McDonald Visiwa|McDonald Visiwa", + /* BRB */ "Barbados", + /* ATG */ "Antigua na Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Shelisheli", + /* PLW */ "Palau", + /* MNP */ "Visiwa vya Mariana ya Kaskazini", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Kisiwa cha Man", + /* LCA */ "Mtakatifu Lucia", + /* FSM */ "Micronesia|Shirikisho la Mikronesia", + /* SGP */ "Singapore", + /* TON */ "Tonga", + /* DMA */ "Dominica", + /* BHR */ "Bahrain", + /* KIR */ "Kiribati", + /* TCA */ "Turks na Caicos|Caicos", + /* STP */ "Sao Tome na Principe|Principe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinique", + /* FRO */ "Visiwa vya Faroe", + /* GLP */ "Guadeloupe", + /* COM */ "Comoro", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Luxembourg", + /* WSM */ "Samoa", + /* SGS */ "South Georgia na South Sandwich Islands|Visiwa vya South Sandwich", + /* PYF */ "Polynesia ya Kifaransa", + /* CPV */ "Cape Verde", + /* TTO */ "Trinidad na Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Kusini mwa Ufaransa na Antarctic Ardhi", + /* PRI */ "Pwetoriko", + /* CYP */ "Cyprus", + /* LBN */ "Lebanon", + /* JAM */ "Jamaica", + /* GMB */ "Gambia", + /* QAT */ "Qatar", + /* FLK */ "Visiwa vya Falkland", + /* VUT */ "Vanuatu", + /* MNE */ "Montenegro", + /* BHS */ "Bahamas", + /* TLS */ "Timor ya Mashariki", + /* SWZ */ "Swaziland", + /* KWT */ "Kuwait", + /* FJI */ "Fiji Visiwa vya", + /* NCL */ "Caledonia New", + /* SVN */ "Slovenia", + /* ISR */ "Israel", + /* PSE */ "Maeneo ya Palestina", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Djibouti", + /* MKD */ "Makedonia", + /* RWA */ "Rwanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Equatorial Guinea", + /* ALB */ "Albania", + /* SLB */ "Visiwa vya Solomon", + /* ARM */ "Armenia", + /* LSO */ "Lesotho", + /* BEL */ "Ubelgiji", + /* MDA */ "Moldova", + /* GNB */ "Guinea-Bissau", + /* TWN */ "Taiwan", + /* BTN */ "Bhutan", + /* CHE */ "Switzerland", + /* NLD */ "Uholanzi", + /* DNK */ "Denmark", + /* EST */ "Estonia", + /* DOM */ "Jamhuri ya Dominika", + /* SVK */ "Slovakia", + /* CRI */ "Costa Rica", + /* BIH */ "Bosnia na Herzegovina", + /* HRV */ "Croatia", + /* TGO */ "Togo", + /* LVA */ "Latvia", + /* LTU */ "Lithuania", + /* LKA */ "Sri Lanka", + /* GEO */ "Georgia", + /* IRL */ "Ireland", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Jamhuri ya Czech", + /* GUF */ "Kifaransa Guiana", + /* ARE */ "Umoja wa Falme za Kiarabu", + /* AUT */ "Austria", + /* AZE */ "Azerbaijan", + /* SRB */ "Serbia", + /* JOR */ "Jordan", + /* PRT */ "Ureno", + /* HUN */ "Hungary", + /* KOR */ "Korea ya Kusini", + /* ISL */ "Iceland", + /* GTM */ "Guatemala", + /* CUB */ "Cuba", + /* BGR */ "Bulgaria", + /* LBR */ "Liberia", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritrea", + /* MWI */ "Malawi", + /* PRK */ "Korea Kaskazini", + /* NIC */ "Nicaragua", + /* GRC */ "Ugiriki", + /* TJK */ "Tajikistan", + /* BGD */ "Bangladesh", + /* NPL */ "Nepal", + /* TUN */ "Tunisia", + /* SUR */ "Surinam", + /* URY */ "Uruguay", + /* KHM */ "Cambodia", + /* SYR */ "Syria", + /* SEN */ "Senegal", + /* KGZ */ "Kyrgyzstan", + /* BLR */ "Belarus", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Romania", + /* GHA */ "Ghana", + /* UGA */ "Uganda", + /* GBR */ "Uingereza|Scotland|Mkuu wa Uingereza|Northern Ireland|Ireland, Northern", + /* GIN */ "Guinea", + /* ECU */ "Ecuador", + /* ESH */ "Western Sahara|Saharawi", + /* GAB */ "Gabon", + /* NZL */ "New Zealand", + /* BFA */ "Burkina Faso", + /* PHL */ "Philippines", + /* ITA */ "Italia", + /* OMN */ "Oman", + /* POL */ "Poland", + /* CIV */ "Ivory Coast", + /* NOR */ "Norway", + /* MYS */ "Malaysia", + /* VNM */ "Vietnam", + /* FIN */ "Finland", + /* COG */ "Congo-Brazzaville", + /* DEU */ "Ujerumani", + /* JPN */ "Japan", + /* ZWE */ "Zimbabwe", + /* PRY */ "Paraguay", + /* IRQ */ "Iraq", + /* MAR */ "Morocco", + /* UZB */ "Uzbekistan", + /* SWE */ "Sweden", + /* PNG */ "Papua New Guinea", + /* CMR */ "Cameroon", + /* TKM */ "Turkmenistan", + /* ESP */ "Hispania", + /* THA */ "Thailand", + /* YEM */ "Yemen", + /* FRA */ "Ufaransa", + /* ALA */ "Aaland Visiwa", + /* KEN */ "Kenya", + /* BWA */ "Botswana", + /* MDG */ "Madagascar", + /* UKR */ "Ukraine", + /* SSD */ "Sudan Kusini", + /* CAF */ "Jamhuri ya Afrika ya Kati", + /* SOM */ "Somalia", + /* AFG */ "Afghanistan", + /* MMR */ "Myanmar|Burma", + /* ZMB */ "Zambia", + /* CHL */ "Chile", + /* TUR */ "Uturuki", + /* PAK */ "Pakistan", + /* MOZ */ "Msumbiji", + /* NAM */ "Namibia", + /* VEN */ "Venezuela", + /* NGA */ "Nigeria", + /* TZA */ "Tanzania", + /* EGY */ "Misri", + /* MRT */ "Mauritania", + /* BOL */ "Bolivia", + /* ETH */ "Ethiopia", + /* COL */ "Colombia", + /* ZAF */ "Africa Kusini", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Niger", + /* TCD */ "Chad", + /* PER */ "Peru", + /* MNG */ "Mongolia", + /* IRN */ "Iran", + /* LBY */ "Libya", + /* SDN */ "Sudan", + /* IDN */ "Indonesia", + /* DIF */ "Wilaya ya shirikisho", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Mexico State", + /* TAB */ "Tabasco", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Durango", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Greenland", + /* SAU */ "Saudi Arabia", + /* COD */ "Congo-Kinshasa", + /* DZA */ "Algeria", + /* KAZ */ "Kazakhstan", + /* ARG */ "Argentina", + /* IN-DD */ "Daman na Diu", + /* IN-DN */ "Dadra na Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman and Nicobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Punjab", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunachal Pradesh", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarakhand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu na Kashmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "West Bengal", + /* IN-MP */ "Madhya Pradesh", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andhra Pradesh", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "New South Wales", + /* ACT */ "Australian Capital Territory", + /* JBT */ "Jervis Bay Wapelestina", + /* AU-NT */ "Wilaya ya Kaskazini", + /* AU-SA */ "Australia Kusini", + /* TAS */ "Tasmania", + /* VIC */ "Victoria", + /* AU-WA */ "Australia ya Magharibi", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso", + /* BR-PA */ "Para", + /* BR-AM */ "Amazonas", + /* US-DC */ "Wilaya ya Columbia", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "South Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "North Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Georgia", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "California", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "New Brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prince Edward Island", + /* CA-YT */ "Yukon", + /* CA-NT */ "Northwest Territories", + /* CA-NU */ "Nunavut", + /* IND */ "India", + /* AUS */ "Australia", + /* BRA */ "Brazil", + /* USA */ "Marekani|United States of America|Amerika", + /* MEX */ "Mexico", + /* MOW */ "Moscow", + /* SPE */ "Saint Petersburg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "Ingushetia Republic", + /* RU-AD */ "Adygea Jamhuri", + /* RU-SE */ "Ossetia ya Kaskazini-Alania Republic", + /* RU-KB */ "Kabardino-Balkar Jamhuri", + /* RU-KC */ "Karachay-Cherkess Jamhuri", + /* RU-CE */ "Chechen Jamhuri", + /* RU-CU */ "Chuvash Jamhuri", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblast", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga Oblast", + /* RU-TT */ "Tambov Oblast", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblast", + /* AST */ "Astrakhan Oblast", + /* MOS */ "Moscow Oblast", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "Dagestan Republic", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia Republic", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd Oblast", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Karelia Republic", + /* NEN */ "Nenets Autonomous Okrug", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovia Republic", + /* NIZ */ "Nizhny Novgorod Oblast", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Jamhuri", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Bashkortostan Republic", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Tatarstan Republic", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Khanty-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Chelyabinsk Oblast", + /* RU-BU */ "Buryatia Republic", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Khakassia Jamhuri", + /* KEM */ "Kemerovo Oblast", + /* RU-AL */ "Altai Republic", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Jamhuri", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadani Oblast", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Jewish Autonomous Oblast", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Sakha Republic|Yakutia Republic", + /* CAN */ "Canada", + /* RUS */ "Russia", + /* CN-SH */ "Shanghai", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Beijing", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangxi Zhuang", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Xinjiang Uyghur", + /* CHN */ "China", + /* UMI */ "Marekani Ndogo Visiwa Outlying", + /* CPT */ "Clipperton Kisiwa", + /* ATA */ "Antarctica", + /* AAA */ "International|Dunia" +#else // MAPCODE_SUPPORT_LANGUAGE_SW + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_SW +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_SW_H__ diff --git a/mapcodelib/internal_territory_names_tr.h b/mapcodelib/internal_territory_names_tr.h new file mode 100644 index 0000000..f1926cc --- /dev/null +++ b/mapcodelib/internal_territory_names_tr.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_TR_H__ +#define __INTERNAL_TERRITORY_NAMES_TR_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_TR[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_TR // Turkish + /* VAT */ "Vatikan|Holy See", + /* MCO */ "Monako", + /* GIB */ "Cebelitarık", + /* TKL */ "Tokelau", + /* CCK */ "Cocos Adaları|Keeling Adaları", + /* BLM */ "Saint-Barthelemy", + /* NRU */ "Nauru", + /* TUV */ "Tuvalu", + /* MAC */ "Makao", + /* SXM */ "Sint Maarten", + /* MAF */ "Saint-Martin", + /* NFK */ "Norfolk ve Philip Island|Philip Island", + /* PCN */ "Pitcairn Adaları", + /* BVT */ "Bouvet Adası", + /* BMU */ "Bermuda", + /* IOT */ "İngiliz Hint Okyanusu Toprakları", + /* SMR */ "San Marino", + /* GGY */ "Guernsey", + /* AIA */ "Anguilla", + /* MSR */ "Montserrat", + /* JEY */ "Jersey", + /* CXR */ "Noel Adası", + /* WLF */ "Wallis ve Futuna|Futuna", + /* VGB */ "Britanya Virjin Adaları", + /* LIE */ "Lihtenştayn", + /* ABW */ "Aruba", + /* MHL */ "Marşal Adaları", + /* ASM */ "Amerikan Samoası", + /* COK */ "Cook Adaları", + /* SPM */ "Aziz Pierre ve Miquelon|Miquelon", + /* NIU */ "Niue", + /* KNA */ "Saint Kitts ve Nevis|Nevis", + /* CYM */ "Cayman Adaları", + /* BES */ "Bonaire, St. Eustatuis ve Saba|Saba|St Eustatius", + /* MDV */ "Maldivler", + /* SHN */ "Saint Helena, Ascension ve Tristan da Cunha|Yükseliş|Tristan da Cunha", + /* MLT */ "Malta", + /* GRD */ "Grenada", + /* VIR */ "ABD Virjin Adaları", + /* MYT */ "Mayotte", + /* SJM */ "Svalbard ve Jan Mayen|Jan Mayen", + /* VCT */ "Saint Vincent ve Grenadines|Grenadinler", + /* HMD */ "Adası ve McDonald Adaları Heard|McDonald Adaları", + /* BRB */ "Barbados", + /* ATG */ "Antigua ve Barbuda|Barbuda", + /* CUW */ "Curacao", + /* SYC */ "Seyşeller", + /* PLW */ "Palau", + /* MNP */ "Kuzey Mariana Adaları", + /* AND */ "Andorra", + /* GUM */ "Guam", + /* IMN */ "Man Adası", + /* LCA */ "Saint Lucia", + /* FSM */ "Mikronezya Federal Devletleri", + /* SGP */ "Singapur", + /* TON */ "Tonga", + /* DMA */ "Dominika", + /* BHR */ "Bahreyn", + /* KIR */ "Kiribati", + /* TCA */ "Turks ve Caicos Adaları|Caicos Adaları", + /* STP */ "São Tomé ve Príncipe|Príncipe", + /* HKG */ "Hong Kong", + /* MTQ */ "Martinik", + /* FRO */ "Faroe Adaları", + /* GLP */ "Guadeloupe", + /* COM */ "Komorlar", + /* MUS */ "Mauritius", + /* REU */ "Reunion", + /* LUX */ "Lüksemburg", + /* WSM */ "Samoa", + /* SGS */ "Güney Georgia ve Güney Sandwich Adaları|Güney Sandwich Adaları", + /* PYF */ "Fransız Polinezyası", + /* CPV */ "Yeşil Burun Adaları|Cape Verde", + /* TTO */ "Trinidad ve Tobago|Tobago", + /* BRN */ "Brunei", + /* ATF */ "Fransız Güney ve Antarktik", + /* PRI */ "Porto Riko", + /* CYP */ "Kıbrıs Cumhuriyeti", + /* LBN */ "Lübnan", + /* JAM */ "Jamaika", + /* GMB */ "Gambiya", + /* QAT */ "Katar", + /* FLK */ "Falkland adaları", + /* VUT */ "Vanuatu", + /* MNE */ "Karadağ", + /* BHS */ "Bahamalar", + /* TLS */ "Doğu Timor", + /* SWZ */ "Svaziland", + /* KWT */ "Kuveyt", + /* FJI */ "Fiji", + /* NCL */ "Yeni Kaledonya", + /* SVN */ "Slovenya", + /* ISR */ "İsrail", + /* PSE */ "Filistin Bölgesi", + /* SLV */ "El Salvador", + /* BLZ */ "Belize", + /* DJI */ "Cibuti", + /* MKD */ "Makedonya", + /* RWA */ "Ruanda", + /* HTI */ "Haiti", + /* BDI */ "Burundi", + /* GNQ */ "Ekvator Ginesi", + /* ALB */ "Arnavutluk", + /* SLB */ "Solomon Adaları", + /* ARM */ "Ermenistan", + /* LSO */ "Lesotho", + /* BEL */ "Belçika", + /* MDA */ "Moldova", + /* GNB */ "Gine-Bissau", + /* TWN */ "Tayvan", + /* BTN */ "Bhutan", + /* CHE */ "İsviçre", + /* NLD */ "Hollanda", + /* DNK */ "Danimarka", + /* EST */ "Estonya", + /* DOM */ "Dominik Cumhuriyeti", + /* SVK */ "Slovakya", + /* CRI */ "Kosta Rika", + /* BIH */ "Bosna-Hersek", + /* HRV */ "Hırvatistan", + /* TGO */ "Togo", + /* LVA */ "Letonya", + /* LTU */ "Litvanya", + /* LKA */ "Sri Lanka", + /* GEO */ "Gürcistan", + /* IRL */ "İrlanda", + /* SLE */ "Sierra Leone", + /* PAN */ "Panama", + /* CZE */ "Çek Cumhuriyeti", + /* GUF */ "Fransız Guyanası", + /* ARE */ "Birleşik Arap Emirlikleri", + /* AUT */ "Avusturya", + /* AZE */ "Azerbaycan", + /* SRB */ "Sırbistan", + /* JOR */ "Ürdün", + /* PRT */ "Portekiz", + /* HUN */ "Macaristan", + /* KOR */ "Güney Kore", + /* ISL */ "İzlanda", + /* GTM */ "Guatemala", + /* CUB */ "Küba", + /* BGR */ "Bulgaristan", + /* LBR */ "Liberya", + /* HND */ "Honduras", + /* BEN */ "Benin", + /* ERI */ "Eritre", + /* MWI */ "Malavi", + /* PRK */ "Kuzey Kore", + /* NIC */ "Nikaragua", + /* GRC */ "Yunanistan", + /* TJK */ "Tacikistan", + /* BGD */ "Bangladeş", + /* NPL */ "Nepal", + /* TUN */ "Tunus", + /* SUR */ "Surinam", + /* URY */ "Uruguay", + /* KHM */ "Kamboçya", + /* SYR */ "Suriye", + /* SEN */ "Senegal", + /* KGZ */ "Kırgızistan", + /* BLR */ "Beyaz Rusya", + /* GUY */ "Guyana", + /* LAO */ "Laos", + /* ROU */ "Romanya", + /* GHA */ "Gana", + /* UGA */ "Uganda", + /* GBR */ "Birleşik Krallık|İskoçya|Büyük Britanya|Kuzey İrlanda|İrlanda, Kuzey", + /* GIN */ "Gine", + /* ECU */ "Ekvador", + /* ESH */ "Batı Sahra", + /* GAB */ "Gabon", + /* NZL */ "Yeni Zelanda", + /* BFA */ "Burkina Faso", + /* PHL */ "Filipinler", + /* ITA */ "İtalya", + /* OMN */ "Umman", + /* POL */ "Polonya", + /* CIV */ "Fildişi Sahili", + /* NOR */ "Norveç", + /* MYS */ "Malezya", + /* VNM */ "Vietnam", + /* FIN */ "Finlandiya", + /* COG */ "Kongo-Brazzaville", + /* DEU */ "Almanya", + /* JPN */ "Japonya", + /* ZWE */ "Zimbabve", + /* PRY */ "Paraguay", + /* IRQ */ "Irak", + /* MAR */ "Fas", + /* UZB */ "Özbekistan", + /* SWE */ "İsveç", + /* PNG */ "Papua Yeni Gine", + /* CMR */ "Kamerun", + /* TKM */ "Türkmenistan", + /* ESP */ "İspanya", + /* THA */ "Tayland", + /* YEM */ "Yemen", + /* FRA */ "Fransa", + /* ALA */ "Aaland Adaları", + /* KEN */ "Kenya", + /* BWA */ "Botsvana", + /* MDG */ "Madagaskar", + /* UKR */ "Ukrayna", + /* SSD */ "Güney Sudan", + /* CAF */ "Orta Afrika Cumhuriyeti", + /* SOM */ "Somali", + /* AFG */ "Afganistan", + /* MMR */ "Myanmar|Burma", + /* ZMB */ "Zambiya", + /* CHL */ "Şili", + /* TUR */ "Türkiye", + /* PAK */ "Pakistan", + /* MOZ */ "Mozambik", + /* NAM */ "Namibya", + /* VEN */ "Venezuela", + /* NGA */ "Nijerya", + /* TZA */ "Tanzanya", + /* EGY */ "Mısır", + /* MRT */ "Moritanya", + /* BOL */ "Bolivya", + /* ETH */ "Etiyopya", + /* COL */ "Kolombiya", + /* ZAF */ "Güney Afrika", + /* MLI */ "Mali", + /* AGO */ "Angola", + /* NER */ "Nijer", + /* TCD */ "Çad", + /* PER */ "Peru", + /* MNG */ "Moğolistan", + /* IRN */ "İran", + /* LBY */ "Libya", + /* SDN */ "Sudan", + /* IDN */ "Endonezya", + /* DIF */ "Federal Bölge", + /* TLA */ "Tlaxcala", + /* MOR */ "Morelos", + /* AGU */ "Aguascalientes", + /* MX-CL */ "Colima", + /* QUE */ "Queretaro", + /* HID */ "Hidalgo", + /* MX-MX */ "Meksika Devlet", + /* TAB */ "Tabasko", + /* NAY */ "Nayarit", + /* GUA */ "Guanajuato", + /* PUE */ "Puebla", + /* YUC */ "Yucatan", + /* ROO */ "Quintana Roo", + /* SIN */ "Sinaloa", + /* CAM */ "Campeche", + /* MIC */ "Michoacan", + /* SLP */ "San Luis Potosi", + /* GRO */ "Guerrero", + /* NLE */ "Nuevo Leon", + /* BCN */ "Baja California", + /* VER */ "Veracruz", + /* CHP */ "Chiapas", + /* BCS */ "Baja California Sur", + /* ZAC */ "Zacatecas", + /* JAL */ "Jalisco", + /* TAM */ "Tamaulipas", + /* OAX */ "Oaxaca", + /* DUR */ "Colorado eyaletinde bir şehir", + /* COA */ "Coahuila", + /* SON */ "Sonora", + /* CHH */ "Chihuahua", + /* GRL */ "Grönland", + /* SAU */ "Suudi Arabistan", + /* COD */ "Kongo Kinşasa", + /* DZA */ "Cezayir", + /* KAZ */ "Kazakistan", + /* ARG */ "Arjantin", + /* IN-DD */ "Daman and Diu", + /* IN-DN */ "Dadra and Nagar Haveli", + /* IN-CH */ "Chandigarh", + /* IN-AN */ "Andaman ve Nikobar", + /* IN-LD */ "Lakshadweep", + /* IN-DL */ "Delhi", + /* IN-ML */ "Meghalaya", + /* IN-NL */ "Nagaland", + /* IN-MN */ "Manipur", + /* IN-TR */ "Tripura", + /* IN-MZ */ "Mizoram", + /* IN-SK */ "Sikkim", + /* IN-PB */ "Pencap", + /* IN-HR */ "Haryana", + /* IN-AR */ "Arunaçal Pradeş", + /* IN-AS */ "Assam", + /* IN-BR */ "Bihar", + /* IN-UT */ "Uttarkand", + /* IN-GA */ "Goa", + /* IN-KL */ "Kerala", + /* IN-TN */ "Tamil Nadu", + /* IN-HP */ "Himachal Pradesh", + /* IN-JK */ "Jammu ve Keşmir", + /* IN-CT */ "Chhattisgarh", + /* IN-JH */ "Jharkhand", + /* IN-KA */ "Karnataka", + /* IN-RJ */ "Rajasthan", + /* IN-OR */ "Odisha|Orissa", + /* IN-GJ */ "Gujarat", + /* IN-WB */ "Batı Bengal", + /* IN-MP */ "Madya Pradeş", + /* IN-TG */ "Telangana", + /* IN-AP */ "Andra Pradeş", + /* IN-MH */ "Maharashtra", + /* IN-UP */ "Uttar Pradesh", + /* IN-PY */ "Puducherry", + /* NSW */ "Yeni Güney Galler", + /* ACT */ "Avustralya Başkent Bölgesi", + /* JBT */ "Jervis Bay Bölge", + /* AU-NT */ "Northern Territory", + /* AU-SA */ "Güney Avustralya", + /* TAS */ "Tazmanya", + /* VIC */ "Victoria", + /* AU-WA */ "Batı Avustralya", + /* QLD */ "Queensland", + /* BR-DF */ "Distrito Federal", + /* BR-SE */ "Sergipe", + /* BR-AL */ "Alagoas", + /* BR-RJ */ "Rio de Janeiro", + /* BR-ES */ "Espirito Santo", + /* BR-RN */ "Rio Grande do Norte", + /* BR-PB */ "Paraiba", + /* BR-SC */ "Santa Catarina", + /* BR-PE */ "Pernambuco", + /* BR-AP */ "Amapa", + /* BR-CE */ "Ceara", + /* BR-AC */ "Acre", + /* BR-PR */ "Parana", + /* BR-RR */ "Roraima", + /* BR-RO */ "Rondonia", + /* BR-SP */ "Sao Paulo", + /* BR-PI */ "Piaui", + /* BR-TO */ "Tocantins", + /* BR-RS */ "Rio Grande do Sul", + /* BR-MA */ "Maranhao", + /* BR-GO */ "Goias", + /* BR-MS */ "Mato Grosso do Sul", + /* BR-BA */ "Bahia", + /* BR-MG */ "Minas Gerais", + /* BR-MT */ "Mato Grosso do", + /* BR-PA */ "Pará", + /* BR-AM */ "Amazonas", + /* US-DC */ "Kolumbiya Bölgesi", + /* US-RI */ "Rhode Island", + /* US-DE */ "Delaware", + /* US-CT */ "Connecticut", + /* US-NJ */ "New Jersey", + /* US-NH */ "New Hampshire", + /* US-VT */ "Vermont", + /* US-MA */ "Massachusetts", + /* US-HI */ "Hawaii", + /* US-MD */ "Maryland", + /* US-WV */ "West Virginia", + /* US-SC */ "South Carolina", + /* US-ME */ "Maine", + /* US-IN */ "Indiana", + /* US-KY */ "Kentucky", + /* US-TN */ "Tennessee", + /* US-VA */ "Virginia", + /* US-OH */ "Ohio", + /* US-PA */ "Pennsylvania", + /* US-MS */ "Mississippi", + /* US-LA */ "Louisiana", + /* US-AL */ "Alabama", + /* US-AR */ "Arkansas", + /* US-NC */ "North Carolina", + /* US-NY */ "New York", + /* US-IA */ "Iowa", + /* US-IL */ "Illinois", + /* US-GA */ "Gürcistan", + /* US-WI */ "Wisconsin", + /* US-FL */ "Florida", + /* US-MO */ "Missouri", + /* US-OK */ "Oklahoma", + /* US-ND */ "North Dakota", + /* US-WA */ "Washington", + /* US-SD */ "South Dakota", + /* US-NE */ "Nebraska", + /* US-KS */ "Kansas", + /* US-ID */ "Idaho", + /* US-UT */ "Utah", + /* US-MN */ "Minnesota", + /* US-MI */ "Michigan", + /* US-WY */ "Wyoming", + /* US-OR */ "Oregon", + /* US-CO */ "Colorado", + /* US-NV */ "Nevada", + /* US-AZ */ "Arizona", + /* US-NM */ "New Mexico", + /* US-MT */ "Montana", + /* US-CA */ "California", + /* US-TX */ "Texas", + /* US-AK */ "Alaska", + /* CA-BC */ "British Columbia", + /* CA-AB */ "Alberta", + /* CA-ON */ "Ontario", + /* CA-QC */ "Quebec", + /* CA-SK */ "Saskatchewan", + /* CA-MB */ "Manitoba", + /* CA-NL */ "Newfoundland", + /* CA-NB */ "Yeni brunswick", + /* CA-NS */ "Nova Scotia", + /* CA-PE */ "Prens Edward Adası", + /* CA-YT */ "Yukon", + /* CA-NT */ "Kuzeybatı bölgesi", + /* CA-NU */ "Nunavut", + /* IND */ "Hindistan", + /* AUS */ "Avustralya", + /* BRA */ "Brezilya", + /* USA */ "ABD|Amerika Birleşik Devletleri|Amerika", + /* MEX */ "Meksika", + /* MOW */ "Moskova", + /* SPE */ "Petersburg", + /* KGD */ "Kaliningrad Oblast", + /* RU-IN */ "İnguşetya Cumhuriyeti", + /* RU-AD */ "Adigey Cumhuriyeti", + /* RU-SE */ "Kuzey Osetya-Alania Cumhuriyeti", + /* RU-KB */ "Kabardey-Balkar Cumhuriyeti", + /* RU-KC */ "Karaçay-Çerkes Cumhuriyeti", + /* RU-CE */ "Çeçen Cumhuriyeti", + /* RU-CU */ "Çuvaş Cumhuriyeti", + /* IVA */ "Ivanovo Oblast", + /* LIP */ "Lipetsk Oblast", + /* ORL */ "Oryol Oblast", + /* TUL */ "Tula Oblast", + /* RU-BE */ "Belgorod Oblastı", + /* VLA */ "Vladimir Oblast", + /* KRS */ "Kursk Oblast", + /* KLU */ "Kaluga Oblastı", + /* RU-TT */ "Tambov Oblastı", + /* BRY */ "Bryansk Oblast", + /* YAR */ "Yaroslavl Oblast", + /* RYA */ "Ryazan Oblastı", + /* AST */ "Astrakhan Oblast", + /* MOS */ "Moscow Oblast", + /* SMO */ "Smolensk Oblast", + /* RU-DA */ "Dağıstan Cumhuriyeti", + /* VOR */ "Voronezh Oblast", + /* NGR */ "Novgorod Oblast", + /* PSK */ "Pskov Oblast", + /* KOS */ "Kostroma Oblast", + /* STA */ "Stavropol Krai", + /* KDA */ "Krasnodar Krai", + /* RU-KL */ "Kalmykia Cumhuriyeti", + /* TVE */ "Tver Oblast", + /* LEN */ "Leningrad Oblast", + /* ROS */ "Rostov Oblast", + /* VGG */ "Volgograd", + /* VLG */ "Vologda Oblast", + /* MUR */ "Murmansk Oblast", + /* RU-KR */ "Karelya Cumhuriyeti", + /* NEN */ "Nenets Özerk Okrugu", + /* RU-KO */ "Komi Republic", + /* ARK */ "Arkhangelsk Oblast", + /* RU-MO */ "Mordovya Cumhuriyeti", + /* NIZ */ "Nijniy Novgorod Oblastı", + /* PNZ */ "Penza Oblast", + /* RU-KI */ "Kirov Oblast", + /* RU-ME */ "Mari El Cumhuriyeti", + /* ORE */ "Orenburg Oblast", + /* ULY */ "Ulyanovsk Oblast", + /* RU-PM */ "Perm Krai", + /* RU-BA */ "Başkortostan Cumhuriyeti", + /* RU-UD */ "Udmurt Republic", + /* RU-TA */ "Tataristan Cumhuriyeti", + /* SAM */ "Samara Oblast", + /* SAR */ "Saratov Oblast", + /* YAN */ "Yamalo-Nenets", + /* RU-KM */ "Hanti-Mansi", + /* SVE */ "Sverdlovsk Oblast", + /* TYU */ "Tyumen Oblast", + /* KGN */ "Kurgan Oblast", + /* RU-CH */ "Chelyabinsk", + /* RU-BU */ "Buryatia Cumhuriyeti", + /* ZAB */ "Zabaykalsky Krai", + /* IRK */ "Irkutsk Oblast", + /* NVS */ "Novosibirsk Oblast", + /* TOM */ "Tomsk Oblast", + /* OMS */ "Omsk Oblast", + /* RU-KK */ "Hakasya Cumhuriyeti", + /* KEM */ "Kemerovo Oblastı", + /* RU-AL */ "Altay Cumhuriyeti", + /* ALT */ "Altai Krai", + /* RU-TY */ "Tuva Cumhuriyeti", + /* KYA */ "Krasnoyarsk Krai", + /* MAG */ "Magadan Oblastı", + /* CHU */ "Chukotka Okrug", + /* KAM */ "Kamchatka Krai", + /* SAK */ "Sakhalin Oblast", + /* RU-PO */ "Primorsky Krai", + /* YEV */ "Yahudi Özerk Oblastı", + /* KHA */ "Khabarovsk Krai", + /* AMU */ "Amur Oblast", + /* RU-SA */ "Yakutistan|Yakutia Cumhuriyeti", + /* CAN */ "Kanada", + /* RUS */ "Rusya", + /* CN-SH */ "Şangay", + /* CN-TJ */ "Tianjin", + /* CN-BJ */ "Pekin", + /* CN-HI */ "Hainan", + /* CN-NX */ "Ningxia Hui", + /* CN-CQ */ "Chongqing", + /* CN-ZJ */ "Zhejiang", + /* CN-JS */ "Jiangsu", + /* CN-FJ */ "Fujian", + /* CN-AH */ "Anhui", + /* CN-LN */ "Liaoning", + /* CN-SD */ "Shandong", + /* CN-SX */ "Shanxi", + /* CN-JX */ "Jiangxi", + /* CN-HA */ "Henan", + /* CN-GZ */ "Guizhou", + /* CN-GD */ "Guangdong", + /* CN-HB */ "Hubei", + /* CN-JL */ "Jilin", + /* CN-HE */ "Hebei", + /* CN-SN */ "Shaanxi", + /* CN-NM */ "Nei Mongol|Inner Mongolia", + /* CN-HL */ "Heilongjiang", + /* CN-HN */ "Hunan", + /* CN-GX */ "Guangksi", + /* CN-SC */ "Sichuan", + /* CN-YN */ "Yunnan", + /* CN-XZ */ "Xizang|Tibet", + /* CN-GS */ "Gansu", + /* CN-QH */ "Qinghai", + /* CN-XJ */ "Sincan Uygur", + /* CHN */ "Çin Halk Cumhuriyeti", + /* UMI */ "Amerika Birleşik Devletleri Küçük Dış Adaları", + /* CPT */ "Clipperton Adası", + /* ATA */ "Antarktika", + /* AAA */ "Uluslararası|Dünya" +#else // MAPCODE_SUPPORT_LANGUAGE_TR + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_TR +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_TR_H__ diff --git a/mapcodelib/internal_territory_names_uk.h b/mapcodelib/internal_territory_names_uk.h new file mode 100644 index 0000000..6007cc7 --- /dev/null +++ b/mapcodelib/internal_territory_names_uk.h @@ -0,0 +1,567 @@ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +#ifndef __INTERNAL_TERRITORY_NAMES_UK_H__ +#define __INTERNAL_TERRITORY_NAMES_UK_H__ + +#ifdef __cplusplus +extern "C" { +#endif + +// *** GENERATED FILE (coords.cpp), DO NOT CHANGE OR PRETTIFY *** + +static const char *TERRITORY_FULL_NAME_UK[] = { +#ifdef MAPCODE_SUPPORT_LANGUAGE_UK // Ukrainian + /* VAT */ "Місто Ватикан|Святий Престол", + /* MCO */ "Монако", + /* GIB */ "Гібралтар", + /* TKL */ "Токелау", + /* CCK */ "Кокосові острови|Кілінг острова", + /* BLM */ "Сен-Бартельмі", + /* NRU */ "Науру", + /* TUV */ "Тувалу", + /* MAC */ "Макао", + /* SXM */ "Сінт-Маартен", + /* MAF */ "Сен-Мартен", + /* NFK */ "Норфолк і Філіп-Айленд|Філіп-Айленд", + /* PCN */ "Піткерн", + /* BVT */ "острів Буве", + /* BMU */ "Бермудські острови", + /* IOT */ "Британська територія в Індійському океані", + /* SMR */ "Сан - Маріно", + /* GGY */ "Гернсі", + /* AIA */ "Ангілья", + /* MSR */ "Монсеррат", + /* JEY */ "Джерсі", + /* CXR */ "острів різдва", + /* WLF */ "Уолліс і Футуна|Південна Африка", + /* VGB */ "Британські Віргінські острови|Віргінські острови, Британські", + /* LIE */ "Ліхтенштейн", + /* ABW */ "Аруба", + /* MHL */ "Маршаллові острови", + /* ASM */ "Американське Самоа|Самоа, Американське", + /* COK */ "острови Кука", + /* SPM */ "Сен-П`єр і Мікелон|Мікелон", + /* NIU */ "Ніуе", + /* KNA */ "Сент-Кітс і Невіс|Невіс", + /* CYM */ "Кайманові острови", + /* BES */ "Бонайре, Сент-Естатіус і Саба|Саба|Сент-Естатіус", + /* MDV */ "Мальдіви", + /* SHN */ "Святої Єлени, Вознесіння і Трістан-да-Кунья|Вознесіння|Трістан-да-Кунья", + /* MLT */ "Мальта", + /* GRD */ "Гренада", + /* VIR */ "Американські Віргінські острови|Віргінські острови, США", + /* MYT */ "Майотта", + /* SJM */ "Шпіцберген і Ян-Маєн|Ян-Маєн", + /* VCT */ "Сент-Вінсент і Гренадіни|Гренадіни", + /* HMD */ "Острів Херд і острови Макдональд|Макдональд", + /* BRB */ "Барбадос", + /* ATG */ "Антигуа і Барбуда|Барбуда", + /* CUW */ "лікер кюрасо", + /* SYC */ "Сейшельські острови", + /* PLW */ "Палау", + /* MNP */ "Північні Маріанські острови", + /* AND */ "андорра", + /* GUM */ "Гуам", + /* IMN */ "Острів Мен", + /* LCA */ "Сент-Люсія", + /* FSM */ "Мікронезія|Федеративні Штати Мікронезії", + /* SGP */ "Сінгапур", + /* TON */ "Тонга", + /* DMA */ "Домініка", + /* BHR */ "Бахрейн", + /* KIR */ "Кірібаті", + /* TCA */ "Острови Теркс і Кайкос|Кайкос", + /* STP */ "Сан-Томе і Прінсіпі|Прінсіпі", + /* HKG */ "Гонконг", + /* MTQ */ "Мартинюк", + /* FRO */ "Фарерські острови", + /* GLP */ "Гваделупа", + /* COM */ "Коморські острови", + /* MUS */ "Маврикій", + /* REU */ "возз`єднання", + /* LUX */ "Люксембург", + /* WSM */ "Самоа", + /* SGS */ "Південна Джорджія та Південні Сандвічеві острови|Південні Сандвічеві острови", + /* PYF */ "Французька Полінезія", + /* CPV */ "Кабо-Верде", + /* TTO */ "Тринідад і Тобаго|Тобаго", + /* BRN */ "Бруней", + /* ATF */ "Французькі Південні та Антарктичні землі", + /* PRI */ "Пуерто Ріко", + /* CYP */ "Кіпр", + /* LBN */ "Ліван", + /* JAM */ "Ямайка", + /* GMB */ "Гамбія", + /* QAT */ "Катар", + /* FLK */ "Фолклендські острови", + /* VUT */ "Вануату", + /* MNE */ "Чорногорія", + /* BHS */ "Багамські о-ви", + /* TLS */ "східний Тимор", + /* SWZ */ "Свазіленд", + /* KWT */ "Кувейт", + /* FJI */ "Фіджі", + /* NCL */ "Нова Каледонія", + /* SVN */ "Словенія", + /* ISR */ "Ізраїль", + /* PSE */ "палестинські території", + /* SLV */ "Сальвадор", + /* BLZ */ "Беліз", + /* DJI */ "Джібуті", + /* MKD */ "Македонія", + /* RWA */ "Руанда", + /* HTI */ "Гаїті", + /* BDI */ "Бурунді", + /* GNQ */ "Екваторіальна Гвінея", + /* ALB */ "Албанія", + /* SLB */ "Соломонові острови", + /* ARM */ "Вірменія", + /* LSO */ "Лесото", + /* BEL */ "Бельгія", + /* MDA */ "Молдова", + /* GNB */ "Гвінея-Бісау", + /* TWN */ "Тайвань", + /* BTN */ "Бутан", + /* CHE */ "Швейцарія", + /* NLD */ "Нідерланди", + /* DNK */ "Данія", + /* EST */ "Естонія", + /* DOM */ "Домініканська республіка", + /* SVK */ "Словаччина", + /* CRI */ "Коста-Ріка", + /* BIH */ "Боснія і Герцеговина", + /* HRV */ "Хорватія", + /* TGO */ "Того", + /* LVA */ "Латвія", + /* LTU */ "Литва", + /* LKA */ "Шрі Ланка", + /* GEO */ "Грузія", + /* IRL */ "Ірландія", + /* SLE */ "Сьєрра-Леоне", + /* PAN */ "Панама", + /* CZE */ "Чеська Республіка", + /* GUF */ "Французька Гвіана", + /* ARE */ "Об`єднані Арабські Емірати", + /* AUT */ "Австрія", + /* AZE */ "Азербайджан", + /* SRB */ "Сербія", + /* JOR */ "Йорданія", + /* PRT */ "Португалія", + /* HUN */ "Угорщина", + /* KOR */ "Південна Корея", + /* ISL */ "Ісландія", + /* GTM */ "Гватемала", + /* CUB */ "Куба", + /* BGR */ "Болгарія", + /* LBR */ "Ліберія", + /* HND */ "Гондурас", + /* BEN */ "Бенін", + /* ERI */ "Еритрея", + /* MWI */ "Малаві", + /* PRK */ "Північна Корея", + /* NIC */ "Нікарагуа", + /* GRC */ "Греція", + /* TJK */ "Таджикистан", + /* BGD */ "Бангладеш", + /* NPL */ "Непал", + /* TUN */ "Туніс", + /* SUR */ "Суринам", + /* URY */ "Уругвай", + /* KHM */ "Камбоджа", + /* SYR */ "Сирія", + /* SEN */ "Сенегал", + /* KGZ */ "Киргизія", + /* BLR */ "Білорусь", + /* GUY */ "Гайана", + /* LAO */ "Лаос", + /* ROU */ "Румунія", + /* GHA */ "Гана", + /* UGA */ "Уганда", + /* GBR */ "Сполучене Королівство|Шотландія|Великобританія|Північна Ірландія|Ірландія, Північна", + /* GIN */ "Гвінея", + /* ECU */ "Еквадор", + /* ESH */ "Західна Сахара|сахрави", + /* GAB */ "Габон", + /* NZL */ "Нова Зеландія", + /* BFA */ "Буркіна-Фасо", + /* PHL */ "Філіппіни", + /* ITA */ "Італія", + /* OMN */ "Оман", + /* POL */ "Польща", + /* CIV */ "Берег Слонової Кістки", + /* NOR */ "Норвегія", + /* MYS */ "Малайзія", + /* VNM */ "В`єтнам", + /* FIN */ "Фінляндія", + /* COG */ "Конго-Браззавіль", + /* DEU */ "Німеччина", + /* JPN */ "Японія", + /* ZWE */ "Зімбабве", + /* PRY */ "Парагвай", + /* IRQ */ "Ірак", + /* MAR */ "Марокко", + /* UZB */ "Узбекистан", + /* SWE */ "Швеція", + /* PNG */ "Папуа-Нова Гвінея", + /* CMR */ "Камерун", + /* TKM */ "Туркменістан", + /* ESP */ "Іспанія", + /* THA */ "Таїланд", + /* YEM */ "Ємен", + /* FRA */ "Франція", + /* ALA */ "Аландські острови", + /* KEN */ "Кенія", + /* BWA */ "Ботсвана", + /* MDG */ "Мадагаскар", + /* UKR */ "Україна", + /* SSD */ "південний Судан", + /* CAF */ "Центрально-Африканська Республіка", + /* SOM */ "Сомалі", + /* AFG */ "Афганістан", + /* MMR */ "М`янма|Бірма", + /* ZMB */ "Замбія", + /* CHL */ "Чилі", + /* TUR */ "Туреччина", + /* PAK */ "Пакистан", + /* MOZ */ "Мозамбік", + /* NAM */ "Намібія", + /* VEN */ "Венесуела", + /* NGA */ "Нігерія", + /* TZA */ "Танзанія", + /* EGY */ "Єгипет", + /* MRT */ "Мавританія", + /* BOL */ "Болівія", + /* ETH */ "Ефіопія", + /* COL */ "Колумбія", + /* ZAF */ "Південна Африка", + /* MLI */ "Малі", + /* AGO */ "Ангола", + /* NER */ "Нігер", + /* TCD */ "Чад", + /* PER */ "Перу", + /* MNG */ "Монголія", + /* IRN */ "Іран", + /* LBY */ "Лівія", + /* SDN */ "Судан", + /* IDN */ "Індонезія", + /* DIF */ "Федеральний округ", + /* TLA */ "Тлашкала", + /* MOR */ "Морелос", + /* AGU */ "Агуаскальентес", + /* MX-CL */ "Коліма", + /* QUE */ "Керетаро", + /* HID */ "ідальго", + /* MX-MX */ "Штат Мексика", + /* TAB */ "табаско", + /* NAY */ "Наяріт", + /* GUA */ "Гуанахуато", + /* PUE */ "Пуебла", + /* YUC */ "Юкатан", + /* ROO */ "Кінтана-Роо", + /* SIN */ "Сіналоа", + /* CAM */ "Кампече", + /* MIC */ "Мічоакан", + /* SLP */ "Сан - Луїс-Потосі", + /* GRO */ "Герреро", + /* NLE */ "Нуево-Леон", + /* BCN */ "Нижня Каліфорнія", + /* VER */ "Веракрус", + /* CHP */ "Чьяпас", + /* BCS */ "Південна Нижня Каліфорнія", + /* ZAC */ "Сакатекас", + /* JAL */ "Халіско", + /* TAM */ "Тамауліпас", + /* OAX */ "Оахака", + /* DUR */ "Дуранго", + /* COA */ "Коахуіла", + /* SON */ "Сонора", + /* CHH */ "чихуахуа", + /* GRL */ "Гренландія", + /* SAU */ "Саудівська Аравія", + /* COD */ "Конго-Кіншаса", + /* DZA */ "Алжир", + /* KAZ */ "Казахстан", + /* ARG */ "Аргентина", + /* IN-DD */ "Даман і Діу", + /* IN-DN */ "Дадра і Нагархавелі", + /* IN-CH */ "Чандігарх", + /* IN-AN */ "Андаманські і Нікобарські", + /* IN-LD */ "Лакшадвип", + /* IN-DL */ "Делі", + /* IN-ML */ "Мегхалая", + /* IN-NL */ "Нагаленд", + /* IN-MN */ "Маніпур", + /* IN-TR */ "Тріпура", + /* IN-MZ */ "Мізорам", + /* IN-SK */ "Сіккім", + /* IN-PB */ "Пенджаб", + /* IN-HR */ "Харьяна", + /* IN-AR */ "Аруначал-Прадеш", + /* IN-AS */ "Ассам", + /* IN-BR */ "Біхар", + /* IN-UT */ "Уттаракханд", + /* IN-GA */ "Гоа", + /* IN-KL */ "Керала", + /* IN-TN */ "Тамілнад", + /* IN-HP */ "Хімачал-Прадеш", + /* IN-JK */ "Джамму і Кашмір", + /* IN-CT */ "Чхаттісгарх", + /* IN-JH */ "Джаркханд", + /* IN-KA */ "Карнатака", + /* IN-RJ */ "Раджастхан", + /* IN-OR */ "Орісса", + /* IN-GJ */ "Гуджарат", + /* IN-WB */ "Західна Бенгалія", + /* IN-MP */ "Мадхья-Прадеш", + /* IN-TG */ "Телінгани", + /* IN-AP */ "Андхра-Прадеш", + /* IN-MH */ "Махараштра", + /* IN-UP */ "Уттар-Прадеш", + /* IN-PY */ "Пондічеррі", + /* NSW */ "Новий Південний Уельс", + /* ACT */ "Австралійська столична територія", + /* JBT */ "Територія Джервіс-Бей", + /* AU-NT */ "Північна територія", + /* AU-SA */ "Південна Австралія", + /* TAS */ "Тасманія", + /* VIC */ "Вікторія", + /* AU-WA */ "Західна Австралія", + /* QLD */ "Квінсленд", + /* BR-DF */ "Федеральний округ", + /* BR-SE */ "Сержіпі", + /* BR-AL */ "Алагоас", + /* BR-RJ */ "Ріо-де-Жанейро", + /* BR-ES */ "Еспіріту-Санту", + /* BR-RN */ "Ріо-Гранде-ду-Норті", + /* BR-PB */ "Параїба", + /* BR-SC */ "Санта-Катаріна", + /* BR-PE */ "Пернамбуку", + /* BR-AP */ "Амапа", + /* BR-CE */ "Сеара", + /* BR-AC */ "Акрі", + /* BR-PR */ "Парана", + /* BR-RR */ "Рорайма", + /* BR-RO */ "Рондонія", + /* BR-SP */ "Сан-Паулу", + /* BR-PI */ "Піауї", + /* BR-TO */ "Токантінс", + /* BR-RS */ "Ріо-Гранде-ду-Сул", + /* BR-MA */ "Мараньян", + /* BR-GO */ "Гояс", + /* BR-MS */ "Мату-Гросу-ду-Сул", + /* BR-BA */ "Баїя", + /* BR-MG */ "Мінас-Жерайс", + /* BR-MT */ "Мату-Гросу", + /* BR-PA */ "пара", + /* BR-AM */ "Амазонас", + /* US-DC */ "Федеральний округ Колумбія", + /* US-RI */ "Род-Айленд", + /* US-DE */ "Делавер", + /* US-CT */ "Коннектикут", + /* US-NJ */ "Нью Джерсі", + /* US-NH */ "Нью-Гемпшир", + /* US-VT */ "Вермонт", + /* US-MA */ "Массачусетс", + /* US-HI */ "Гаваї", + /* US-MD */ "Меріленд", + /* US-WV */ "Західна Віргінія", + /* US-SC */ "Південна Кароліна", + /* US-ME */ "Мен", + /* US-IN */ "Індіана", + /* US-KY */ "Кентуккі", + /* US-TN */ "Теннессі", + /* US-VA */ "Віргінія", + /* US-OH */ "Огайо", + /* US-PA */ "Пенсільванія", + /* US-MS */ "Міссісіпі", + /* US-LA */ "Луїзіана", + /* US-AL */ "Алабама", + /* US-AR */ "Арканзас", + /* US-NC */ "Північна Кароліна", + /* US-NY */ "Нью-Йорк", + /* US-IA */ "Айова", + /* US-IL */ "Іллінойс", + /* US-GA */ "Грузія", + /* US-WI */ "Вісконсін", + /* US-FL */ "Флорида", + /* US-MO */ "Міссурі", + /* US-OK */ "Оклахома", + /* US-ND */ "Північна Дакота", + /* US-WA */ "Вашингтон", + /* US-SD */ "Південна Дакота", + /* US-NE */ "Небраска", + /* US-KS */ "Канзас", + /* US-ID */ "Айдахо", + /* US-UT */ "Юта", + /* US-MN */ "Міннесота", + /* US-MI */ "Мічиган", + /* US-WY */ "Вайомінг", + /* US-OR */ "Орегон", + /* US-CO */ "Колорадо", + /* US-NV */ "Невада", + /* US-AZ */ "Арізона", + /* US-NM */ "Нью-Мексико", + /* US-MT */ "Монтана", + /* US-CA */ "Каліфорнія", + /* US-TX */ "Техас", + /* US-AK */ "Аляска", + /* CA-BC */ "Британська Колумбія", + /* CA-AB */ "альберта", + /* CA-ON */ "Онтаріо", + /* CA-QC */ "Квебек", + /* CA-SK */ "Саскачеван", + /* CA-MB */ "Манітоба", + /* CA-NL */ "ньюфаундленд", + /* CA-NB */ "Нью-Брансвік", + /* CA-NS */ "Нова Шотландія", + /* CA-PE */ "Острів Принца Едуарда", + /* CA-YT */ "Юкон", + /* CA-NT */ "північно-західні території", + /* CA-NU */ "Нунавут", + /* IND */ "Індія", + /* AUS */ "Австралія", + /* BRA */ "Бразилія", + /* USA */ "США|Сполучені Штати Америки|Америка", + /* MEX */ "Мексика", + /* MOW */ "Москва", + /* SPE */ "Санкт-Петербург", + /* KGD */ "Калінінградська область", + /* RU-IN */ "Республіка Інгушетія", + /* RU-AD */ "Республіка Адигея", + /* RU-SE */ "Північна Осетія-Аланія", + /* RU-KB */ "Кабардино-Балкарська Республіка", + /* RU-KC */ "Карачаєво-Черкеська Республіка", + /* RU-CE */ "Чеченська Республіка", + /* RU-CU */ "Чуваська Республіка", + /* IVA */ "Івановська область", + /* LIP */ "Липецька область", + /* ORL */ "Орловська область", + /* TUL */ "Тульська область", + /* RU-BE */ "Бєлгородська область", + /* VLA */ "Володимирська область", + /* KRS */ "Курська область", + /* KLU */ "Калузька область", + /* RU-TT */ "Тамбовська область", + /* BRY */ "Брянська область", + /* YAR */ "Ярославська область", + /* RYA */ "Рязанська область", + /* AST */ "Астраханська область", + /* MOS */ "Московська область", + /* SMO */ "Смоленська область", + /* RU-DA */ "Республіка Дагестан", + /* VOR */ "Воронежская область", + /* NGR */ "Новгородська область", + /* PSK */ "Псковська область", + /* KOS */ "Костромська область", + /* STA */ "Ставропольський край", + /* KDA */ "Краснодарський край", + /* RU-KL */ "Республіка Калмикія", + /* TVE */ "Тверська область", + /* LEN */ "Ленінградська область", + /* ROS */ "Ростовська область", + /* VGG */ "Волгоградська область", + /* VLG */ "Вологодська область", + /* MUR */ "Мурманська область", + /* RU-KR */ "Республіка Карелія", + /* NEN */ "Ненецький автономний округ", + /* RU-KO */ "Республіка Комі", + /* ARK */ "Архангельська область", + /* RU-MO */ "Республіка Мордовія", + /* NIZ */ "Нижегородська область", + /* PNZ */ "Пензенська область", + /* RU-KI */ "Кіровська область", + /* RU-ME */ "Республіка Марій Ел", + /* ORE */ "Оренбурзька область", + /* ULY */ "Ульяновська область", + /* RU-PM */ "Пермський край", + /* RU-BA */ "Республіка Башкортостан", + /* RU-UD */ "Удмуртська Республіка", + /* RU-TA */ "Республіка Татарстан", + /* SAM */ "Самарська область", + /* SAR */ "Саратовська область", + /* YAN */ "Ямало-Ненецький", + /* RU-KM */ "Ханти-Мансійський", + /* SVE */ "Свердловська область", + /* TYU */ "Тюменська область", + /* KGN */ "Курганська область", + /* RU-CH */ "Челябінська область", + /* RU-BU */ "Республіка Бурятія", + /* ZAB */ "Забайкальський край", + /* IRK */ "Іркутська область", + /* NVS */ "Новосибірська область", + /* TOM */ "Томська область", + /* OMS */ "Омська область", + /* RU-KK */ "Республіка Хакасія", + /* KEM */ "Кемеровська область", + /* RU-AL */ "Республіка Алтай", + /* ALT */ "Алтайський край", + /* RU-TY */ "Республіка Тива", + /* KYA */ "Красноярський край", + /* MAG */ "Магаданська область", + /* CHU */ "Чукотський округ", + /* KAM */ "Камчатський край", + /* SAK */ "Сахалінська область", + /* RU-PO */ "Приморський край", + /* YEV */ "Єврейська автономна область", + /* KHA */ "Хабаровський край", + /* AMU */ "Амурська область", + /* RU-SA */ "Республіка Саха|Якутія", + /* CAN */ "Канада", + /* RUS */ "Росія", + /* CN-SH */ "Шанхай", + /* CN-TJ */ "Тяньцзінь", + /* CN-BJ */ "Пекін", + /* CN-HI */ "Хайнань", + /* CN-NX */ "Нінся-Хуейський", + /* CN-CQ */ "Чунцин", + /* CN-ZJ */ "Чжецзян", + /* CN-JS */ "Цзянсу", + /* CN-FJ */ "Фуцзянь", + /* CN-AH */ "Аньхой", + /* CN-LN */ "Ляонін", + /* CN-SD */ "Шаньдун", + /* CN-SX */ "Шаньсі", + /* CN-JX */ "Цзянси", + /* CN-HA */ "Хенань", + /* CN-GZ */ "Гуйчжоу", + /* CN-GD */ "Гуандун", + /* CN-HB */ "Хубей", + /* CN-JL */ "Цзілінь", + /* CN-HE */ "Хебей", + /* CN-SN */ "Шеньсі", + /* CN-NM */ "Внутрішня Монголія", + /* CN-HL */ "Хейлунцзян", + /* CN-HN */ "Хунань", + /* CN-GX */ "Гуансі-Чжуанський", + /* CN-SC */ "Сичуань", + /* CN-YN */ "Юньнань", + /* CN-XZ */ "Тибетський автономний район|Тибет", + /* CN-GS */ "Ганьсу", + /* CN-QH */ "Цинхай", + /* CN-XJ */ "Синьцзян-Уйгурський", + /* CHN */ "Китай", + /* UMI */ "США Зовнішні малі острови", + /* CPT */ "острів Клиппертон", + /* ATA */ "Антарктида", + /* AAA */ "Міжнародний|Світ|Земля" +#else // MAPCODE_SUPPORT_LANGUAGE_UK + NULL +#endif // MAPCODE_SUPPORT_LANGUAGE_UK +}; + +#ifdef __cplusplus +} +#endif + +#endif // __INTERNAL_TERRITORY_NAMES_UK_H__ diff --git a/mapcodelib/internal_territory_search.h b/mapcodelib/internal_territory_search.h index 6a0cb20..7e573e9 100644 --- a/mapcodelib/internal_territory_search.h +++ b/mapcodelib/internal_territory_search.h @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __INTERNAL_TERRITORY_SEARCH_H__ #define __INTERNAL_TERRITORY_SEARCH_H__ diff --git a/mapcodelib/mapcode_alphabets.h b/mapcodelib/mapcode_alphabets.h index a8d35da..7ffab2b 100644 --- a/mapcodelib/mapcode_alphabets.h +++ b/mapcodelib/mapcode_alphabets.h @@ -1,27 +1,26 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __MAPCODE_ALPHABETS_H__ #define __MAPCODE_ALPHABETS_H__ #ifdef __cplusplus extern "C" { + #endif /** - * Mapcodes are suppored in a variety of alphabets, using UTF16. The following + * Mapcodes are supported in a variety of alphabets, using UTF-16. The following * enum specifies the alphabets (or scripts, as they are also called). * The 'default' alphabet is Roman, which is always supported. Other * alphabets may not be supported by every application that accepts @@ -57,7 +56,7 @@ enum Alphabet { ALPHABET_ODIA, ALPHABET_KANNADA, ALPHABET_GUJARATI, - _ALPHABET_MAX, + _ALPHABET_MAX }; #ifdef __cplusplus @@ -65,4 +64,3 @@ enum Alphabet { #endif #endif // __MAPCODE_ALPHABETS_H__ - diff --git a/mapcodelib/mapcode_legacy.c b/mapcodelib/mapcode_legacy.c index c024ca9..6587ece 100644 --- a/mapcodelib/mapcode_legacy.c +++ b/mapcodelib/mapcode_legacy.c @@ -1,51 +1,49 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #include #include #include "mapcode_legacy.h" -#include "mapcoder.h" -#include "internal_alphabet_recognizer.h" + /** * Include global legacy buffers. These are not thread-safe! */ static Mapcodes GLOBAL_RESULT; static char GLOBAL_MAKEISO_BUFFER[2 * (MAX_ISOCODE_LEN + 1)]; -static char *GLOBAL_MAKEISO_PTR; +static char* GLOBAL_MAKEISO_PTR = GLOBAL_MAKEISO_BUFFER + (MAX_ISOCODE_LEN + 1); int encodeLatLonToMapcodes_Deprecated( - char **mapcodesAndTerritories, - double latDeg, - double lonDeg, - enum Territory territory, - int extraDigits) { - char **v = mapcodesAndTerritories; + char** mapcodesAndTerritories, + double latDeg, + double lonDeg, + enum Territory territory, + int extraDigits) { + char** v = mapcodesAndTerritories; encodeLatLonToMapcodes(&GLOBAL_RESULT, latDeg, lonDeg, territory, extraDigits); if (v) { int i; for (i = 0; i < GLOBAL_RESULT.count; i++) { - char *s = &GLOBAL_RESULT.mapcode[i][0]; - char *p = strchr(s, ' '); + char* s = &GLOBAL_RESULT.mapcode[i][0]; + char* p = strchr(s, ' '); if (p == NULL) { - v[i * 2 + 1] = (char *) "AAA"; + v[i * 2 + 1] = (char*)"AAA"; v[i * 2] = s; - } else { + } + else { *p++ = 0; v[i * 2 + 1] = s; v[i * 2] = p; @@ -56,15 +54,16 @@ int encodeLatLonToMapcodes_Deprecated( } -const char *convertTerritoryCodeToIsoName_Deprecated( - enum Territory territoryContext, - int useShortName) { +const char* convertTerritoryCodeToIsoName_Deprecated( + enum Territory territoryContext, + int useShortName) { if (GLOBAL_MAKEISO_PTR == GLOBAL_MAKEISO_BUFFER) { GLOBAL_MAKEISO_PTR = GLOBAL_MAKEISO_BUFFER + (MAX_ISOCODE_LEN + 1); - } else { + } + else { GLOBAL_MAKEISO_PTR = GLOBAL_MAKEISO_BUFFER; } - return (const char *) getTerritoryIsoName(GLOBAL_MAKEISO_PTR, territoryContext, useShortName); + return (const char*)getTerritoryIsoName(GLOBAL_MAKEISO_PTR, territoryContext, useShortName); } @@ -75,19 +74,18 @@ static char GLOBAL_ASCII_BUFFER[MAX_MAPCODE_RESULT_LEN]; static UWORD GLOBAL_UTF16_BUFFER[MAX_MAPCODE_RESULT_LEN]; -const char *decodeToRoman_Deprecated(const UWORD *utf16String) { +const char* decodeToRoman_Deprecated(const UWORD* utf16String) { return convertToRoman(GLOBAL_ASCII_BUFFER, MAX_MAPCODE_RESULT_LEN, utf16String); } -const UWORD *encodeToAlphabet_Deprecated(const char *asciiString, +const UWORD* encodeToAlphabet_Deprecated(const char* asciiString, enum Alphabet alphabet) { return convertToAlphabet(GLOBAL_UTF16_BUFFER, MAX_MAPCODE_RESULT_LEN, asciiString, alphabet); } -char *convertToRoman(char *asciiBuffer, int maxLength, const UWORD *unicodeBuffer) { - +char* convertToRoman(char* asciiBuffer, int maxLength, const UWORD* unicodeBuffer) { MapcodeElements mapcodeElements; double lat, lon; enum MapcodeError err; @@ -99,13 +97,13 @@ char *convertToRoman(char *asciiBuffer, int maxLength, const UWORD *unicodeBuffe } if (!err) { char romanized[MAX_MAPCODE_RESULT_LEN]; - sprintf(romanized, "%s%s%s%s%s", - mapcodeElements.territoryISO, - *mapcodeElements.territoryISO ? " " : "", - mapcodeElements.properMapcode, - *mapcodeElements.precisionExtension ? "-" : "", - mapcodeElements.precisionExtension); - if ((int) strlen(romanized) < maxLength) { + snprintf(romanized, sizeof(romanized), "%s%s%s%s%s", + mapcodeElements.territoryISO, + *mapcodeElements.territoryISO ? " " : "", + mapcodeElements.properMapcode, + *mapcodeElements.precisionExtension ? "-" : "", + mapcodeElements.precisionExtension); + if ((int)strlen(romanized) < maxLength) { strcpy(asciiBuffer, romanized); } } diff --git a/mapcodelib/mapcode_legacy.h b/mapcodelib/mapcode_legacy.h index 5318558..566a1a7 100644 --- a/mapcodelib/mapcode_legacy.h +++ b/mapcodelib/mapcode_legacy.h @@ -1,24 +1,23 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __MAPCODE_LEGACY_H__ #define __MAPCODE_LEGACY_H__ #ifdef __cplusplus extern "C" { + #endif #include "mapcoder.h" @@ -29,8 +28,8 @@ extern "C" { /** * List of #defines to support legacy systems. */ -#define decodeMapcodeToLatLon(latDeg, lonDeg, mapcode, territory) decodeUtf8MapcodeToLatLon(latDeg, lonDeg, NULL, mapcode, territory) -#define compareWithMapcodeFormat(utf8, canContainTerritory) compareUtf8WithMapcodeFormat(utf8) +#define decodeMapcodeToLatLon(latDeg, lonDeg, mapcode, territory) decodeMapcodeToLatLonUtf8(latDeg, lonDeg, mapcode, territory, NULL) +#define compareWithMapcodeFormat(utf8, canContainTerritory) compareWithMapcodeFormatUtf8(utf8) #define convertTerritoryIsoNameToCode getTerritoryCode #define coord2mc(results, lat, lon, territory) encodeLatLonToMapcodes_Deprecated(results, lat, lon,territory, 0) @@ -50,6 +49,11 @@ extern "C" { #define COMPARE_MAPCODE_MISSING_CHARACTERS ERR_MAPCODE_INCOMPLETE +#define MAX_PROPER_MAPCODE_LEN MAX_PROPER_MAPCODE_ASCII_LEN +#define MAX_ISOCODE_LEN MAX_ISOCODE_ASCII_LEN +#define MAX_CLEAN_MAPCODE_LEN MAX_CLEAN_MAPCODE_ASCII_LEN +#define MAX_MAPCODE_RESULT_LEN MAX_MAPCODE_RESULT_ASCII_LEN + #define MAX_LANGUAGES _ALPHABET_MAX #define MAPCODE_LANGUAGE_ROMAN ALPHABET_ROMAN #define MAPCODE_LANGUAGE_GREEK ALPHABET_GREEK @@ -76,9 +80,9 @@ extern "C" { * Encode a latitude, longitude pair (in degrees) to a set of Mapcodes. Not thread-safe! * * Arguments: - * mapcodesAndTerritories - Results set of mapcodes and territories. + * mapcodesAndTerritories - Result set of mapcodes and territories. * The caller must pass an array of at least 2 * MAX_NR_OF_MAPCODE_RESULTS - * string points, which must NOT be allocated or de-allocated by the caller. + * string pointers, which must NOT be allocated or de-allocated by the caller. * The resulting strings are statically allocated by the library and will be overwritten * by the next call to this method! * lat - Latitude, in degrees. Range: -90..90. @@ -90,34 +94,34 @@ extern "C" { * make them represent the coordinate more accurately. * * Returns: - * Number of results stored in parameter results. Always >= 0 (0 if no encoding was possible or an error occurred). - * The results are stored as pairs (Mapcode, territory name) in: + * Number of results (N). Always >= 0 (0 if no encoding was possible or an error occurred). + * The results are stored as pairs (Mapcode, territory name) in mapcodesAndTerritories: * (results[0], results[1])...(results[(2 * N) - 2], results[(2 * N) - 1]) */ -int encodeLatLonToMapcodes_Deprecated( // Warning: this method is deprecated and not thread-safe. - char **mapcodesAndTerritories, - double latDeg, - double lonDeg, - enum Territory territory, - int extraDigits); +int encodeLatLonToMapcodes_Deprecated( // Warning: this method is deprecated and not thread-safe. + char** mapcodesAndTerritories, + double latDeg, + double lonDeg, + enum Territory territory, + int extraDigits); /** * DEPRECATED OLD VARIANT, NOT THREAD-SAFE: * * Convert a territory to a territory name. - * Non-threadsafe routine which uses static storage, overwritten at each call. + * Non-thread-safe routine which uses static storage, overwritten at each call. * * Arguments: * territory - Territory to get the name of. - * userShortName - Pass 0 for full name, 1 for short name (state codes may be ambiguous). + * useShortName - Pass 0 for full name, 1 for short name (state codes may be ambiguous). * * Returns: * Pointer to result. String will be empty if territory illegal. */ -const char *convertTerritoryCodeToIsoName_Deprecated( - enum Territory territory, - int useShortName); +const char* convertTerritoryCodeToIsoName_Deprecated( + enum Territory territory, + int useShortName); /** @@ -131,8 +135,7 @@ const char *convertTerritoryCodeToIsoName_Deprecated( * Returns: * Pointer to same buffer as asciiString (allocated by caller), which holds the result. */ -char *convertToRoman(char *asciiString, int maxLength, const UWORD *utf16String); - +char* convertToRoman(char* asciiString, int maxLength, const UWORD* utf16String); /** @@ -145,9 +148,9 @@ char *convertToRoman(char *asciiString, int maxLength, const UWORD *utf16String) * alphabet - Alphabet to use. * * Returns: - * Encoded Unicode string, points at buffer from 'utf16String', allocated/deallocated by caller. + * Encoded Unicode string, points at buffer from 'utf16String', allocated and deallocated by the caller. */ -UWORD *convertToAlphabet(UWORD *utf16String, int maxLength, const char *asciiString, enum Alphabet alphabet); +UWORD* convertToAlphabet(UWORD* utf16String, int maxLength, const char* asciiString, enum Alphabet alphabet); /** @@ -159,7 +162,7 @@ UWORD *convertToAlphabet(UWORD *utf16String, int maxLength, const char *asciiStr * String must NOT be de-allocated by the caller. * It will be overwritten by a subsequent call to this method! */ -const char *decodeToRoman_Deprecated(const UWORD *utf16String); +const char* decodeToRoman_Deprecated(const UWORD* utf16String); /** @@ -170,7 +173,7 @@ const char *decodeToRoman_Deprecated(const UWORD *utf16String); * String must NOT be de-allocated by the caller. * It will be overwritten by a subsequent call to this method! */ -const UWORD *encodeToAlphabet_Deprecated(const char *asciiString, enum Alphabet alphabet); +const UWORD* encodeToAlphabet_Deprecated(const char* asciiString, enum Alphabet alphabet); #ifdef __cplusplus diff --git a/mapcodelib/mapcode_territories.h b/mapcodelib/mapcode_territories.h index c23c7d1..95e1da0 100644 --- a/mapcodelib/mapcode_territories.h +++ b/mapcodelib/mapcode_territories.h @@ -1,23 +1,22 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __MAPCODE_TERRITORIES_H__ #define __MAPCODE_TERRITORIES_H__ #ifdef __cplusplus extern "C" { + #endif // *** GENERATED FILE (coords.cpp data2.3.0), DO NOT CHANGE OR PRETTIFY *** @@ -570,4 +569,3 @@ enum Territory { #endif #endif // __MAPCODE_TERRITORIES_H__ - diff --git a/mapcodelib/mapcoder.c b/mapcodelib/mapcoder.c index 39acb87..9c6ebf5 100644 --- a/mapcodelib/mapcoder.c +++ b/mapcodelib/mapcoder.c @@ -1,39 +1,117 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/** + * @file mapcoder.c + * @brief Core implementation of the Mapcode encoding and decoding system + * + * This file contains the complete implementation of the Mapcode system, which provides + * a way to encode any location on Earth into a short alphanumeric code and decode + * it back to precise coordinates. * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at + * Key functionality includes: + * - Encoding latitude/longitude coordinates to mapcode strings + * - Decoding mapcode strings back to coordinates + * - Territory-based encoding for shorter codes within specific regions + * - Support for high-precision encoding with extra digits + * - Multi-alphabet support for international usage + * - Territory name handling and lookup functions * - * http://www.apache.org/licenses/LICENSE-2.0 + * The encoding uses a sophisticated grid system that divides the Earth's surface + * into increasingly fine grids, with special handling for different territory + * shapes and boundary conditions. * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * @author Stichting Mapcode Foundation + * @version See MAPCODE_C_VERSION constant */ #include // strlen strcpy strcat memcpy memmove strstr strchr memcmp #include // atof #include // toupper -#include // floor +#include // floor fabs #include "mapcoder.h" #include "internal_data.h" #include "internal_iso3166_data.h" -#include "internal_territory_names_english.h" #include "internal_territory_alphabets.h" #include "internal_territory_names_local.h" #include "internal_alphabet_recognizer.h" +#include "internal_territory_names_af.h" +#include "internal_territory_names_ar.h" +#include "internal_territory_names_be.h" +#include "internal_territory_names_cn.h" +#include "internal_territory_names_cs.h" +#include "internal_territory_names_da.h" +#include "internal_territory_names_de.h" +#include "internal_territory_names_en.h" +#include "internal_territory_names_es.h" +#include "internal_territory_names_fi.h" +#include "internal_territory_names_fr.h" +#include "internal_territory_names_he.h" +#include "internal_territory_names_hi.h" +#include "internal_territory_names_hr.h" +#include "internal_territory_names_id.h" +#include "internal_territory_names_it.h" +#include "internal_territory_names_ja.h" +#include "internal_territory_names_ko.h" +#include "internal_territory_names_nl.h" +#include "internal_territory_names_no.h" +#include "internal_territory_names_pl.h" +#include "internal_territory_names_pt.h" +#include "internal_territory_names_ru.h" +#include "internal_territory_names_sv.h" +#include "internal_territory_names_sw.h" +#include "internal_territory_names_tr.h" +#include "internal_territory_names_uk.h" +/** + * @section exported_constants Exported Constants + * The constants are also exported as variables to allow other languages to use them. + * This provides runtime access to compile-time constants for language bindings. + */ +char* _MAPCODE_C_VERSION = MAPCODE_C_VERSION; // Version string of the mapcode library +int _MAX_NR_OF_MAPCODE_RESULTS = MAX_NR_OF_MAPCODE_RESULTS; // Maximum number of mapcode results returned +int _MAX_PRECISION_DIGITS = MAX_PRECISION_DIGITS; // Maximum extra precision digits supported +int _MAX_PROPER_MAPCODE_ASCII_LEN = MAX_PROPER_MAPCODE_ASCII_LEN; // Maximum length of a proper mapcode in ASCII +int _MAX_ISOCODE_ASCII_LEN = MAX_ISOCODE_ASCII_LEN; // Maximum length of ISO territory code +int _MAX_CLEAN_MAPCODE_ASCII_LEN = MAX_CLEAN_MAPCODE_ASCII_LEN; // Maximum length of clean mapcode (no territory) +int _MAX_MAPCODE_RESULT_ASCII_LEN = MAX_MAPCODE_RESULT_ASCII_LEN; // Maximum length of complete result string +int _MAX_TERRITORY_FULLNAME_UTF8_LEN = MAX_TERRITORY_FULLNAME_UTF8_LEN; // Maximum territory name length in UTF-8 +int _MAX_MAPCODE_RESULT_UTF8_LEN = MAX_MAPCODE_RESULT_UTF8_LEN; // Maximum result length in UTF-8 +int _MAX_MAPCODE_RESULT_UTF16_LEN = MAX_MAPCODE_RESULT_UTF16_LEN; // Maximum result length in UTF-16 +int _MAX_ALPHABETS_PER_TERRITORY = MAX_ALPHABETS_PER_TERRITORY; // Maximum alphabets supported per territory +/** + * @section debug_system Debug and Assertion System + * Debug mode provides runtime assertion checking to catch programming errors + * during development and testing. + */ #ifdef DEBUG #include - -void _TestAssert(int iCondition, const char *cstrFile, int iLine) { +/** + * @brief Debug assertion function that tracks and reports failed conditions + * @param iCondition The condition to test (should be true) + * @param cstrFile Source file where assertion occurred + * @param iLine Line number where assertion occurred + * + * This function provides detailed error reporting when assertions fail in debug mode. + * It keeps track of assertion failures and terminates the program after too many + * failures to prevent cascading errors. + */ +void _TestAssert(int iCondition, const char* cstrFile, int iLine) { static int nrAsserts = 0; if (!iCondition) { fprintf(stderr, "** Assertion failed: file \"%s\", line %d\n", cstrFile, iLine); @@ -45,9 +123,10 @@ void _TestAssert(int iCondition, const char *cstrFile, int iLine) { } } - +// In debug mode, assertions are active and report failures #define ASSERT(condition) _TestAssert((int) (condition), __FILE__, (int) __LINE__) #else +// In release mode, assertions are compiled out for performance #define ASSERT(condition) #endif @@ -62,99 +141,346 @@ void _TestAssert(int iCondition, const char *cstrFile, int iLine) { #endif -#define IS_NAMELESS(m) (TERRITORY_BOUNDARIES[m].flags & 64) -#define IS_RESTRICTED(m) (TERRITORY_BOUNDARIES[m].flags & 512) -#define IS_SPECIAL_SHAPE(m) (TERRITORY_BOUNDARIES[m].flags & 1024) -#define REC_TYPE(m) ((TERRITORY_BOUNDARIES[m].flags >> 7) & 3) -#define SMART_DIV(m) (TERRITORY_BOUNDARIES[m].flags >> 16) -#define HEADER_LETTER(m) (ENCODE_CHARS[(TERRITORY_BOUNDARIES[m].flags >> 11) & 31]) +/** + * @section territory_flag_macros Territory Boundary Flag Extraction Macros + * These macros extract specific information from the flags field of territory boundary records. + * Each territory has flags that encode various properties used during encoding/decoding. + */ +#define IS_NAMELESS(m) (TERRITORY_BOUNDARIES[m].flags & 64) // Territory uses nameless encoding (bit 6) +#define IS_RESTRICTED(m) (TERRITORY_BOUNDARIES[m].flags & 512) // Territory has access restrictions (bit 9) +#define IS_SPECIAL_SHAPE(m) (TERRITORY_BOUNDARIES[m].flags & 1024) // Territory has non-standard shape (bit 10) +#define REC_TYPE(m) ((TERRITORY_BOUNDARIES[m].flags >> 7) & 3) // Record type (bits 7-8): grid encoding method +#define SMART_DIV(m) ((int)((unsigned int)(TERRITORY_BOUNDARIES[m].flags) >> 16)) // Smart divider value (bits 16+): grid subdivision +#define HEADER_LETTER(m) (ENCODE_CHARS[(TERRITORY_BOUNDARIES[m].flags >> 11) & 31]) // Header letter for encoding (bits 11-15) -#define TOKENSEP 0 -#define TOKENDOT 1 -#define TOKENCHR 2 -#define TOKENVOWEL 3 -#define TOKENZERO 4 -#define TOKENHYPH 5 +/** + * @section parsing_tokens Token Types for Mapcode Parsing + * These constants define different types of tokens encountered during mapcode parsing. + */ +#define TOKENSEP 0 // Separator character (space, hyphen, etc.) +#define TOKENDOT 1 // Dot character '.' +#define TOKENCHR 2 // Regular character (consonant or digit) +#define TOKENVOWEL 3 // Vowel character (A, E, U) +#define TOKENZERO 4 // Zero digit '0' +#define TOKENHYPH 5 // Hyphen character '-' -#define STATE_GO 31 +/** + * @section parsing_state Parsing State Constants + */ +#define STATE_GO 31 // Active parsing state identifier -#define MATH_PI 3.14159265358979323846 -#define MAX_PRECISION_FACTOR 810000 // 30 to the power (MAX_PRECISION_DIGITS/2). +/** + * @section mathematical_constants Mathematical and Earth Constants + * Fundamental constants used in coordinate calculations and grid mathematics. + */ +#define MATH_PI 3.14159265358979323846 // High-precision value of π +#define MAX_PRECISION_FACTOR 810000 // 30^(MAX_PRECISION_DIGITS/2) - base precision factor -// Radius of Earth. -#define EARTH_RADIUS_X_METERS 6378137 -#define EARTH_RADIUS_Y_METERS 6356752 +// Earth's radius in meters (WGS84 ellipsoid approximation) +#define EARTH_RADIUS_X_METERS 6378137 // Equatorial radius (semi-major axis) +#define EARTH_RADIUS_Y_METERS 6356752 // Polar radius (semi-minor axis) -// Circumference of Earth. -#define EARTH_CIRCUMFERENCE_X (EARTH_RADIUS_X_METERS * 2 * MATH_PI) -#define EARTH_CIRCUMFERENCE_Y (EARTH_RADIUS_Y_METERS * 2 * MATH_PI) +// Earth's circumference in meters +#define EARTH_CIRCUMFERENCE_X (EARTH_RADIUS_X_METERS * 2 * MATH_PI) // Equatorial circumference +#define EARTH_CIRCUMFERENCE_Y (EARTH_RADIUS_Y_METERS * 2 * MATH_PI) // Meridional circumference -#define MICROLAT_TO_FRACTIONS_FACTOR ((double) MAX_PRECISION_FACTOR) -#define MICROLON_TO_FRACTIONS_FACTOR (4.0 * MAX_PRECISION_FACTOR) +/** + * @section coordinate_conversion Coordinate Conversion Factors + * Factors for converting between different coordinate representations. + */ +#define MICROLAT_TO_FRACTIONS_FACTOR ((double) MAX_PRECISION_FACTOR) // Convert latitude microdegrees to fractions +#define MICROLON_TO_FRACTIONS_FACTOR (4.0 * MAX_PRECISION_FACTOR) // Convert longitude microdegrees to fractions + +/** + * @section grid_encoding_constants Grid and Encoding Constants + * These constants define the fundamental grid structure used in mapcode encoding. + * The mapcode system uses a base-31 grid system that recursively subdivides space. + */ +#define GRID_SIZE_31 31 // Base grid size: 31x31 grid cells (base-31 encoding) +#define GRID_SIZE_961 961 // 31^2 = 961 - second level grid size +#define GRID_SIZE_962 962 // 961 + 1 - used for boundary calculations +#define GRID_SIZE_SQUARED (961 * 961) // 961^2 - third level grid size for fine precision +#define MAX_NAMELESS_RECORDS 62 // Maximum nameless territory records in subdivision +#define Y_DIVIDER 90 // Standard latitude divider for grid calculations +#define SPECIAL_CODEX_21 21 // Special encoding method identifier (type 21) +#define SPECIAL_CODEX_22 22 // Special encoding method identifier (type 22) +#define SPECIAL_CODEX_13 13 // Special encoding method identifier (type 13) +#define SPECIAL_CODEX_14 14 // Special encoding method identifier (type 14) +#define GRID_MULTIPLIER_16 16 // Multiplier for grid offset calculations -#define FLAG_UTF8_STRING 0 // interpret pointer a utf8 characters -#define FLAG_UTF16_STRING 1 // interpret pointer a UWORD* to utf16 characters +/** + * @section string_encoding_flags String Encoding Type Flags + * Flags to distinguish between different string encoding formats. + */ +#define FLAG_UTF8_STRING 0 // Interpret string pointer as UTF-8 characters +#define FLAG_UTF16_STRING 1 // Interpret string pointer as UTF-16 characters -// Meters per degree latitude is fixed. For longitude: use factor * cos(midpoint of two degree latitudes). -static const double METERS_PER_DEGREE_LAT = EARTH_CIRCUMFERENCE_Y / 360.0; -static const double METERS_PER_DEGREE_LON = EARTH_CIRCUMFERENCE_X / 360.0; +/** + * @section distance_calculation Distance Calculation Constants + * Meters per degree latitude is constant globally. For longitude, the actual + * distance varies by latitude, so use factor * cos(midpoint_latitude). + */ +static const double METERS_PER_DEGREE_LAT = EARTH_CIRCUMFERENCE_Y / 360.0; // ~111,319 meters per degree latitude +static const double METERS_PER_DEGREE_LON = EARTH_CIRCUMFERENCE_X / 360.0; // ~111,320 meters per degree longitude at equator -static const int DEBUG_STOP_AT = -1; // to externally test-restrict internal encoding, do not use! +/** + * @section debug_control Debug Control Variables + */ +static const int DEBUG_STOP_AT = -1; // Internal debug limit for encoding tests (do not use in production!) -// important information about the 8 parents -static const char *PARENTS_3 = "USA,IND,CAN,AUS,MEX,BRA,RUS,CHN,"; -static const char *PARENTS_2 = "US,IN,CA,AU,MX,BR,RU,CN,"; +/** + * @section locale_support Locale and Language Support Structures + * These structures support multi-language territory names for international usage. + */ + +/** + * @brief Registry item linking a locale identifier to territory name translations + * @param locale Two-character locale identifier (e.g., "EN", "FR", "DE") + * @param territoryFullNames Array of translated territory names for this locale + */ +typedef struct { + const char* locale; // Language/locale identifier + const char** territoryFullNames; // Array of territory names in this language +} LocaleRegistryItem; + +/** + * @brief Registry of supported locales and their territory name translations + * This array maps two-character locale codes to arrays of translated territory names. + * Supports major world languages for international mapcode applications. + */ +static const LocaleRegistryItem LOCALE_REGISTRY[] = { + {"AF", TERRITORY_FULL_NAME_AF}, // Afrikaans + {"AR", TERRITORY_FULL_NAME_AR}, // Arabic + {"BE", TERRITORY_FULL_NAME_BE}, // Belarusian + {"CN", TERRITORY_FULL_NAME_CN}, // Chinese (Simplified) + {"CS", TERRITORY_FULL_NAME_CS}, // Czech + {"DA", TERRITORY_FULL_NAME_DA}, // Danish + {"DE", TERRITORY_FULL_NAME_DE}, // German + {"EN", TERRITORY_FULL_NAME_EN}, // English + {"ES", TERRITORY_FULL_NAME_ES}, // Spanish + {"FI", TERRITORY_FULL_NAME_FI}, // Finnish + {"FR", TERRITORY_FULL_NAME_FR}, // French + {"HE", TERRITORY_FULL_NAME_HE}, // Hebrew + {"HI", TERRITORY_FULL_NAME_HI}, // Hindi + {"HR", TERRITORY_FULL_NAME_HR}, // Croatian + {"ID", TERRITORY_FULL_NAME_ID}, // Indonesian + {"IT", TERRITORY_FULL_NAME_IT}, // Italian + {"JA", TERRITORY_FULL_NAME_JA}, // Japanese + {"KO", TERRITORY_FULL_NAME_KO}, // Korean + {"NL", TERRITORY_FULL_NAME_NL}, // Dutch + {"NO", TERRITORY_FULL_NAME_NO}, // Norwegian + {"PT", TERRITORY_FULL_NAME_PT}, // Portuguese + {"PL", TERRITORY_FULL_NAME_PL}, // Polish + {"RU", TERRITORY_FULL_NAME_RU}, // Russian + {"SV", TERRITORY_FULL_NAME_SV}, // Swedish + {"SW", TERRITORY_FULL_NAME_SW}, // Swahili + {"TR", TERRITORY_FULL_NAME_TR}, // Turkish + {"UK", TERRITORY_FULL_NAME_UK} // Ukrainian +}; + +/** + * @section parent_territories Parent Territory Information + * The 8 major parent territories that contain subdivisions with shorter mapcodes. + * These large countries/regions are subdivided to allow shorter codes within them. + */ + +/** + * @brief Three-letter ISO codes for parent territories + * Comma-separated string of 3-letter ISO codes for the 8 major parent territories + */ +static const char* PARENTS_3 = "USA,IND,CAN,AUS,MEX,BRA,RUS,CHN,"; + +/** + * @brief Two-letter ISO codes for parent territories + * Comma-separated string of 2-letter ISO codes corresponding to PARENTS_3 + */ +static const char* PARENTS_2 = "US,IN,CA,AU,MX,BR,RU,CN,"; + +/** + * @brief Territory enumeration values for parent territories + * Array mapping parent territory numbers (1-8) to their Territory enum values. + * Index 0 is TERRITORY_NONE, indices 1-8 are the 8 parent territories. + */ static const enum Territory PARENT_NR[9] = { - TERRITORY_NONE, - TERRITORY_USA, - TERRITORY_IND, - TERRITORY_CAN, - TERRITORY_AUS, - TERRITORY_MEX, - TERRITORY_BRA, - TERRITORY_RUS, - TERRITORY_CHN + TERRITORY_NONE, // 0 - no parent + TERRITORY_USA, // 1 - United States of America + TERRITORY_IND, // 2 - India + TERRITORY_CAN, // 3 - Canada + TERRITORY_AUS, // 4 - Australia + TERRITORY_MEX, // 5 - Mexico + TERRITORY_BRA, // 6 - Brazil + TERRITORY_RUS, // 7 - Russia + TERRITORY_CHN // 8 - China }; -// base-31 alphabet, digits (0-9), consonants (10-30), vowels (31-33) -static const char ENCODE_CHARS[34] = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', - 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', - 'A', 'E', 'U'}; +/** + * @section base31_encoding Base-31 Encoding Character Set + * The mapcode system uses a base-31 alphabet for compact encoding. + * Character set is designed to avoid ambiguous characters and improve readability. + */ +/** + * @brief Base-31 encoding alphabet used for mapcode generation + * + * Character mapping: + * - Positions 0-9: Digits '0'-'9' + * - Positions 10-30: Consonants 'B','C','D','F','G','H','J','K','L','M','N','P','Q','R','S','T','V','W','X','Y','Z' + * - Positions 31-33: Vowels 'A','E','U' (used for special purposes) + * + * Notable exclusions: 'I' and 'O' are excluded to avoid confusion with '1' and '0' + */ +static const char ENCODE_CHARS[34] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', // Digits (0-9) + 'B', 'C', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'M', // Consonants (10-19) + 'N', 'P', 'Q', 'R', 'S', 'T', 'V', 'W', 'X', 'Y', 'Z', // Consonants (20-30) + 'A', 'E', 'U' // Vowels (31-33) +}; -static signed char decodeChar(const char ch) { - // base-31 value of ascii character (negative for illegal characters) - // special cases -2, -3, -4 for vowels; o and i interpreted as 0 and 1. - static const signed char decode_chars[256] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 32 - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, // 48 - -1, -2, 10, 11, 12, -3, 13, 14, 15, 1, 16, 17, 18, 19, 20, 0, // 64 - 21, 22, 23, 24, 25, -4, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, // 80 - -1, -2, 10, 11, 12, -3, 13, 14, 15, 1, 16, 17, 18, 19, 20, 0, // 96 - 21, 22, 23, 24, 25, -4, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, // 112 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 128 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 144 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 176 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 192 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 208 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 224 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // 240 - }; - return decode_chars[(unsigned char) ch]; // ch can be negative, must be fit to range 0-255. -} /////////////////////////////////////////////////////////////////////////////////////////////// // -// distanceInMeters +// PRECOMPUTED COMPANION TABLES +// +// Derived once from TERRITORY_BOUNDARIES.flags; queried in hot encode/decode loops +// to avoid repeated bit-masking on the same record per iteration. // /////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC - returns distance (in meters) between two coordinates (in degrees) +#define KIND_BIT_NAMELESS 0x01u +#define KIND_BIT_RESTRICTED 0x02u +#define KIND_BIT_SPECIAL_SHAPE 0x04u + +static unsigned char RECORD_CODEX[MAPCODE_BOUNDARY_MAX + 1]; +static unsigned char RECORD_REC_TYPE[MAPCODE_BOUNDARY_MAX + 1]; +static unsigned char RECORD_KIND[MAPCODE_BOUNDARY_MAX + 1]; +static unsigned char RECORD_HEADER_LETTER[MAPCODE_BOUNDARY_MAX + 1]; +static unsigned short RECORD_SMART_DIV[MAPCODE_BOUNDARY_MAX + 1]; + +#define TERRITORY_TABLE_SIZE (_TERRITORY_MAX - _TERRITORY_MIN) +static int TERRITORY_FIRST_NAMELESS[TERRITORY_TABLE_SIZE]; +static int TERRITORY_NAMELESS_COUNT[TERRITORY_TABLE_SIZE]; + +/* Not thread-safe for concurrent first call. Duplicate concurrent init writes + identical values so results are logically correct, but callers must ensure + the library is initialized before spawning threads, or initialize once + explicitly on the main thread. */ +static int companion_initialized = 0; + +static void initCompanionTables(void) { + int m; + int t; + if (companion_initialized) { + return; + } + for (m = 0; m <= MAPCODE_BOUNDARY_MAX; m++) { + const int flags = TERRITORY_BOUNDARIES[m].flags; + const int c = flags & 31; + const int codex_val = 10 * (c / 5) + ((c % 5) + 1); + const int rec_type = (flags >> 7) & 3; + unsigned char kind = 0; + if (flags & 64) { kind |= KIND_BIT_NAMELESS; } + if (flags & 512) { kind |= KIND_BIT_RESTRICTED; } + if (flags & 1024) { kind |= KIND_BIT_SPECIAL_SHAPE; } + RECORD_CODEX[m] = (unsigned char) codex_val; + RECORD_REC_TYPE[m] = (unsigned char) rec_type; + RECORD_KIND[m] = kind; + RECORD_HEADER_LETTER[m] = (unsigned char) ENCODE_CHARS[(flags >> 11) & 31]; + RECORD_SMART_DIV[m] = (unsigned short) ((unsigned int) flags >> 16); + } + for (t = 0; t < TERRITORY_TABLE_SIZE; t++) { + TERRITORY_FIRST_NAMELESS[t] = -1; + TERRITORY_NAMELESS_COUNT[t] = 0; + } + for (t = 0; t < TERRITORY_TABLE_SIZE - 1; t++) { + const int from = DATA_START[t]; + const int upto_excl = DATA_START[t + 1]; + int i; + int first = -1; + int count = 0; + for (i = from; i < upto_excl; i++) { + if (RECORD_KIND[i] & KIND_BIT_NAMELESS) { + if (first < 0) { + first = i; + } + count++; + } + } + TERRITORY_FIRST_NAMELESS[t] = first; + TERRITORY_NAMELESS_COUNT[t] = count; + } +#ifdef DEBUG + for (m = 0; m <= MAPCODE_BOUNDARY_MAX; m++) { + const int flagsDbg = TERRITORY_BOUNDARIES[m].flags; + const int cDbg = flagsDbg & 31; + const int codex_valDbg = 10 * (cDbg / 5) + ((cDbg % 5) + 1); + ASSERT(RECORD_CODEX[m] == (unsigned char) codex_valDbg); + ASSERT(RECORD_REC_TYPE[m] == (unsigned char) ((flagsDbg >> 7) & 3)); + ASSERT(((RECORD_KIND[m] & KIND_BIT_NAMELESS) != 0) == ((flagsDbg & 64) != 0)); + ASSERT(((RECORD_KIND[m] & KIND_BIT_RESTRICTED) != 0) == ((flagsDbg & 512) != 0)); + ASSERT(((RECORD_KIND[m] & KIND_BIT_SPECIAL_SHAPE) != 0) == ((flagsDbg & 1024) != 0)); + ASSERT(RECORD_HEADER_LETTER[m] == (unsigned char) ENCODE_CHARS[(flagsDbg >> 11) & 31]); + ASSERT(RECORD_SMART_DIV[m] == (unsigned short) ((unsigned int) flagsDbg >> 16)); + } +#endif + companion_initialized = 1; +} + + +/** + * @brief Convert ASCII character to base-31 value for mapcode decoding + * @param ch ASCII character to decode + * @return Base-31 value (0-30), or negative for special cases: + * -1: illegal character + * -2: vowel 'A' (position 31 in ENCODE_CHARS) + * -3: vowel 'E' (position 32 in ENCODE_CHARS) + * -4: vowel 'U' (position 33 in ENCODE_CHARS) + * + * Special handling: 'O'/'o' maps to '0', 'I'/'i' maps to '1' for user convenience. + * This allows users to type potentially confusing characters and still get correct results. + */ +static signed char decodeChar(const char ch) { + // Lookup table for base-31 value of ASCII character (negative for illegal characters) + // Special cases -2, -3, -4 for vowels; 'O' and 'I' interpreted as '0' and '1'. + static const signed char decode_chars[256] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 16 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 32 + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, // 48 + -1, -2, 10, 11, 12, -3, 13, 14, 15, 1, 16, 17, 18, 19, 20, 0, // 64 + 21, 22, 23, 24, 25, -4, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, // 80 + -1, -2, 10, 11, 12, -3, 13, 14, 15, 1, 16, 17, 18, 19, 20, 0, // 96 + 21, 22, 23, 24, 25, -4, 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, // 112 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 128 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 144 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 176 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 192 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 208 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 224 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // 240 + }; + return decode_chars[(unsigned char)ch]; // ch can be negative, must be fit to range 0-255. +} + +/** + * @brief Calculate the distance in meters between two coordinate points + * @param latDeg1 Latitude of first point in degrees (-90 to 90) + * @param lonDeg1 Longitude of first point in degrees (-180 to 180) + * @param latDeg2 Latitude of second point in degrees (-90 to 90) + * @param lonDeg2 Longitude of second point in degrees (-180 to 180) + * @return Distance between the two points in meters + * + * This function calculates the approximate distance between two points on Earth's surface + * using a simplified spherical model. The calculation: + * 1. Handles longitude wrapping around the 180°/-180° meridian + * 2. Uses cosine correction for longitude distance based on average latitude + * 3. Applies Pythagorean theorem to get final distance + * + * Note: This is an approximation suitable for mapcode purposes but not a precise + * geodetic distance calculation (which would require ellipsoid math). + * + * @public + */ double distanceInMeters(double latDeg1, double lonDeg1, double latDeg2, double lonDeg2) { double dx; double dy; @@ -165,7 +491,8 @@ double distanceInMeters(double latDeg1, double lonDeg1, double latDeg2, double l ASSERT((-90.0 <= latDeg2) && (latDeg2 <= 90.0)); if (wrapped) { deltaLonDegrees = 360.0 - (lonDeg1 - lonDeg2); - } else { + } + else { deltaLonDegrees = lonDeg2 - lonDeg1; } if (deltaLonDegrees > 180.0) { @@ -177,27 +504,49 @@ double distanceInMeters(double latDeg1, double lonDeg1, double latDeg2, double l return sqrt(dx * dx + dy * dy); } -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// maxErrorInMeters -// -/////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @section precision_error_calculation Precision Error Calculation + * The mapcode system supports high-precision encoding with additional digits. + * Each extra digit reduces the maximum possible error by approximately a factor of 5. + */ -// maximum error in meters for a certain nr of high-precision digits +/** + * @brief Maximum error distances in meters for different precision levels + * + * This lookup table contains the maximum possible error (in meters) for each + * supported precision level. The values are empirically determined based on + * the mapcode grid system: + * + * Index 0: Base precision (no extra digits) - ~7.49m max error + * Index 1: 1 extra digit - ~1.39m max error + * Index 2: 2 extra digits - ~0.251m max error + * ... and so on up to MAX_PRECISION_DIGITS + * + * Each additional precision level reduces error by approximately 30^0.5 ≈ 5.48x + */ static const double MAX_ERROR_IN_METERS[MAX_PRECISION_DIGITS + 1] = { - 7.49, - 1.39, - 0.251, - 0.0462, - 0.00837, - 0.00154, - 0.000279, - 0.0000514, - 0.0000093 + 7.49, // 0 extra digits - base precision + 1.39, // 1 extra digit + 0.251, // 2 extra digits + 0.0462, // 3 extra digits + 0.00837, // 4 extra digits + 0.00154, // 5 extra digits + 0.000279, // 6 extra digits + 0.0000514, // 7 extra digits + 0.0000093 // 8 extra digits (maximum supported) }; - -// PUBLIC - returns maximum error in meters for a certain nr of high-precision digits +/** + * @brief Get the maximum possible error for a given precision level + * @param extraDigits Number of extra precision digits (0 to MAX_PRECISION_DIGITS) + * @return Maximum error in meters for this precision level, or 0.0 for invalid input + * + * This function returns the theoretical maximum error that can occur when encoding + * a coordinate at the specified precision level. The actual error is typically + * much smaller than this maximum value. + * + * @public + */ double maxErrorInMeters(int extraDigits) { ASSERT(extraDigits >= 0); if ((extraDigits < 0) || (extraDigits > MAX_PRECISION_DIGITS)) { @@ -206,76 +555,106 @@ double maxErrorInMeters(int extraDigits) { return MAX_ERROR_IN_METERS[extraDigits]; } -/////////////////////////////////////////////////////////////////////////////////////////////// -// -// Point / Point32 -// -/////////////////////////////////////////////////////////////////////////////////////////////// +/** + * @section coordinate_structures Coordinate Representation Structures + * The mapcode system uses multiple coordinate representations for different purposes: + * - Point32: Integer microdegree coordinates (precise, efficient) + * - Point: Floating-point coordinates (flexible units depending on context) + */ +/** + * @brief Integer coordinate point in microdegrees + * + * This structure represents coordinates using 32-bit integers in microdegrees + * (millionths of a degree). This provides: + * - High precision without floating-point rounding errors + * - Efficient storage and comparison operations + * - Range: approximately ±2147 degrees (more than sufficient for Earth coordinates) + */ typedef struct { - int latMicroDeg; // latitude in microdegrees - int lonMicroDeg; // longitude in microdegrees + int latMicroDeg; // Latitude in microdegrees (±90,000,000 for ±90°) + int lonMicroDeg; // Longitude in microdegrees (±180,000,000 for ±180°) } Point32; -typedef struct { // Point - double lat; // latitude (units depend on situation) - double lon; // longitude (units depend on situation) +/** + * @brief Floating-point coordinate point with flexible units + * + * This structure uses double-precision floating-point numbers. + * The units depend on context: + * - Sometimes degrees (for user-facing coordinates) + * - Sometimes fractions (for internal grid calculations) + * - Sometimes other units (for intermediate calculations) + */ +typedef struct { + double lat; // Latitude (units depend on usage context) + double lon; // Longitude (units depend on usage context) } Point; - -static Point32 convertFractionsToCoord32(const Point *p) { +/** + * @brief Convert fraction coordinates to 32-bit microdegree coordinates + * @param p Point containing coordinates in fraction units + * @return Point32 with coordinates converted to microdegrees + * + * This function converts from the internal fraction coordinate system + * to microdegree integers. The conversion factors (810000, 3240000) are + * derived from the mapcode grid mathematics. + */ +static Point32 convertFractionsToCoord32(const Point* p) { Point32 p32; - p32.latMicroDeg = (int) floor(p->lat / 810000); - p32.lonMicroDeg = (int) floor(p->lon / 3240000); + p32.latMicroDeg = (int)floor(p->lat / 810000); // Convert latitude fractions to microdegrees + p32.lonMicroDeg = (int)floor(p->lon / 3240000); // Convert longitude fractions to microdegrees return p32; } - -static Point convertFractionsToDegrees(const Point *p) { +/** + * @brief Convert fraction coordinates to degree coordinates + * @param p Point containing coordinates in fraction units + * @return Point with coordinates converted to degrees + * + * This function converts from the internal fraction coordinate system + * to standard degree coordinates. The large divisors (810000 * 1000000, + * 3240000 * 1000000) scale from fractions to degrees. + */ +static Point convertFractionsToDegrees(const Point* p) { Point pd; - pd.lat = p->lat / (810000 * 1000000.0); - pd.lon = p->lon / (3240000 * 1000000.0); + pd.lat = p->lat / (810000 * 1000000.0); // Convert latitude fractions to degrees + pd.lon = p->lon / (3240000 * 1000000.0); // Convert longitude fractions to degrees return pd; } -static const unsigned char DOUBLE_NAN[8] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F}; // NAN (Not a Number) -static const unsigned char DOUBLE_INF[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F}; // +Infinity -static const unsigned char DOUBLE_MIN_INF[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xFF}; // -Infinity - static enum MapcodeError -convertCoordsToMicrosAndFractions(Point32 *coord32, int *fracLat, int *fracLon, double latDeg, double lonDeg) { +convertCoordsToMicrosAndFractions(Point32* coord32, int* fracLat, int* fracLon, double latDeg, double lonDeg) { double frac; ASSERT(coord32); - if (memcmp(&lonDeg, DOUBLE_NAN, 8) == 0 || memcmp(&lonDeg, DOUBLE_INF, 8) == 0 || - memcmp(&lonDeg, DOUBLE_MIN_INF, 8) == 0 || - memcmp(&latDeg, DOUBLE_NAN, 8) == 0) { + if (isnan(lonDeg) || isinf(lonDeg) || isnan(latDeg) || isinf(latDeg)) { return ERR_BAD_COORDINATE; } if (latDeg < -90) { latDeg = -90; - } else if (latDeg > 90) { + } + else if (latDeg > 90) { latDeg = 90; } latDeg += 90; // lat now [0..180] ASSERT((0.0 <= latDeg) && (latDeg <= 180.0)); - latDeg *= (double) 810000000000; + latDeg *= (double)810000000000; frac = floor(latDeg + 0.1); - coord32->latMicroDeg = (int) (frac / (double) 810000); + coord32->latMicroDeg = (int)(frac / (double)810000); if (fracLat) { - frac -= ((double) coord32->latMicroDeg * (double) 810000); - *fracLat = (int) frac; + frac -= ((double)coord32->latMicroDeg * (double)810000); + *fracLat = (int)frac; } coord32->latMicroDeg -= 90000000; lonDeg -= (360.0 * floor(lonDeg / 360)); // lon now in [0..360> ASSERT((0.0 <= lonDeg) && (lonDeg < 360.0)); - lonDeg *= (double) 3240000000000; + lonDeg *= (double)3240000000000; frac = floor(lonDeg + 0.1); - coord32->lonMicroDeg = (int) (frac / (double) 3240000); + coord32->lonMicroDeg = (int)(frac / (double)3240000); if (fracLon) { - frac -= (double) coord32->lonMicroDeg * (double) 3240000; - *fracLon = (int) frac; + frac -= (double)coord32->lonMicroDeg * (double)3240000; + *fracLon = (int)frac; } if (coord32->lonMicroDeg >= 180000000) { coord32->lonMicroDeg -= 360000000; @@ -297,7 +676,8 @@ static int isInRange(int lonMicroDeg, const int minLonMicroDeg, const int maxLon } if (lonMicroDeg < minLonMicroDeg) { lonMicroDeg += 360000000; - } else { + } + else { lonMicroDeg -= 360000000; } // 1.32 fix FIJI edge case if (minLonMicroDeg <= lonMicroDeg && lonMicroDeg < maxLonMicroDeg) { @@ -308,17 +688,17 @@ static int isInRange(int lonMicroDeg, const int minLonMicroDeg, const int maxLon // returns true iff given coordinate "coord32" fits inside given TerritoryBoundary -static int fitsInsideBoundaries(const Point32 *coord32, const TerritoryBoundary *b) { +static int fitsInsideBoundaries(const Point32* coord32, const TerritoryBoundary* b) { ASSERT(coord32); ASSERT(b); return (b->miny <= coord32->latMicroDeg && - coord32->latMicroDeg < b->maxy && - isInRange(coord32->lonMicroDeg, b->minx, b->maxx)); + coord32->latMicroDeg < b->maxy && + isInRange(coord32->lonMicroDeg, b->minx, b->maxx)); } // set target TerritoryBoundary to a source extended with deltalat, deltaLon (in microDegrees) -static TerritoryBoundary *getExtendedBoundaries(TerritoryBoundary *target, const TerritoryBoundary *source, +static TerritoryBoundary* getExtendedBoundaries(TerritoryBoundary* target, const TerritoryBoundary* source, const int deltaLatMicroDeg, const int deltaLonMicroDeg) { ASSERT(target); ASSERT(source); @@ -346,7 +726,7 @@ typedef struct { } MapcodeZone; -static void setFromFractions(MapcodeZone *z, +static void setFromFractions(MapcodeZone* z, const double y, const double x, const double yDelta, const double xDelta) { ASSERT(z); @@ -354,21 +734,22 @@ static void setFromFractions(MapcodeZone *z, z->fmaxx = x + xDelta; if (yDelta < 0) { z->fminy = y + 1 + yDelta; // y+yDelta can NOT be represented - z->fmaxy = y + 1; // y CAN be represented - } else { + z->fmaxy = y + 1; // y CAN be represented + } + else { z->fminy = y; z->fmaxy = y + yDelta; } } -static int isEmpty(const MapcodeZone *z) { +static int isEmpty(const MapcodeZone* z) { ASSERT(z); return ((z->fmaxx <= z->fminx) || (z->fmaxy <= z->fminy)); } -static Point getMidPointFractions(const MapcodeZone *z) { +static Point getMidPointFractions(const MapcodeZone* z) { Point p; ASSERT(z); p.lon = floor((z->fminx + z->fmaxx) / 2); @@ -377,7 +758,7 @@ static Point getMidPointFractions(const MapcodeZone *z) { } -static void zoneCopyFrom(MapcodeZone *target, const MapcodeZone *source) { +static void zoneCopyFrom(MapcodeZone* target, const MapcodeZone* source) { ASSERT(target); ASSERT(source); target->fminy = source->fminy; @@ -389,7 +770,7 @@ static void zoneCopyFrom(MapcodeZone *target, const MapcodeZone *source) { // determine the non-empty intersection zone z between a given zone and the boundary of territory rectangle m. // returns nonzero in case such a zone exists -static int restrictZoneTo(MapcodeZone *z, const MapcodeZone *zone, const TerritoryBoundary *b) { +static int restrictZoneTo(MapcodeZone* z, const MapcodeZone* zone, const TerritoryBoundary* b) { ASSERT(z); ASSERT(zone); ASSERT(b); @@ -409,7 +790,8 @@ static int restrictZoneTo(MapcodeZone *z, const MapcodeZone *zone, const Territo if (bmaxx < 0 && z->fminx > 0) { bminx += (360000000 * MICROLON_TO_FRACTIONS_FACTOR); bmaxx += (360000000 * MICROLON_TO_FRACTIONS_FACTOR); - } else if (bminx > 0 && z->fmaxx < 0) { + } + else if (bminx > 0 && z->fmaxx < 0) { bminx -= (360000000 * MICROLON_TO_FRACTIONS_FACTOR); bmaxx -= (360000000 * MICROLON_TO_FRACTIONS_FACTOR); } @@ -431,19 +813,19 @@ static int restrictZoneTo(MapcodeZone *z, const MapcodeZone *zone, const Territo /////////////////////////////////////////////////////////////////////////////////////////////// // PRIVATE - copy characters into targetString, limited to its size -static char *lengthCopy(char *targetString, const char *sourceString, int nrCharacters, int targetSize) { +static char* lengthCopy(char* targetString, const char* sourceString, int nrCharacters, int targetSize) { if (nrCharacters >= targetSize) { nrCharacters = targetSize - 1; } - memcpy(targetString, sourceString, (size_t) nrCharacters); + memcpy(targetString, sourceString, (size_t)nrCharacters); targetString[nrCharacters] = 0; return targetString; } // PRIVATE - copy as much of sourceString as will fit; returns targetString -static char *safeCopy(char *targetString, const char *sourceString, const int targetSize) { - int sourceLength = (int) strlen(sourceString); +static char* safeCopy(char* targetString, const char* sourceString, const int targetSize) { + int sourceLength = (int)strlen(sourceString); return lengthCopy(targetString, sourceString, sourceLength, targetSize); } @@ -470,11 +852,10 @@ static int lastRec(const enum Territory ccode) { // returns parent of ccode (or TERRITORY_NONE) static enum Territory parentTerritoryOf(const enum Territory ccode) { - if (ccode == TERRITORY_NONE) { + if (ccode <= _TERRITORY_MIN || ccode >= _TERRITORY_MAX) { return TERRITORY_NONE; } - ASSERT((_TERRITORY_MIN < ccode) && (ccode < _TERRITORY_MAX)); - return PARENT_NR[(int) PARENT_LETTER[INDEX_OF_TERRITORY(ccode)]]; + return PARENT_NR[(int)PARENT_LETTER[INDEX_OF_TERRITORY(ccode)]]; } @@ -488,29 +869,31 @@ static int coDex(const int m) { static int xDivider4(const int miny, const int maxy) { // 360 * cos(microdegrees>>19) static const int xdivider19[172] = { - 360, 360, 360, 360, 360, 360, 361, 361, 361, 361, - 362, 362, 362, 363, 363, 363, 364, 364, 365, 366, - 366, 367, 367, 368, 369, 370, 370, 371, 372, 373, - 374, 375, 376, 377, 378, 379, 380, 382, 383, 384, - 386, 387, 388, 390, 391, 393, 394, 396, 398, 399, - 401, 403, 405, 407, 409, 411, 413, 415, 417, 420, - 422, 424, 427, 429, 432, 435, 437, 440, 443, 446, - 449, 452, 455, 459, 462, 465, 469, 473, 476, 480, - 484, 488, 492, 496, 501, 505, 510, 515, 520, 525, - 530, 535, 540, 546, 552, 558, 564, 570, 577, 583, - 590, 598, 605, 612, 620, 628, 637, 645, 654, 664, - 673, 683, 693, 704, 715, 726, 738, 751, 763, 777, - 791, 805, 820, 836, 852, 869, 887, 906, 925, 946, - 968, 990, 1014, 1039, 1066, 1094, 1123, 1154, 1187, 1223, - 1260, 1300, 1343, 1389, 1438, 1490, 1547, 1609, 1676, 1749, - 1828, 1916, 2012, 2118, 2237, 2370, 2521, 2691, 2887, 3114, - 3380, 3696, 4077, 4547, 5139, 5910, 6952, 8443, 10747, 14784, - 23681, 59485 + 360, 360, 360, 360, 360, 360, 361, 361, 361, 361, + 362, 362, 362, 363, 363, 363, 364, 364, 365, 366, + 366, 367, 367, 368, 369, 370, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 382, 383, 384, + 386, 387, 388, 390, 391, 393, 394, 396, 398, 399, + 401, 403, 405, 407, 409, 411, 413, 415, 417, 420, + 422, 424, 427, 429, 432, 435, 437, 440, 443, 446, + 449, 452, 455, 459, 462, 465, 469, 473, 476, 480, + 484, 488, 492, 496, 501, 505, 510, 515, 520, 525, + 530, 535, 540, 546, 552, 558, 564, 570, 577, 583, + 590, 598, 605, 612, 620, 628, 637, 645, 654, 664, + 673, 683, 693, 704, 715, 726, 738, 751, 763, 777, + 791, 805, 820, 836, 852, 869, 887, 906, 925, 946, + 968, 990, 1014, 1039, 1066, 1094, 1123, 1154, 1187, 1223, + 1260, 1300, 1343, 1389, 1438, 1490, 1547, 1609, 1676, 1749, + 1828, 1916, 2012, 2118, 2237, 2370, 2521, 2691, 2887, 3114, + 3380, 3696, 4077, 4547, 5139, 5910, 6952, 8443, 10747, 14784, + 23681, 59485 }; - if (miny >= 0) { // both above equator? then miny is closest + if (miny >= 0) { + // both above equator? then miny is closest return xdivider19[(miny) >> 19]; } - if (maxy >= 0) { // opposite sides? then equator is worst + if (maxy >= 0) { + // opposite sides? then equator is worst return xdivider19[0]; } return xdivider19[(-maxy) >> 19]; // both negative, so maxy is closest to equator @@ -527,10 +910,10 @@ static int isSubdivision(const enum Territory ccode) { // find first territory rectangle of the same type as m static int firstNamelessRecord(const int m, const int firstcode) { int i = m; - const int codexm = coDex(m); + const int codexm = (int) RECORD_CODEX[m]; ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); - while (i >= firstcode && coDex(i) == codexm && IS_NAMELESS(i)) { + while (i >= firstcode && (int) RECORD_CODEX[i] == codexm && (RECORD_KIND[i] & KIND_BIT_NAMELESS)) { i--; } return (i + 1); @@ -540,11 +923,11 @@ static int firstNamelessRecord(const int m, const int firstcode) { // count all territory rectangles of the same type as m static int countNamelessRecords(const int m, const int firstcode) { const int first = firstNamelessRecord(m, firstcode); - const int codexm = coDex(m); + const int codexm = (int) RECORD_CODEX[m]; int last = m; ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); ASSERT((0 <= firstcode) && (firstcode <= MAPCODE_BOUNDARY_MAX)); - while (coDex(last) == codexm) { + while ((int) RECORD_CODEX[last] == codexm) { last++; } ASSERT((0 <= last) && (last <= MAPCODE_BOUNDARY_MAX)); @@ -553,33 +936,31 @@ static int countNamelessRecords(const int m, const int firstcode) { } -static int isNearBorderOf(const Point32 *coord32, const TerritoryBoundary *b) { +static int isNearBorderOf(const Point32* coord32, const TerritoryBoundary* b) { int xdiv8 = xDivider4(b->miny, b->maxy) / 4; // should be /8 but there's some extra margin TerritoryBoundary tmp; ASSERT(coord32); ASSERT(b); return (fitsInsideBoundaries(coord32, getExtendedBoundaries(&tmp, b, +60, +xdiv8)) && - (!fitsInsideBoundaries(coord32, getExtendedBoundaries(&tmp, b, -60, -xdiv8)))); + (!fitsInsideBoundaries(coord32, getExtendedBoundaries(&tmp, b, -60, -xdiv8)))); } -static void makeUppercase(char *s) { +static void makeUppercase(char* s) { ASSERT(s); while (*s) { - *s = (char) toupper(*s); + *s = (char)toupper(*s); s++; } } // returns 1 - 8, or negative if error -static int getParentNumber(const char *s, const int len) { - const char *p = ((len == 2) ? PARENTS_2 : PARENTS_3); - const char *f; +static int getParentNumber(const char* s, const int len) { + const char* p = ((len == 2) ? PARENTS_2 : PARENTS_3); + const char* f; char country[4]; - if (!s || s[0] == 0 || s[1] == 0 || len < 2 || len > 3) { - return (int) ERR_BAD_ARGUMENTS; - } + ASSERT(s[0] && s[1]); ASSERT((2 <= len) && (len <= 3)); ASSERT(s && ((int) strlen(s) >= len)); lengthCopy(country, s, len, 4); @@ -588,7 +969,7 @@ static int getParentNumber(const char *s, const int len) { if (!f) { return -1; } - return 1 + (int) ((f - p) / (len + 1)); + return 1 + (int)((f - p) / (len + 1)); } /////////////////////////////////////////////////////////////////////////////////////////////// @@ -597,17 +978,18 @@ static int getParentNumber(const char *s, const int len) { // /////////////////////////////////////////////////////////////////////////////////////////////// -static void repackIfAllDigits(char *input, const int aonly) { - char *s = input; +static void repackIfAllDigits(char* input, const int aonly) { + char* s = input; int alldigits = 1; // assume all digits - char *e; - char *dotpos = NULL; + char* e; + char* dotpos = NULL; ASSERT(input); for (e = s; *e != 0 && *e != '-'; e++) { if (*e < '0' || *e > '9') { if (*e == '.' && !dotpos) { dotpos = e; - } else { + } + else { alldigits = 0; break; } @@ -624,7 +1006,8 @@ static void repackIfAllDigits(char *input, const int aonly) { *input = 'A'; *s = ENCODE_CHARS[v / 32]; *e = ENCODE_CHARS[v % 32]; - } else // encode using A,E,U + } + else // encode using A,E,U { const int v = ((*s) - '0') * 10 + ((*e) - '0'); *s = ENCODE_CHARS[(v / 34) + 31]; @@ -636,9 +1019,9 @@ static void repackIfAllDigits(char *input, const int aonly) { // rewrite all-digit codes // returns 1 if unpacked, 0 if left unchanged, negative if unchanged and an error was detected -static int unpackIfAllDigits(char *input) { - char *s = input; - char *dotpos = NULL; +static int unpackIfAllDigits(char* input) { + char* s = input; + char* dotpos = NULL; const int aonly = ((*s == 'A') || (*s == 'a')); if (aonly) { s++; @@ -646,52 +1029,60 @@ static int unpackIfAllDigits(char *input) { for (; *s != 0 && s[2] != 0 && s[2] != '-'; s++) { if (*s == '-') { break; - } else if (*s == '.' && !dotpos) { + } + else if (*s == '.' && !dotpos) { dotpos = s; - } else if ((decodeChar(*s) < 0) || (decodeChar(*s) > 9)) { + } + else if ((decodeChar(*s) < 0) || (decodeChar(*s) > 9)) { return 0; - } // nondigit, so stop + } // nondigit, so stop } if (dotpos) { if (aonly) // v1.50 encoded only with A's { const int v = (((s[0] == 'A') || (s[0] == 'a')) ? 31 : decodeChar(s[0])) * 32 + - (((s[1] == 'A') || (s[1] == 'a')) ? 31 : decodeChar(s[1])); - *input = (char) ('0' + (v / 100)); - s[0] = (char) ('0' + ((v / 10) % 10)); - s[1] = (char) ('0' + (v % 10)); + (((s[1] == 'A') || (s[1] == 'a')) ? 31 : decodeChar(s[1])); + *input = (char)('0' + (v / 100)); + s[0] = (char)('0' + ((v / 10) % 10)); + s[1] = (char)('0' + (v % 10)); return 1; } // v1.50 if ((*s == 'a') || (*s == 'e') || (*s == 'u') || (*s == 'A') || (*s == 'E') || (*s == 'U')) { - char *e = s + 1; // s is vowel, e is lastchar + char* e = s + 1; // s is vowel, e is lastchar int v = 0; if (*s == 'e' || *s == 'E') { v = 34; - } else if (*s == 'u' || *s == 'U') { + } + else if (*s == 'u' || *s == 'U') { v = 68; } if ((*e == 'a') || (*e == 'A')) { v += 31; - } else if ((*e == 'e') || (*e == 'E')) { + } + else if ((*e == 'e') || (*e == 'E')) { v += 32; - } else if ((*e == 'u') || (*e == 'U')) { + } + else if ((*e == 'u') || (*e == 'U')) { v += 33; - } else if (decodeChar(*e) < 0) { - return (int) ERR_INVALID_CHARACTER; - } else { + } + else if (decodeChar(*e) < 0) { + return (int)ERR_INVALID_CHARACTER; + } + else { v += decodeChar(*e); } if (v < 100) { - *s = ENCODE_CHARS[(unsigned int) v / 10]; - *e = ENCODE_CHARS[(unsigned int) v % 10]; - } else { - return (int) ERR_INVALID_ENDVOWELS; // mapcodes ends in UE or UU + *s = ENCODE_CHARS[(unsigned int)v / 10]; + *e = ENCODE_CHARS[(unsigned int)v % 10]; + } + else { + return (int)ERR_INVALID_ENDVOWELS; // mapcodes ends in UE or UU } return 1; } @@ -711,33 +1102,36 @@ typedef struct { int fraclat; // latitude fraction of microdegrees, expressed in 1 / 810,000ths int fraclon; // longitude fraction of microdegrees, expressed in 1 / 3,240,000ths // output - Mapcodes *mapcodes; + Mapcodes* mapcodes; } EncodeRec; // encode the high-precision extension (0-8 characters) -static void encodeExtension(char *result, const int extrax4, const int extray, const int dividerx4, +static void encodeExtension(char* result, const int extrax4, const int extray, const int dividerx4, const int dividery, int extraDigits, const int ydirection, - const EncodeRec *enc) // append extra characters to result for more precision + const EncodeRec* enc) // append extra characters to result for more precision { ASSERT(result); ASSERT(enc); - if (extraDigits > 0) { // anything to do? - char *s = result + strlen(result); - double factorx = (double) MAX_PRECISION_FACTOR * dividerx4; // perfect integer! - double factory = (double) MAX_PRECISION_FACTOR * dividery; // perfect integer! - double valx = ((double) MAX_PRECISION_FACTOR * extrax4) + enc->fraclon; // perfect integer! - double valy = ((double) MAX_PRECISION_FACTOR * extray) + (ydirection * enc->fraclat); // perfect integer! + if (extraDigits > 0) { + // anything to do? + char* s = result + strlen(result); + double factorx = (double)MAX_PRECISION_FACTOR * dividerx4; // perfect integer! + double factory = (double)MAX_PRECISION_FACTOR * dividery; // perfect integer! + double valx = ((double)MAX_PRECISION_FACTOR * extrax4) + enc->fraclon; // perfect integer! + double valy = ((double)MAX_PRECISION_FACTOR * extray) + (ydirection * enc->fraclat); // perfect integer! // protect against floating Point errors if (valx < 0) { valx = 0; - } else if (valx >= factorx) { + } + else if (valx >= factorx) { valx = factorx - 1; } if (valy < 0) { valy = 0; - } else if (valy >= factory) { + } + else if (valy >= factory) { valy = factory - 1; } @@ -751,10 +1145,10 @@ static void encodeExtension(char *result, const int extrax4, const int extray, c int gx, gy; factorx /= 30; - gx = (int) (valx / factorx); + gx = (int)(valx / factorx); factory /= 30; - gy = (int) (valy / factory); + gy = (int)(valy / factory); *s++ = ENCODE_CHARS[(gy / 5) * 5 + (gx / 6)]; if (--extraDigits == 0) { @@ -770,31 +1164,33 @@ static void encodeExtension(char *result, const int extrax4, const int extray, c valy -= factory * gy; // for next iteration } *s = 0; // terminate the result - ASSERT((int) strlen(s) == extraDigits); } } // encode 'value' into result[nrchars] -static void encodeBase31(char *result, int value, int nrchars) { +static void encodeBase31(char* result, int value, int nrchars) { ASSERT(result); ASSERT(nrchars >= 0); result[nrchars] = 0; // zero-terminate! while (nrchars > 0) { + const int q = value / 31; + const int r = value - q * 31; nrchars--; - result[nrchars] = ENCODE_CHARS[value % 31]; - value /= 31; + result[nrchars] = ENCODE_CHARS[r]; + value = q; } } -static void encodeTriple(char *result, const int difx, const int dify) { +static void encodeTriple(char* result, const int difx, const int dify) { ASSERT(result); if (dify < 4 * 34) // first 4(x34) rows of 6(x28) wide { *result = ENCODE_CHARS[((difx / 28) + 6 * (dify / 34))]; encodeBase31(result + 1, ((difx % 28) * 34 + (dify % 34)), 2); - } else // bottom row + } + else // bottom row { *result = ENCODE_CHARS[(difx / 24) + 24]; encodeBase31(result + 1, (difx % 24) * 40 + (dify - 136), 2); @@ -824,9 +1220,9 @@ static const int NC[6] = {1, 31, 961, 29791, 923521, 28629151}; // returns *result==0 in case of error -static void encodeGrid(char *result, const EncodeRec *enc, const int m, const int extraDigits, +static void encodeGrid(char* result, const EncodeRec* enc, const int m, const int extraDigits, const char headerLetter) { - const TerritoryBoundary *b = TERRITORY_BOUNDARY(m); + const TerritoryBoundary* b = TERRITORY_BOUNDARY(m); const int orgcodex = coDex(m); int codexm; ASSERT(result); @@ -836,7 +1232,8 @@ static void encodeGrid(char *result, const EncodeRec *enc, const int m, const in codexm = orgcodex; if (codexm == 21) { codexm = 22; - } else if (codexm == 14) { + } + else if (codexm == 14) { codexm = 23; } @@ -845,20 +1242,24 @@ static void encodeGrid(char *result, const EncodeRec *enc, const int m, const in result++; } - { // encode + { + // encode int divx, divy; const int prelen = codexm / 10; const int postlen = codexm % 10; divy = SMART_DIV(m); + ASSERT(divy > 0); if (divy == 1) { divx = X_SIDE[prelen]; divy = Y_SIDE[prelen]; - } else { + } + else { divx = (NC[prelen] / divy); } - { // grid + { + // grid const int ygridsize = (b->maxy - b->miny + divy - 1) / divy; const int xgridsize = (b->maxx - b->minx + divx - 1) / divx; int rely = enc->coord32.latMicroDeg - b->miny; @@ -868,7 +1269,8 @@ static void encodeGrid(char *result, const EncodeRec *enc, const int m, const in if (relx < 0) { relx += 360000000; x += 360000000; - } else if (relx >= 360000000) // 1.32 fix FIJI edge case + } + else if (relx >= 360000000) // 1.32 fix FIJI edge case { relx -= 360000000; x -= 360000000; @@ -881,11 +1283,13 @@ static void encodeGrid(char *result, const EncodeRec *enc, const int m, const in return; } - { // prefix + { + // prefix int v; if (divx != divy && prelen > 2) { v = encodeSixWide(relx, rely, divx, divy); - } else { + } + else { v = relx * divy + (divy - 1 - rely); } encodeBase31(result, v, prelen); @@ -900,13 +1304,14 @@ static void encodeGrid(char *result, const EncodeRec *enc, const int m, const in rely = b->miny + (rely * ygridsize); relx = b->minx + (relx * xgridsize); - { // postfix + { + // postfix const int dividery = ((ygridsize + Y_SIDE[postlen] - 1) / Y_SIDE[postlen]); const int dividerx = ((xgridsize + X_SIDE[postlen] - 1) / X_SIDE[postlen]); int extrax, extray; { - char *resultptr = result + prelen; + char* resultptr = result + prelen; int difx = x - relx; @@ -926,7 +1331,8 @@ static void encodeGrid(char *result, const EncodeRec *enc, const int m, const in if (postlen == 3) // encode special { encodeTriple(resultptr, difx, dify); - } else { + } + else { encodeBase31(resultptr, (difx) * Y_SIDE[postlen] + dify, postlen); // swap 4-int codes for readability if (postlen == 4) { @@ -949,12 +1355,50 @@ static void encodeGrid(char *result, const EncodeRec *enc, const int m, const in } } // postfix } // grid - } // encode + } // encode } +/** + * Helper function to calculate storage offset for nameless encoding. + * Determines the storage offset based on the number of nameless records (A), + * the current record index (X), and the codex value (codexm). + * This complex calculation was extracted to improve readability of encodeNameless. + */ +static int calculateStorageOffset(int A, int X, int codexm) { + const int p = GRID_SIZE_31 / A; + const int r = GRID_SIZE_31 % A; // the first r items are p+1 + + if (codexm != SPECIAL_CODEX_21 && A <= GRID_SIZE_31) { + return (X * p + (X < r ? X : r)) * GRID_SIZE_SQUARED; + } + else if (codexm != SPECIAL_CODEX_21 && A < MAX_NAMELESS_RECORDS) { + if (X < (MAX_NAMELESS_RECORDS - A)) { + return X * GRID_SIZE_SQUARED; + } + else { + int storage_offset = (MAX_NAMELESS_RECORDS - A + ((X - MAX_NAMELESS_RECORDS + A) / 2)) * GRID_SIZE_SQUARED; + if ((X + A) & 1) { + storage_offset += (GRID_MULTIPLIER_16 * GRID_SIZE_961 * GRID_SIZE_31); + } + return storage_offset; + } + } + else { + const int BASEPOWER = (codexm == SPECIAL_CODEX_21) ? GRID_SIZE_SQUARED : GRID_SIZE_SQUARED * GRID_SIZE_31; + int BASEPOWERA = (BASEPOWER / A); + if (A == MAX_NAMELESS_RECORDS) { + BASEPOWERA++; + } + else { + BASEPOWERA = GRID_SIZE_961 * (BASEPOWERA / GRID_SIZE_961); + } + return X * BASEPOWERA; + } +} + // *result==0 in case of error -static void encodeNameless(char *result, const EncodeRec *enc, const enum Territory ccode, +static void encodeNameless(char* result, const EncodeRec* enc, const enum Territory ccode, const int extraDigits, const int m) { // determine how many nameless records there are (A), and which one is this (X)... const int A = countNamelessRecords(m, firstRec(ccode)); @@ -966,42 +1410,18 @@ static void encodeNameless(char *result, const EncodeRec *enc, const enum Territ *result = 0; { - const int p = 31 / A; - const int r = 31 % A; // the first r items are p+1 const int codexm = coDex(m); const int codexlen = (codexm / 10) + (codexm % 10); // determine side of square around centre int SIDE; - int storage_offset; - const TerritoryBoundary *b; + const int storage_offset = calculateStorageOffset(A, X, codexm); + const TerritoryBoundary* b; int xSIDE, orgSIDE; - if (codexm != 21 && A <= 31) { - storage_offset = (X * p + (X < r ? X : r)) * (961 * 961); - } else if (codexm != 21 && A < 62) { - if (X < (62 - A)) { - storage_offset = X * (961 * 961); - } else { - storage_offset = (62 - A + ((X - 62 + A) / 2)) * (961 * 961); - if ((X + A) & 1) { - storage_offset += (16 * 961 * 31); - } - } - } else { - const int BASEPOWER = (codexm == 21) ? 961 * 961 : 961 * 961 * 31; - int BASEPOWERA = (BASEPOWER / A); - if (A == 62) { - BASEPOWERA++; - } else { - BASEPOWERA = (961) * (BASEPOWERA / 961); - } - - storage_offset = X * BASEPOWERA; - } - SIDE = SMART_DIV(m); + ASSERT(SIDE > 0); b = TERRITORY_BOUNDARY(m); orgSIDE = SIDE; @@ -1014,7 +1434,7 @@ static void encodeNameless(char *result, const EncodeRec *enc, const enum Territ const int dx = (4 * (enc->coord32.lonMicroDeg - b->minx) + xFracture) / dividerx4; // div with quarters const int extrax4 = (enc->coord32.lonMicroDeg - b->minx) * 4 - (dx * dividerx4); // mod with quarters - const int dividery = 90; + const int dividery = Y_DIVIDER; int dy = (b->maxy - enc->coord32.latMicroDeg) / dividery; int extray = (b->maxy - enc->coord32.latMicroDeg) % dividery; @@ -1024,17 +1444,18 @@ static void encodeNameless(char *result, const EncodeRec *enc, const enum Territ } if (IS_SPECIAL_SHAPE(m)) { - SIDE = 1 + ((b->maxy - b->miny) / 90); // new side, based purely on y-distance + SIDE = 1 + ((b->maxy - b->miny) / Y_DIVIDER); // new side, based purely on y-distance xSIDE = (orgSIDE * orgSIDE) / SIDE; v += encodeSixWide(dx, SIDE - 1 - dy, xSIDE, SIDE); - } else { + } + else { v += (dx * SIDE + dy); } encodeBase31(result, v, codexlen + 1); // nameless { int dotp = codexlen; - if (codexm == 13) { + if (codexm == SPECIAL_CODEX_13) { dotp--; } memmove(result + dotp, result + dotp - 1, 4); @@ -1042,7 +1463,7 @@ static void encodeNameless(char *result, const EncodeRec *enc, const enum Territ } if (!IS_SPECIAL_SHAPE(m)) { - if (codexm == 22 && A < 62 && orgSIDE == 961) { + if (codexm == SPECIAL_CODEX_22 && A < MAX_NAMELESS_RECORDS && orgSIDE == GRID_SIZE_961) { const char t = result[codexlen - 2]; result[codexlen - 2] = result[codexlen]; result[codexlen] = t; @@ -1052,25 +1473,24 @@ static void encodeNameless(char *result, const EncodeRec *enc, const enum Territ encodeExtension(result, extrax4, extray, dividerx4, dividery, extraDigits, -1, enc); // nameless return; - } // in range } } // encode in m (known to fit) -static void encodeAutoHeader(char *result, const EncodeRec *enc, const int m, const int extraDigits) { +static void encodeAutoHeader(char* result, const EncodeRec* enc, const int m, const int extraDigits) { int i; int STORAGE_START = 0; int W, H, xdiv, product; - const TerritoryBoundary *b; + const TerritoryBoundary* b; // search back to first of the group int firstindex = m; const int codexm = coDex(m); ASSERT(result); ASSERT(enc); - ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); + ASSERT((1 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); ASSERT((0 <= extraDigits) && (extraDigits <= MAX_PRECISION_DIGITS)); while (REC_TYPE(firstindex - 1) > 1 && coDex(firstindex - 1) == codexm) { @@ -1089,7 +1509,8 @@ static void encodeAutoHeader(char *result, const EncodeRec *enc, const int m, co H = 176 * ((H + 176 - 1) / 176); W = 168 * ((W + 168 - 1) / 168); product = (W / 168) * (H / 176) * 961 * 31; - if (REC_TYPE(i) == 2) { // plus pipe + if (REC_TYPE(i) == 2) { + // plus pipe const int GOODROUNDER = codexm >= 23 ? (961 * 961 * 31) : (961 * 961); product = ((STORAGE_START + product + GOODROUNDER - 1) / GOODROUNDER) * GOODROUNDER - STORAGE_START; } @@ -1127,7 +1548,7 @@ static void encodeAutoHeader(char *result, const EncodeRec *enc, const int m, co } -static void encoderEngine(const enum Territory ccode, const EncodeRec *enc, const int stop_with_one_result, +static void encoderEngine(const enum Territory ccode, const EncodeRec* enc, const int stop_with_one_result, const int extraDigits, const int requiredEncoder, const enum Territory ccode_override) { int from; int upto; @@ -1150,27 +1571,32 @@ static void encoderEngine(const enum Territory ccode, const EncodeRec *enc, cons /////////////////////////////////////////////////////////// { int i; - char result[128]; + char result[MAX_MAPCODE_RESULT_ASCII_LEN]; int result_counter = 0; *result = 0; for (i = from; i <= upto; i++) { if (fitsInsideBoundaries(&enc->coord32, TERRITORY_BOUNDARY(i))) { - if (IS_NAMELESS(i)) { + const unsigned char kind = RECORD_KIND[i]; + const unsigned char recTypeI = RECORD_REC_TYPE[i]; + if (kind & KIND_BIT_NAMELESS) { encodeNameless(result, enc, ccode, extraDigits, i); - } else if (REC_TYPE(i) > 1) { + } + else if (recTypeI > 1) { encodeAutoHeader(result, enc, i, extraDigits); - } else if ((i == upto) && isSubdivision(ccode)) { + } + else if ((i == upto) && isSubdivision(ccode)) { // *** do a recursive call for the parent *** encoderEngine(parentTerritoryOf(ccode), enc, stop_with_one_result, extraDigits, requiredEncoder, ccode); return; - } else // must be grid + } + else // must be grid { // skip IS_RESTRICTED records unless there already is a result - if (result_counter || !IS_RESTRICTED(i)) { - if (coDex(i) < 54) { - char headerletter = (char) ((REC_TYPE(i) == 1) ? HEADER_LETTER(i) : 0); + if (result_counter || !(kind & KIND_BIT_RESTRICTED)) { + if (RECORD_CODEX[i] < 54) { + const char headerletter = (char)((recTypeI == 1) ? RECORD_HEADER_LETTER[i] : 0); encodeGrid(result, enc, i, extraDigits, headerletter); } } @@ -1185,13 +1611,19 @@ static void encoderEngine(const enum Territory ccode, const EncodeRec *enc, cons if ((requiredEncoder < 0) || (requiredEncoder == i)) { const enum Territory ccodeFinal = (ccode_override != TERRITORY_NONE ? ccode_override : ccode); if (*result && enc->mapcodes && (enc->mapcodes->count < MAX_NR_OF_MAPCODE_RESULTS)) { - char *s = enc->mapcodes->mapcode[enc->mapcodes->count++]; - if (ccodeFinal == TERRITORY_AAA) { // AAA is never shown with territory + char* s = enc->mapcodes->mapcode[enc->mapcodes->count++]; + if (ccodeFinal == TERRITORY_AAA) { + // AAA is never shown with territory strcpy(s, result); - } else { + } + else { getTerritoryIsoName(s, ccodeFinal, 0); - strcat(s, " "); - strcat(s, result); + { + size_t isoLen = strlen(s); + size_t resultLen = strlen(result); + s[isoLen] = ' '; + memcpy(s + isoLen + 1, result, resultLen + 1); /* +1 includes NUL */ + } } } if (requiredEncoder == i) { @@ -1211,7 +1643,7 @@ static void encoderEngine(const enum Territory ccode, const EncodeRec *enc, cons // pass Point to an array of pointers (at least 42), will be made to Point to result strings... // returns nr of results; -static int encodeLatLonToMapcodes_internal(Mapcodes *mapcodes, +static int encodeLatLonToMapcodes_internal(Mapcodes* mapcodes, const double lat, const double lon, const enum Territory territoryContext, const int stop_with_one_result, const int requiredEncoder, const int extraDigits) { @@ -1220,6 +1652,7 @@ static int encodeLatLonToMapcodes_internal(Mapcodes *mapcodes, enc.mapcodes->count = 0; ASSERT(mapcodes); ASSERT((0 <= extraDigits) && (extraDigits <= MAX_PRECISION_DIGITS)); + initCompanionTables(); if (convertCoordsToMicrosAndFractions(&enc.coord32, &enc.fraclat, &enc.fraclon, lat, lon) < 0) { return 0; @@ -1227,7 +1660,6 @@ static int encodeLatLonToMapcodes_internal(Mapcodes *mapcodes, if (territoryContext < _TERRITORY_MIN) // ALL results? { - #ifndef NO_FAST_ENCODE { const int sum = enc.coord32.lonMicroDeg + enc.coord32.latMicroDeg; @@ -1235,21 +1667,24 @@ static int encodeLatLonToMapcodes_internal(Mapcodes *mapcodes, int i = 0; // pointer into REDIVAR for (;;) { const int r = REDIVAR[i++]; - if (r >= 0 && r < 1024) { // leaf? + if (r >= 0 && r < 1024) { + // leaf? int j; for (j = 0; j <= r; j++) { - const enum Territory ccode = (j == r ? TERRITORY_AAA : (enum Territory) REDIVAR[i + j]); + const enum Territory ccode = (j == r ? TERRITORY_AAA : (enum Territory)REDIVAR[i + j]); encoderEngine(ccode, &enc, stop_with_one_result, extraDigits, requiredEncoder, TERRITORY_NONE); if ((stop_with_one_result || (requiredEncoder >= 0)) && (enc.mapcodes->count > 0)) { break; } } break; - } else { + } + else { coord = sum - coord; if (coord > r) { i = REDIVAR[i]; - } else { + } + else { i++; } } @@ -1259,15 +1694,16 @@ static int encodeLatLonToMapcodes_internal(Mapcodes *mapcodes, { int i; for (i = _TERRITORY_MIN + 1; i < _TERRITORY_MAX; i++) { - encoderEngine((enum Territory) i, &enc, stop_with_one_result, extraDigits, requiredEncoder, TERRITORY_NONE); + encoderEngine((enum Territory)i, &enc, stop_with_one_result, extraDigits, requiredEncoder, + TERRITORY_NONE); if ((stop_with_one_result || (requiredEncoder >= 0)) && (enc.mapcodes->count > 0)) { break; } } } #endif - - } else { + } + else { encoderEngine(territoryContext, &enc, stop_with_one_result, extraDigits, requiredEncoder, TERRITORY_NONE); } return mapcodes->count; @@ -1282,27 +1718,27 @@ static int encodeLatLonToMapcodes_internal(Mapcodes *mapcodes, typedef struct { // input MapcodeElements mapcodeElements; - const char *orginput; // original full input string - const char *mapcode; // input mapcode (first character of proper mapcode excluding territory code) - const char *extension; // input extension (or empty) + const char* orginput; // original full input string + const char* mapcode; // input mapcode (first character of proper mapcode excluding territory code) + const char* extension; // input extension (or empty) enum Territory context; // input territory context (or TERRITORY_NONE) - const char *iso; // input territory alphacode (context) + const char* iso; // input territory alphacode (context) // output - Point result; // result - Point32 coord32; // result in integer arithmetic (microdegrees) - MapcodeZone zone; // result zone (in "DegreeFractions") + Point result; // result + Point32 coord32; // result in integer arithmetic (microdegrees) + MapcodeZone zone; // result zone (in "DegreeFractions") } DecodeRec; // decode the high-precision extension (0-8 characters) -// this routine takes the integer-arithmeteic decoding results (dec->coord32), adds precision, +// this routine takes the integer-arithmeteic decoding results (dec->coord32), adds precision, // and determines result zone (dec->zone); returns negative in case of error. -static enum MapcodeError decodeExtension(DecodeRec *dec, +static enum MapcodeError decodeExtension(DecodeRec* dec, int dividerx4, int dividery, const int lon_offset4, const int extremeLat32, const int maxLon32) { double lat1, lon4; - const char *extrapostfix = dec->extension; + const char* extrapostfix = dec->extension; int lon32 = 0; int lat32 = 0; int processor = 1; @@ -1326,7 +1762,8 @@ static enum MapcodeError decodeExtension(DecodeRec *dec, } // illegal extension character row2 = (c2 / 6); column2 = (c2 % 6); - } else { + } + else { odd = 1; row2 = 0; column2 = 0; @@ -1343,14 +1780,15 @@ static enum MapcodeError decodeExtension(DecodeRec *dec, processor *= 30; } - lon4 = (dec->coord32.lonMicroDeg * 4 * (double) MAX_PRECISION_FACTOR) + ((lon32 * (double) dividerx4)) + - (lon_offset4 * (double) MAX_PRECISION_FACTOR); - lat1 = (dec->coord32.latMicroDeg * (double) MAX_PRECISION_FACTOR) + ((lat32 * (double) dividery)); + lon4 = (dec->coord32.lonMicroDeg * 4 * (double)MAX_PRECISION_FACTOR) + ((lon32 * (double)dividerx4)) + + (lon_offset4 * (double)MAX_PRECISION_FACTOR); + lat1 = (dec->coord32.latMicroDeg * (double)MAX_PRECISION_FACTOR) + ((lat32 * (double)dividery)); // determine the range of coordinates that are encoded to this mapcode if (odd) { setFromFractions(&dec->zone, lat1, lon4, 5 * dividery, 6 * dividerx4); - } else { + } + else { setFromFractions(&dec->zone, lat1, lon4, dividery, dividerx4); } @@ -1362,7 +1800,8 @@ static enum MapcodeError decodeExtension(DecodeRec *dec, if (dec->zone.fmaxy > extremeLat32 * MICROLAT_TO_FRACTIONS_FACTOR) { dec->zone.fmaxy = extremeLat32 * MICROLAT_TO_FRACTIONS_FACTOR; } - } else { + } + else { if (dec->zone.fminy < extremeLat32 * MICROLAT_TO_FRACTIONS_FACTOR) { dec->zone.fminy = extremeLat32 * MICROLAT_TO_FRACTIONS_FACTOR; } @@ -1375,7 +1814,7 @@ static enum MapcodeError decodeExtension(DecodeRec *dec, // decode 'code' until either a dot or an end-of-string is encountered -static int decodeBase31(const char *code) { +static int decodeBase31(const char* code) { int value = 0; ASSERT(code); while (*code != '.' && *code != 0) { @@ -1385,17 +1824,18 @@ static int decodeBase31(const char *code) { } -static void decodeTriple(const char *result, int *difx, int *dify) { +static void decodeTriple(const char* result, int* difx, int* dify) { // decode the first character const int c1 = decodeChar(*result++); - ASSERT(result); + ASSERT(result - 1); ASSERT(difx); ASSERT(dify); if (c1 < 24) { int m = decodeBase31(result); *difx = (c1 % 6) * 28 + (m / 34); *dify = (c1 / 6) * 34 + (m % 34); - } else // bottom row + } + else // bottom row { int x = decodeBase31(result); *dify = (x % 40) + 136; @@ -1404,7 +1844,7 @@ static void decodeTriple(const char *result, int *difx, int *dify) { } // decodeTriple static void decodeSixWide(const int v, const int width, const int height, - int *x, int *y) { + int* x, int* y) { int w; int D = 6; int col = v / (height * 6); @@ -1424,14 +1864,14 @@ static void decodeSixWide(const int v, const int width, const int height, // *** mid-level encode routines *** // decodes dec->mapcode in context of territory rectangle m; returns negative if error -static enum MapcodeError decodeGrid(DecodeRec *dec, const int m, const int hasHeaderLetter) { - const char *input = (hasHeaderLetter ? dec->mapcode + 1 : dec->mapcode); - const int codexlen = (int) (strlen(input) - 1); - int prelen = (int) (strchr(input, '.') - input); - char result[MAX_PROPER_MAPCODE_LEN + 1]; +static enum MapcodeError decodeGrid(DecodeRec* dec, const int m, const int hasHeaderLetter) { + const char* input = (hasHeaderLetter ? dec->mapcode + 1 : dec->mapcode); + const int codexlen = (int)(strlen(input) - 1); + int prelen = (int)(strchr(input, '.') - input); + char result[MAX_PROPER_MAPCODE_ASCII_LEN + 1]; ASSERT(dec); - if (codexlen > MAX_PROPER_MAPCODE_LEN) { + if (codexlen > MAX_PROPER_MAPCODE_ASCII_LEN) { return ERR_BAD_MAPCODE_LENGTH; } if (prelen > 5) { @@ -1451,10 +1891,12 @@ static enum MapcodeError decodeGrid(DecodeRec *dec, const int m, const int hasHe int divx, divy; divy = SMART_DIV(m); + ASSERT(divy > 0); if (divy == 1) { divx = X_SIDE[prelen]; divy = Y_SIDE[prelen]; - } else { + } + else { divx = (NC[prelen] / divy); } @@ -1471,7 +1913,8 @@ static enum MapcodeError decodeGrid(DecodeRec *dec, const int m, const int hasHe if (divx != divy && prelen > 2) { // special grid, useful when prefix is 3 or more, and not a nice 961x961 decodeSixWide(v, divx, divy, &relx, &rely); - } else { + } + else { relx = (v / divy); rely = divy - 1 - (v % divy); } @@ -1482,7 +1925,7 @@ static enum MapcodeError decodeGrid(DecodeRec *dec, const int m, const int hasHe { - const TerritoryBoundary *b = TERRITORY_BOUNDARY(m); + const TerritoryBoundary* b = TERRITORY_BOUNDARY(m); const int ygridsize = (b->maxy - b->miny + divy - 1) / divy; // microdegrees per cell const int xgridsize = (b->maxx - b->minx + divx - 1) / divx; // microdegrees per cell @@ -1498,13 +1941,14 @@ static enum MapcodeError decodeGrid(DecodeRec *dec, const int m, const int hasHe // decoderelative { - char *r = result + prelen + 1; + char* r = result + prelen + 1; int difx, dify; if (postlen == 3) // decode special { decodeTriple(r, &difx, &dify); - } else { + } + else { if (postlen == 4) { char t = r[1]; r[1] = r[2]; @@ -1544,11 +1988,11 @@ static enum MapcodeError decodeGrid(DecodeRec *dec, const int m, const int hasHe // decodes dec->mapcode in context of territory rectangle m, territory dec->context // Returns negative in case of error -static enum MapcodeError decodeNameless(DecodeRec *dec, int m) { +static enum MapcodeError decodeNameless(DecodeRec* dec, int m) { int A, F; char input[8]; const int codexm = coDex(m); - const int codexlen = (int) (strlen(dec->mapcode) - 1); + const int codexlen = (int)(strlen(dec->mapcode) - 1); ASSERT(dec); ASSERT((0 <= m) && (m <= MAPCODE_BOUNDARY_MAX)); if (codexlen != 4 && codexlen != 5) { @@ -1573,7 +2017,7 @@ static enum MapcodeError decodeNameless(DecodeRec *dec, int m) { int swapletters = 0; int xSIDE; int X; - const TerritoryBoundary *b; + const TerritoryBoundary* b; // make copy of input, so we can swap around letters during the decoding char result[32]; @@ -1585,26 +2029,30 @@ static enum MapcodeError decodeNameless(DecodeRec *dec, int m) { if (offset < r * (p + 1)) { X = offset / (p + 1); - } else { + } + else { swapletters = ((p == 1) && (codexm == 22)); X = r + (offset - (r * (p + 1))) / p; } - } else if (codexm != 21 && A < 62) { - + } + else if (codexm != 21 && A < 62) { X = decodeChar(*result); if (X < (62 - A)) { swapletters = (codexm == 22); - } else { + } + else { X = X + (X - (62 - A)); } - } else // code==21 || A>=62 + } + else // code==21 || A>=62 { const int BASEPOWER = (codexm == 21) ? 961 * 961 : 961 * 961 * 31; int BASEPOWERA = (BASEPOWER / A); if (A == 62) { BASEPOWERA++; - } else { + } + else { BASEPOWERA = 961 * (BASEPOWERA / 961); } @@ -1627,7 +2075,8 @@ static enum MapcodeError decodeNameless(DecodeRec *dec, int m) { if (X > 0) { v -= (X * p + (X < r ? X : r)) * (961 * 961); } - } else if (codexm != 21 && A < 62) { + } + else if (codexm != 21 && A < 62) { v = decodeBase31(result + 1); if (X >= (62 - A)) { if (v >= (16 * 961 * 31)) { @@ -1639,7 +2088,9 @@ static enum MapcodeError decodeNameless(DecodeRec *dec, int m) { m = (F + X); - xSIDE = SIDE = SMART_DIV(m); + SIDE = SMART_DIV(m); + ASSERT(SIDE > 0); + xSIDE = SIDE; b = TERRITORY_BOUNDARY(m); @@ -1654,7 +2105,8 @@ static enum MapcodeError decodeNameless(DecodeRec *dec, int m) { decodeSixWide(v, xSIDE, SIDE, &dx, &dy); dy = SIDE - 1 - dy; - } else { + } + else { dy = v % SIDE; dx = v / SIDE; } @@ -1680,10 +2132,10 @@ static enum MapcodeError decodeNameless(DecodeRec *dec, int m) { // decodes dec->mapcode in context of territory rectangle m or one of its mates -static enum MapcodeError decodeAutoHeader(DecodeRec *dec, int m) { - const char *input = dec->mapcode; +static enum MapcodeError decodeAutoHeader(DecodeRec* dec, int m) { + const char* input = dec->mapcode; const int codexm = coDex(m); - const char *dot = strchr(input, '.'); + const char* dot = strchr(input, '.'); int STORAGE_START = 0; int value; ASSERT(dec); @@ -1696,7 +2148,7 @@ static enum MapcodeError decodeAutoHeader(DecodeRec *dec, int m) { value *= (961 * 31); for (; coDex(m) == codexm && REC_TYPE(m) > 1; m++) { - const TerritoryBoundary *b = TERRITORY_BOUNDARY(m); + const TerritoryBoundary* b = TERRITORY_BOUNDARY(m); // determine how many cells int H = (b->maxy - b->miny + 89) / 90; // multiple of 10m const int xdiv = xDivider4(b->miny, b->maxy); @@ -1757,14 +2209,17 @@ static unsigned char getRomanVersionOf(UWORD w) { if (w > ROMAN_VERSION_MAX_CHAR || ROMAN_VERSION_OF[w >> 6] == NULL) { return '?'; } - return (unsigned char) ROMAN_VERSION_OF[w >> 6][w & 63]; + return (unsigned char)ROMAN_VERSION_OF[w >> 6][w & 63]; } -static void convertFromAbjad(char *s) { +static void convertFromAbjad(char* s) { int len, dot, form, c; - char *postfix = strchr(s, '-'); - dot = (int) (strchr(s, '.') - s); + char* postfix = strchr(s, '-'); + { + const char* dotptr = strchr(s, '.'); + dot = dotptr ? (int)(dotptr - s) : -1; + } if (dot < 2 || dot > 5) { return; } @@ -1774,65 +2229,71 @@ static void convertFromAbjad(char *s) { unpackIfAllDigits(s); - len = (int) strlen(s); + len = (int)strlen(s); form = (dot >= 2 && dot <= 5 ? dot * 10 + (len - dot - 1) : 0); if (form == 23) { c = decodeChar(s[3]) * 8 + (decodeChar(s[4]) - 18); if (c >= 0 && c < 31) { -// s[0] = s[0]; -// s[1] = s[1]; -// s[2] = '.'; + // s[0] = s[0]; + // s[1] = s[1]; + // s[2] = '.'; s[3] = ENCODE_CHARS[c]; s[4] = s[5]; s[5] = 0; } - } else if (form == 24) { + } + else if (form == 24) { c = decodeChar(s[3]) * 8 + (decodeChar(s[4]) - 18); if (c >= 0 && c < 63) { -// s[0] = s[0]; -// s[1] = s[1]; -// s[2] = '.'; + // s[0] = s[0]; + // s[1] = s[1]; + // s[2] = '.'; s[3] = '.'; s[4] = s[5]; s[5] = s[6]; s[6] = 0; if (c >= 32) { s[2] = ENCODE_CHARS[c - 32]; - } else { + } + else { s[3] = ENCODE_CHARS[c]; } } - } else if (form == 34) { + } + else if (form == 34) { c = (decodeChar(s[2]) * 10) + (decodeChar(s[5]) - 7); if (c >= 0 && c < 93) { -// s[0] = s[0]; -// s[1] = s[1]; + // s[0] = s[0]; + // s[1] = s[1]; s[2] = '.'; -// s[3] = '.'; -// s[4] = s[4]; + // s[3] = '.'; + // s[4] = s[4]; s[5] = s[6]; s[6] = s[7]; s[7] = 0; if (c < 31) { s[3] = ENCODE_CHARS[c]; - } else if (c < 62) { + } + else if (c < 62) { s[2] = ENCODE_CHARS[c - 31]; - } else { + } + else { s[2] = ENCODE_CHARS[c - 62]; s[3] = s[4]; s[4] = '.'; } } - } else if (form == 35) { + } + else if (form == 35) { c = (decodeChar(s[2]) * 8) + (decodeChar(s[6]) - 18); if (c >= 0 && c < 63) { -// s[0] = s[0]; -// s[1] = s[1]; -// s[3] = '.'; -// s[4] = s[4]; -// s[5] = s[5]; + // s[0] = s[0]; + // s[1] = s[1]; + // s[3] = '.'; + // s[4] = s[4]; + // s[5] = s[5]; s[6] = s[7]; s[7] = s[8]; s[8] = 0; @@ -1840,33 +2301,36 @@ static void convertFromAbjad(char *s) { s[2] = ENCODE_CHARS[c - 32]; s[3] = s[4]; s[4] = '.'; - } else { + } + else { s[2] = ENCODE_CHARS[c]; } } - } else if (form == 45) { + } + else if (form == 45) { c = (decodeChar(s[2]) * 100) + (decodeChar(s[5]) * 10) + (decodeChar(s[8]) - 39); if (c >= 0 && c < 961) { -// s[0] = s[0]; -// s[1] = s[1]; + // s[0] = s[0]; + // s[1] = s[1]; s[2] = ENCODE_CHARS[c / 31]; -// s[3] = s[3]; -// s[4] = '.'; + // s[3] = s[3]; + // s[4] = '.'; s[5] = s[6]; s[6] = s[7]; s[7] = s[9]; s[8] = ENCODE_CHARS[c % 31]; s[9] = 0; } - } else if (form == 55) { + } + else if (form == 55) { c = (decodeChar(s[2]) * 100) + (decodeChar(s[6]) * 10) + (decodeChar(s[9]) - 39); if (c >= 0 && c < 961) { -// s[0] = s[0]; -// s[1] = s[1]; + // s[0] = s[0]; + // s[1] = s[1]; s[2] = ENCODE_CHARS[c / 31]; -// s[3] = s[3]; -// s[4] = s[4]; -// s[5] = '.'; + // s[3] = s[3]; + // s[4] = s[4]; + // s[5] = '.'; s[6] = s[7]; s[7] = s[8]; s[8] = s[10]; @@ -1876,7 +2340,7 @@ static void convertFromAbjad(char *s) { } repackIfAllDigits(s, 0); if (postfix) { - len = (int) strlen(s); + len = (int)strlen(s); *postfix = '-'; memmove(s + len, postfix, strlen(postfix) + 1); } @@ -1895,19 +2359,19 @@ static void convertFromAbjad(char *s) { * otherwise returns the alphabet of the first different character * encountered, or negative (_ALPHABET_MIN) if it isn't recognized. */ -static enum Alphabet recognizeAlphabetUtf8(const char *utf8) { +static enum Alphabet recognizeAlphabetUtf8(const char* utf8) { ASSERT(utf8); while (*utf8 != 0) { - int c = (unsigned char) *utf8++; + int c = (unsigned char)*utf8++; if (c >= 0xC0) { enum Alphabet alphabet; - int c2 = (unsigned char) *utf8++; + int c2 = (unsigned char)*utf8++; if (c2 < 0x80) { return _ALPHABET_MIN; // utf8 error! } c = ((c - 0xC0) << 6) + (c2 & 63); if (c >= 0x800) { - int c3 = (unsigned char) *utf8++; + int c3 = (unsigned char)*utf8++; c = ((c - 0x800) << 6) + (c3 & 63); if (c3 < 0x80 || c > 0xFFFF) { return _ALPHABET_MIN; // utf8 error! @@ -1930,107 +2394,156 @@ static enum Alphabet recognizeAlphabetUtf8(const char *utf8) { /////////////////////////////////////////////////////////////////////////////////////////////// -// 32=busyextension 64=end territory 128(256)=end of clean mapcode(with extension) 512=end of extension +// 32=busyextension 64=end territory 128(256)=end of clean mapcode(with extension) 512=end of extension static const int STATE_MACHINE[27][6] = { - // SPACE DOT DETTER VOWEL ZERO HYPHEN - // 0 start === looking for very first detter - {0, ERR_UNEXPECTED_DOT, 1, 1, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, - // 1 L/P === det:LL vowel:TA - {ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_DOT, 2, 23, ERR_DOT_MISSING, ERR_BAD_TERRITORY_FORMAT}, - // 2 LL/PP === white: TT waitprefix | dot: PP. | det:LLL/PPP | vowel:TTA | hyphen:TT- - {18 | - 64, 6, 3, 24, ERR_DOT_MISSING, 14}, - // 3 LLL/PPP === white: TTT prefix | dot: PPP. mapcode | det: PPPP | hyphen: TTT- - {18 | - 64, 6, 4, ERR_INVALID_VOWEL, ERR_DOT_MISSING, 14}, - // 4 PPPP === dot: PPPP. | det: PPPPP - {ERR_BAD_TERRITORY_FORMAT, 6, 5, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_BAD_TERRITORY_FORMAT}, - // 5 PPPPP === must get dot now! Dot:PPPPP. - {ERR_BAD_TERRITORY_FORMAT, 6, ERR_INVALID_MAPCODE_FORMAT, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_BAD_TERRITORY_FORMAT}, - // 6 prefix. === get first postfix! det: prefix.L | vowel: prefix.A - {ERR_INVALID_MAPCODE_FORMAT, ERR_UNEXPECTED_DOT, 7, 25, ERR_MAPCODE_INCOMPLETE, ERR_UNEXPECTED_HYPHEN}, - // 7 prefix.L === get 2nd postfix! det: prefix.LL | vowel: prefix.LA - {ERR_INVALID_MAPCODE_FORMAT, ERR_UNEXPECTED_DOT, 8, 25, ERR_MAPCODE_INCOMPLETE, ERR_UNEXPECTED_HYPHEN}, - // 8 prefix.LL === get 3d postfix! white:trail | det: prefix.LLL | vowel: prefix.LLA | zero:done | hyphen: mc- - {22 | 128, ERR_UNEXPECTED_DOT, 9, 25, STATE_GO | - 128, - 11 | - 256}, - // 9 prefix.LLL === white:trail | zero:done | hyphen:mc- - {22 | - 128, ERR_UNEXPECTED_DOT, 10, 25, STATE_GO | - 128, 11 | - 256}, - //10 prefix.LLLL === white:trail | zero:done | hyphen:mc- | det/vowel = postfix full - {22 | - 128, ERR_UNEXPECTED_DOT, 13, 13, STATE_GO | - 128, 11 | - 256}, - - //11 mc- === MUST get first precision detter - {ERR_EXTENSION_INVALID_LENGTH, ERR_UNEXPECTED_DOT, 12, ERR_EXTENSION_INVALID_CHARACTER, ERR_MAPCODE_INCOMPLETE, ERR_UNEXPECTED_HYPHEN}, - //12 mc-L* === Keep reading precision detters | white=trail | zero=done - {22 | 512, ERR_UNEXPECTED_DOT, 12 | 32, ERR_EXTENSION_INVALID_CHARACTER, - STATE_GO | - 512, ERR_UNEXPECTED_HYPHEN}, - - //13 prefix.LLLLL === - {22 | - 128, ERR_UNEXPECTED_DOT, ERR_INVALID_MAPCODE_FORMAT, ERR_INVALID_VOWEL, STATE_GO | - 128, 11 | - 256}, - - //14 TC- === get first state letter - {ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_DOT, 15, 15, ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_HYPHEN}, - //15 TC-S === get 2nd state letter - {ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_DOT, 16, 16, ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_HYPHEN}, - //16 TC-SS === white:waitprefix | det/vow:TC-SSS - {18 | - 64, ERR_UNEXPECTED_DOT, 17, 17, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, - //17 TC-SSS === white:waitprefix - {18 | - 64, ERR_UNEXPECTED_DOT, ERR_BAD_TERRITORY_FORMAT, ERR_BAD_TERRITORY_FORMAT, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, - - //18 TC waitprefix === skip more whitespace, MUST get 1st prefix letter/vowel - {18, ERR_UNEXPECTED_DOT, 19, 19, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, - //19 TC P === get second prefix detter - {ERR_DOT_MISSING, ERR_UNEXPECTED_DOT, 20, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, - //20 TC PP === dot:prefix. | det:TC PPP - {ERR_DOT_MISSING, 6, 21, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, - //21 TC PPP === dot:prefix. | det:PPPP - {ERR_DOT_MISSING, 6, 4, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, - - //22 trailing === skip whitespace until end of string - {22, ERR_UNEXPECTED_DOT, ERR_TRAILING_CHARACTERS, ERR_TRAILING_CHARACTERS, STATE_GO, ERR_UNEXPECTED_HYPHEN}, - - //23 TA === white:waitprefix | det: TAT | vowel:TAA | hyphen:TC- - {18 | - 64, ERR_INVALID_VOWEL, 24, 24, ERR_DOT_MISSING, 14}, - //24 TTA/TAT/TAA === space:TC waitprefix | hyphen:TC- - {18 | - 64, ERR_INVALID_VOWEL, ERR_INVALID_VOWEL, ERR_INVALID_VOWEL, ERR_DOT_MISSING, 14}, - - //25 prefix.[L*]A === white:trail | det/vow:full mc | zero:done | hyphen:mc- - {22 | - 128, ERR_UNEXPECTED_DOT, 26, 26, STATE_GO | - 128, 11 | - 256}, - //26 prefix.[L*]AL === white:trail | zero:done | hyphen:mc- - {22 | - 128, ERR_UNEXPECTED_DOT, ERR_INVALID_VOWEL, ERR_INVALID_VOWEL, STATE_GO | - 128, 11 | - 256}, + // SPACE DOT DETTER VOWEL ZERO HYPHEN + // 0 start === looking for very first detter + {0, ERR_UNEXPECTED_DOT, 1, 1, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, + // 1 L/P === det:LL vowel:TA + {ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_DOT, 2, 23, ERR_DOT_MISSING, ERR_BAD_TERRITORY_FORMAT}, + // 2 LL/PP === white: TT waitprefix | dot: PP. | det:LLL/PPP | vowel:TTA | hyphen:TT- + { + 18 | + 64, + 6, 3, 24, ERR_DOT_MISSING, 14 + }, + // 3 LLL/PPP === white: TTT prefix | dot: PPP. mapcode | det: PPPP | hyphen: TTT- + { + 18 | + 64, + 6, 4, ERR_INVALID_VOWEL, ERR_DOT_MISSING, 14 + }, + // 4 PPPP === dot: PPPP. | det: PPPPP + {ERR_BAD_TERRITORY_FORMAT, 6, 5, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_BAD_TERRITORY_FORMAT}, + // 5 PPPPP === must get dot now! Dot:PPPPP. + { + ERR_BAD_TERRITORY_FORMAT, 6, ERR_INVALID_MAPCODE_FORMAT, ERR_INVALID_VOWEL, ERR_DOT_MISSING, + ERR_BAD_TERRITORY_FORMAT + }, + // 6 prefix. === get first postfix! det: prefix.L | vowel: prefix.A + {ERR_INVALID_MAPCODE_FORMAT, ERR_UNEXPECTED_DOT, 7, 25, ERR_MAPCODE_INCOMPLETE, ERR_UNEXPECTED_HYPHEN}, + // 7 prefix.L === get 2nd postfix! det: prefix.LL | vowel: prefix.LA + {ERR_INVALID_MAPCODE_FORMAT, ERR_UNEXPECTED_DOT, 8, 25, ERR_MAPCODE_INCOMPLETE, ERR_UNEXPECTED_HYPHEN}, + // 8 prefix.LL === get 3d postfix! white:trail | det: prefix.LLL | vowel: prefix.LLA | zero:done | hyphen: mc- + { + 22 | 128, ERR_UNEXPECTED_DOT, 9, 25, STATE_GO | + 128, + 11 | + 256 + }, + // 9 prefix.LLL === white:trail | zero:done | hyphen:mc- + { + 22 | + 128, + ERR_UNEXPECTED_DOT, 10, 25, STATE_GO | + 128, + 11 | + 256 + }, + //10 prefix.LLLL === white:trail | zero:done | hyphen:mc- | det/vowel = postfix full + { + 22 | + 128, + ERR_UNEXPECTED_DOT, 13, 13, STATE_GO | + 128, + 11 | + 256 + }, + + //11 mc- === MUST get first precision detter + { + ERR_EXTENSION_INVALID_LENGTH, ERR_UNEXPECTED_DOT, 12, ERR_EXTENSION_INVALID_CHARACTER, ERR_MAPCODE_INCOMPLETE, + ERR_UNEXPECTED_HYPHEN + }, + //12 mc-L* === Keep reading precision detters | white=trail | zero=done + { + 22 | 512, ERR_UNEXPECTED_DOT, 12 | 32, ERR_EXTENSION_INVALID_CHARACTER, + STATE_GO | + 512, + ERR_UNEXPECTED_HYPHEN + }, + + //13 prefix.LLLLL === + { + 22 | + 128, + ERR_UNEXPECTED_DOT, ERR_INVALID_MAPCODE_FORMAT, ERR_INVALID_VOWEL, STATE_GO | + 128, + 11 | + 256 + }, + + //14 TC- === get first state letter + {ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_DOT, 15, 15, ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_HYPHEN}, + //15 TC-S === get 2nd state letter + {ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_DOT, 16, 16, ERR_BAD_TERRITORY_FORMAT, ERR_UNEXPECTED_HYPHEN}, + //16 TC-SS === white:waitprefix | det/vow:TC-SSS + { + 18 | + 64, + ERR_UNEXPECTED_DOT, 17, 17, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN + }, + //17 TC-SSS === white:waitprefix + { + 18 | + 64, + ERR_UNEXPECTED_DOT, ERR_BAD_TERRITORY_FORMAT, ERR_BAD_TERRITORY_FORMAT, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN + }, + + //18 TC waitprefix === skip more whitespace, MUST get 1st prefix letter/vowel + {18, ERR_UNEXPECTED_DOT, 19, 19, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, + //19 TC P === get second prefix detter + {ERR_DOT_MISSING, ERR_UNEXPECTED_DOT, 20, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, + //20 TC PP === dot:prefix. | det:TC PPP + {ERR_DOT_MISSING, 6, 21, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, + //21 TC PPP === dot:prefix. | det:PPPP + {ERR_DOT_MISSING, 6, 4, ERR_INVALID_VOWEL, ERR_DOT_MISSING, ERR_UNEXPECTED_HYPHEN}, + + //22 trailing === skip whitespace until end of string + {22, ERR_UNEXPECTED_DOT, ERR_TRAILING_CHARACTERS, ERR_TRAILING_CHARACTERS, STATE_GO, ERR_UNEXPECTED_HYPHEN}, + + //23 TA === white:waitprefix | det: TAT | vowel:TAA | hyphen:TC- + { + 18 | + 64, + ERR_INVALID_VOWEL, 24, 24, ERR_DOT_MISSING, 14 + }, + //24 TTA/TAT/TAA === space:TC waitprefix | hyphen:TC- + { + 18 | + 64, + ERR_INVALID_VOWEL, ERR_INVALID_VOWEL, ERR_INVALID_VOWEL, ERR_DOT_MISSING, 14 + }, + + //25 prefix.[L*]A === white:trail | det/vow:full mc | zero:done | hyphen:mc- + { + 22 | + 128, + ERR_UNEXPECTED_DOT, 26, 26, STATE_GO | + 128, + 11 | + 256 + }, + //26 prefix.[L*]AL === white:trail | zero:done | hyphen:mc- + { + 22 | + 128, + ERR_UNEXPECTED_DOT, ERR_INVALID_VOWEL, ERR_INVALID_VOWEL, STATE_GO | + 128, + 11 | + 256 + }, }; // Returns 0 if ok, negative in case of error (where -999 represents "may BECOME a valid mapcode if more characters are added) -static enum MapcodeError parseMapcodeString(MapcodeElements *mapcodeElements, const char *string, int interpretAsUtf16, +static enum MapcodeError parseMapcodeString(MapcodeElements* mapcodeElements, const char* string, int interpretAsUtf16, enum Territory territory) { - const UWORD *utf16 = (const UWORD *) string; + const UWORD* utf16 = (const UWORD*)string; int isAbjad = 0; - const unsigned char *utf8 = (unsigned char *) string; + const unsigned char* utf8 = (unsigned char*)string; int extensionLength = 0; - char *cleanPtr = NULL; + char* cleanPtr = NULL; int nondigits = 0, vowels = 0; int state = 0; ASSERT(string); @@ -2050,37 +2563,43 @@ static enum MapcodeError parseMapcodeString(MapcodeElements *mapcodeElements, co isAbjad = 1; } cx = getRomanVersionOf(*utf16++); - } else { + } + else { cx = *utf8++; } // recognize token: decode returns -2=a -3=e -4=0, 0..9 for digit or "o" or "i", 10..31 for char, -1 for illegal char if (cx == '.') { token = TOKENDOT; if (mapcodeElements) { - mapcodeElements->indexOfDot = (int) (cleanPtr - mapcodeElements->properMapcode); + mapcodeElements->indexOfDot = (int)(cleanPtr - mapcodeElements->properMapcode); } if (mapcodeElements) { *cleanPtr++ = cx; } - } else if (cx == '-') { + } + else if (cx == '-') { token = TOKENHYPH; if (mapcodeElements) { *cleanPtr++ = cx; } - } else if (cx == 0) { + } + else if (cx == 0) { token = TOKENZERO; - } else if ((cx == ' ') || (cx == '\t')) { + } + else if ((cx == ' ') || (cx == '\t')) { token = TOKENSEP; - } else { - char c; - if (cx >= 0xC0) { // utf8 character + } + else { + signed char c; + if (cx >= 0xC0) { + // utf8 character unsigned char c2 = *utf8++; int w = ((cx - 0xC0) << 6) + (c2 & 63); if (c2 < 0x80) { return ERR_INVALID_CHARACTER; // utf8 error } if (w >= 0x800) { - int c3 = (int) *utf8++; + int c3 = (int)*utf8++; w = ((w - 0x800) << 6) + (c3 & 63); if (c3 < 0x80 || w > 0xFFFF) { return ERR_INVALID_CHARACTER; // utf8 error @@ -2093,42 +2612,51 @@ static enum MapcodeError parseMapcodeString(MapcodeElements *mapcodeElements, co isAbjad = 1; } } - cx = getRomanVersionOf((UWORD) w); + cx = getRomanVersionOf((UWORD)w); } c = decodeChar(cx); - if (c < 0) { // vowel or illegal? - if (c == -1) { // illegal? + if (c < 0) { + // vowel or illegal? + if (c == -1) { + // illegal? return ERR_INVALID_CHARACTER; } token = TOKENVOWEL; vowels++; if (mapcodeElements) { - *cleanPtr++ = (char) toupper(cx); + *cleanPtr++ = (char)toupper(cx); } - } else if (c < 10) { // digit + } + else if (c < 10) { + // digit token = TOKENCHR; // digit if (mapcodeElements) { - *cleanPtr++ = (char) toupper(cx); + *cleanPtr++ = (char)toupper(cx); } - } else { // character B-Z + } + else { + // character B-Z token = TOKENCHR; if (!extensionLength) { nondigits++; } if (mapcodeElements) { - *cleanPtr++ = (char) toupper(cx); + *cleanPtr++ = (char)toupper(cx); } } } newstate = STATE_MACHINE[state][token]; if (newstate >= 32) { - if (newstate >= 512) { // end of extension + if (newstate >= 512) { + // end of extension if (mapcodeElements) { *cleanPtr = 0; cleanPtr = mapcodeElements->precisionExtension; } - } else if (newstate >= 128) { - if (newstate >= 256) { // start of extension + } + else if (newstate >= 128) { + if (newstate >= 256) { + // start of extension extensionLength = 1; cleanPtr--; // get rid of hyphen } @@ -2137,15 +2665,20 @@ static enum MapcodeError parseMapcodeString(MapcodeElements *mapcodeElements, co *cleanPtr = 0; cleanPtr = mapcodeElements->precisionExtension; } - } else if (newstate >= 64) { // end of territory + } + else if (newstate >= 64) { + // end of territory nondigits = vowels = 0; if (mapcodeElements) { - int len = (int) (cleanPtr - mapcodeElements->properMapcode); - ASSERT(len < MAX_ISOCODE_LEN); - lengthCopy(mapcodeElements->territoryISO, mapcodeElements->properMapcode, len, MAX_ISOCODE_LEN + 1); + int len = (int)(cleanPtr - mapcodeElements->properMapcode); + ASSERT(len < MAX_ISOCODE_ASCII_LEN); + lengthCopy(mapcodeElements->territoryISO, mapcodeElements->properMapcode, len, + MAX_ISOCODE_ASCII_LEN + 1); cleanPtr = mapcodeElements->properMapcode; } - } else { // add to extension + } + else { + // add to extension if (++extensionLength > MAX_PRECISION_DIGITS) { return ERR_EXTENSION_INVALID_LENGTH; } @@ -2154,11 +2687,13 @@ static enum MapcodeError parseMapcodeString(MapcodeElements *mapcodeElements, co } if (newstate < 0) { - return (enum MapcodeError) newstate; - } else if (newstate == STATE_GO) { + return (enum MapcodeError)newstate; + } + else if (newstate == STATE_GO) { if (vowels > 3 || (nondigits == 1 && vowels > 1) || (nondigits > 1 && vowels > 0)) { return ERR_INVALID_VOWEL; - } else if (nondigits == 0 && vowels == 0) { + } + else if (nondigits == 0 && vowels == 0) { return ERR_ALL_DIGIT_CODE; } if (mapcodeElements) { @@ -2168,15 +2703,16 @@ static enum MapcodeError parseMapcodeString(MapcodeElements *mapcodeElements, co } if (isAbjad) { convertFromAbjad(mapcodeElements->properMapcode); - mapcodeElements->indexOfDot = (int) (strchr(mapcodeElements->properMapcode, '.') - - mapcodeElements->properMapcode); + mapcodeElements->indexOfDot = (int)(strchr(mapcodeElements->properMapcode, '.') - + mapcodeElements->properMapcode); } if (*mapcodeElements->territoryISO) { mapcodeElements->territoryCode = getTerritoryCode(mapcodeElements->territoryISO, territory); if (mapcodeElements->territoryCode < _TERRITORY_MIN) { return ERR_UNKNOWN_TERRITORY; } - } else { + } + else { mapcodeElements->territoryCode = territory; } if ((mapcodeElements->territoryCode == TERRITORY_MEX) && (strlen(mapcodeElements->properMapcode) < 8)) { @@ -2192,32 +2728,40 @@ static enum MapcodeError parseMapcodeString(MapcodeElements *mapcodeElements, co } -enum MapcodeError compareWithMapcodeFormatUtf8(const char *utf8String) { +enum MapcodeError compareWithMapcodeFormatUtf8(const char* utf8String) { ASSERT(utf8String); return parseMapcodeString(NULL, utf8String, FLAG_UTF8_STRING, TERRITORY_NONE); } -enum MapcodeError compareWithMapcodeFormatUtf16(const UWORD *Utf16String) { +enum MapcodeError compareWithMapcodeFormatUtf16(const UWORD* Utf16String) { ASSERT(Utf16String); - return parseMapcodeString(NULL, (const char *) Utf16String, FLAG_UTF16_STRING, TERRITORY_NONE); + return parseMapcodeString(NULL, (const char*)Utf16String, FLAG_UTF16_STRING, TERRITORY_NONE); } -// returns nonzero if error -static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { +/** + * Main decoder engine that converts a mapcode string to coordinates. + * Handles territory context, validates format, and iterates through + * possible territory boundaries to find the correct decoding. + * Returns ERR_OK on success, or appropriate error code on failure. + */ +static enum MapcodeError decoderEngine(DecodeRec* dec, int parseFlags) { enum Territory ccode; enum MapcodeError err; int codex; int from; int upto; int i; - char *s; + char* s; int wasAllDigits = 0; ASSERT(dec); + initCompanionTables(); + // Parse the mapcode string into its components (territory, proper mapcode, extension) err = parseMapcodeString(&dec->mapcodeElements, dec->orginput, parseFlags, dec->context); - if (err) { // clear all parsed fields in case of error + if (err) { + // Clear all parsed fields in case of error to ensure clean state dec->mapcodeElements.territoryISO[0] = 0; dec->mapcodeElements.properMapcode[0] = 0; dec->mapcodeElements.precisionExtension[0] = 0; @@ -2228,7 +2772,7 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { dec->context = ccode; dec->mapcode = dec->mapcodeElements.properMapcode; dec->extension = dec->mapcodeElements.precisionExtension; - codex = dec->mapcodeElements.indexOfDot * 9 + (int) strlen(dec->mapcodeElements.properMapcode) - 1; + codex = dec->mapcodeElements.indexOfDot * 9 + (int)strlen(dec->mapcodeElements.properMapcode) - 1; s = dec->mapcodeElements.properMapcode; if (strchr(s, 'A') || strchr(s, 'E') || strchr(s, 'U')) { @@ -2238,12 +2782,18 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { wasAllDigits = 1; } - if (codex == 54) { + if (codex > 54) { + ASSERT(codex == 55); + return ERR_MAPCODE_UNDECODABLE; + } + else if (codex == 54) { // international mapcodes must be in international context ccode = TERRITORY_AAA; - } else if (ccode < _TERRITORY_MIN) { + } + else if (ccode < _TERRITORY_MIN) { return ERR_MISSING_TERRITORY; - } else if (isSubdivision(ccode)) { + } + else if (isSubdivision(ccode)) { // int mapcodes must be interpreted in the parent of a subdivision enum Territory parent = parentTerritoryOf(ccode); if ((codex == 44) || ((codex == 34 || codex == 43) && (parent == TERRITORY_IND || parent == TERRITORY_MEX))) { @@ -2254,34 +2804,38 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { from = firstRec(ccode); upto = lastRec(ccode); - // try all ccode rectangles to decode s (pointing to first character of proper mapcode) + // try all ccode rectangles to decode s (pointing to first character of proper mapcode), assume not decodable + err = ERR_MAPCODE_UNDECODABLE; for (i = from; i <= upto; i++) { - const int codexi = coDex(i); - const int r = REC_TYPE(i); + const unsigned char kind = RECORD_KIND[i]; + const int codexi = (int) RECORD_CODEX[i]; + const int r = (int) RECORD_REC_TYPE[i]; if (r == 0) { - if (IS_NAMELESS(i)) { + if (kind & KIND_BIT_NAMELESS) { if (((codexi == 21) && (codex == 22)) || ((codexi == 22) && (codex == 32)) || ((codexi == 13) && (codex == 23))) { err = decodeNameless(dec, i); break; } - } else { + } + else { if ((codexi == codex) || ((codex == 22) && (codexi == 21))) { err = decodeGrid(dec, i, 0); // first of all, make sure the zone fits the country restrictZoneTo(&dec->zone, &dec->zone, TERRITORY_BOUNDARY(upto)); - if ((err == ERR_OK) && IS_RESTRICTED(i)) { + if ((err == ERR_OK) && (kind & KIND_BIT_RESTRICTED)) { int nrZoneOverlaps = 0; int j; // *** make sure decode fits somewhere *** dec->result = getMidPointFractions(&dec->zone); dec->coord32 = convertFractionsToCoord32(&dec->result); - for (j = i - 1; j >= from; j--) { // look in previous rects - if (!IS_RESTRICTED(j)) { + for (j = i - 1; j >= from; j--) { + // look in previous rects + if (!(RECORD_KIND[j] & KIND_BIT_RESTRICTED)) { if (fitsInsideBoundaries(&dec->coord32, TERRITORY_BOUNDARY(j))) { nrZoneOverlaps = 1; break; @@ -2292,8 +2846,9 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { if (!nrZoneOverlaps) { MapcodeZone zfound; TerritoryBoundary prevu; - for (j = from; j < i; j++) { // try all smaller rectangles j - if (!IS_RESTRICTED(j)) { + for (j = from; j < i; j++) { + // try all smaller rectangles j + if (!(RECORD_KIND[j] & KIND_BIT_RESTRICTED)) { MapcodeZone z; if (restrictZoneTo(&z, &dec->zone, TERRITORY_BOUNDARY(j))) { nrZoneOverlaps++; @@ -2302,7 +2857,9 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { zoneCopyFrom(&zfound, &z); ASSERT(j <= MAPCODE_BOUNDARY_MAX); memcpy(&prevu, TERRITORY_BOUNDARY(j), sizeof(TerritoryBoundary)); - } else { // nrZoneOverlaps >= 2 + } + else { + // nrZoneOverlaps >= 2 // more than one hit break; // give up } @@ -2312,7 +2869,8 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { // if several sub-areas intersect, just return the whole zone // (the center of which may NOT re-encode to the same mapcode!) - if (nrZoneOverlaps == 1) { // found exactly ONE intersection? + if (nrZoneOverlaps == 1) { + // found exactly ONE intersection? zoneCopyFrom(&dec->zone, &zfound); } } @@ -2320,16 +2878,19 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { if (!nrZoneOverlaps) { err = ERR_MAPCODE_UNDECODABLE; // type 3 "NLD L222.222" } - } // *** make sure decode fits somewhere *** + } // *** make sure decode fits somewhere *** break; } } - } else if (r == 1) { - if (codex == codexi + 10 && HEADER_LETTER(i) == *s) { + } + else if (r == 1) { + if (codex == codexi + 10 && (unsigned char) *s == RECORD_HEADER_LETTER[i]) { err = decodeGrid(dec, i, 1); break; } - } else { //r>1 + } + else { + //r>1 if (((codex == 23) && (codexi == 22)) || ((codex == 33) && (codexi == 23))) { err = decodeAutoHeader(dec, i); @@ -2381,36 +2942,149 @@ static enum MapcodeError decoderEngine(DecodeRec *dec, int parseFlags) { /////////////////////////////////////////////////////////////////////////////////////////////// // WARNING - these alphabets have NOT yet been released as standard! use at your own risk! check www.mapcode.com for details. -static const UWORD ASCII_TO_UTF16[_ALPHABET_MAX][36] = { // A-Z equivalents for ascii characters A to Z, 0-9 - // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 - {0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // roman - {0x0391, 0x0392, 0x039e, 0x0394, 0x0388, 0x0395, 0x0393, 0x0397, 0x0399, 0x03a0, 0x039a, 0x039b, 0x039c, 0x039d, 0x039f, 0x03a1, 0x0398, 0x03a8, 0x03a3, 0x03a4, 0x0389, 0x03a6, 0x03a9, 0x03a7, 0x03a5, 0x0396, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // greek - {0x0410, 0x0412, 0x0421, 0x0414, 0x0415, 0x0416, 0x0413, 0x041d, 0x0049, 0x041f, 0x041a, 0x041b, 0x041c, 0x0417, 0x041e, 0x0420, 0x0424, 0x042f, 0x0426, 0x0422, 0x042d, 0x0427, 0x0428, 0x0425, 0x0423, 0x0411, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // cyrillic - {0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05e3, 0x05d4, 0x05d6, 0x05d7, 0x05d5, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05e1, 0x05dd, 0x05de, 0x05e0, 0x05e2, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // hebrew - {0x0905, 0x0915, 0x0917, 0x0918, 0x090f, 0x091a, 0x091c, 0x091f, 0x0049, 0x0920, 0x0923, 0x0924, 0x0926, 0x0927, 0x004f, 0x0928, 0x092a, 0x092d, 0x092e, 0x0930, 0x092b, 0x0932, 0x0935, 0x0938, 0x0939, 0x092c, 0x0966, 0x0967, 0x0968, 0x0969, 0x096a, 0x096b, 0x096c, 0x096d, 0x096e, 0x096f}, // Devanagari - {0x0d12, 0x0d15, 0x0d16, 0x0d17, 0x0d0b, 0x0d1a, 0x0d1c, 0x0d1f, 0x0049, 0x0d21, 0x0d24, 0x0d25, 0x0d26, 0x0d27, 0x0d20, 0x0d28, 0x0d2e, 0x0d30, 0x0d31, 0x0d32, 0x0d09, 0x0d34, 0x0d35, 0x0d36, 0x0d38, 0x0d39, 0x0d66, 0x0d67, 0x0d68, 0x0d69, 0x0d6a, 0x0d6b, 0x0d6c, 0x0d6d, 0x0d6e, 0x0d6f}, // Malayalam - {0x10a0, 0x10a1, 0x10a3, 0x10a6, 0x10a4, 0x10a9, 0x10ab, 0x10ac, 0x0049, 0x10ae, 0x10b0, 0x10b1, 0x10b2, 0x10b4, 0x10ad, 0x10b5, 0x10b6, 0x10b7, 0x10b8, 0x10b9, 0x10a8, 0x10ba, 0x10bb, 0x10bd, 0x10be, 0x10bf, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Georgian - {0x30a2, 0x30ab, 0x30ad, 0x30af, 0x30aa, 0x30b1, 0x30b3, 0x30b5, 0x0049, 0x30b9, 0x30c1, 0x30c8, 0x30ca, 0x30cc, 0x004f, 0x30d2, 0x30d5, 0x30d8, 0x30db, 0x30e1, 0x30a8, 0x30e2, 0x30e8, 0x30e9, 0x30ed, 0x30f2, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Katakana - {0x0e30, 0x0e01, 0x0e02, 0x0e04, 0x0e32, 0x0e07, 0x0e08, 0x0e09, 0x0049, 0x0e0a, 0x0e11, 0x0e14, 0x0e16, 0x0e17, 0x004f, 0x0e18, 0x0e1a, 0x0e1c, 0x0e21, 0x0e23, 0x0e2c, 0x0e25, 0x0e27, 0x0e2d, 0x0e2e, 0x0e2f, 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, 0x0e58, 0x0e59}, // Thai - {0x0eb0, 0x0e81, 0x0e82, 0x0e84, 0x0ec3, 0x0e87, 0x0e88, 0x0e8a, 0x0ec4, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9a, 0x004f, 0x0e9c, 0x0e9e, 0x0ea1, 0x0ea2, 0x0ea3, 0x0ebd, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eaf, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Laos - {0x0556, 0x0532, 0x0533, 0x0534, 0x0535, 0x0538, 0x0539, 0x053a, 0x053b, 0x053d, 0x053f, 0x0540, 0x0541, 0x0543, 0x0555, 0x0547, 0x0548, 0x054a, 0x054d, 0x054e, 0x0545, 0x054f, 0x0550, 0x0551, 0x0552, 0x0553, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // armenian - {0x099c, 0x0998, 0x0995, 0x0996, 0x09ae, 0x0997, 0x0999, 0x099a, 0x0049, 0x099d, 0x09a0, 0x09a1, 0x09a2, 0x09a3, 0x004f, 0x09a4, 0x09a5, 0x09a6, 0x09a8, 0x09aa, 0x099f, 0x09ac, 0x09ad, 0x09af, 0x09b2, 0x09b9, 0x09e6, 0x09e7, 0x09e8, 0x09e9, 0x09ea, 0x09eb, 0x09ec, 0x09ed, 0x09ee, 0x09ef}, // Bengali/Assamese - {0x0a05, 0x0a15, 0x0a17, 0x0a18, 0x0a0f, 0x0a1a, 0x0a1c, 0x0a1f, 0x0049, 0x0a20, 0x0a23, 0x0a24, 0x0a26, 0x0a27, 0x004f, 0x0a28, 0x0a2a, 0x0a2d, 0x0a2e, 0x0a30, 0x0a2b, 0x0a32, 0x0a35, 0x0a38, 0x0a39, 0x0a21, 0x0a66, 0x0a67, 0x0a68, 0x0a69, 0x0a6a, 0x0a6b, 0x0a6c, 0x0a6d, 0x0a6e, 0x0a6f}, // Gurmukhi - {0x0f58, 0x0f40, 0x0f41, 0x0f42, 0x0f64, 0x0f44, 0x0f45, 0x0f46, 0x0049, 0x0f47, 0x0f49, 0x0f55, 0x0f50, 0x0f4f, 0x004f, 0x0f51, 0x0f53, 0x0f54, 0x0f56, 0x0f5e, 0x0f60, 0x0f5f, 0x0f61, 0x0f62, 0x0f63, 0x0f66, 0x0f20, 0x0f21, 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26, 0x0f27, 0x0f28, 0x0f29}, // Tibetan - {0x0628, 0x062a, 0x062d, 0x062e, 0x062B, 0x062f, 0x0630, 0x0631, 0x0627, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0647, 0x0637, 0x0638, 0x0639, 0x063a, 0x0641, 0x0642, 0x062C, 0x0644, 0x0645, 0x0646, 0x0648, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Arabic - {0x1112, 0x1100, 0x1102, 0x1103, 0x1166, 0x1105, 0x1107, 0x1109, 0x1175, 0x1110, 0x1111, 0x1161, 0x1162, 0x1163, 0x110b, 0x1164, 0x1165, 0x1167, 0x1169, 0x1172, 0x1174, 0x110c, 0x110e, 0x110f, 0x116d, 0x116e, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Korean // 0xc601, 0xc77c, 0xc774, 0xc0bc, 0xc0ac, 0xc624, 0xc721, 0xce60, 0xd314, 0xad6c (vocal digits) - {0x1005, 0x1000, 0x1001, 0x1002, 0x1013, 0x1003, 0x1004, 0x101a, 0x0049, 0x1007, 0x100c, 0x100d, 0x100e, 0x1010, 0x101d, 0x1011, 0x1012, 0x101e, 0x1014, 0x1015, 0x1016, 0x101f, 0x1017, 0x1018, 0x100f, 0x101c, 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049}, // Burmese - {0x1789, 0x1780, 0x1781, 0x1782, 0x1785, 0x1783, 0x1784, 0x1787, 0x179a, 0x1788, 0x178a, 0x178c, 0x178d, 0x178e, 0x004f, 0x1791, 0x1792, 0x1793, 0x1794, 0x1795, 0x179f, 0x1796, 0x1798, 0x179b, 0x17a0, 0x17a2, 0x17e0, 0x17e1, 0x17e2, 0x17e3, 0x17e4, 0x17e5, 0x17e6, 0x17e7, 0x17e8, 0x17e9}, // Khmer - {0x0d85, 0x0d9a, 0x0d9c, 0x0d9f, 0x0d89, 0x0da2, 0x0da7, 0x0da9, 0x0049, 0x0dac, 0x0dad, 0x0daf, 0x0db1, 0x0db3, 0x004f, 0x0db4, 0x0db6, 0x0db8, 0x0db9, 0x0dba, 0x0d8b, 0x0dbb, 0x0dbd, 0x0dc0, 0x0dc3, 0x0dc4, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Sinhalese - {0x0794, 0x0780, 0x0781, 0x0782, 0x0797, 0x0783, 0x0784, 0x0785, 0x0049, 0x0786, 0x0787, 0x0788, 0x0789, 0x078a, 0x004f, 0x078b, 0x078c, 0x078d, 0x078e, 0x078f, 0x079c, 0x0790, 0x0791, 0x0792, 0x0793, 0x07b1, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Thaana - {0x3123, 0x3105, 0x3108, 0x3106, 0x3114, 0x3107, 0x3109, 0x310a, 0x0049, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f, 0x004f, 0x3115, 0x3116, 0x3110, 0x3111, 0x3112, 0x3113, 0x3129, 0x3117, 0x3128, 0x3118, 0x3119, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Chinese - {0x2D49, 0x2D31, 0x2D33, 0x2D37, 0x2D53, 0x2D3C, 0x2D3D, 0x2D40, 0x2D4F, 0x2D43, 0x2D44, 0x2D45, 0x2D47, 0x2D4D, 0x2D54, 0x2D4E, 0x2D55, 0x2D56, 0x2D59, 0x2D5A, 0x2D62, 0x2D5B, 0x2D5C, 0x2D5F, 0x2D61, 0x2D63, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Tifinagh (BERBER) - {0x0b99, 0x0b95, 0x0b9a, 0x0b9f, 0x0b86, 0x0ba4, 0x0ba8, 0x0baa, 0x0049, 0x0bae, 0x0baf, 0x0bb0, 0x0bb2, 0x0bb5, 0x004f, 0x0bb4, 0x0bb3, 0x0bb1, 0x0b85, 0x0b88, 0x0b93, 0x0b89, 0x0b8e, 0x0b8f, 0x0b90, 0x0b92, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Tamil (digits 0xBE6-0xBEF) - {0x121B, 0x1260, 0x1264, 0x12F0, 0x121E, 0x134A, 0x1308, 0x1200, 0x0049, 0x12E8, 0x12AC, 0x1208, 0x1293, 0x1350, 0x12D0, 0x1354, 0x1240, 0x1244, 0x122C, 0x1220, 0x12C8, 0x1226, 0x1270, 0x1276, 0x1338, 0x12DC, 0x1372, 0x1369, 0x136a, 0x136b, 0x136c, 0x136d, 0x136e, 0x136f, 0x1370, 0x1371}, // Amharic (digits 1372|1369-1371) - {0x0C1E, 0x0C15, 0x0C17, 0x0C19, 0x0C2B, 0x0C1A, 0x0C1C, 0x0C1F, 0x0049, 0x0C20, 0x0C21, 0x0C23, 0x0C24, 0x0C25, 0x004f, 0x0C26, 0x0C27, 0x0C28, 0x0C2A, 0x0C2C, 0x0C2D, 0x0C2E, 0x0C30, 0x0C32, 0x0C33, 0x0C35, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Telugu - {0x0B1D, 0x0B15, 0x0B16, 0x0B17, 0x0B23, 0x0B18, 0x0B1A, 0x0B1C, 0x0049, 0x0B1F, 0x0B21, 0x0B22, 0x0B24, 0x0B25, 0x0B20, 0x0B26, 0x0B27, 0x0B28, 0x0B2A, 0x0B2C, 0x0B39, 0x0B2E, 0x0B2F, 0x0B30, 0x0B33, 0x0B38, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Odia - {0x0C92, 0x0C95, 0x0C96, 0x0C97, 0x0C8E, 0x0C99, 0x0C9A, 0x0C9B, 0x0049, 0x0C9C, 0x0CA0, 0x0CA1, 0x0CA3, 0x0CA4, 0x004f, 0x0CA6, 0x0CA7, 0x0CA8, 0x0CAA, 0x0CAB, 0x0C87, 0x0CAC, 0x0CAD, 0x0CB0, 0x0CB2, 0x0CB5, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Kannada - {0x0AB3, 0x0A97, 0x0A9C, 0x0AA1, 0x0A87, 0x0AA6, 0x0AAC, 0x0A95, 0x0049, 0x0A9A, 0x0A9F, 0x0AA4, 0x0AAA, 0x0AA0, 0x004f, 0x0AB0, 0x0AB5, 0x0A9E, 0x0AAE, 0x0AAB, 0x0A89, 0x0AB7, 0x0AA8, 0x0A9D, 0x0AA2, 0x0AAD, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039}, // Gujarati +static const UWORD ASCII_TO_UTF16[_ALPHABET_MAX][36] = { + // A-Z equivalents for ascii characters A to Z, 0-9 + // A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9 + { + 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, + 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059, 0x005a, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // roman + { + 0x0391, 0x0392, 0x039e, 0x0394, 0x0388, 0x0395, 0x0393, 0x0397, 0x0399, 0x03a0, 0x039a, 0x039b, 0x039c, 0x039d, + 0x039f, 0x03a1, 0x0398, 0x03a8, 0x03a3, 0x03a4, 0x0389, 0x03a6, 0x03a9, 0x03a7, 0x03a5, 0x0396, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // greek + { + 0x0410, 0x0412, 0x0421, 0x0414, 0x0415, 0x0416, 0x0413, 0x041d, 0x0049, 0x041f, 0x041a, 0x041b, 0x041c, 0x0417, + 0x041e, 0x0420, 0x0424, 0x042f, 0x0426, 0x0422, 0x042d, 0x0427, 0x0428, 0x0425, 0x0423, 0x0411, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // cyrillic + { + 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05e3, 0x05d4, 0x05d6, 0x05d7, 0x05d5, 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, + 0x05e1, 0x05dd, 0x05de, 0x05e0, 0x05e2, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // hebrew + { + 0x0905, 0x0915, 0x0917, 0x0918, 0x090f, 0x091a, 0x091c, 0x091f, 0x0049, 0x0920, 0x0923, 0x0924, 0x0926, 0x0927, + 0x004f, 0x0928, 0x092a, 0x092d, 0x092e, 0x0930, 0x092b, 0x0932, 0x0935, 0x0938, 0x0939, 0x092c, 0x0966, 0x0967, + 0x0968, 0x0969, 0x096a, 0x096b, 0x096c, 0x096d, 0x096e, 0x096f + }, // Devanagari + { + 0x0d12, 0x0d15, 0x0d16, 0x0d17, 0x0d0b, 0x0d1a, 0x0d1c, 0x0d1f, 0x0049, 0x0d21, 0x0d24, 0x0d25, 0x0d26, 0x0d27, + 0x0d20, 0x0d28, 0x0d2e, 0x0d30, 0x0d31, 0x0d32, 0x0d09, 0x0d34, 0x0d35, 0x0d36, 0x0d38, 0x0d39, 0x0d66, 0x0d67, + 0x0d68, 0x0d69, 0x0d6a, 0x0d6b, 0x0d6c, 0x0d6d, 0x0d6e, 0x0d6f + }, // Malayalam + { + 0x10a0, 0x10a1, 0x10a3, 0x10a6, 0x10a4, 0x10a9, 0x10ab, 0x10ac, 0x0049, 0x10ae, 0x10b0, 0x10b1, 0x10b2, 0x10b4, + 0x10ad, 0x10b5, 0x10b6, 0x10b7, 0x10b8, 0x10b9, 0x10a8, 0x10ba, 0x10bb, 0x10bd, 0x10be, 0x10bf, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Georgian + { + 0x30a2, 0x30ab, 0x30ad, 0x30af, 0x30aa, 0x30b1, 0x30b3, 0x30b5, 0x0049, 0x30b9, 0x30c1, 0x30c8, 0x30ca, 0x30cc, + 0x004f, 0x30d2, 0x30d5, 0x30d8, 0x30db, 0x30e1, 0x30a8, 0x30e2, 0x30e8, 0x30e9, 0x30ed, 0x30f2, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Katakana + { + 0x0e30, 0x0e01, 0x0e02, 0x0e04, 0x0e32, 0x0e07, 0x0e08, 0x0e09, 0x0049, 0x0e0a, 0x0e11, 0x0e14, 0x0e16, 0x0e17, + 0x004f, 0x0e18, 0x0e1a, 0x0e1c, 0x0e21, 0x0e23, 0x0e2c, 0x0e25, 0x0e27, 0x0e2d, 0x0e2e, 0x0e2f, 0x0e50, 0x0e51, + 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, 0x0e58, 0x0e59 + }, // Thai + { + 0x0eb0, 0x0e81, 0x0e82, 0x0e84, 0x0ec3, 0x0e87, 0x0e88, 0x0e8a, 0x0ec4, 0x0e8d, 0x0e94, 0x0e97, 0x0e99, 0x0e9a, + 0x004f, 0x0e9c, 0x0e9e, 0x0ea1, 0x0ea2, 0x0ea3, 0x0ebd, 0x0ea7, 0x0eaa, 0x0eab, 0x0ead, 0x0eaf, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Laos + { + 0x0556, 0x0532, 0x0533, 0x0534, 0x0535, 0x0538, 0x0539, 0x053a, 0x053b, 0x053d, 0x053f, 0x0540, 0x0541, 0x0543, + 0x0555, 0x0547, 0x0548, 0x054a, 0x054d, 0x054e, 0x0545, 0x054f, 0x0550, 0x0551, 0x0552, 0x0553, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // armenian + { + 0x099c, 0x0998, 0x0995, 0x0996, 0x09ae, 0x0997, 0x0999, 0x099a, 0x0049, 0x099d, 0x09a0, 0x09a1, 0x09a2, 0x09a3, + 0x004f, 0x09a4, 0x09a5, 0x09a6, 0x09a8, 0x09aa, 0x099f, 0x09ac, 0x09ad, 0x09af, 0x09b2, 0x09b9, 0x09e6, 0x09e7, + 0x09e8, 0x09e9, 0x09ea, 0x09eb, 0x09ec, 0x09ed, 0x09ee, 0x09ef + }, // Bengali/Assamese + { + 0x0a05, 0x0a15, 0x0a17, 0x0a18, 0x0a0f, 0x0a1a, 0x0a1c, 0x0a1f, 0x0049, 0x0a20, 0x0a23, 0x0a24, 0x0a26, 0x0a27, + 0x004f, 0x0a28, 0x0a2a, 0x0a2d, 0x0a2e, 0x0a30, 0x0a2b, 0x0a32, 0x0a35, 0x0a38, 0x0a39, 0x0a21, 0x0a66, 0x0a67, + 0x0a68, 0x0a69, 0x0a6a, 0x0a6b, 0x0a6c, 0x0a6d, 0x0a6e, 0x0a6f + }, // Gurmukhi + { + 0x0f58, 0x0f40, 0x0f41, 0x0f42, 0x0f64, 0x0f44, 0x0f45, 0x0f46, 0x0049, 0x0f47, 0x0f49, 0x0f55, 0x0f50, 0x0f4f, + 0x004f, 0x0f51, 0x0f53, 0x0f54, 0x0f56, 0x0f5e, 0x0f60, 0x0f5f, 0x0f61, 0x0f62, 0x0f63, 0x0f66, 0x0f20, 0x0f21, + 0x0f22, 0x0f23, 0x0f24, 0x0f25, 0x0f26, 0x0f27, 0x0f28, 0x0f29 + }, // Tibetan + { + 0x0628, 0x062a, 0x062d, 0x062e, 0x062B, 0x062f, 0x0630, 0x0631, 0x0627, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, + 0x0647, 0x0637, 0x0638, 0x0639, 0x063a, 0x0641, 0x0642, 0x062C, 0x0644, 0x0645, 0x0646, 0x0648, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Arabic + { + 0x1112, 0x1100, 0x1102, 0x1103, 0x1166, 0x1105, 0x1107, 0x1109, 0x1175, 0x1110, 0x1111, 0x1161, 0x1162, 0x1163, + 0x110b, 0x1164, 0x1165, 0x1167, 0x1169, 0x1172, 0x1174, 0x110c, 0x110e, 0x110f, 0x116d, 0x116e, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Korean // 0xc601, 0xc77c, 0xc774, 0xc0bc, 0xc0ac, 0xc624, 0xc721, 0xce60, 0xd314, 0xad6c (vocal digits) + { + 0x1005, 0x1000, 0x1001, 0x1002, 0x1013, 0x1003, 0x1004, 0x101a, 0x0049, 0x1007, 0x100c, 0x100d, 0x100e, 0x1010, + 0x101d, 0x1011, 0x1012, 0x101e, 0x1014, 0x1015, 0x1016, 0x101f, 0x1017, 0x1018, 0x100f, 0x101c, 0x1040, 0x1041, + 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, 0x1048, 0x1049 + }, // Burmese + { + 0x1789, 0x1780, 0x1781, 0x1782, 0x1785, 0x1783, 0x1784, 0x1787, 0x179a, 0x1788, 0x178a, 0x178c, 0x178d, 0x178e, + 0x004f, 0x1791, 0x1792, 0x1793, 0x1794, 0x1795, 0x179f, 0x1796, 0x1798, 0x179b, 0x17a0, 0x17a2, 0x17e0, 0x17e1, + 0x17e2, 0x17e3, 0x17e4, 0x17e5, 0x17e6, 0x17e7, 0x17e8, 0x17e9 + }, // Khmer + { + 0x0d85, 0x0d9a, 0x0d9c, 0x0d9f, 0x0d89, 0x0da2, 0x0da7, 0x0da9, 0x0049, 0x0dac, 0x0dad, 0x0daf, 0x0db1, 0x0db3, + 0x004f, 0x0db4, 0x0db6, 0x0db8, 0x0db9, 0x0dba, 0x0d8b, 0x0dbb, 0x0dbd, 0x0dc0, 0x0dc3, 0x0dc4, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Sinhalese + { + 0x0794, 0x0780, 0x0781, 0x0782, 0x0797, 0x0783, 0x0784, 0x0785, 0x0049, 0x0786, 0x0787, 0x0788, 0x0789, 0x078a, + 0x004f, 0x078b, 0x078c, 0x078d, 0x078e, 0x078f, 0x079c, 0x0790, 0x0791, 0x0792, 0x0793, 0x07b1, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Thaana + { + 0x3123, 0x3105, 0x3108, 0x3106, 0x3114, 0x3107, 0x3109, 0x310a, 0x0049, 0x310b, 0x310c, 0x310d, 0x310e, 0x310f, + 0x004f, 0x3115, 0x3116, 0x3110, 0x3111, 0x3112, 0x3113, 0x3129, 0x3117, 0x3128, 0x3118, 0x3119, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Chinese + { + 0x2D49, 0x2D31, 0x2D33, 0x2D37, 0x2D53, 0x2D3C, 0x2D3D, 0x2D40, 0x2D4F, 0x2D43, 0x2D44, 0x2D45, 0x2D47, 0x2D4D, + 0x2D54, 0x2D4E, 0x2D55, 0x2D56, 0x2D59, 0x2D5A, 0x2D62, 0x2D5B, 0x2D5C, 0x2D5F, 0x2D61, 0x2D63, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Tifinagh (BERBER) + { + 0x0b99, 0x0b95, 0x0b9a, 0x0b9f, 0x0b86, 0x0ba4, 0x0ba8, 0x0baa, 0x0049, 0x0bae, 0x0baf, 0x0bb0, 0x0bb2, 0x0bb5, + 0x004f, 0x0bb4, 0x0bb3, 0x0bb1, 0x0b85, 0x0b88, 0x0b93, 0x0b89, 0x0b8e, 0x0b8f, 0x0b90, 0x0b92, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Tamil (digits 0xBE6-0xBEF) + { + 0x121B, 0x1260, 0x1264, 0x12F0, 0x121E, 0x134A, 0x1308, 0x1200, 0x0049, 0x12E8, 0x12AC, 0x1208, 0x1293, 0x1350, + 0x12D0, 0x1354, 0x1240, 0x1244, 0x122C, 0x1220, 0x12C8, 0x1226, 0x1270, 0x1276, 0x1338, 0x12DC, 0x1372, 0x1369, + 0x136a, 0x136b, 0x136c, 0x136d, 0x136e, 0x136f, 0x1370, 0x1371 + }, // Amharic (digits 1372|1369-1371) + { + 0x0C1E, 0x0C15, 0x0C17, 0x0C19, 0x0C2B, 0x0C1A, 0x0C1C, 0x0C1F, 0x0049, 0x0C20, 0x0C21, 0x0C23, 0x0C24, 0x0C25, + 0x004f, 0x0C26, 0x0C27, 0x0C28, 0x0C2A, 0x0C2C, 0x0C2D, 0x0C2E, 0x0C30, 0x0C32, 0x0C33, 0x0C35, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Telugu + { + 0x0B1D, 0x0B15, 0x0B16, 0x0B17, 0x0B23, 0x0B18, 0x0B1A, 0x0B1C, 0x0049, 0x0B1F, 0x0B21, 0x0B22, 0x0B24, 0x0B25, + 0x0B20, 0x0B26, 0x0B27, 0x0B28, 0x0B2A, 0x0B2C, 0x0B39, 0x0B2E, 0x0B2F, 0x0B30, 0x0B33, 0x0B38, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Odia + { + 0x0C92, 0x0C95, 0x0C96, 0x0C97, 0x0C8E, 0x0C99, 0x0C9A, 0x0C9B, 0x0049, 0x0C9C, 0x0CA0, 0x0CA1, 0x0CA3, 0x0CA4, + 0x004f, 0x0CA6, 0x0CA7, 0x0CA8, 0x0CAA, 0x0CAB, 0x0C87, 0x0CAC, 0x0CAD, 0x0CB0, 0x0CB2, 0x0CB5, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Kannada + { + 0x0AB3, 0x0A97, 0x0A9C, 0x0AA1, 0x0A87, 0x0AA6, 0x0AAC, 0x0A95, 0x0049, 0x0A9A, 0x0A9F, 0x0AA4, 0x0AAA, 0x0AA0, + 0x004f, 0x0AB0, 0x0AB5, 0x0A9E, 0x0AAE, 0x0AAB, 0x0A89, 0x0AB7, 0x0AA8, 0x0A9D, 0x0AA2, 0x0AAD, 0x0030, 0x0031, + 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039 + }, // Gujarati }; /////////////////////////////////////////////////////////////////////////////////////////////// @@ -2420,17 +3094,16 @@ static const UWORD ASCII_TO_UTF16[_ALPHABET_MAX][36] = { // A-Z equivalents for /////////////////////////////////////////////////////////////////////////////////////////////// - /// PRIVATE convert a mapcode to an ABJAD-format (never more than 2 non-digits in a row) -static char *convertToAbjad(char *targetAsciiString, const char *sourceAsciiString, int maxLength) { +static char* convertToAbjad(char* targetAsciiString, const char* sourceAsciiString, int maxLength) { int form, i, dot, inarow, len; - const char *rest; + const char* rest; ASSERT(targetAsciiString); ASSERT(sourceAsciiString); - len = (int) strlen(sourceAsciiString); + len = (int)strlen(sourceAsciiString); rest = strchr(sourceAsciiString, '-'); if (rest != NULL) { - len = ((int) (rest - sourceAsciiString)); + len = ((int)(rest - sourceAsciiString)); } if (len >= maxLength) { len = maxLength - 1; @@ -2442,8 +3115,11 @@ static char *convertToAbjad(char *targetAsciiString, const char *sourceAsciiStri lengthCopy(targetAsciiString, sourceAsciiString, len, maxLength); unpackIfAllDigits(targetAsciiString); - len = (int) strlen(targetAsciiString); - dot = (int) (strchr(targetAsciiString, '.') - targetAsciiString); + len = (int)strlen(targetAsciiString); + { + const char* dotptr = strchr(targetAsciiString, '.'); + dot = dotptr ? (int)(dotptr - targetAsciiString) : -1; + } form = dot * 10 + (len - dot - 1); @@ -2455,17 +3131,19 @@ static char *convertToAbjad(char *targetAsciiString, const char *sourceAsciiStri inarow++; if (decodeChar(c) <= 9) { inarow = 0; - } else if (inarow > 2) { + } + else if (inarow > 2) { break; } } } if (dot < 2 || dot > 5 || (inarow < 3 && - (form == 22 || form == 32 || form == 33 || form == 42 || form == 43 || form == 44 || - form == 54))) { + (form == 22 || form == 32 || form == 33 || form == 42 || form == 43 || form == 44 || + form == 54))) { // no need to do anything, return input unchanged return safeCopy(targetAsciiString, sourceAsciiString, maxLength); - } else if (form >= 22 && form <= 54) { + } + else if (form >= 22 && form <= 54) { char c1, c2, c3 = '?'; int c = decodeChar(targetAsciiString[2]); if (c < 0) { @@ -2477,17 +3155,21 @@ static char *convertToAbjad(char *targetAsciiString, const char *sourceAsciiStri c1 = ENCODE_CHARS[c / 100]; c2 = ENCODE_CHARS[(c % 100) / 10]; c3 = ENCODE_CHARS[c % 10]; - } else if (len == 7) { + } + else if (len == 7) { if (form == 24) { c += 7; - } else if (form == 33) { + } + else if (form == 33) { c += 38; - } else if (form == 42) { + } + else if (form == 42) { c += 69; } c1 = ENCODE_CHARS[c / 10]; c2 = ENCODE_CHARS[c % 10]; - } else { + } + else { c1 = ENCODE_CHARS[2 + (c / 8)]; c2 = ENCODE_CHARS[2 + (c % 8)]; } @@ -2498,28 +3180,33 @@ static char *convertToAbjad(char *targetAsciiString, const char *sourceAsciiStri targetAsciiString[5] = targetAsciiString[4]; targetAsciiString[4] = c2; targetAsciiString[3] = c1; -// targetAsciiString[2] = '.'; -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; - } else if (form == 23) { // s0 s1 . s3 s4 s5 -> s0 s1 . C1 C2 s4 s5 + // targetAsciiString[2] = '.'; + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; + } + else if (form == 23) { + // s0 s1 . s3 s4 s5 -> s0 s1 . C1 C2 s4 s5 targetAsciiString[7] = 0; targetAsciiString[6] = targetAsciiString[5]; targetAsciiString[5] = targetAsciiString[4]; targetAsciiString[4] = c2; targetAsciiString[3] = c1; -// targetAsciiString[2] = '.'; -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; - } else if (form == 32) { // s0 s1 s2 . s4 s5 -> s0 s1 . C* C2 s4 s5 + // targetAsciiString[2] = '.'; + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; + } + else if (form == 32) { + // s0 s1 s2 . s4 s5 -> s0 s1 . C* C2 s4 s5 targetAsciiString[7] = 0; targetAsciiString[6] = targetAsciiString[5]; targetAsciiString[5] = targetAsciiString[4]; targetAsciiString[4] = c2; - targetAsciiString[3] = (char) (c1 + 4); + targetAsciiString[3] = (char)(c1 + 4); targetAsciiString[2] = '.'; -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; - } else if (form == 24 || form == 33 || form == 42) { + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; + } + else if (form == 24 || form == 33 || form == 42) { // s0 s1 . s3 s4 s5 s6 -> s0 s1 C1 . s4 C2 s5 s6 // s0 s1 s2 . s4 s5 s6 -> s0 s1 C1 . s4 C2 s5 s6 // s0 s1 s2 s3 . s5 s6 -> s0 s1 C1 . s3 C2 s5 s6 @@ -2530,67 +3217,73 @@ static char *convertToAbjad(char *targetAsciiString, const char *sourceAsciiStri targetAsciiString[4] = targetAsciiString[(form == 42 ? 3 : 4)]; targetAsciiString[3] = '.'; targetAsciiString[2] = c1; -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; - } else if (form == 34) { // s0 s1 s2 . s4 s5 s6 s7 -> s0 s1 C1 . s4 s5 C2 S6 S7 + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; + } + else if (form == 34) { + // s0 s1 s2 . s4 s5 s6 s7 -> s0 s1 C1 . s4 s5 C2 S6 S7 targetAsciiString[9] = 0; targetAsciiString[8] = targetAsciiString[7]; targetAsciiString[7] = targetAsciiString[6]; targetAsciiString[6] = c2; -// targetAsciiString[5] = targetAsciiString[5]; -// targetAsciiString[4] = targetAsciiString[4]; -// targetAsciiString[3] = '.'; + // targetAsciiString[5] = targetAsciiString[5]; + // targetAsciiString[4] = targetAsciiString[4]; + // targetAsciiString[3] = '.'; targetAsciiString[2] = c1; -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; - } else if (form == 43) { // s0 s1 s2 s3 . s5 s6 s7 -> s0 s1 C* . s3 s5 C2 S6 S7 + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; + } + else if (form == 43) { + // s0 s1 s2 s3 . s5 s6 s7 -> s0 s1 C* . s3 s5 C2 S6 S7 targetAsciiString[9] = 0; targetAsciiString[8] = targetAsciiString[7]; targetAsciiString[7] = targetAsciiString[6]; targetAsciiString[6] = c2; -// targetAsciiString[5] = targetAsciiString[5]; + // targetAsciiString[5] = targetAsciiString[5]; targetAsciiString[4] = targetAsciiString[3]; targetAsciiString[3] = '.'; - targetAsciiString[2] = (char) (c1 + 4); -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; - } else if (form == 44) { + targetAsciiString[2] = (char)(c1 + 4); + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; + } + else if (form == 44) { targetAsciiString[10] = 0; targetAsciiString[9] = targetAsciiString[7]; targetAsciiString[8] = c3; targetAsciiString[7] = targetAsciiString[6]; targetAsciiString[6] = targetAsciiString[5]; targetAsciiString[5] = c2; -// targetAsciiString[4] = '.'; -// targetAsciiString[3] = targetAsciiString[3]; + // targetAsciiString[4] = '.'; + // targetAsciiString[3] = targetAsciiString[3]; targetAsciiString[2] = c1; -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; - } else if (form == 54) { + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; + } + else if (form == 54) { targetAsciiString[11] = 0; targetAsciiString[10] = targetAsciiString[8]; targetAsciiString[9] = c3; targetAsciiString[8] = targetAsciiString[7]; targetAsciiString[7] = targetAsciiString[6]; targetAsciiString[6] = c2; -// targetAsciiString[5] = '.'; -// targetAsciiString[4] = targetAsciiString[4]; -// targetAsciiString[3] = targetAsciiString[3]; + // targetAsciiString[5] = '.'; + // targetAsciiString[4] = targetAsciiString[4]; + // targetAsciiString[3] = targetAsciiString[3]; targetAsciiString[2] = c1; -// targetAsciiString[1] = targetAsciiString[1]; -// targetAsciiString[0] = targetAsciiString[0]; + // targetAsciiString[1] = targetAsciiString[1]; + // targetAsciiString[0] = targetAsciiString[0]; } } repackIfAllDigits(targetAsciiString, 0); if (rest) { - int totalLen = (int) strlen(targetAsciiString); - int needed = (int) strlen(rest); + int totalLen = (int)strlen(targetAsciiString); + int needed = (int)strlen(rest); int tocopy = maxLength - totalLen - 1; if (tocopy > needed) { tocopy = needed; } if (tocopy > 0) { - memcpy(targetAsciiString + totalLen, rest, (size_t) tocopy); + memcpy(targetAsciiString + totalLen, rest, (size_t)tocopy); targetAsciiString[totalLen + tocopy] = 0; } } @@ -2598,12 +3291,12 @@ static char *convertToAbjad(char *targetAsciiString, const char *sourceAsciiStri } -static UWORD *encodeUtf16(UWORD *utf16String, const int maxLength, const char *asciiString, +static UWORD* encodeUtf16(UWORD* utf16String, const int maxLength, const char* asciiString, const enum Alphabet alphabet) // convert mapcode string alphabet { - UWORD *w = utf16String; - const UWORD *e = w + maxLength - 1; - const char *r = asciiString; + UWORD* w = utf16String; + const UWORD* e = w + maxLength - 1; + const char* r = asciiString; ASSERT(utf16String); ASSERT(asciiString); while (*r != 0 && w < e) { @@ -2611,13 +3304,19 @@ static UWORD *encodeUtf16(UWORD *utf16String, const int maxLength, const char *a if ((c >= 'a') && (c <= 'z')) { c += ('A' - 'a'); } - if ((c < ' ') || (c > 'Z')) { // not in any valid range? - *w++ = (UWORD) c; // leave untranslated - } else if ((c >= '0') && (c <= '9')) { // digit? - *w++ = ASCII_TO_UTF16[alphabet][26 + (int) c - '0']; - } else if (c < 'A') { // valid but not a letter (e.g. a dot, a space...) - *w++ = (UWORD) c; // leave untranslated - } else { + if ((c < ' ') || (c > 'Z')) { + // not in any valid range? + *w++ = (UWORD)c; // leave untranslated + } + else if ((c >= '0') && (c <= '9')) { + // digit? + *w++ = ASCII_TO_UTF16[alphabet][26 + (int)c - '0']; + } + else if (c < 'A') { + // valid but not a letter (e.g. a dot, a space...) + *w++ = (UWORD)c; // leave untranslated + } + else { *w++ = ASCII_TO_UTF16[alphabet][c - 'A']; } } @@ -2627,15 +3326,16 @@ static UWORD *encodeUtf16(UWORD *utf16String, const int maxLength, const char *a // PUBLIC - convert as much as will fit of mapcode into utf16String -UWORD *convertToAlphabet(UWORD *utf16String, int maxLength, const char *asciiString, +UWORD* convertToAlphabet(UWORD* utf16String, int maxLength, const char* asciiString, enum Alphabet alphabet) // 0=roman, 2=cyrillic { - UWORD *startbuf = utf16String; - UWORD *lastspot = &utf16String[maxLength - 1]; + UWORD* startbuf = utf16String; + UWORD* lastspot = &utf16String[maxLength - 1]; ASSERT(utf16String); ASSERT(asciiString); if (maxLength > 0) { - char targetAsciiString[MAX_MAPCODE_RESULT_LEN] = ""; + char targetAsciiString[MAX_MAPCODE_RESULT_ASCII_LEN] = ""; + char abjadString[MAX_MAPCODE_RESULT_ASCII_LEN] = ""; // skip leading spaces while (*asciiString > 0 && *asciiString <= 32) { @@ -2644,15 +3344,16 @@ UWORD *convertToAlphabet(UWORD *utf16String, int maxLength, const char *asciiStr // straight-copy everything up to and including first space { - const char *e = strchr(asciiString, ' '); + const char* e = strchr(asciiString, ' '); if (e) { while (asciiString <= e) { - if (utf16String == lastspot) { // buffer fully filled? + if (utf16String == lastspot) { + // buffer fully filled? // zero-terminate and return *utf16String = 0; return startbuf; } - *utf16String++ = (UWORD) *asciiString++; + *utf16String++ = (UWORD)*asciiString++; } while (*asciiString == ' ') { asciiString++; @@ -2662,16 +3363,17 @@ UWORD *convertToAlphabet(UWORD *utf16String, int maxLength, const char *asciiStr if (alphabet == ALPHABET_GREEK || alphabet == ALPHABET_HEBREW || alphabet == ALPHABET_ARABIC || alphabet == ALPHABET_KOREAN) { - asciiString = convertToAbjad(targetAsciiString, asciiString, MAX_MAPCODE_RESULT_LEN); + asciiString = convertToAbjad(abjadString, asciiString, MAX_MAPCODE_RESULT_ASCII_LEN); } // re-pack E/U-voweled mapcodes when necessary: - if (alphabet == ALPHABET_GREEK) { // alphabet has fewer characters than Roman! + if (alphabet == ALPHABET_GREEK) { + // alphabet has fewer characters than Roman! if (strchr(asciiString, 'E') || strchr(asciiString, 'U') || strchr(asciiString, 'e') || strchr(asciiString, 'u')) { // copy trimmed mapcode into temporary buffer targetAsciiString - int len = (int) strlen(asciiString); - if (len < MAX_MAPCODE_RESULT_LEN) { + int len = (int)strlen(asciiString); + if (len < MAX_MAPCODE_RESULT_ASCII_LEN) { while (len > 0 && asciiString[len - 1] > 0 && asciiString[len - 1] <= 32) { len--; } @@ -2684,7 +3386,7 @@ UWORD *convertToAlphabet(UWORD *utf16String, int maxLength, const char *asciiStr } } - encodeUtf16(utf16String, 1 + (int) (lastspot - utf16String), asciiString, alphabet); + encodeUtf16(utf16String, 1 + (int)(lastspot - utf16String), asciiString, alphabet); } return startbuf; } @@ -2693,41 +3395,44 @@ UWORD *convertToAlphabet(UWORD *utf16String, int maxLength, const char *asciiStr /** * Convert a zero-terminated UTF16 to a UTF8 string */ -char *convertUtf16ToUtf8(char *utf8, const UWORD *utf16) { +char* convertUtf16ToUtf8(char* utf8, const UWORD* utf16) { + char* start = utf8; ASSERT(utf16); ASSERT(utf8); while (*utf16) { UWORD c = *utf16++; if (c < 0x80) { - *utf8++ = (char) c; - } else if (c < 0x800) { - *utf8++ = (char) (0xC0 + (c >> 6)); - *utf8++ = (char) (0x80 + (c & 63)); - } else { - *utf8++ = (char) (0xE0 + (c >> 12)); - *utf8++ = (char) (0x80 + ((c >> 6) & 63)); - *utf8++ = (char) (0x80 + (c & 63)); + *utf8++ = (char)c; + } + else if (c < 0x800) { + *utf8++ = (char)(0xC0 + (c >> 6)); + *utf8++ = (char)(0x80 + (c & 63)); + } + else { + *utf8++ = (char)(0xE0 + (c >> 12)); + *utf8++ = (char)(0x80 + ((c >> 6) & 63)); + *utf8++ = (char)(0x80 + (c & 63)); } } *utf8 = 0; - return utf8; + return start; } // Caller must make sure utf8String can hold at least MAX_MAPCODE_RESULT_LEN characters (including 0-terminator). -UWORD *convertMapcodeToAlphabetUtf16(UWORD *utf16String, const char *mapcodeString, enum Alphabet alphabet) { +UWORD* convertMapcodeToAlphabetUtf16(UWORD* utf16String, const char* mapcodeString, enum Alphabet alphabet) { ASSERT(utf16String); ASSERT(mapcodeString); ASSERT(alphabet > _ALPHABET_MIN && alphabet < _ALPHABET_MAX); *utf16String = 0; - if (strlen(mapcodeString) < MAX_MAPCODE_RESULT_LEN) { - convertToAlphabet(utf16String, MAX_MAPCODE_RESULT_LEN, mapcodeString, alphabet); + if (strlen(mapcodeString) < MAX_MAPCODE_RESULT_ASCII_LEN) { + convertToAlphabet(utf16String, MAX_MAPCODE_RESULT_UTF16_LEN, mapcodeString, alphabet); } return utf16String; } -char *convertMapcodeToAlphabetUtf8(char *utf8String, const char *mapcodeString, enum Alphabet alphabet) { - UWORD utf16[MAX_MAPCODE_RESULT_LEN]; +char* convertMapcodeToAlphabetUtf8(char* utf8String, const char* mapcodeString, enum Alphabet alphabet) { + UWORD utf16[MAX_MAPCODE_RESULT_UTF16_LEN + 1]; return convertUtf16ToUtf8(utf8String, convertMapcodeToAlphabetUtf16(utf16, mapcodeString, alphabet)); } @@ -2738,19 +3443,22 @@ char *convertMapcodeToAlphabetUtf8(char *utf8String, const char *mapcodeString, // /////////////////////////////////////////////////////////////////////////////////////////////// -// PUBLIC - returns name of territory in (sufficiently large!) result string. +// PUBLIC - returns name of territory in (sufficiently large!) result string. // useShortNames: 0=full 1=short // returns empty string in case of error -char *getTerritoryIsoName(char *territoryISO, enum Territory territory, int useShortName) { - ASSERT(territory); - if (territory == TERRITORY_NONE) { +char* getTerritoryIsoName(char* territoryISO, enum Territory territory, int useShortName) { + ASSERT(territoryISO); + ASSERT(useShortName == 0 || useShortName == 1); + if (territory <= _TERRITORY_MIN || territory >= _TERRITORY_MAX) { *territoryISO = 0; - } else { - const char *alphaCode = ISO3166_ALPHA[INDEX_OF_TERRITORY(territory)]; - const char *hyphen = strchr(alphaCode, '-'); + } + else { + const char* alphaCode = ISO3166_ALPHA[INDEX_OF_TERRITORY(territory)]; + const char* hyphen = strchr(alphaCode, '-'); if (useShortName && hyphen != NULL) { strcpy(territoryISO, hyphen + 1); - } else { + } + else { strcpy(territoryISO, alphaCode); } } @@ -2778,7 +3486,8 @@ enum Territory getCountryOrParentCountry(enum Territory territory) { // PUBLIC - returns nonzero if coordinate is near more than one territory border int multipleBordersNearby(double latDeg, double lonDeg, enum Territory territory) { const enum Territory ccode = territory; - if ((ccode > _TERRITORY_MIN) && (ccode != TERRITORY_AAA)) { // valid territory, not earth + if ((ccode > _TERRITORY_MIN) && (ccode != TERRITORY_AAA)) { + // valid territory, not earth const enum Territory parentTerritoryCode = getParentCountryOf(territory); if (parentTerritoryCode != TERRITORY_NONE) { // there is a parent! check its borders as well... @@ -2809,18 +3518,18 @@ int multipleBordersNearby(double latDeg, double lonDeg, enum Territory territory } -static int compareAlphaCode(const void *e1, const void *e2) { - const AlphaRec *a1 = (const AlphaRec *) e1; - const AlphaRec *a2 = (const AlphaRec *) e2; +static int compareAlphaCode(const void* e1, const void* e2) { + const AlphaRec* a1 = (const AlphaRec*)e1; + const AlphaRec* a2 = (const AlphaRec*)e2; ASSERT(e1); ASSERT(e2); return strcmp(a1->alphaCode, a2->alphaCode); } // cmp -static enum Territory findMatch(const int parentNumber, const char *territoryISO) { +static enum Territory findMatch(const int parentNumber, const char* territoryISO) { // build an uppercase search term - char codeISO[MAX_ISOCODE_LEN + 1]; - const char *r = territoryISO; + char codeISO[MAX_ISOCODE_ASCII_LEN + 1]; + const char* r = territoryISO; int len = 0; ASSERT(territoryISO); @@ -2833,7 +3542,7 @@ static enum Territory findMatch(const int parentNumber, const char *territoryISO codeISO[2] = '-'; len = 3; } - while ((len < MAX_ISOCODE_LEN) && (*r > 32)) { + while ((len < MAX_ISOCODE_ASCII_LEN) && (*r > 32)) { codeISO[len++] = *r++; } if (*r > 32) { @@ -2841,14 +3550,16 @@ static enum Territory findMatch(const int parentNumber, const char *territoryISO } codeISO[len] = 0; makeUppercase(codeISO); - { // binary-search the result - const AlphaRec *p; + { + // binary-search the result + const AlphaRec* p; AlphaRec t; t.alphaCode = codeISO; - p = (const AlphaRec *) bsearch(&t, ALPHA_SEARCH, NR_TERRITORY_RECS, sizeof(AlphaRec), compareAlphaCode); + p = (const AlphaRec*)bsearch(&t, ALPHA_SEARCH, NR_TERRITORY_RECS, sizeof(AlphaRec), compareAlphaCode); if (p) { - if (strcmp(t.alphaCode, p->alphaCode) == 0) { // only interested in PERFECT match + if (strcmp(t.alphaCode, p->alphaCode) == 0) { + // only interested in PERFECT match return p->territory; } // match } // found @@ -2859,7 +3570,7 @@ static enum Territory findMatch(const int parentNumber, const char *territoryISO // PUBLIC - returns territory of territoryISO (or negative if not found). // optionalTerritoryContext: pass to handle ambiguities (pass TERRITORY_NONE if unknown). -enum Territory getTerritoryCode(const char *territoryISO, enum Territory optionalTerritoryContext) { +enum Territory getTerritoryCode(const char* territoryISO, enum Territory optionalTerritoryContext) { if (territoryISO == NULL) { return TERRITORY_NONE; } @@ -2871,9 +3582,11 @@ enum Territory getTerritoryCode(const char *territoryISO, enum Territory optiona if (territoryISO[0] && territoryISO[1]) { if (territoryISO[2] == '-') { return findMatch(getParentNumber(territoryISO, 2), territoryISO + 3); - } else if (territoryISO[2] && territoryISO[3] == '-') { + } + else if (territoryISO[2] && territoryISO[3] == '-') { return findMatch(getParentNumber(territoryISO, 3), territoryISO + 4); - } else { + } + else { enum Territory b; int parentNumber = 0; if (optionalTerritoryContext > _TERRITORY_MIN) { @@ -2891,23 +3604,24 @@ enum Territory getTerritoryCode(const char *territoryISO, enum Territory optiona // PUBLIC - decode string into lat,lon; returns negative in case of error -enum MapcodeError -decodeMapcodeToLatLonUtf8(double *latDeg, double *lonDeg, const char *mapcode, enum Territory territory, - MapcodeElements *mapcodeElements) { +enum MapcodeError decodeMapcodeToLatLonUtf8(double* latDeg, double* lonDeg, + const char* mapcode, enum Territory territory, + MapcodeElements* mapcodeElements) { if ((latDeg == NULL) || (lonDeg == NULL) || (mapcode == NULL)) { return ERR_BAD_ARGUMENTS; - } else { + } + else { enum MapcodeError ret; DecodeRec dec = { - {"", TERRITORY_NONE, "", 0, ""}, - 0, - 0, - 0, - TERRITORY_NONE, - 0, - {0.0, 0.0}, - {0, 0}, - {0.0, 0.0, 0.0, 0.0} + {"", TERRITORY_NONE, "", 0, ""}, + 0, + 0, + 0, + TERRITORY_NONE, + 0, + {0.0, 0.0}, + {0, 0}, + {0.0, 0.0, 0.0, 0.0} }; dec.orginput = mapcode; dec.context = territory; @@ -2925,25 +3639,26 @@ decodeMapcodeToLatLonUtf8(double *latDeg, double *lonDeg, const char *mapcode, e // PUBLIC - decode string into lat,lon; returns negative in case of error -enum MapcodeError -decodeMapcodeToLatLonUtf16(double *latDeg, double *lonDeg, const UWORD *mapcode, enum Territory territory, - MapcodeElements *mapcodeElements) { +enum MapcodeError decodeMapcodeToLatLonUtf16(double* latDeg, double* lonDeg, + const UWORD* mapcode, enum Territory territory, + MapcodeElements* mapcodeElements) { if ((latDeg == NULL) || (lonDeg == NULL) || (mapcode == NULL)) { return ERR_BAD_ARGUMENTS; - } else { + } + else { enum MapcodeError ret; DecodeRec dec = { - {"", TERRITORY_NONE, "", 0, ""}, - 0, - 0, - 0, - TERRITORY_NONE, - 0, - {0.0, 0.0}, - {0, 0}, - {0.0, 0.0, 0.0, 0.0} + {"", TERRITORY_NONE, "", 0, ""}, + 0, + 0, + 0, + TERRITORY_NONE, + 0, + {0.0, 0.0}, + {0, 0}, + {0.0, 0.0, 0.0, 0.0} }; - dec.orginput = (const char *) mapcode; + dec.orginput = (const char*)mapcode; dec.context = territory; ret = decoderEngine(&dec, FLAG_UTF16_STRING); @@ -2960,7 +3675,7 @@ decodeMapcodeToLatLonUtf16(double *latDeg, double *lonDeg, const UWORD *mapcode, // PUBLIC - encode lat,lon for territory to a mapcode with extraDigits accuracy int -encodeLatLonToSingleMapcode(char *mapcode, double latDeg, double lonDeg, enum Territory territory, int extraDigits) { +encodeLatLonToSingleMapcode(char* mapcode, double latDeg, double lonDeg, enum Territory territory, int extraDigits) { Mapcodes rlocal; int ret; ASSERT(mapcode); @@ -2970,12 +3685,10 @@ encodeLatLonToSingleMapcode(char *mapcode, double latDeg, double lonDeg, enum Te if (extraDigits > MAX_PRECISION_DIGITS) { extraDigits = MAX_PRECISION_DIGITS; } - if (territory <= TERRITORY_UNKNOWN) { - return 0; - } ret = encodeLatLonToMapcodes_internal(&rlocal, latDeg, lonDeg, territory, 1, DEBUG_STOP_AT, extraDigits); *mapcode = 0; - if (ret <= 0) { // no solutions? + if (ret <= 0) { + // no solutions? return ret; } // prefix territory unless international @@ -2984,9 +3697,25 @@ encodeLatLonToSingleMapcode(char *mapcode, double latDeg, double lonDeg, enum Te } +// PUBLIC - encode lat,lon for territory to a selected mapcode (from all results) with extraDigits accuracy +int +encodeLatLonToSelectedMapcode(char* mapcode, double latDeg, double lonDeg, enum Territory territory, int extraDigits, + int indexOfSelected) { + Mapcodes mapcodes; + int nrOfResults = 0; + nrOfResults = encodeLatLonToMapcodes(&mapcodes, latDeg, lonDeg, territory, extraDigits); + ASSERT(nrOfResults == mapcodes.count); + if ((nrOfResults <= 0) || (indexOfSelected < 0) || (indexOfSelected >= nrOfResults)) { + return 0; + } + strcpy(mapcode, mapcodes.mapcode[indexOfSelected]); + return nrOfResults; +} + + // PUBLIC - encode lat,lon for (optional) territory to mapcodes with extraDigits accuracy int -encodeLatLonToMapcodes(Mapcodes *mapcodes, double latDeg, double lonDeg, enum Territory territory, int extraDigits) { +encodeLatLonToMapcodes(Mapcodes* mapcodes, double latDeg, double lonDeg, enum Territory territory, int extraDigits) { ASSERT(mapcodes); if (extraDigits < 0) { return 0; @@ -3004,7 +3733,7 @@ encodeLatLonToMapcodes(Mapcodes *mapcodes, double latDeg, double lonDeg, enum Te /////////////////////////////////////////////////////////////////////////////////////////////// // PUBLIC - returns most common alphabets for territory, NULL if error -const TerritoryAlphabets *getAlphabetsForTerritory(enum Territory territory) { +const TerritoryAlphabets* getAlphabetsForTerritory(enum Territory territory) { if (territory > _TERRITORY_MIN && territory < _TERRITORY_MAX) { return &ALPHABETS_FOR_TERRITORY[INDEX_OF_TERRITORY(territory)]; } @@ -3018,90 +3747,152 @@ const TerritoryAlphabets *getAlphabetsForTerritory(enum Territory territory) { // /////////////////////////////////////////////////////////////////////////////////////////////// - -static int getFullTerritoryName_internal( - char *territoryName, - enum Territory territory, - int alternative, - int alphabet, - const char *namelist[]) { - - const char *s; - const char *pipePtr; +static int +getFullTerritoryName_internal(char* territoryName, enum Territory territory, int alternative, const char* locale, + enum Alphabet alphabet) { + const char* territoryNamesPiped; + const char* pipePtr; + const char** territoryNamesList = NULL; ASSERT(territoryName); - if (!territoryName) { + ASSERT((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX)); + ASSERT((alphabet == _ALPHABET_MIN) || ((_ALPHABET_MIN < alphabet) && (alphabet < _ALPHABET_MAX))); + + // Defensive bail out if incorrect arguments. + if (!territoryName || (alternative < 0) || (territory <= _TERRITORY_MIN) || (territory >= _TERRITORY_MAX)) { + if (territoryName) { + *territoryName = 0; + } return 0; } - if (!namelist || alternative < 0 || - territory <= _TERRITORY_MIN || territory >= _TERRITORY_MAX) { - *territoryName = 0; - return 0; + + // Check locale. + if (locale == NULL) { + // Use local names if locale is null. + territoryNamesList = TERRITORY_FULL_NAME_LOCAL; + } + else { + // Try and get correct list. + int i; + int upTo = (int)strlen(locale); + char localeUpper[4] = ""; // Default locale is empty (which implies 'fallback'). + char* sep = strchr(locale, '_'); // Official separator is '_' (as in "en_US"). + if (!sep) { + sep = strchr(locale, '-'); // But we also allow '-' (often used as well). + } + if (sep) { + upTo = (int)(sep - locale); + } + lengthCopy(localeUpper, locale, upTo, sizeof(localeUpper)); + makeUppercase(localeUpper); + + territoryNamesList = NULL; + for (i = 0; i < (int)(sizeof(LOCALE_REGISTRY) / sizeof(LOCALE_REGISTRY[0])); ++i) { + if (!strcmp(LOCALE_REGISTRY[i].locale, localeUpper)) { + territoryNamesList = LOCALE_REGISTRY[i].territoryFullNames; + break; + } + } } - s = namelist[INDEX_OF_TERRITORY(territory)]; + + // Use English if locale is invalid (or was empty = fallback). + if (territoryNamesList == NULL || territoryNamesList[0] == NULL) { + territoryNamesList = DEFAULT_TERRITORY_FULL_NAME; + } + + *territoryName = 0; + territoryNamesPiped = territoryNamesList[INDEX_OF_TERRITORY(territory)]; for (;;) { - pipePtr = strchr(s, '|'); + pipePtr = strchr(territoryNamesPiped, '|'); - if ((int) _ALPHABET_MIN < alphabet && alphabet < (int) _ALPHABET_MAX) { + if ((_ALPHABET_MIN < alphabet) && (alphabet < _ALPHABET_MAX)) { + // Alphabet was specified. if (pipePtr) { - lengthCopy(territoryName, s, (int) (pipePtr - s), MAX_TERRITORY_FULLNAME_LEN); - } else { - ASSERT(strlen(s) <= MAX_TERRITORY_FULLNAME_LEN); - strcpy(territoryName, s); - } - if ((enum Alphabet) alphabet != recognizeAlphabetUtf8(territoryName)) { // filter out - if (!pipePtr) { // this is the last string! - *territoryName = 0; + ASSERT((pipePtr - territoryNamesPiped) <= MAX_TERRITORY_FULLNAME_UTF8_LEN); + lengthCopy(territoryName, territoryNamesPiped, (int)(pipePtr - territoryNamesPiped), + MAX_TERRITORY_FULLNAME_UTF8_LEN); + } + else { + ASSERT(strlen(territoryNamesPiped) <= MAX_TERRITORY_FULLNAME_UTF8_LEN); + strcpy(territoryName, territoryNamesPiped); + } + if (alphabet != recognizeAlphabetUtf8(territoryName)) { + // filter out + if (!pipePtr) { + // this is the last string! return 0; } - s = pipePtr + 1; + territoryNamesPiped = pipePtr + 1; continue; } } - if (!pipePtr) { // this is the last string! - if (alternative) { // not what we want? - *territoryName = 0; + if (!pipePtr) { + // this is the last string! + if (alternative > 0) { + // not what we want? return 0; } - ASSERT(strlen(s) <= MAX_TERRITORY_FULLNAME_LEN); - strcpy(territoryName, s); // no bracket, return it all + ASSERT(strlen(territoryNamesPiped) <= MAX_TERRITORY_FULLNAME_UTF8_LEN); + strcpy(territoryName, territoryNamesPiped); // no bracket, return it all return 1; - } else { - if (!alternative) { // what we want? + } + else { + if (!alternative) { + // what we want? break; } alternative--; - s = pipePtr + 1; + territoryNamesPiped = pipePtr + 1; } } - lengthCopy(territoryName, s, (int) (pipePtr - s), MAX_TERRITORY_FULLNAME_LEN); + lengthCopy(territoryName, territoryNamesPiped, (int)(pipePtr - territoryNamesPiped), + MAX_TERRITORY_FULLNAME_UTF8_LEN); return 1; } -int getFullTerritoryNameEnglish(char *territoryName, enum Territory territory, int alternative) { - return getFullTerritoryName_internal(territoryName, territory, alternative, -1, TERRITORY_FULL_NAME); +int getFullTerritoryNameEnglish(char* territoryName, enum Territory territory, int alternative) { + ASSERT(territoryName); + ASSERT((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX)); + return getFullTerritoryNameInLocaleUtf8(territoryName, territory, alternative, "en_US"); } -int getFullTerritoryNameLocalInAlphabet(char *territoryName, enum Territory territory, int alternative, - enum Alphabet alphabet) { +int getFullTerritoryNameInLocaleUtf8(char* territoryName, enum Territory territory, int alternative, + const char* locale) { ASSERT(territoryName); - if (!territoryName) { - return 0; - } + ASSERT(((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX)) || (territory == TERRITORY_UNKNOWN)); + return getFullTerritoryName_internal(territoryName, territory, alternative, locale, _ALPHABET_MIN); +} + + +int getFullTerritoryNameInLocaleInAlphabetUtf8(char* territoryName, enum Territory territory, int alternative, + const char* locale, enum Alphabet alphabet) { + ASSERT(territoryName); + ASSERT((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX)); if ((alphabet <= _ALPHABET_MIN) || (alphabet >= _ALPHABET_MAX)) { *territoryName = 0; return 0; } - return getFullTerritoryName_internal(territoryName, territory, alternative, (int) alphabet, - TERRITORY_LOCAL_NAME_UTF8); + return getFullTerritoryName_internal(territoryName, territory, alternative, locale, alphabet); } -int getFullTerritoryNameLocal(char *territoryName, enum Territory territory, int alternative) { - return getFullTerritoryName_internal(territoryName, territory, alternative, -1, TERRITORY_LOCAL_NAME_UTF8); +int getFullTerritoryNameLocalUtf8(char* territoryName, enum Territory territory, int alternative) { + ASSERT(territoryName); + ASSERT((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX)); + return getFullTerritoryName_internal(territoryName, territory, alternative, NULL, _ALPHABET_MIN); } +int getFullTerritoryNameLocalInAlphabetUtf8(char* territoryName, enum Territory territory, int alternative, + enum Alphabet alphabet) { + ASSERT(territoryName); + ASSERT((_TERRITORY_MIN < territory) && (territory < _TERRITORY_MAX)); + if ((alphabet <= _ALPHABET_MIN) || (alphabet >= _ALPHABET_MAX)) { + *territoryName = 0; + return 0; + } + return getFullTerritoryName_internal(territoryName, territory, alternative, NULL, alphabet); +} diff --git a/mapcodelib/mapcoder.h b/mapcodelib/mapcoder.h index 13b88d4..918360d 100644 --- a/mapcodelib/mapcoder.h +++ b/mapcodelib/mapcoder.h @@ -1,67 +1,125 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. #ifndef __MAPCODER_H__ #define __MAPCODER_H__ #ifdef __cplusplus extern "C" { + #endif +#include #include "mapcode_territories.h" #include "mapcode_alphabets.h" +// English is always defined - this is the fallback language for any unknown language. +#define MAPCODE_SUPPORT_LANGUAGE_EN +#define DEFAULT_TERRITORY_FULL_NAME TERRITORY_FULL_NAME_EN + +#ifndef MAPCODE_NO_SUPPORT_ALL_LANGUAGES +#define MAPCODE_SUPPORT_LANGUAGE_AF +#define MAPCODE_SUPPORT_LANGUAGE_AR +#define MAPCODE_SUPPORT_LANGUAGE_BE +#define MAPCODE_SUPPORT_LANGUAGE_CN +#define MAPCODE_SUPPORT_LANGUAGE_CS +#define MAPCODE_SUPPORT_LANGUAGE_DA +#define MAPCODE_SUPPORT_LANGUAGE_DE +#define MAPCODE_SUPPORT_LANGUAGE_EN +#define MAPCODE_SUPPORT_LANGUAGE_ES +#define MAPCODE_SUPPORT_LANGUAGE_FI +#define MAPCODE_SUPPORT_LANGUAGE_FR +#define MAPCODE_SUPPORT_LANGUAGE_HE +#define MAPCODE_SUPPORT_LANGUAGE_HI +#define MAPCODE_SUPPORT_LANGUAGE_HR +#define MAPCODE_SUPPORT_LANGUAGE_ID +#define MAPCODE_SUPPORT_LANGUAGE_IT +#define MAPCODE_SUPPORT_LANGUAGE_JA +#define MAPCODE_SUPPORT_LANGUAGE_KO +#define MAPCODE_SUPPORT_LANGUAGE_NL +#define MAPCODE_SUPPORT_LANGUAGE_NO +#define MAPCODE_SUPPORT_LANGUAGE_PL +#define MAPCODE_SUPPORT_LANGUAGE_PT +#define MAPCODE_SUPPORT_LANGUAGE_RU +#define MAPCODE_SUPPORT_LANGUAGE_SV +#define MAPCODE_SUPPORT_LANGUAGE_SW +#define MAPCODE_SUPPORT_LANGUAGE_TR +#define MAPCODE_SUPPORT_LANGUAGE_UK +#endif + +#define MAPCODE_C_VERSION "2.5.7" +#define UWORD uint16_t // 2-byte unsigned integer. + +#define MAX_NR_OF_MAPCODE_RESULTS 22 // Max. number of results ever returned by encoder (e.g. for 26.904899, 95.138515). + +#define MAX_PRECISION_DIGITS 8 // Max. number of extension characters (excluding the hyphen). Must be even. + + +#define MAX_PROPER_MAPCODE_ASCII_LEN 11 // Max. chars in a proper mapcode (including the dot, excl. precision extension). + +#define MAX_ISOCODE_ASCII_LEN 7 // Max. chars in a valid ISO3166 territory code. +#define MAX_CLEAN_MAPCODE_ASCII_LEN (MAX_PROPER_MAPCODE_ASCII_LEN + 1 + MAX_PRECISION_DIGITS) // Max. chars in a clean mapcode (excluding zero-terminator). + +#define MAX_MAPCODE_RESULT_ASCII_LEN (MAX_ISOCODE_ASCII_LEN + 1 + MAX_CLEAN_MAPCODE_ASCII_LEN + 1) // Max. chars to store a single result (including zero-terminator). -#define MAPCODE_C_VERSION "2.5.1" -#define UWORD unsigned short int // 2-byte unsigned integer. -#define MAX_NR_OF_MAPCODE_RESULTS 22 // Max. number of results ever returned by encoder (e.g. for 26.904899, 95.138515). -#define MAX_PROPER_MAPCODE_LEN 11 // Max. number of characters in a proper mapcode (including the dot, excl. precision extension). -#define MAX_PRECISION_DIGITS 8 // Max. number of extension characters (excluding the hyphen). Must be even. -#define MAX_ISOCODE_LEN 7 // Max. number of characters of a valid ISO3166 territory code; although nothing longer than SIX characters is ever generated (RU-KAM), users can input SEVEN characters (RUS-KAM). -#define MAX_TERRITORY_FULLNAME_LEN 79 // Max. number of characters to store the longest possible territory name (in any alphabet, excl. 0-terminator). -#define MAX_CLEAN_MAPCODE_LEN (MAX_PROPER_MAPCODE_LEN + 1 + MAX_PRECISION_DIGITS) // Max. number of characters in a clean mapcode (excluding zero-terminator). -#define MAX_MAPCODE_RESULT_LEN (MAX_ISOCODE_LEN + 1 + MAX_CLEAN_MAPCODE_LEN + 1) // Max. number of characters to store a single result (including zero-terminator). +#define MAX_TERRITORY_FULLNAME_UTF8_LEN 111 // Max. number of characters to store the longest possible territory name (in UTF-8) +#define MAX_MAPCODE_RESULT_UTF8_LEN (MAX_MAPCODE_RESULT_ASCII_LEN * 3) // One mapcode character can become at most 3 UTF-8 characters. + +#define MAX_MAPCODE_RESULT_UTF16_LEN (MAX_MAPCODE_RESULT_ASCII_LEN) // Each mapcode character can become one UTF-16 word. + + +// The constants are also exported as variables, to allow other languages to use them. +extern char* _MAPCODE_C_VERSION; +extern int _MAX_NR_OF_MAPCODE_RESULTS; +extern int _MAX_PRECISION_DIGITS; +extern int _MAX_PROPER_MAPCODE_ASCII_LEN; +extern int _MAX_ISOCODE_ASCII_LEN; +extern int _MAX_CLEAN_MAPCODE_ASCII_LEN; +extern int _MAX_MAPCODE_RESULT_ASCII_LEN; +extern int _MAX_TERRITORY_FULLNAME_UTF8_LEN; +extern int _MAX_MAPCODE_RESULT_UTF8_LEN; +extern int _MAX_MAPCODE_RESULT_UTF16_LEN; +extern int _MAX_ALPHABETS_PER_TERRITORY; + /** - * The type Mapcodes hold a number of mapcodes, for example from an encoding call. - * If a result contains a space, that space seperates the territory ISO3166 code from the mapcode. + * The type `Mapcodes` holds a number of Mapcodes, for example from an encoding call. + * If a result contains a space, that space separates the territory ISO3166 code from the mapcode. * International mapcodes never include a territory ISO3166 code, nor a space. */ typedef struct { - int count; // The number of mapcode results (length of array). - char mapcode[MAX_NR_OF_MAPCODE_RESULTS][MAX_MAPCODE_RESULT_LEN]; // The mapcodes. + int count; // The number of mapcode results (length of array). + char mapcode[MAX_NR_OF_MAPCODE_RESULTS][MAX_MAPCODE_RESULT_ASCII_LEN]; // The mapcodes. } 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 `MapcodeElements` 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) + * char isoName[MAX_ISOCODE_ASCII_LEN + 1]; + * getTerritoryIsoName(isoName, mapcodeElements.territoryCode, 0); */ typedef struct { - 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). - char precisionExtension[MAX_PRECISION_DIGITS + 1]; // The (romanised) exyension (excluding the hyphen). + char territoryISO[MAX_ISOCODE_ASCII_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_ASCII_LEN + 1]; // The (romanised) mapcode excl. territory or extension. + int indexOfDot; // Position of dot in properMapcode (a value between 2 and 5). + char precisionExtension[MAX_PRECISION_DIGITS + 1]; // The (romanised) extension (excluding the hyphen). } MapcodeElements; @@ -69,42 +127,41 @@ typedef struct { * List of error return codes (negative except for ERR_OK = 0) */ enum MapcodeError { - // note: an incomplete mapcode could "become" complete by adding letters. - ERR_MAPCODE_INCOMPLETE = -999, // not enough letters (yet) after dot + ERR_MAPCODE_INCOMPLETE = -999, // not enough letters (yet) after dot // format errors. - ERR_ALL_DIGIT_CODE = -299, // mapcode consists only of digits - ERR_INVALID_MAPCODE_FORMAT, // string not recognized as mapcode format - ERR_INVALID_CHARACTER, // mapcode contains an invalid character - ERR_BAD_ARGUMENTS, // an argument is invalid (e.g. NULL) - ERR_INVALID_ENDVOWELS, // mapcodes ends in UE or UU - ERR_EXTENSION_INVALID_LENGTH, // precision extension too long, or empty + ERR_ALL_DIGIT_CODE = -299, // mapcode consists only of digits + ERR_INVALID_MAPCODE_FORMAT, // string not recognized as mapcode format + ERR_INVALID_CHARACTER, // mapcode contains an invalid character + ERR_BAD_ARGUMENTS, // an argument is invalid (e.g. NULL) + ERR_INVALID_ENDVOWELS, // mapcode ends in UE or UU + ERR_EXTENSION_INVALID_LENGTH, // precision extension too long, or empty ERR_EXTENSION_INVALID_CHARACTER, // bad precision extension character (e.g. Z) - ERR_UNEXPECTED_DOT, // mapcode dot can not be in this position - ERR_DOT_MISSING, // mapcode dot not found - ERR_UNEXPECTED_HYPHEN, // hyphen can not be in this position - ERR_INVALID_VOWEL, // vowel in invalid location, or missing - ERR_BAD_TERRITORY_FORMAT, // mapcode territory badly formatted - ERR_TRAILING_CHARACTERS, // characters found trailing the mapcode + ERR_UNEXPECTED_DOT, // mapcode dot can not be in this position + ERR_DOT_MISSING, // mapcode dot not found + ERR_UNEXPECTED_HYPHEN, // hyphen can not be in this position + ERR_INVALID_VOWEL, // vowel in invalid location, or missing + ERR_BAD_TERRITORY_FORMAT, // mapcode territory badly formatted + ERR_TRAILING_CHARACTERS, // characters found trailing the mapcode // parse errors. - ERR_UNKNOWN_TERRITORY = -199, // mapcode territory not recognized + ERR_UNKNOWN_TERRITORY = -199, // mapcode territory not recognized // other errors. - ERR_BAD_MAPCODE_LENGTH = -99, // proper mapcode too short or too long - ERR_MISSING_TERRITORY, // mapcode can not be decoded without territory - ERR_EXTENSION_UNDECODABLE, // extension does not decode to valid coordinate - ERR_MAPCODE_UNDECODABLE, // mapcode does not decode inside territory - ERR_BAD_COORDINATE, // latitude or longitude is NAN or infinite + ERR_BAD_MAPCODE_LENGTH = -99, // proper mapcode too short or too long + ERR_MISSING_TERRITORY, // mapcode can not be decoded without territory + ERR_EXTENSION_UNDECODABLE, // extension does not decode to valid coordinate + ERR_MAPCODE_UNDECODABLE, // mapcode does not decode inside territory + ERR_BAD_COORDINATE, // latitude or longitude is NaN or infinite // all OK. - ERR_OK = 0, + ERR_OK = 0 }; @@ -122,28 +179,25 @@ enum MapcodeError { * make them represent the coordinate more accurately. * * Returns: - * Number of results stored in parameter results. Always >= 0 (0 if no encoding was possible or an error occurred). - * The results are stored as pairs (Mapcode, territory name) in: - * (results[0], results[1])...(results[(2 * N) - 2], results[(2 * N) - 1]) + * Number of results stored in `mapcodes->count`. Always >= 0 (0 if no encoding was possible or an error occurred). + * Each resulting string is stored in `mapcodes->mapcode[i]` and may include a territory ISO3166 code followed by a space when applicable. */ int encodeLatLonToMapcodes( - Mapcodes *mapcodes, - double latDeg, - double lonDeg, - enum Territory territory, - int extraDigits); + Mapcodes* mapcodes, + double latDeg, + double lonDeg, + enum Territory territory, + int extraDigits); /** * Encode a latitude, longitude pair (in degrees) to a single Mapcode: the shortest possible for the given territory - * (which can be 0 for all territories). + * (pass TERRITORY_NONE or TERRITORY_UNKNOWN to consider all territories). * * Arguments: - * result - Returned Mapcode. The caller must not allocate or de-allocated this string. - * The resulting string MUST be allocated (and de-allocated) by the caller (contrary to - * encodeLatLonToMapcodes!). - * The caller should allocate at least MAX_MAPCODE_RESULT_LEN characters for the string. + * mapcode - Output buffer for the resulting Mapcode. The caller must allocate this buffer + * with capacity of at least MAX_MAPCODE_RESULT_ASCII_LEN characters. * lat - Latitude, in degrees. Range: -90..90. * lon - Longitude, in degrees. Range: -180..180. * territory - Territory (e.g. as obtained from getTerritoryCode), used as encoding context. @@ -156,15 +210,46 @@ int encodeLatLonToMapcodes( * Number of results. <=0 if encoding failed, or 1 if it succeeded. */ int encodeLatLonToSingleMapcode( - char *mapcode, - double latDeg, - double lonDeg, - enum Territory territory, - int extraDigits); + char* mapcode, + double latDeg, + double lonDeg, + enum Territory territory, + int extraDigits); /** - * Decode a utf8 or ascii Mapcode to a latitude, longitude pair (in degrees). + * Encode a latitude, longitude pair (in degrees) to a single Mapcode, selected from all Mapcodes. + * This method is offered for languages which have trouble supporting multi-dimensional arrays from C + * (like Swift). + * + * Arguments: + * mapcode - Output buffer for the resulting Mapcode. The caller must allocate this buffer + * with capacity of at least MAX_MAPCODE_RESULT_ASCII_LEN characters. + * lat - Latitude, in degrees. Range: -90..90. + * lon - Longitude, in degrees. Range: -180..180. + * territory - Territory (e.g. as obtained from getTerritoryCode), used as encoding context. + * Pass TERRITORY_NONE or TERRITORY_UNKNOWN to get Mapcodes for all territories. + * extraDigits - Number of extra "digits" to add to the generated mapcode. The preferred default is 0. + * Other valid values are 1 to 8, which will add extra letters to the mapcodes to + * make them represent the coordinate more accurately. + * indexOfSelected - Index of selected mapcode. Must be in valid range for number of results. + * The index is base 0. To fetch all Mapcodes, pass 0 in a first call to retrieve the + * first Mapcode and the total number of results and iterate over the rest. + * + * Returns: + * Total number of results available for selection. <=0 if encoding failed, or >0 if it succeeded. + */ +int encodeLatLonToSelectedMapcode( + char* mapcode, + double latDeg, + double lonDeg, + enum Territory territory, + int extraDigits, + int indexOfSelected); + + +/** + * Decode a UTF-8 or ASCII Mapcode to a latitude/longitude pair (in degrees). * * Arguments: * lat - Decoded latitude, in degrees. Range: -90..90. @@ -175,36 +260,36 @@ int encodeLatLonToSingleMapcode( * mapcodeElements - If not NULL, filled with analysis of the string (unless an error was encountered). * * Returns: - * ERR_OK if encoding succeeded. + * ERR_OK if decoding succeeded. */ enum MapcodeError decodeMapcodeToLatLonUtf8( - double *latDeg, - double *lonDeg, - const char *utf8string, - enum Territory territory, - MapcodeElements *mapcodeElements); + double* latDeg, + double* lonDeg, + const char* utf8string, + enum Territory territory, + MapcodeElements* mapcodeElements); /** - * Decode a utf16 Mapcode to a latitude, longitude pair (in degrees). + * Decode a UTF-16 Mapcode to a latitude/longitude pair (in degrees). * * Arguments: * lat - Decoded latitude, in degrees. Range: -90..90. * lon - Decoded longitude, in degrees. Range: -180..180. - * mapcodeElements - If not NULL, filled with analysis of the string (unless an error was encountered) - * utf8string - Mapcode to decode (ascii or utf8 string). + * utf16string - Mapcode to decode (UTF-16 string). * territory - Territory (e.g. as obtained from getTerritoryCode), used as decoding context. * Pass TERRITORY_NONE if not available. + * mapcodeElements - If not NULL, filled with analysis of the string (unless an error was encountered). * * Returns: - * ERR_OK if encoding succeeded. + * ERR_OK if decoding succeeded. */ enum MapcodeError decodeMapcodeToLatLonUtf16( - double *latDeg, - double *lonDeg, - const UWORD *utf16string, - enum Territory territory, - MapcodeElements *mapcodeElements); + double* latDeg, + double* lonDeg, + const UWORD* utf16string, + enum Territory territory, + MapcodeElements* mapcodeElements); /** @@ -212,7 +297,7 @@ enum MapcodeError decodeMapcodeToLatLonUtf16( * the return value ERR_OK indicates the string has the Mapcode format, much like string comparison strcmp returns.) * * Arguments: - * utf8String/utf16String - Mapcode string to check, in UTF8 or UTF16 format. + * utf8String/utf16String - Mapcode string to check, in UTF-8 or UTF-16 format. * * Returns: * ERR_OK if the string has a correct Mapcode format, another ERR_XXX value if the string does @@ -222,46 +307,46 @@ enum MapcodeError decodeMapcodeToLatLonUtf16( * NOTE: a correct Mapcode format does not in itself guarantee the mapcode will decode to * a valid coordinate! */ -enum MapcodeError compareWithMapcodeFormatUtf8(const char *utf8String); +enum MapcodeError compareWithMapcodeFormatUtf8(const char* utf8String); -enum MapcodeError compareWithMapcodeFormatUtf16(const UWORD *utf16String); +enum MapcodeError compareWithMapcodeFormatUtf16(const UWORD* utf16String); /** * Convert an ISO3166 territory code to a territory. * * Arguments: - * territoryISO - String starting with ISO3166 code of territory (e.g. "USA" or "US-CA"). - * parentTerritoryCode - Parent territory, or TERRITORY_NONE if not available. + * territoryISO - String starting with ISO3166 code of territory (e.g. "USA" or "US-CA"). + * optionalTerritoryContext - Parent territory, or TERRITORY_NONE if not available. * * Returns: * Territory (> _TERRITORY_MIN) if succeeded, or TERRITORY_NONE if failed. */ enum Territory getTerritoryCode( - const char *territoryISO, - enum Territory optionalTerritoryContext); + const char* territoryISO, + enum Territory optionalTerritoryContext); /** * Convert a territory to a territory name. * * Arguments: - * territoryISO - String to territory ISO code name result. + * territoryISO - Output buffer for the territory ISO code name. * territory - Territory to get the name of. - * userShortName - Pass 0 for full name, 1 for short name (state codes may be ambiguous). + * useShortName - Pass 0 for full name, 1 for short name (state codes may be ambiguous). * * Returns: * Pointer to result. String will be empty if territory illegal. */ -char *getTerritoryIsoName( - char *territoryISO, - enum Territory territory, - int useShortName); +char* getTerritoryIsoName( + char* territoryISO, + enum Territory territory, + int useShortName); /** - * Given a territory, return the territory itself it it was a country, or return its parent - * territory if it was a subdivision (e.g. a state). + * Given a territory, return the territory itself if it is a country, or return its parent + * territory if it is a subdivision (e.g. a state). * * Arguments: * territory - territory (either a country or a subdivision, e.g. a state). @@ -317,21 +402,21 @@ double maxErrorInMeters(int extraDigits); * Return value: * 0 if coordinate is NOT near more than one territory border, non-0 otherwise. * - * Note that for the mapcode system, the following should hold: IF a point p has a + * Note that for the mapcode system, the following should hold: IF a point p has a * mapcode M, THEN decode(M) delivers a point q within maxErrorInMeters() of p. * Furthermore, encode(q) must yield back M *unless* point q is near multiple borders. */ int multipleBordersNearby( - double latDeg, - double lonDeg, - enum Territory territory); + double latDeg, + double lonDeg, + enum Territory territory); /** - * Returns territory names in English or in the local language. There's always at least 1 alternative (with index 0). + * Returns territory names in English. There's always at least 1 alternative (with index 0). * * Arguments: - * territoryName - Target string, allocated by caller to be at least MAX_TERRITORY_NAME_LENGTH + 1 bytes. + * territoryName - Target string, allocated by caller to be at least MAX_TERRITORY_FULLNAME_UTF8_LEN + 1 bytes. * territory - Territory to get name for. * alternative - Which name to get, must be >= 0 (0 = default, 1 = first alternative, 2 = second etc.). * @@ -340,9 +425,9 @@ int multipleBordersNearby( * non-0 if the alternative exists (territoryName contains name). */ int getFullTerritoryNameEnglish( - char *territoryName, - enum Territory territory, - int alternative); + char* territoryName, + enum Territory territory, + int alternative); /** @@ -351,29 +436,59 @@ int getFullTerritoryNameEnglish( * of its alphabet. There is always at least 1 alternative, with index 0. * * Arguments: - * territoryName - Target string, allocated by caller to be at least MAX_TERRITORY_NAME_LENGTH + 1 bytes. + * territoryName - Target string, allocated by caller to be at least MAX_TERRITORY_FULLNAME_UTF8_LEN + 1 bytes. + * territory - Territory to get name for. + * alternative - Which name to get, must be >= 0 (0 = default, 1 = first alternative, 2 = second etc.). + * alphabet - Alphabet to use for territoryName. Must be a valid alphabet value. + * + * Return value: + * 0 if the alternative does not exist (territoryName will be empty). + * non-0 if the alternative exists (territoryName contains name). + */ +int getFullTerritoryNameLocalUtf8( + char* territoryName, + enum Territory territory, + int alternative); + +int getFullTerritoryNameLocalInAlphabetUtf8( + char* territoryName, + enum Territory territory, + int alternative, + enum Alphabet alphabet); + + +/** + * Returns territory names in a specific locale. There are two variants of this call. One returns + * territory names in a specified alphabet only. The other simply returns the local names, regardless + * of its alphabet. There is always at least 1 alternative, with index 0. + * + * Arguments: + * territoryName - Target string, allocated by caller to be at least MAX_TERRITORY_FULLNAME_UTF8_LEN + 1 bytes. * territory - Territory to get name for. * alternative - Which name to get, must be >= 0 (0 = default, 1 = first alternative, 2 = second etc.). + * locale - A locale (e.g. "en_US" for U.S. English); use NULL for local territory names. * alphabet - Alphabet to use for territoryName. Must be a valid alphabet value. * * Return value: * 0 if the alternative does not exist (territoryName will be empty). * non-0 if the alternative exists (territoryName contains name). */ -int getFullTerritoryNameLocal( - char *territoryName, - enum Territory territory, - int alternative); +int getFullTerritoryNameInLocaleUtf8( + char* territoryName, + enum Territory territory, + int alternative, + const char* locale); -int getFullTerritoryNameLocalInAlphabet( - char *territoryName, - enum Territory territory, - int alternative, - enum Alphabet alphabet); +int getFullTerritoryNameInLocaleInAlphabetUtf8( + char* territoryName, + enum Territory territory, + int alternative, + const char* locale, + enum Alphabet alphabet); /** - * This struct contains the returned alphabest for getAlphabetsForTerritory. The 'count' specifies + * This struct contains the returned alphabets for getAlphabetsForTerritory. The 'count' specifies * how many alphabets are listed in 'alphabet', range [1, MAX_ALPHABETS_PER_TERRITORY]. */ #define MAX_ALPHABETS_PER_TERRITORY 3 @@ -393,9 +508,9 @@ typedef struct { * * Returns: * A pointer to a TerritoryAlphabets structure, or NULL if the territory is invalid. - * (The pointer is owned by the library and should not be dealloacted by the caller.) + * (The pointer is owned by the library and should not be deallocated by the caller.) */ -const TerritoryAlphabets *getAlphabetsForTerritory(enum Territory territory); +const TerritoryAlphabets* getAlphabetsForTerritory(enum Territory territory); /** @@ -403,14 +518,14 @@ const TerritoryAlphabets *getAlphabetsForTerritory(enum Territory territory); * * Arguments: * utf8String - Buffer to be filled with the Unicode string result. - * Must have capacity for (3 * MAX_MAPCODE_RESULT_LEN + 1) characters. - * asciiString - ASCII string to encode (must be < MAX_MAPCODE_RESULT_LEN characters). + * Must have capacity for MAX_MAPCODE_RESULT_UTF8_LEN + 1 characters. + * asciiString - ASCII string to encode (must be < MAX_MAPCODE_RESULT_ASCII_LEN characters). * alphabet - Alphabet to use. * * Returns: - * Encode UTF8 string (pointer to utf8String buffer), allocated and deallocated by the caller. + * Encoded UTF-8 string (pointer to utf8String buffer), allocated and deallocated by the caller. */ -char *convertMapcodeToAlphabetUtf8(char *utf8String, const char *asciiString, enum Alphabet alphabet); +char* convertMapcodeToAlphabetUtf8(char* utf8String, const char* asciiString, enum Alphabet alphabet); /** @@ -418,14 +533,14 @@ char *convertMapcodeToAlphabetUtf8(char *utf8String, const char *asciiString, en * * Arguments: * utf16String - Buffer to be filled with the Unicode string result. - * Must have capacity for (MAX_MAPCODE_RESULT_LEN utf16 + 1) characters. - * asciiString - ASCII string to encode (must be < MAX_MAPCODE_RESULT_LEN characters). + * Must have capacity for MAX_MAPCODE_RESULT_UTF16_LEN 16-bit characters. + * asciiString - ASCII string to encode (must be < MAX_MAPCODE_RESULT_ASCII_LEN characters). * alphabet - Alphabet to use. * * Returns: - * Encode UTF16 string (pointer to utf16String buffer), allocated and deallocated by the caller. + * Encoded UTF-16 string (pointer to utf16String buffer), allocated and deallocated by the caller. */ -UWORD *convertMapcodeToAlphabetUtf16(UWORD *utf16String, const char *asciiString, enum Alphabet alphabet); +UWORD* convertMapcodeToAlphabetUtf16(UWORD* utf16String, const char* asciiString, enum Alphabet alphabet); #ifdef __cplusplus diff --git a/unittest/README.md b/test/README.md similarity index 94% rename from unittest/README.md rename to test/README.md index fca55d3..5fc21c1 100644 --- a/unittest/README.md +++ b/test/README.md @@ -4,7 +4,7 @@ To build the unit tests, execute: cd ../mapcodelib gcc -DDEBUG -O -c mapcoder.c - cd ../unittest + cd ../test gcc -DDEBUG -O -DDEBUG unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o To execute the tests, simply execute: @@ -17,7 +17,7 @@ Compile and run as follows to use `valgrind` (http://valgrind.org) to detect mem cd ../mapcodelib gcc -g -O0 -c mapcoder.c - cd ../unittest + cd ../test gcc -g -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o valgrind --leak-check=yes ./unittest @@ -27,7 +27,7 @@ Or, add `-fsanitize=address` to run the address sanitizer: cd ../mapcodelib gcc -O -c mapcoder.c - cd ../unittest + cd ../test gcc -O unittest.c -lm -lpthread -fsanitize=address -o unittest ../mapcodelib/mapcoder.o 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: cd ../mapcodelib gcc -g -O0 -c mapcoder.c -pg - cd ../unittest + cd ../test gcc -g -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -pg ## 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: cd ../mapcodelib gcc -fprofile-arcs -ftest-coverage -O0 -c mapcoder.c - cd ../unittest + cd ../test gcc -fprofile-arcs -ftest-coverage -O0 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -pg ./unittest cd ../mapcodelib gcov mapcoder.c - cd ../unittest + cd ../test gcov unittest.c The test coverage reports are the `*.gcov` text files. diff --git a/unittest/alphabets.csv b/test/alphabets.csv similarity index 100% rename from unittest/alphabets.csv rename to test/alphabets.csv diff --git a/test/clean.sh b/test/clean.sh new file mode 100755 index 0000000..cf38e5b --- /dev/null +++ b/test/clean.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +echo "Clean test files..." +if [ -f unittest.c ] +then + rm -f _*.txt gmon.out *.gcda *.gcno *.gcov ../mapcodelib/*.gcda ../mapcodelib/*.gcno ../mapcodelib/*.gcov +fi diff --git a/unittest/decode_test.h b/test/decode_test.h similarity index 99% rename from unittest/decode_test.h rename to test/decode_test.h index 5c6c4b8..ef2a12c 100644 --- a/unittest/decode_test.h +++ b/test/decode_test.h @@ -1,24 +1,22 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // *** GENERATED FILE (dividemaps.cpp), DO NOT CHANGE OR PRETTIFY *** // Generated for data version 2.3.0 using dividemaps.cpp typedef struct { - double latitude; // - double longitude; // + double latitude; // + double longitude; // int nrLocalMapcodes; // 0 if no need to test int nrGlobalMapcodes; // 0 if no need to test const char *mapcode; // expected mapcode, empty if no need to test @@ -15881,4 +15879,3 @@ static const EncodeTestRecord ENCODE_TEST[] = { {40.917864, 79.9773185, 3, 6, "CN-XJ 0123.XX"}, {0, 0, 0, 0, NULL} }; - diff --git a/test/no_warnings.env b/test/no_warnings.env new file mode 100755 index 0000000..8dd1a54 --- /dev/null +++ b/test/no_warnings.env @@ -0,0 +1 @@ +-Wall -Wextra -Wno-pointer-to-int-cast -Wno-deprecated-declarations -Wno-unused-but-set-variable diff --git a/test/run_all.sh b/test/run_all.sh new file mode 100755 index 0000000..b2f50db --- /dev/null +++ b/test/run_all.sh @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OUT=_report.txt +echo "Run all tests..." | tee $OUT +date | tee -a $OUT +echo "" | tee -a $OUT +./run_compare.sh | tee -a $OUT +./run_normal.sh | tee -a $OUT +./run_sanitizer.sh | tee -a $OUT +./run_valgrind.sh | tee -a $OUT +./run_gcov.sh | tee -a $OUT +./run_gprof.sh | tee -a $OUT +echo "" | tee -a $OUT +echo "Done" | tee -a $OUT diff --git a/unittest/run_compare.sh b/test/run_compare.sh similarity index 60% rename from unittest/run_compare.sh rename to test/run_compare.sh index 591ceaa..6222bdd 100755 --- a/unittest/run_compare.sh +++ b/test/run_compare.sh @@ -1,8 +1,23 @@ #!/bin/sh -OPTS="-Wall -Werror -Wno-pointer-to-int-cast" +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# -NEW=../utility/mapcode -OLD=$HOME/bin/mapcode-2.3.1 +OPTS="$(cat ./no_warnings.env)" +NEW=../mapcode-2.5.6 +OLD=../mapcode-2.5.2 NEWFILE=_new.txt OLDFILE=_old.txt @@ -10,10 +25,20 @@ OPTS1="--grid 1000000 8" OPTS2="--random 1000000 8 1234" OPTS3="--random 1000000 8 11223344" -TEST=`which $OLD` +comparison_error() { + echo "If you want to run the comparison test script, please create symbolic links" + echo "to two version of the mapcode utility:" + echo " $OLD" + echo " $NEW" + echo "These must be placed in the root directory of this project." + exit +} + +TEST=$(which $OLD) if [ "$TEST" = "" ] then echo "No $OLD found on this machine - skipping script..." + comparison_error exit 1 fi @@ -28,12 +53,13 @@ cd ../mapcodelib gcc $OPTS -O3 -c mapcoder.c cd ../utility gcc $OPTS -O3 mapcode.cpp -lm -o mapcode ../mapcodelib/mapcoder.o -cd ../unittest +cd ../test -TEST=`which $NEW` +TEST=$(which $NEW) if [ "$TEST" = "" ] then echo "No $NEW found on this machine - skipping script..." + comparison_error exit 1 fi @@ -91,6 +117,3 @@ else rm -f $NEWFILE $OLDFILE fi echo "!! -------------------------------------------------------------" - -echo "" -echo "Report in: $REPORT" diff --git a/test/run_gcov.sh b/test/run_gcov.sh new file mode 100755 index 0000000..39b6537 --- /dev/null +++ b/test/run_gcov.sh @@ -0,0 +1,46 @@ +#!/bin/sh +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OPTS="$(cat ./no_warnings.env) -fprofile-arcs -ftest-coverage" +LIB="../mapcodelib/mapcoder.o" + +TEST=$(which gcov) +if [ "$TEST" = "" ] +then + echo "No gcov found on this machine - skipping script..." + exit 1 +fi + +echo "!! -------------------------------------------------------------" +echo "Run gcov unittest.coverage..." +date +echo "!! -------------------------------------------------------------" + +echo "" +echo "Run gcov with: -O0" +cd ../mapcodelib +gcc $OPTS -O0 -c mapcoder.c +cd ../test +gcc $OPTS -O0 unittest.c -lm -lpthread -o unittest $LIB +./unittest +cd ../mapcodelib +gcov mapcoder.c +cd ../test +gcov unittest.c +echo "!! -------------------------------------------------------------" +echo "!! Coverage reports in: *.gcov files" +echo "!! -------------------------------------------------------------" diff --git a/unittest/run_gprof.sh b/test/run_gprof.sh similarity index 54% rename from unittest/run_gprof.sh rename to test/run_gprof.sh index 665a4cc..d880a54 100755 --- a/unittest/run_gprof.sh +++ b/test/run_gprof.sh @@ -1,8 +1,24 @@ #!/bin/sh -OPTS="-Wall -Werror -Wno-pointer-to-int-cast" +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OPTS="$(cat ./no_warnings.env)" LIB="../mapcodelib/mapcoder.o" -TEST=`which gprof` +TEST=$(which gprof) if [ "$TEST" = "" ] then echo "No gprof found on this machine - skipping script..." @@ -18,7 +34,7 @@ echo "" echo "Run gprof with: -O0" cd ../mapcodelib gcc $OPTS -g -O0 -c mapcoder.c -pg -cd ../unittest +cd ../test gcc $OPTS -g -O0 unittest.c -lm -lpthread -o unittest $LIB -pg ./unittest gprof ./unittest @@ -28,11 +44,8 @@ echo "" echo "Run gprof with: -O3" cd ../mapcodelib gcc $OPTS -g -O3 -c mapcoder.c -pg -cd ../unittest +cd ../test gcc $OPTS -g -O3 unittest.c -lm -lpthread -o unittest $LIB -pg ./unittest gprof ./unittest echo "!! -------------------------------------------------------------" - -echo "" -echo "Report in: $REPORT" diff --git a/test/run_normal.sh b/test/run_normal.sh new file mode 100755 index 0000000..954fe51 --- /dev/null +++ b/test/run_normal.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OPTS="$(cat ./no_warnings.env)" + +echo "!! -------------------------------------------------------------" +echo "Run normal..." +date +echo "!! -------------------------------------------------------------" + +echo "" +echo "Run normal with: -O0" +cd ../mapcodelib +gcc $OPTS -O0 -DDEBUG -c mapcoder.c +cd ../test +gcc $OPTS -O0 -DDEBUG unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o +./unittest +echo "!! -------------------------------------------------------------" + +echo "" +echo "Run normal with: -O3" +cd ../mapcodelib +gcc $OPTS -O3 -c mapcoder.c +cd ../test +gcc $OPTS -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o +./unittest +echo "!! -------------------------------------------------------------" diff --git a/unittest/run_sanitizer.sh b/test/run_sanitizer.sh similarity index 65% rename from unittest/run_sanitizer.sh rename to test/run_sanitizer.sh index 28a2632..f282712 100755 --- a/unittest/run_sanitizer.sh +++ b/test/run_sanitizer.sh @@ -1,10 +1,26 @@ #!/bin/sh -OPTS="-Wall -Werror -Wno-pointer-to-int-cast" +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OPTS="$(cat ./no_warnings.env)" LIB="../mapcodelib/mapcoder.o" export ASAN_OPTIONS=debug=true:strict_string_checks=1:detect_stack_use_after_return=true:detect_invalid_pointer_pairs=99999:detect_container_overflow=true:detect_odr_violation=2:check_initialization_order=true:strict_init_order=true -TEST=`which clang` +TEST=$(which clang) if [ "$TEST" = "" ] then echo "No clang found on this machine - skipping script..." @@ -21,7 +37,7 @@ echo "" echo "Run address sanitizer with: -O0" cd ../mapcodelib gcc $OPTS -O0 -DDEBUG -c mapcoder.c -cd ../unittest +cd ../test gcc $OPTS -O0 -DDEBUG unittest.c -lm -lpthread -fsanitize=address -o unittest $LIB ./unittest echo "!! -------------------------------------------------------------" @@ -31,7 +47,7 @@ echo "" echo "Run address sanitizer with: -O2" cd ../mapcodelib gcc $OPTS -O2 -c mapcoder.c -cd ../unittest +cd ../test gcc $OPTS -O2 unittest.c -lm -lpthread -fsanitize=address -o unittest $LIB ./unittest echo "!! -------------------------------------------------------------" @@ -41,10 +57,7 @@ echo "" echo "Run address sanitizer with: -O3" cd ../mapcodelib gcc $OPTS -O3 -c mapcoder.c -cd ../unittest +cd ../test gcc $OPTS -O3 unittest.c -lm -lpthread -fsanitize=address -o unittest $LIB ./unittest echo "!! -------------------------------------------------------------" - -echo "" -echo "Report in: $REPORT" diff --git a/test/run_valgrind.sh b/test/run_valgrind.sh new file mode 100755 index 0000000..6444247 --- /dev/null +++ b/test/run_valgrind.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +OPTS="$(cat ./no_warnings.env)" +LIB="../mapcodelib/mapcoder.o" + +TEST=$(which valgrind) +if [ "$TEST" = "" ] +then + echo "No valgrind found on this machine - skipping script..." + exit 1 +fi + +echo "!! -------------------------------------------------------------" +echo "Run valgrind" +date +echo "!! -------------------------------------------------------------" + +echo "" +echo "Run valgrind with: -O0" +cd ../mapcodelib +gcc $OPTS -g -O0 -c mapcoder.c +cd ../test +gcc $OPTS -g -O0 unittest.c -lm -lpthread -o unittest $LIB +valgrind --leak-check=yes ./unittest +echo "!! -------------------------------------------------------------" diff --git a/unittest/territories.csv b/test/territories.csv similarity index 100% rename from unittest/territories.csv rename to test/territories.csv diff --git a/unittest/test_territories.h b/test/test_territories.h similarity index 98% rename from unittest/test_territories.h rename to test/test_territories.h index 2fd81dc..67a9cd9 100644 --- a/unittest/test_territories.h +++ b/test/test_territories.h @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // *** GENERATED FILE (fast_territories.cpp), DO NOT CHANGE OR PRETTIFY *** #include "../mapcodelib/mapcode_territories.h" diff --git a/unittest/unittest.c b/test/unittest.c similarity index 56% rename from unittest/unittest.c rename to test/unittest.c index 01e9fe5..b5b9f4f 100644 --- a/unittest/unittest.c +++ b/test/unittest.c @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /** * This application performs a number of tests on the Mapcode C library. @@ -102,304 +100,310 @@ static int testMapcodeFormats(void) { enum MapcodeError parseError; // expected error enum MapcodeError decodeError; // expected error when decoded } formattests[] = { - {"nld bc.xy-x1y", ERR_OK, ERR_OK}, - {"pan a1.2e-b2c", ERR_OK, ERR_OK}, - {"###################", ERR_INVALID_CHARACTER}, - {"...................", ERR_UNEXPECTED_DOT}, - {"1111111111111111.11", ERR_INVALID_MAPCODE_FORMAT}, - {"US-XXXXXXXXXXXXXXXX", ERR_BAD_TERRITORY_FORMAT}, - {"US-----------------", ERR_UNEXPECTED_HYPHEN}, - {"-------------------", ERR_UNEXPECTED_HYPHEN}, - - {"cck XX.XX", ERR_OK, ERR_OK}, // nameless22 - {"cze XX.XXX", ERR_OK, ERR_OK}, // nameless23 - {"NLD XXX.XX", ERR_OK, ERR_OK}, // nameless32 - {"VAT 5d.dd", ERR_OK, ERR_OK}, // Grid22 - {"NLD XX.XXX", ERR_OK, ERR_OK}, // Grid23 - {"bhr xxx.xx", ERR_OK, ERR_OK}, // Grid32 - {"FRA XXX.XXX", ERR_OK, ERR_OK}, // Grid33 - {"irl xx.xxxx", ERR_OK, ERR_OK}, // Grid24 - {"cub xxxx.xx", ERR_OK, ERR_OK}, // Grid42 - {"ben xxxx.xxx", ERR_OK, ERR_OK}, // Grid34 - {"USA xxxx.xxxx", ERR_OK, ERR_OK}, // Grid44 - {"US-AZ hhh.hh", ERR_OK, ERR_OK}, // HGrid32 - {"Bel hhh.hhh", ERR_OK, ERR_OK}, // HGrid33 - {"PAN hh.hhhh", ERR_OK, ERR_OK}, // HGrid24 - {"GRC hhhh.hh", ERR_OK, ERR_OK}, // HGrid42 - {"NZL hhhh.hhh", ERR_OK, ERR_OK}, // HGrid43 - {"KAZ hhh.hhhh", ERR_OK, ERR_OK}, // HGrid34 - {"RUS xxxx.xxxx", ERR_OK, ERR_OK}, // HGrid44 - {"CN-SH hhhh.hhhh", ERR_OK, ERR_OK}, // HGrid44 - {"VAT hhhhh.hhhh", ERR_OK, ERR_OK}, // HGrid54 - {"hhhhh.hhhh", ERR_OK, ERR_OK}, // HGrid54 - {"TUV hh.hhh", ERR_OK, ERR_OK}, // AutoHeader23 - {"LVA L88.ZVR", ERR_OK, ERR_OK}, // AutoHeader33 - {"WLF XLG.3GP", ERR_OK, ERR_OK}, // HGrid33 R - {"VAT j0q3.27r", ERR_OK, ERR_OK}, // HGrid43 R - {"PAK hhhh.hhhh", ERR_OK, ERR_OK}, // HGrid44 R - - {"NLD 49.4V", ERR_OK, ERR_OK}, - {"NLX 49.4V", ERR_UNKNOWN_TERRITORY}, - {"49.4V", ERR_OK, ERR_MISSING_TERRITORY}, - {"BRA 49.4V", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 - {"BRA XXXXX.XXX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 - {"NLD XXXX.XXXX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 - {"NLD ZZ.ZZ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 1 nameless - {"NLD Q000.000", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 2 grid - {"NLD L222.222", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 3 restricted - {"usa A222.22AA", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 4 grid - {"atf hhh.hhh", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 5 autoh zone - {"ASM zz.zzh", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 6 autoh out - - {"nld ZNZ.RZG-B", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 - {"WLF 01.AE-09V", ERR_OK, ERR_OK}, - {"LVA LDV.ZVR-B ", ERR_OK, ERR_OK}, // AutoHeader - {"LVA LDV.ZVR-BY ", ERR_OK, ERR_EXTENSION_UNDECODABLE}, - {"01.AE", ERR_OK, ERR_MISSING_TERRITORY}, - {"nld 01.AE", ERR_OK, ERR_OK}, - {"nld oi.AE", ERR_OK, ERR_OK}, - {"oi.oi", ERR_ALL_DIGIT_CODE}, - {"nld oi.OI-xxx", ERR_ALL_DIGIT_CODE}, - {"CUB 3467.UY", ERR_OK, ERR_OK}, - {"34.UY", ERR_OK, ERR_MISSING_TERRITORY}, - {"mx XX.XX", ERR_OK, ERR_OK}, - {"", ERR_DOT_MISSING}, - {"ttat.tt ", ERR_INVALID_VOWEL}, - {"ttat-tt tt.tt", ERR_INVALID_VOWEL}, - {"ttat tt.tt", ERR_INVALID_VOWEL}, - {"XXAX.XXXX", ERR_INVALID_VOWEL}, - {"2A22.2222", ERR_INVALID_VOWEL}, - {"22A2.2222", ERR_INVALID_VOWEL}, - {"MAP.CODE", ERR_INVALID_VOWEL}, - {"XAXX.XXXX", ERR_INVALID_VOWEL}, - {"XXXA.XXXX", ERR_INVALID_VOWEL}, - {"XXXAX.XXXX", ERR_INVALID_VOWEL}, - {"XXXXA.XXXX", ERR_INVALID_VOWEL}, - {"nld XXXX.XXXXA", ERR_INVALID_VOWEL}, - {"nld XXXX.ALA", ERR_INVALID_VOWEL}, - {"nld XXXX.LAXA", ERR_INVALID_VOWEL}, - {"nld XXXX.LLLLA", ERR_INVALID_VOWEL}, - {"nld XXXX.A2e", ERR_INVALID_VOWEL}, - {"nld XXXX.2e2e", ERR_INVALID_VOWEL}, - {"nld XXXX.2222u", ERR_INVALID_VOWEL}, - {"222A.2222", ERR_INVALID_VOWEL}, - {"222A2.2222", ERR_INVALID_VOWEL}, - {"ttt 2222A.2222", ERR_INVALID_VOWEL}, - {"2222.2AAA", ERR_INVALID_VOWEL}, - {"A222.2AAA", ERR_INVALID_VOWEL}, - {"usa 2222.22A2", ERR_OK, ERR_OK}, - {"usa 2222.22AA", ERR_OK, ERR_OK}, - {".123", ERR_UNEXPECTED_DOT}, - {".xyz", ERR_UNEXPECTED_DOT}, - {"x.xyz", ERR_UNEXPECTED_DOT}, - {"xxx.z-12", ERR_UNEXPECTED_HYPHEN}, - {"xx.xx.", ERR_UNEXPECTED_DOT}, - {"xxxx xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"xxxxx xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"123", ERR_DOT_MISSING}, - {"xxx.", ERR_MAPCODE_INCOMPLETE}, - {"xxx.z", ERR_MAPCODE_INCOMPLETE}, - {"NLD 49.4V-", ERR_MAPCODE_INCOMPLETE}, - {"NLD 49.4V", ERR_OK, ERR_OK}, - {" NLD 49.4V ", ERR_OK, ERR_OK}, - {"NLD 49.4V-1", ERR_OK, ERR_OK}, - {"NLD 49.4V-12", ERR_OK, ERR_OK}, - {"NLD 49.4V-123", ERR_OK, ERR_OK}, - {"NLD 49.4V-12345678", ERR_OK, ERR_OK}, - {"NLD 49.4V- ", ERR_EXTENSION_INVALID_LENGTH}, - {"NLD 49.4V-123456789", ERR_EXTENSION_INVALID_LENGTH}, - {"49.4V-xxxxxxxxxxxxxx", ERR_EXTENSION_INVALID_LENGTH}, - {"DD.DD- ", ERR_EXTENSION_INVALID_LENGTH}, - {"nld DD.DD-", ERR_MAPCODE_INCOMPLETE}, - {"TAM 49.4V", ERR_OK, ERR_OK}, - {"BRA 49.4V", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 - {"CA 49.4V", ERR_OK, ERR_OK}, - {"N 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"XXXX ", ERR_BAD_TERRITORY_FORMAT}, - {"XXXXX ", ERR_BAD_TERRITORY_FORMAT}, - {"XXXX 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"XXXXX 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"-XX 49.4V", ERR_UNEXPECTED_HYPHEN}, - {"X-XX 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"XXXX-XX 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"XX-X 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"XX-XXXX 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"XX-XXXE 49.4V", ERR_BAD_TERRITORY_FORMAT}, - {"12.34", ERR_ALL_DIGIT_CODE}, - {"NLD 12.34", ERR_ALL_DIGIT_CODE}, - {"AAA 12.34", ERR_ALL_DIGIT_CODE}, - {"AAA 12.34-XXX", ERR_ALL_DIGIT_CODE}, - {"123 12.34-123", ERR_ALL_DIGIT_CODE}, - {"xx-xx 12.34", ERR_ALL_DIGIT_CODE}, - {"12-34 12.34", ERR_ALL_DIGIT_CODE}, - {"CN-34 12.3X", ERR_OK, ERR_OK}, - {" TAM XX.XX-XX ", ERR_OK, ERR_OK}, - {" TAM XXX.XX-XX ", ERR_OK, ERR_OK}, - {" TAM XX.XXX-XX ", ERR_OK, ERR_OK}, - {" TAM XX.XXXX-XX ", ERR_OK, ERR_OK}, - {" TAM XXX.XXX-XX ", ERR_OK, ERR_OK}, - {" gab XXXX.XX-XX ", ERR_OK, ERR_OK}, - {" kAZ XXX.XXXX-XX ", ERR_OK, ERR_OK}, - {" IND XXXX.XXX-XX ", ERR_OK, ERR_OK}, - {" USA XXXX.XXXX-XX ", ERR_OK, ERR_OK}, - {" VAT XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, - {" NLD XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, - {" USA XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, - {" XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, - {" usa XXXXX.XXX-XX ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 - {" XXXXX.XXX-XX ", ERR_OK, ERR_MISSING_TERRITORY}, - {"xx-xx.x xx.xx", ERR_UNEXPECTED_DOT}, - {"xx-xx-x xx.xx", ERR_UNEXPECTED_HYPHEN}, - {"xx.xx-x-x", ERR_UNEXPECTED_HYPHEN}, - {"xx-xx xx-xx", ERR_UNEXPECTED_HYPHEN}, - {"xx-xx xx-xx.xx", ERR_UNEXPECTED_HYPHEN}, - {"xx.xx.xx", ERR_UNEXPECTED_DOT}, - {"xx-xx xx.xx.xx", ERR_UNEXPECTED_DOT}, - {"xx-xx xx.xx-xx-xx", ERR_UNEXPECTED_HYPHEN}, - {"xx-xx xx.xx x", ERR_TRAILING_CHARACTERS}, - {"xx-xx xx.xx-x x", ERR_TRAILING_CHARACTERS}, - {"xx-xx xx.xx-x -", ERR_UNEXPECTED_HYPHEN}, - {"xx-xx xx.xx-x .", ERR_UNEXPECTED_DOT}, - {"xx-xx xx.xx-x 2", ERR_TRAILING_CHARACTERS}, - {"xx-xx xx.x#x", ERR_INVALID_CHARACTER}, - {"xx# xx.xx", ERR_INVALID_CHARACTER}, - {"xx-xx #xx.xx", ERR_INVALID_CHARACTER}, - {"xx-xx xx.xx-xx#xx", ERR_INVALID_CHARACTER}, - {"xx-xx -xx.xx", ERR_UNEXPECTED_HYPHEN}, - {"xx-xx .xx.xx", ERR_UNEXPECTED_DOT}, - {".123", ERR_UNEXPECTED_DOT}, - {" .123", ERR_UNEXPECTED_DOT}, - {"", ERR_DOT_MISSING}, - {" ", ERR_DOT_MISSING}, - {"-xx.xx", ERR_UNEXPECTED_HYPHEN}, - {" - xx.xx", ERR_UNEXPECTED_HYPHEN}, - {"D xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"D.123", ERR_UNEXPECTED_DOT}, - {"D", ERR_DOT_MISSING}, - {"D-xxxxx", ERR_BAD_TERRITORY_FORMAT}, - {"DD", ERR_DOT_MISSING}, - {"DDDa.DDD", ERR_INVALID_VOWEL}, - {"DDD", ERR_DOT_MISSING}, - {"DDDD xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"DDDDE.xxxx", ERR_INVALID_VOWEL}, - {"DDDD", ERR_DOT_MISSING}, - {"DDDD-CA xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"DDDDD CA xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"DDDDDA xx.xx", ERR_INVALID_VOWEL}, - {"DDDDD", ERR_DOT_MISSING}, - {"DDDDD-CA xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"DDDDD..xxxx", ERR_UNEXPECTED_DOT}, - {"DDDDD.", ERR_MAPCODE_INCOMPLETE}, - {"DDDDD.-xxxx.xx", ERR_UNEXPECTED_HYPHEN}, - {"DDD.L.LLL ", ERR_UNEXPECTED_DOT}, - {"DDD.L", ERR_MAPCODE_INCOMPLETE}, - {"DDD.L-xxxxxxxx", ERR_UNEXPECTED_HYPHEN}, - {"DD.DD.CA", ERR_UNEXPECTED_DOT}, - {"DD.DDD.CA", ERR_UNEXPECTED_DOT}, - {"DD.DDDD.CA ", ERR_UNEXPECTED_DOT}, - {"DD.DDDDA ", ERR_INVALID_VOWEL}, - {"DD.DD-. ", ERR_UNEXPECTED_DOT}, - {"DD.DD-", ERR_MAPCODE_INCOMPLETE}, - {"DD.DD--XXX", ERR_UNEXPECTED_HYPHEN}, - {"DD.DD-x. ", ERR_UNEXPECTED_DOT}, - {"DD.DD-A", ERR_EXTENSION_INVALID_CHARACTER}, - {"DD.DD-xA", ERR_EXTENSION_INVALID_CHARACTER}, - {"DD.DD-xxxE", ERR_EXTENSION_INVALID_CHARACTER}, - {"DD.DD-xxxxxu", ERR_EXTENSION_INVALID_CHARACTER}, - {"DD.DD-x-xxx", ERR_UNEXPECTED_HYPHEN}, - {"ta.xx ", ERR_INVALID_VOWEL}, - {"ta", ERR_DOT_MISSING}, - {"DAD- ", ERR_BAD_TERRITORY_FORMAT}, - {"DAD-. ", ERR_UNEXPECTED_DOT}, - {"DAD-", ERR_BAD_TERRITORY_FORMAT}, - {"DAD--XXX", ERR_UNEXPECTED_HYPHEN}, - {"DAD-X xx.xx", ERR_BAD_TERRITORY_FORMAT}, - {"DAD-X. ", ERR_UNEXPECTED_DOT}, - {"DAD-X", ERR_BAD_TERRITORY_FORMAT}, - {"DAD-X-XXX", ERR_UNEXPECTED_HYPHEN}, - {"DAD-XX.XX ", ERR_UNEXPECTED_DOT}, - {"DAD-XX", ERR_DOT_MISSING}, - {"DAD-XX-XX", ERR_UNEXPECTED_HYPHEN}, - {"DAD-XXX.XX ", ERR_UNEXPECTED_DOT}, - {"DAD-XXXX", ERR_BAD_TERRITORY_FORMAT}, - {"DAD-XXXA", ERR_BAD_TERRITORY_FORMAT}, - {"DAD-XXX", ERR_DOT_MISSING}, - {"DAD-XXX-XX", ERR_UNEXPECTED_HYPHEN}, - {"DAD-XX .XX ", ERR_UNEXPECTED_DOT}, - {"DAD-XX ", ERR_DOT_MISSING}, - {"DAD-XX -XX", ERR_UNEXPECTED_HYPHEN}, - {"DD-DD A ", ERR_DOT_MISSING}, - {"DD-DD A. ", ERR_UNEXPECTED_DOT}, - {"DD-DD AA.33 ", ERR_INVALID_VOWEL}, - {"DD-DD A", ERR_DOT_MISSING}, - {"DD-DD A-XX", ERR_UNEXPECTED_HYPHEN}, - {"DD-DD A3 ", ERR_DOT_MISSING}, - {"DD-DD A3A.XX ", ERR_INVALID_VOWEL}, - {"DD-DD A3", ERR_DOT_MISSING}, - {"DD-DD A3-XX", ERR_UNEXPECTED_HYPHEN}, - {"DD-DD A33 ", ERR_DOT_MISSING}, - {"DD-DD A33A.XX", ERR_INVALID_VOWEL}, - {"DD-DD A33", ERR_DOT_MISSING}, - {"DD-DD A33-XX", ERR_UNEXPECTED_HYPHEN}, - {"DD-DD xx.xx .", ERR_UNEXPECTED_DOT}, - {"DD-DD xx.xx x", ERR_TRAILING_CHARACTERS}, - {"DD-DD xx.xx a", ERR_TRAILING_CHARACTERS}, - {"DD-DD xx.xx -x", ERR_UNEXPECTED_HYPHEN}, - {"xx.xx .xx", ERR_UNEXPECTED_DOT}, - {"xx.xx x", ERR_TRAILING_CHARACTERS}, - {"xx.xx a", ERR_TRAILING_CHARACTERS}, - {"xx.xx -123", ERR_UNEXPECTED_HYPHEN}, - {" xx.xx-DD .", ERR_UNEXPECTED_DOT}, - {" xx.xx-DD x", ERR_TRAILING_CHARACTERS}, - {" xx.xx-DD a", ERR_TRAILING_CHARACTERS}, - {"xx.xx xxxxxxxxxxxx", ERR_TRAILING_CHARACTERS}, - {" xx.xx-DD -", ERR_UNEXPECTED_HYPHEN}, - {"tta.ttt ", ERR_INVALID_VOWEL}, - {"ttaa.ttt ", ERR_INVALID_VOWEL}, - {"tta", ERR_DOT_MISSING}, - - {"DDD. ", ERR_INVALID_MAPCODE_FORMAT}, // 6/0 : white na dot - {"DDDDD. xxxx.xx", ERR_INVALID_MAPCODE_FORMAT}, // 6/0 : white na dot - {"DDD.L ", ERR_INVALID_MAPCODE_FORMAT}, // 7.0 : postfix too short - {"DDDDDD xx.xx", ERR_INVALID_MAPCODE_FORMAT}, // 5/2 : 6char ter - {"DDDDDD.xxx", ERR_INVALID_MAPCODE_FORMAT}, // 5/2 : 6char mc + {"nld bc.xy-x1y", ERR_OK, ERR_OK}, + {"pan a1.2e-b2c", ERR_OK, ERR_OK}, + {"###################", ERR_INVALID_CHARACTER, ERR_OK}, + {"...................", ERR_UNEXPECTED_DOT, ERR_OK}, + {"1111111111111111.11", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, + {"US-XXXXXXXXXXXXXXXX", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"US-----------------", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"-------------------", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + + {"cck XX.XX", ERR_OK, ERR_OK}, // nameless22 + {"cze XX.XXX", ERR_OK, ERR_OK}, // nameless23 + {"NLD XXX.XX", ERR_OK, ERR_OK}, // nameless32 + {"VAT 5d.dd", ERR_OK, ERR_OK}, // Grid22 + {"NLD XX.XXX", ERR_OK, ERR_OK}, // Grid23 + {"bhr xxx.xx", ERR_OK, ERR_OK}, // Grid32 + {"FRA XXX.XXX", ERR_OK, ERR_OK}, // Grid33 + {"irl xx.xxxx", ERR_OK, ERR_OK}, // Grid24 + {"cub xxxx.xx", ERR_OK, ERR_OK}, // Grid42 + {"ben xxxx.xxx", ERR_OK, ERR_OK}, // Grid34 + {"USA xxxx.xxxx", ERR_OK, ERR_OK}, // Grid44 + {"US-AZ hhh.hh", ERR_OK, ERR_OK}, // HGrid32 + {"Bel hhh.hhh", ERR_OK, ERR_OK}, // HGrid33 + {"PAN hh.hhhh", ERR_OK, ERR_OK}, // HGrid24 + {"GRC hhhh.hh", ERR_OK, ERR_OK}, // HGrid42 + {"NZL hhhh.hhh", ERR_OK, ERR_OK}, // HGrid43 + {"KAZ hhh.hhhh", ERR_OK, ERR_OK}, // HGrid34 + {"RUS xxxx.xxxx", ERR_OK, ERR_OK}, // HGrid44 + {"CN-SH hhhh.hhhh", ERR_OK, ERR_OK}, // HGrid44 + {"VAT hhhhh.hhhh", ERR_OK, ERR_OK}, // HGrid54 + {"hhhhh.hhhh", ERR_OK, ERR_OK}, // HGrid54 + {"TUV hh.hhh", ERR_OK, ERR_OK}, // AutoHeader23 + {"LVA L88.ZVR", ERR_OK, ERR_OK}, // AutoHeader33 + {"WLF XLG.3GP", ERR_OK, ERR_OK}, // HGrid33 R + {"VAT j0q3.27r", ERR_OK, ERR_OK}, // HGrid43 R + {"PAK hhhh.hhhh", ERR_OK, ERR_OK}, // HGrid44 R + + {"NLD 49.4V", ERR_OK, ERR_OK}, + {"NLX 49.4V", ERR_UNKNOWN_TERRITORY, ERR_OK}, + {"49.4V", ERR_OK, ERR_MISSING_TERRITORY}, + {"BRA 49.4V", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 + {"BRA XXXXX.XXX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 + {"NLD XXXX.XXXX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 + {"NLD ZZ.ZZ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 1 nameless + {"NLD Q000.000", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 2 grid + {"NLD L222.222", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 3 restricted + {"usa A222.22AA", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 4 grid + {"atf hhh.hhh", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 5 autoh zone + {"ASM zz.zzh", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 6 autoh out + + {"nld ZNZ.RZG-B", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 + {"WLF 01.AE-09V", ERR_OK, ERR_OK}, + {"LVA LDV.ZVR-B ", ERR_OK, ERR_OK}, // AutoHeader + {"LVA LDV.ZVR-BY ", ERR_OK, ERR_EXTENSION_UNDECODABLE}, + {"01.AE", ERR_OK, ERR_MISSING_TERRITORY}, + {"nld 01.AE", ERR_OK, ERR_OK}, + {"nld oi.AE", ERR_OK, ERR_OK}, + {"oi.oi", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"nld oi.OI-xxx", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"CUB 3467.UY", ERR_OK, ERR_OK}, + {"34.UY", ERR_OK, ERR_MISSING_TERRITORY}, + {"mx XX.XX", ERR_OK, ERR_OK}, + {"", ERR_DOT_MISSING, ERR_OK}, + {"ttat.tt ", ERR_INVALID_VOWEL, ERR_OK}, + {"ttat-tt tt.tt", ERR_INVALID_VOWEL, ERR_OK}, + {"ttat tt.tt", ERR_INVALID_VOWEL, ERR_OK}, + {"XXAX.XXXX", ERR_INVALID_VOWEL, ERR_OK}, + {"2A22.2222", ERR_INVALID_VOWEL, ERR_OK}, + {"22A2.2222", ERR_INVALID_VOWEL, ERR_OK}, + {"MAP.CODE", ERR_INVALID_VOWEL, ERR_OK}, + {"XAXX.XXXX", ERR_INVALID_VOWEL, ERR_OK}, + {"XXXA.XXXX", ERR_INVALID_VOWEL, ERR_OK}, + {"XXXAX.XXXX", ERR_INVALID_VOWEL, ERR_OK}, + {"XXXXA.XXXX", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.XXXXA", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.ALA", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.LAXA", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.LLLLA", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.A2e", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.2e2e", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.2222u", ERR_INVALID_VOWEL, ERR_OK}, + {"222A.2222", ERR_INVALID_VOWEL, ERR_OK}, + {"222A2.2222", ERR_INVALID_VOWEL, ERR_OK}, + {"ttt 2222A.2222", ERR_INVALID_VOWEL, ERR_OK}, + {"2222.2AAA", ERR_INVALID_VOWEL, ERR_OK}, + {"A222.2AAA", ERR_INVALID_VOWEL, ERR_OK}, + {"usa 2222.22A2", ERR_OK, ERR_OK}, + {"usa 2222.22AA", ERR_OK, ERR_OK}, + {".123", ERR_UNEXPECTED_DOT, ERR_OK}, + {".xyz", ERR_UNEXPECTED_DOT, ERR_OK}, + {"x.xyz", ERR_UNEXPECTED_DOT, ERR_OK}, + {"xxx.z-12", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx.xx.", ERR_UNEXPECTED_DOT, ERR_OK}, + {"xxxx xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"xxxxx xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"123", ERR_DOT_MISSING, ERR_OK}, + {"xxx.", ERR_MAPCODE_INCOMPLETE, ERR_OK}, + {"xxx.z", ERR_MAPCODE_INCOMPLETE, ERR_OK}, + {"NLD 49.4V-", ERR_MAPCODE_INCOMPLETE, ERR_OK}, + {"NLD 49.4V", ERR_OK, ERR_OK}, + {" NLD 49.4V ", ERR_OK, ERR_OK}, + {"NLD 49.4V-1", ERR_OK, ERR_OK}, + {"NLD 49.4V-12", ERR_OK, ERR_OK}, + {"NLD 49.4V-123", ERR_OK, ERR_OK}, + {"NLD 49.4V-12345678", ERR_OK, ERR_OK}, + {"NLD 49.4V- ", ERR_EXTENSION_INVALID_LENGTH, ERR_OK}, + {"NLD 49.4V-123456789", ERR_EXTENSION_INVALID_LENGTH, ERR_OK}, + {"49.4V-xxxxxxxxxxxxxx", ERR_EXTENSION_INVALID_LENGTH, ERR_OK}, + {"DD.DD- ", ERR_EXTENSION_INVALID_LENGTH, ERR_OK}, + {"nld DD.DD-", ERR_MAPCODE_INCOMPLETE, ERR_OK}, + {"TAM 49.4V", ERR_OK, ERR_OK}, + {"BRA 49.4V", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 + {"CA 49.4V", ERR_OK, ERR_OK}, + {"N 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XXXX ", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XXXXX ", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XXXX 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XXXXX 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"-XX 49.4V", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"X-XX 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XXXX-XX 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XX-X 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XX-XXXX 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"XX-XXXE 49.4V", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"12.34", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"NLD 12.34", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"AAA 12.34", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"AAA 12.34-XXX", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"123 12.34-123", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"xx-xx 12.34", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"12-34 12.34", ERR_ALL_DIGIT_CODE, ERR_OK}, + {"CN-34 12.3X", ERR_OK, ERR_OK}, + {" TAM XX.XX-XX ", ERR_OK, ERR_OK}, + {" TAM XXX.XX-XX ", ERR_OK, ERR_OK}, + {" TAM XX.XXX-XX ", ERR_OK, ERR_OK}, + {" TAM XX.XXXX-XX ", ERR_OK, ERR_OK}, + {" TAM XXX.XXX-XX ", ERR_OK, ERR_OK}, + {" gab XXXX.XX-XX ", ERR_OK, ERR_OK}, + {" kAZ XXX.XXXX-XX ", ERR_OK, ERR_OK}, + {" IND XXXX.XXX-XX ", ERR_OK, ERR_OK}, + {" USA XXXX.XXXX-XX ", ERR_OK, ERR_OK}, + {" VAT XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, + {" NLD XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, + {" USA XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, + {" XXXXX.XXXX-XX ", ERR_OK, ERR_OK}, + {" usa XXXXX.XXX-XX ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // type 0 + {" XXXXX.XXX-XX ", ERR_OK, ERR_MISSING_TERRITORY}, + {"xx-xx.x xx.xx", ERR_UNEXPECTED_DOT, ERR_OK}, + {"xx-xx-x xx.xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx.xx-x-x", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx-xx xx-xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx-xx xx-xx.xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx.xx.xx", ERR_UNEXPECTED_DOT, ERR_OK}, + {"xx-xx xx.xx.xx", ERR_UNEXPECTED_DOT, ERR_OK}, + {"xx-xx xx.xx-xx-xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx-xx xx.xx x", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"xx-xx xx.xx-x x", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"xx-xx xx.xx-x -", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx-xx xx.xx-x .", ERR_UNEXPECTED_DOT, ERR_OK}, + {"xx-xx xx.xx-x 2", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"xx-xx xx.x#x", ERR_INVALID_CHARACTER, ERR_OK}, + {"xx# xx.xx", ERR_INVALID_CHARACTER, ERR_OK}, + {"xx-xx #xx.xx", ERR_INVALID_CHARACTER, ERR_OK}, + {"xx-xx xx.xx-xx#xx", ERR_INVALID_CHARACTER, ERR_OK}, + {"xx-xx -xx.xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx-xx .xx.xx", ERR_UNEXPECTED_DOT, ERR_OK}, + {".123", ERR_UNEXPECTED_DOT, ERR_OK}, + {" .123", ERR_UNEXPECTED_DOT, ERR_OK}, + {"", ERR_DOT_MISSING, ERR_OK}, + {" ", ERR_DOT_MISSING, ERR_OK}, + {"-xx.xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {" - xx.xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"D xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"D.123", ERR_UNEXPECTED_DOT, ERR_OK}, + {"D", ERR_DOT_MISSING, ERR_OK}, + {"D-xxxxx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DD", ERR_DOT_MISSING, ERR_OK}, + {"DDDa.DDD", ERR_INVALID_VOWEL, ERR_OK}, + {"DDD", ERR_DOT_MISSING, ERR_OK}, + {"DDDD xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DDDDE.xxxx", ERR_INVALID_VOWEL, ERR_OK}, + {"DDDD", ERR_DOT_MISSING, ERR_OK}, + {"DDDD-CA xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DDDDD CA xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DDDDDA xx.xx", ERR_INVALID_VOWEL, ERR_OK}, + {"DDDDD", ERR_DOT_MISSING, ERR_OK}, + {"DDDDD-CA xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DDDDD..xxxx", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DDDDD.", ERR_MAPCODE_INCOMPLETE, ERR_OK}, + {"DDDDD.-xxxx.xx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DDD.L.LLL ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DDD.L", ERR_MAPCODE_INCOMPLETE, ERR_OK}, + {"DDD.L-xxxxxxxx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DD.DD.CA", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DD.DDD.CA", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DD.DDDD.CA ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DD.DDDDA ", ERR_INVALID_VOWEL, ERR_OK}, + {"DD.DD-. ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DD.DD-", ERR_MAPCODE_INCOMPLETE, ERR_OK}, + {"DD.DD--XXX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DD.DD-x. ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DD.DD-A", ERR_EXTENSION_INVALID_CHARACTER, ERR_OK}, + {"DD.DD-xA", ERR_EXTENSION_INVALID_CHARACTER, ERR_OK}, + {"DD.DD-xxxE", ERR_EXTENSION_INVALID_CHARACTER, ERR_OK}, + {"DD.DD-xxxxxu", ERR_EXTENSION_INVALID_CHARACTER, ERR_OK}, + {"DD.DD-x-xxx", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"ta.xx ", ERR_INVALID_VOWEL, ERR_OK}, + {"ta", ERR_DOT_MISSING, ERR_OK}, + {"DAD- ", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DAD-. ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DAD-", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DAD--XXX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DAD-X xx.xx", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DAD-X. ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DAD-X", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DAD-X-XXX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DAD-XX.XX ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DAD-XX", ERR_DOT_MISSING, ERR_OK}, + {"DAD-XX-XX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DAD-XXX.XX ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DAD-XXXX", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DAD-XXXA", ERR_BAD_TERRITORY_FORMAT, ERR_OK}, + {"DAD-XXX", ERR_DOT_MISSING, ERR_OK}, + {"DAD-XXX-XX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DAD-XX .XX ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DAD-XX ", ERR_DOT_MISSING, ERR_OK}, + {"DAD-XX -XX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DD-DD A ", ERR_DOT_MISSING, ERR_OK}, + {"DD-DD A. ", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DD-DD AA.33 ", ERR_INVALID_VOWEL, ERR_OK}, + {"DD-DD A", ERR_DOT_MISSING, ERR_OK}, + {"DD-DD A-XX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DD-DD A3 ", ERR_DOT_MISSING, ERR_OK}, + {"DD-DD A3A.XX ", ERR_INVALID_VOWEL, ERR_OK}, + {"DD-DD A3", ERR_DOT_MISSING, ERR_OK}, + {"DD-DD A3-XX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DD-DD A33 ", ERR_DOT_MISSING, ERR_OK}, + {"DD-DD A33A.XX", ERR_INVALID_VOWEL, ERR_OK}, + {"DD-DD A33", ERR_DOT_MISSING, ERR_OK}, + {"DD-DD A33-XX", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"DD-DD xx.xx .", ERR_UNEXPECTED_DOT, ERR_OK}, + {"DD-DD xx.xx x", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"DD-DD xx.xx a", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"DD-DD xx.xx -x", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"xx.xx .xx", ERR_UNEXPECTED_DOT, ERR_OK}, + {"xx.xx x", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"xx.xx a", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"xx.xx -123", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {" xx.xx-DD .", ERR_UNEXPECTED_DOT, ERR_OK}, + {" xx.xx-DD x", ERR_TRAILING_CHARACTERS, ERR_OK}, + {" xx.xx-DD a", ERR_TRAILING_CHARACTERS, ERR_OK}, + {"xx.xx xxxxxxxxxxxx", ERR_TRAILING_CHARACTERS, ERR_OK}, + {" xx.xx-DD -", ERR_UNEXPECTED_HYPHEN, ERR_OK}, + {"tta.ttt ", ERR_INVALID_VOWEL, ERR_OK}, + {"ttaa.ttt ", ERR_INVALID_VOWEL, ERR_OK}, + {"tta", ERR_DOT_MISSING, ERR_OK}, + + {"DDD. ", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, // 6/0 : white na dot + {"DDDDD. xxxx.xx", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, // 6/0 : white na dot + {"DDD.L ", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, // 7.0 : postfix too short + {"DDDDDD xx.xx", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, // 5/2 : 6char ter + {"DDDDDD.xxx", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, // 5/2 : 6char mc + {"XXXX.XXXXX", ERR_OK, ERR_MISSING_TERRITORY}, // 4/5 + {"XXXXX.XXXXX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, // 5/5 + // errors because there are too many letters after a postfix vowel - {"XXXX.AXXX", ERR_INVALID_VOWEL}, - {"nld XXXX.AXX", ERR_INVALID_VOWEL}, - {"nld XXXX.XAXX", ERR_INVALID_VOWEL}, - {"nld XXXX.AXXA", ERR_INVALID_VOWEL}, - {"2222.A22", ERR_INVALID_VOWEL}, - {"2222.A222", ERR_INVALID_VOWEL}, - {"2222.2A22", ERR_INVALID_VOWEL}, + {"XXXX.AXXX", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.AXX", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.XAXX", ERR_INVALID_VOWEL, ERR_OK}, + {"nld XXXX.AXXA", ERR_INVALID_VOWEL, ERR_OK}, + {"2222.A22", ERR_INVALID_VOWEL, ERR_OK}, + {"2222.A222", ERR_INVALID_VOWEL, ERR_OK}, + {"2222.2A22", ERR_INVALID_VOWEL, ERR_OK}, // 5th letter - {"nld DD.DDDDD ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, - {"nld XXXX.XXXXX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, - {" TAM XX.XXXXX-XX ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, - {" TAM XXX.XXXXX-XX ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, - {" TAM XXXX.XXXXX-X ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, - {" TAM XXXXX.XXXXX-X ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"nld DD.DDDDD ", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"nld XXXX.XXXXX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"TAM XX.XXXXX-XX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"TAM XXX.XXXXX-XX", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"TAM XXXX.XXXXX-X", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"TAM XXXXX.XXXXX-X", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"40822.schol", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + {"AAA 40822.schol", ERR_OK, ERR_MAPCODE_UNDECODABLE}, + // errors because the postfix has a 6th letter - {"DD.DDDDDD ", ERR_INVALID_MAPCODE_FORMAT}, - {"nld XXXX.XXXXXX", ERR_INVALID_MAPCODE_FORMAT}, - {" TAM XX.XXXXXX-XX ", ERR_INVALID_MAPCODE_FORMAT}, - {" TAM XXX.XXXXXX-XX ", ERR_INVALID_MAPCODE_FORMAT}, - {" TAM XXXX.XXXXXX-X ", ERR_INVALID_MAPCODE_FORMAT}, - {" TAM XXXXX.XXXXXX-X ", ERR_INVALID_MAPCODE_FORMAT}, + {"DD.DDDDDD ", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, + {"nld XXXX.XXXXXX", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, + {" TAM XX.XXXXXX-XX ", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, + {" TAM XXX.XXXXXX-XX ", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, + {" TAM XXXX.XXXXXX-X ", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, + {" TAM XXXXX.XXXXXX-X ", ERR_INVALID_MAPCODE_FORMAT, ERR_OK}, // Check tabs, spaces and control characters. - {"NLD 49.YV", ERR_OK, ERR_OK}, - {" NLD 49.YV", ERR_OK, ERR_OK}, - {"\tNLD 49.YV", ERR_OK, ERR_OK}, - {"NLD 49.YV ", ERR_OK, ERR_OK}, - {"NLD 49.YV\t", ERR_OK, ERR_OK}, - {"NLD 49.YV", ERR_OK, ERR_OK}, - {"NLD\t49.YV", ERR_OK, ERR_OK}, - {"NLD\n49.YV", ERR_INVALID_CHARACTER}, - {"NLD\r49.YV", ERR_INVALID_CHARACTER}, - {"NLD\v49.YV", ERR_INVALID_CHARACTER}, - {"NLD\b49.YV", ERR_INVALID_CHARACTER}, - {"NLD\a49.YV", ERR_INVALID_CHARACTER}, - {NULL, ERR_OK, ERR_OK} + {"NLD 49.YV", ERR_OK, ERR_OK}, + {" NLD 49.YV", ERR_OK, ERR_OK}, + {"\tNLD 49.YV", ERR_OK, ERR_OK}, + {"NLD 49.YV ", ERR_OK, ERR_OK}, + {"NLD 49.YV\t", ERR_OK, ERR_OK}, + {"NLD 49.YV", ERR_OK, ERR_OK}, + {"NLD\t49.YV", ERR_OK, ERR_OK}, + {"NLD\n49.YV", ERR_INVALID_CHARACTER, ERR_OK}, + {"NLD\r49.YV", ERR_INVALID_CHARACTER, ERR_OK}, + {"NLD\v49.YV", ERR_INVALID_CHARACTER, ERR_OK}, + {"NLD\b49.YV", ERR_INVALID_CHARACTER, ERR_OK}, + {"NLD\a49.YV", ERR_INVALID_CHARACTER, ERR_OK}, + {NULL, ERR_OK, ERR_OK} }; int shouldSucceed = 0; // count nr of calls that SHOULD be successful. @@ -409,7 +413,7 @@ static int testMapcodeFormats(void) { for (i = 0; formattests[i].input != NULL; ++i) { MapcodeElements mapcodeElements; - enum MapcodeError parseError = myParseMapcodeString(&mapcodeElements, formattests[i].input, 0); + enum MapcodeError parseError = myParseMapcodeString(&mapcodeElements, formattests[i].input, TERRITORY_UNKNOWN); enum MapcodeError formatError = compareWithMapcodeFormatUtf8(formattests[i].input); if (formattests[i].parseError == ERR_OK) { shouldSucceed++; @@ -462,19 +466,41 @@ static int testAlphabetParser(void) { const char *userInput; const char *expected; } parseTests[] = { - {"nld bc.xy-x1y", "NLD BC.XY-X1Y"}, - {"nld Α0.12", "NLD 00.E0"}, // A-encoded greek - {"DNK РФ.ХХ", "DNK PQ.XX"}, // greek - {"GRC HP.NO-1Х2ХХ", "GRC HP.NO-1X2XX"}, - {"PRT 31.E2-b2c", "PRT 31.E2-B2C"}, - {"GBR רר.56ר", "GBR XX.XX"},// hebrew abjad - {"BEL طظ.56ط ", "BEL PQ.XP"}, // arab abjad - {"FRA ヒフ.ラヲ", "FRA PQ.XZ"}, - {NULL, NULL} + {"nld bc.xy-x1y", "NLD BC.XY-X1Y (1113;2)"}, + {"nld Α0.12", "NLD 00.E0 (1113;2)"}, // A-encoded greek + {"DNK РФ.ХХ", "DNK PQ.XX (1114;2)"}, // greek + {"GRC HP.NO-1Х2ХХ", "GRC HP.NO-1X2XX (1150;2)"}, + {"PRT 31.E2-b2c", "PRT 31.E2-B2C (1136;2)"}, + {"GBR רר.56ר", "GBR XX.XX (1167;2)"}, // hebrew abjad + {"BEL طظ.56ط ", "BEL PQ.XP (1107;2)"}, // arab abjad + {"FRA ヒフ.ラヲ", "FRA PQ.XZ (1198;2)"}, + {"CA XX.XX", "CA XX.XX (1392;2)"} + }; + static const struct { + const char *input; + enum Alphabet alphabet; + const char *expected; + } convertTests[] = { + {"nld bc.XY-p2q", ALPHABET_ROMAN, "nld BC.XY-P2Q"}, + {"DNK PQ.XX", ALPHABET_DEVANAGARI, "DNK नप.सस"}, + {"GBR XX.XX", ALPHABET_HEBREW, "GBR רר.56ר"}, + {"BEL PQ.XP", ALPHABET_ARABIC, "BEL طظ.56ط"}, + {"nld 00.E0", ALPHABET_GREEK, "nld \xCE\x91\x30.12"} }; int i; - for (i = 0; parseTests[i].userInput; i++) { - char romanized[MAX_MAPCODE_RESULT_LEN + 1]; + for (i = 0; i < (int) (sizeof(convertTests) / sizeof(convertTests[0])); i++) { + char utf8[MAX_MAPCODE_RESULT_UTF8_LEN + 1]; + convertMapcodeToAlphabetUtf8(utf8, convertTests[i].input, convertTests[i].alphabet); + nrTests++; + if (strcmp(utf8, convertTests[i].expected) != 0) { + foundError(); + printf("*** ERROR *** convertMapcodeToAlphabetUtf8(\"%s\",%d) returned \"%s\", (expected %s)\n", + convertTests[i].input, convertTests[i].alphabet, utf8, convertTests[i].expected); + } + } + + for (i = 0; i < (int) (sizeof(parseTests) / sizeof(parseTests[0])); i++) { + char romanized1[MAX_MAPCODE_RESULT_ASCII_LEN + 1]; MapcodeElements mapcodeElements; enum MapcodeError parseError = myParseMapcodeString(&mapcodeElements, parseTests[i].userInput, TERRITORY_UNKNOWN); @@ -485,29 +511,39 @@ static int testAlphabetParser(void) { parseTests[i].userInput, (int) parseError, parseTests[i].expected); } else { nrTests++; - sprintf(romanized, "%s %s%s%s", + sprintf(romanized1, "%s %s%s%s (%d;%d)", mapcodeElements.territoryISO, mapcodeElements.properMapcode, *mapcodeElements.precisionExtension ? "-" : "", - mapcodeElements.precisionExtension); - if (strcmp(romanized, parseTests[i].expected) != 0) { + mapcodeElements.precisionExtension, + mapcodeElements.territoryCode, + mapcodeElements.indexOfDot); + if (strcmp(romanized1, parseTests[i].expected) != 0) { foundError(); - printf("*** ERROR *** myParseMapcodeString(\"%s\") = \"%s\", (expected %s)\n", parseTests[i].userInput, - romanized, parseTests[i].expected); + printf("*** ERROR *** myParseMapcodeString(\"%s\") = \"%s\", (expected \"%s\")\n", + parseTests[i].userInput, + romanized1, parseTests[i].expected); } else { + int err1, err2; double lat1, lon1, lat2, lon2; - int err1 = decodeMapcodeToLatLonUtf8(&lat1, &lon1, parseTests[i].userInput, TERRITORY_UNKNOWN, NULL); - int err2 = decodeMapcodeToLatLonUtf8(&lat2, &lon2, romanized, TERRITORY_UNKNOWN, NULL); + char romanized2[MAX_MAPCODE_RESULT_ASCII_LEN + 1]; + sprintf(romanized2, "%s %s%s%s", + mapcodeElements.territoryISO, + mapcodeElements.properMapcode, + *mapcodeElements.precisionExtension ? "-" : "", + mapcodeElements.precisionExtension); + err1 = decodeMapcodeToLatLonUtf8(&lat1, &lon1, parseTests[i].userInput, TERRITORY_UNKNOWN, NULL); + err2 = decodeMapcodeToLatLonUtf8(&lat2, &lon2, romanized2, TERRITORY_UNKNOWN, NULL); ++nrTests; if (err1 || err2) { foundError(); printf("*** ERROR *** decoding \"%s\" returns %d, decoding \"%s\" returns %d\n", - parseTests[i].userInput, err1, romanized, err2); + parseTests[i].userInput, err1, romanized2, err2); } if (lat1 != lat2 || lon1 != lon2) { foundError(); printf("*** ERROR *** decoding \"%s\" returns (%f,%f), decoding \"%s\" returns (%f,%f)\n", - parseTests[i].userInput, lat1, lon1, romanized, lat2, lon2); + parseTests[i].userInput, lat1, lon1, romanized2, lat2, lon2); } } } @@ -545,7 +581,7 @@ static void printGeneratedMapcodes(const char *title, const Mapcodes *mapcodes) // test encode x,y to M, decode M, re-encode back to M static int testEncodeAndDecode(const char *str, double y, double x, int localsolutions, int globalsolutions) { int nrTests = 0; - char clean[MAX_MAPCODE_RESULT_LEN + 1]; + char clean[MAX_MAPCODE_RESULT_ASCII_LEN + 1]; const char *p, *s; int found = 0; enum Territory tc = TERRITORY_NONE; @@ -562,7 +598,7 @@ static int testEncodeAndDecode(const char *str, double y, double x, int localsol // if str: determine "precision", territory "tc", and a "clean" copy of str if (*str) { - char territory[MAX_ISOCODE_LEN + 1]; + char territory[MAX_ISOCODE_ASCII_LEN + 1]; // find first territory letter in s s = str; while (*s > 0 && *s <= 32) { @@ -571,7 +607,7 @@ static int testEncodeAndDecode(const char *str, double y, double x, int localsol // parse territory, if any p = strchr(s, ' '); len = p ? (int) (p - s) : 0; - if (p && len <= MAX_ISOCODE_LEN) { + if (p && len <= MAX_ISOCODE_ASCII_LEN) { // copy and recognize territory memcpy(territory, s, (size_t) len); territory[len] = 0; @@ -598,7 +634,7 @@ static int testEncodeAndDecode(const char *str, double y, double x, int localsol strcat(clean, " "); i++; } - if (len + i >= MAX_MAPCODE_RESULT_LEN) { + if (len + i >= MAX_MAPCODE_RESULT_ASCII_LEN) { len = 0; } memcpy(clean + i, s, (size_t) len); @@ -824,10 +860,10 @@ static int testFailingDecodes(void) { static int testTerritory(const char *alphaCode, enum Territory territory, int isAlias, int needsParent, enum Territory tcParent) { int nrTests = 0; - char nam[MAX_ISOCODE_LEN + 1]; + char nam[MAX_ISOCODE_ASCII_LEN + 1]; unsigned int i; for (i = 0; i <= strlen(alphaCode); i++) { - char alphacode[MAX_ISOCODE_LEN + 1]; + char alphacode[MAX_ISOCODE_ASCII_LEN + 1]; int tn; strcpy(alphacode, alphaCode); if (!needsParent && (i == 0)) { @@ -864,6 +900,7 @@ static int testTerritory(const char *alphaCode, enum Territory territory, static int testTerritories() { + char nam[MAX_ISOCODE_ASCII_LEN + 1]; int nrTests = 0; int nr = sizeof(TEST_TERRITORIES) / sizeof(TEST_TERRITORIES[0]); int i; @@ -872,6 +909,28 @@ static int testTerritories() { TEST_TERRITORIES[i].isAlias, TEST_TERRITORIES[i].needsParent, TEST_TERRITORIES[i].parent); } + // test extremes + ++nrTests; + if (*getTerritoryIsoName(nam, TERRITORY_NONE, 0) || *getTerritoryIsoName(nam, TERRITORY_UNKNOWN, 0) || + *getTerritoryIsoName(nam, _TERRITORY_MIN, 0) || *getTerritoryIsoName(nam, _TERRITORY_MAX, 0)) { + foundError(); + printf("*** ERROR *** getTerritoryIsoName returned nonempty for bad arguments\n"); + } + ++nrTests; + if (getTerritoryCode(NULL, TERRITORY_VAT) != TERRITORY_NONE) { + foundError(); + printf("*** ERROR *** unexpected getTerritoryCode return for bad arguments\n"); + } + // test some short values + ++nrTests; + if (strcmp(getTerritoryIsoName(nam, TERRITORY_US_CA, 1), "CA") || + strcmp(getTerritoryIsoName(nam, TERRITORY_IN_DD, 1), "DD") || + strcmp(getTerritoryIsoName(nam, TERRITORY_NLD, 1), "NLD") || + strcmp(getTerritoryIsoName(nam, TERRITORY_USA, 1), "USA")) { + foundError(); + printf("*** ERROR *** getTerritoryIsoName returned bad short versions\n"); + } + return nrTests; } @@ -1046,6 +1105,13 @@ static int testDistances(void) { 0.11, 0.22, 0.12, 0.2333, 185011466 }; + // check bad values + ++nrTests; + if (maxErrorInMeters(99) != 0.0) { + foundError(); + printf("*** ERROR *** maxErrorInMeters(99) = %f (expected 0.0)\n", maxErrorInMeters(99)); + } + // check expected values ++nrTests; testDistance(METERS_PER_DEGREE_LON * 1.5, distanceInMeters(0.0, 0.0, 0.0, 1.5)); // Check if #define is correct. ++nrTests; @@ -1088,7 +1154,7 @@ static int testDistances(void) { ++nrTests; testDistance(METERS_PER_DEGREE_LAT, distanceInMeters(0.0, 0.0, -1.0, 0.0)); - for (i = 0; i < (sizeof(coordpairs) / sizeof(coordpairs[0])); i += 5) { + for (i = 0; i < (int) (sizeof(coordpairs) / sizeof(coordpairs[0])); i += 5) { const double distance = distanceInMeters( coordpairs[i], coordpairs[i + 1], coordpairs[i + 2], coordpairs[i + 3]); @@ -1149,7 +1215,7 @@ static int testTerritoryInsides(void) { {"MEX", 21.431788272457, -89.779820144176, 1} }; - for (i = 0; i < (sizeof(TEST_DATA) / sizeof(TEST_DATA[0])); i++) { + for (i = 0; i < (int) (sizeof(TEST_DATA) / sizeof(TEST_DATA[0])); i++) { enum Territory territory = getTerritoryCode(TEST_DATA[i].territory, TERRITORY_NONE); ++nrTests; if (multipleBordersNearby(TEST_DATA[i].lat, TEST_DATA[i].lon, territory) != TEST_DATA[i].nearborders) { @@ -1198,6 +1264,36 @@ static int testTerritoryCode(void) { {TERRITORY_NONE, TERRITORY_NONE, 0} }; + static const struct { + enum Territory input; + enum Territory output; + } ptcTestData[] = { + {TERRITORY_NONE, TERRITORY_NONE}, + {_TERRITORY_MIN, TERRITORY_NONE}, + {TERRITORY_VAT, TERRITORY_NONE}, + {TERRITORY_MX_DIF, TERRITORY_MEX}, + {TERRITORY_MX_CHH, TERRITORY_MEX}, + {TERRITORY_GRL, TERRITORY_NONE}, + {TERRITORY_IN_DD, TERRITORY_IND}, + {TERRITORY_AU_VIC, TERRITORY_AUS}, + {TERRITORY_BR_DF, TERRITORY_BRA}, + {TERRITORY_US_AL, TERRITORY_USA}, + {TERRITORY_CA_NU, TERRITORY_CAN}, + {TERRITORY_RU_LIP, TERRITORY_RUS}, + {TERRITORY_CN_HA, TERRITORY_CHN}, + {TERRITORY_AAA, TERRITORY_NONE}, + {_TERRITORY_MAX, TERRITORY_NONE}, + {TERRITORY_UNKNOWN, TERRITORY_NONE} + }; + + for (i = 0; i < (int) (sizeof(ptcTestData) / sizeof(ptcTestData[0])); i++) { + enum Territory result = getParentCountryOf(ptcTestData[i].input); + if (result != ptcTestData[i].output) { + foundError(); + printf("*** ERROR *** getParentCountryOf(%d) returned unexpected %d\n", ptcTestData[i].input, result); + } + } + for (i = 0; tcTestData[i].inputstring != 0; i++) { enum Territory ccode = getTerritoryCode(tcTestData[i].inputstring, tcTestData[i].context); ++nrTests; @@ -1247,7 +1343,7 @@ static int testGetTerritoryCode(void) { s1[0] = 0; nrTests += testIncorrectGetTerritoryCode(s1); - for (i = 0; i < sizeof(largeString) - 1; ++i) { + for (i = 0; i < (int) sizeof(largeString) - 1; ++i) { largeString[i] = (char) ((i % 223) + 32); } largeString[sizeof(largeString) - 1] = 0; @@ -1379,7 +1475,7 @@ static int testCorrectDecode(char *mc, enum Territory tc) { double lon1; double lat2; double lon2; - UWORD utf16[MAX_CLEAN_MAPCODE_LEN + 1]; + UWORD utf16[MAX_CLEAN_MAPCODE_ASCII_LEN + 1]; int rc = decodeMapcodeToLatLonUtf8(&lat1, &lon1, mc, tc, NULL); if (rc < 0) { foundError(); @@ -1436,7 +1532,7 @@ static int testDecodeRobustness(void) { nrTests += testIncorrectDecode(s1, TERRITORY_NONE); nrTests += testIncorrectDecode(s1, tc); - for (i = 0; i < sizeof(largeString) - 1; ++i) { + for (i = 0; i < (int) sizeof(largeString) - 1; ++i) { largeString[i] = (char) ((i % 223) + 32); } largeString[sizeof(largeString) - 1] = 0; @@ -1452,8 +1548,9 @@ static int testEnvironment(void) { char *s = "1234567890"; long distance = (strstr(s, "0") - s); - printf("sizeof(char)=%ld, sizeof(UWORD)=%ld, sizeof(int)=%ld, sizeof(long int)=%ld\n", - sizeof(char), sizeof(UWORD), sizeof(int), sizeof(long int)); + int testSigned = (int) ((char) -1); + printf("sizeof(char)=%ld, sizeof(UWORD)=%ld, sizeof(int)=%ld, sizeof(long int)=%ld char=%s\n", + sizeof(char), sizeof(UWORD), sizeof(int), sizeof(long int), (testSigned == -1) ? "signed" : "unsigned"); // Check size of UWORD. nrTests++; @@ -1560,14 +1657,16 @@ static int testTerritoriesCsv(void) { // parse and check names e = strchr(s, 10); if (e) { - int i, noMoreNames = 0; *e = 0; - for (i = 0; !noMoreNames; i++) { - char territoryName[MAX_TERRITORY_FULLNAME_LEN + 1]; - noMoreNames = getFullTerritoryNameEnglish(territoryName, csvTerritoryCode, i); - if (!strstr(s, territoryName)) { - foundError(); - printf("*** ERROR *** Name \"%s\" not found in \"%s\"\n", territoryName, s); + { + int i, noMoreNames = 0; + for (i = 0; !noMoreNames; i++) { + char territoryName[MAX_TERRITORY_FULLNAME_UTF8_LEN + 1]; + noMoreNames = getFullTerritoryNameInLocaleUtf8(territoryName, csvTerritoryCode, i, "en_US"); + if (!strstr(s, territoryName)) { + foundError(); + printf("*** ERROR *** Name \"%s\" not found in \"%s\"\n", territoryName, s); + } } } } @@ -1597,7 +1696,7 @@ static int testSingleEncodes(void) { }; int i; for (i = 0; test_single_encode[i].result != NULL; i++) { - char result[MAX_MAPCODE_RESULT_LEN + 1]; + char result[MAX_MAPCODE_RESULT_ASCII_LEN + 1]; encodeLatLonToSingleMapcode(result, test_single_encode[i].latDeg, test_single_encode[i].lonDeg, test_single_encode[i].territory, 4); if (strcmp(result, test_single_encode[i].result) != 0) { @@ -1610,69 +1709,120 @@ static int testSingleEncodes(void) { } -static int testGetFullTerritoryNameEnglish(int expectedCode, const char *expectedName, enum Territory territory, - int alternative) { +static int testSelectedEncodes(void) { int nrTests = 0; - char gotName[MAX_TERRITORY_FULLNAME_LEN + 1]; - int gotCode = getFullTerritoryNameEnglish(gotName, territory, alternative); + char mapcode[MAX_MAPCODE_RESULT_ASCII_LEN]; + double lat = 52.158993; + double lon = 4.492346; + int i = 0; + int total = 0; + do { + total = encodeLatLonToSelectedMapcode(mapcode, lat, lon, TERRITORY_NONE, 0, i); + if (total != 4) { + foundError(); + printf("*** ERROR *** testSelectedEncodes, expected %d alternatives, but got %d", 4, total); + } + switch (i) { + case 0: + if (strcmp(mapcode, "NLD QJM.0G") != 0) { + foundError(); + printf("*** ERROR *** testSelectedEncodes, expected '%s', but got '%s', alternative %d\n", "NLD QJM.0G", mapcode, i); + } + break; + case 1: + if (strcmp(mapcode, "NLD CZQ.15C") != 0) { + foundError(); + printf("*** ERROR *** testSelectedEncodes, expected '%s', but got '%s', alternative %d\n", "NLD CZQ.15C", mapcode, i); + } + break; + case 2: + if (strcmp(mapcode, "NLD N39J.MZN") != 0) { + foundError(); + printf("*** ERROR *** testSelectedEncodes, expected '%s', but got '%s', alternative %d\n", "NLD N39J.MZN", mapcode, i); + } + break; + case 3: + if (strcmp(mapcode, "VHVN4.TZ9S") != 0) { + foundError(); + printf("*** ERROR *** testSelectedEncodes, expected '%s', but got '%s', alternative %d\n", "VHVN4.TZ9S", mapcode, i); + } + break; + default: + foundError(); + printf("*** ERROR *** testSelectedEncodes, expected %d alternatives, but got %d", 4, i); + break; + } + ++i; + } while (i < total); + ++nrTests; + return nrTests; +} + + +static int testGetFullTerritoryNameLocal(const char *expectedName, enum Territory territory, int alternative) { + int nrTests = 0; + int expectedCode = (*expectedName ? 1 : 0); + char gotName[MAX_TERRITORY_FULLNAME_UTF8_LEN + 1]; + int gotCode = getFullTerritoryNameLocalUtf8(gotName, territory, alternative); ++nrTests; - if (strcmp(expectedName, gotName)) { - char s[MAX_ISOCODE_LEN + 1]; + if (expectedCode && strcmp(expectedName, gotName)) { + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); - printf("*** ERROR *** getFullTerritoryNameEnglish error, expected name '%s', but got '%s' for territory %s, alternative %d\n", + printf("*** ERROR *** getFullTerritoryNameLocal error, expected name '%s', but got '%s' for territory %s, alternative %d\n", expectedName, gotName, getTerritoryIsoName(s, territory, 0), alternative); } ++nrTests; if ((expectedCode && !gotCode) || (!expectedCode && gotCode)) { - char s[MAX_ISOCODE_LEN + 1]; + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); - printf("*** ERROR *** getFullTerritoryNameEnglish error, expected return code %d, but got %d (%s) for territory %s, alternative %d\n", + printf("*** ERROR *** getFullTerritoryNameLocal error, expected return code %d, but got %d (%s) for territory %s, alternative %d\n", expectedCode, gotCode, gotName, getTerritoryIsoName(s, territory, 0), alternative); } return nrTests; } -static int -testGetFullTerritoryNameLocal(int expectedCode, const char *expectedName, enum Territory territory, int alternative) { +static int testGetFullTerritoryNameInLocale(const char *expectedName, + enum Territory territory, int alternative, + const char *locale) { int nrTests = 0; - char gotName[MAX_TERRITORY_FULLNAME_LEN + 1]; - int gotCode = getFullTerritoryNameLocal(gotName, territory, alternative); + int expectedCode = (*expectedName ? 1 : 0); + char gotName[MAX_TERRITORY_FULLNAME_UTF8_LEN + 1]; + int gotCode = getFullTerritoryNameInLocaleUtf8(gotName, territory, alternative, locale); ++nrTests; - if (strcmp(expectedName, gotName)) { - char s[MAX_ISOCODE_LEN + 1]; + if (expectedCode && strcmp(expectedName, gotName)) { + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); - printf("*** ERROR *** getFullTerritoryNameLocal error, expected name '%s', but got '%s' for territory %s, alternative %d\n", - expectedName, gotName, getTerritoryIsoName(s, territory, 0), alternative); + printf("*** ERROR *** getFullTerritoryNameInLocale error, expected name '%s', but got '%s' for territory %s, alternative %d, locale %s\n", + expectedName, gotName, getTerritoryIsoName(s, territory, 0), alternative, locale ? locale : "NULL"); } ++nrTests; if ((expectedCode && !gotCode) || (!expectedCode && gotCode)) { - char s[MAX_ISOCODE_LEN + 1]; + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); - printf("*** ERROR *** getFullTerritoryNameLocal error, expected return code %d, but got %d (%s) for territory %s, alternative %d\n", - expectedCode, gotCode, gotName, getTerritoryIsoName(s, territory, 0), alternative); + printf("*** ERROR *** getFullTerritoryNameInLocale error, expected return code %d, but got %d (%s) for territory %s, alternative %d, locale %s\n", + expectedCode, gotCode, gotName, getTerritoryIsoName(s, territory, 0), alternative, locale ? locale : "NULL"); } return nrTests; } -static int testGetFullTerritoryNameLocalInAlphabet( - int expectedCode, const char *expectedName, - enum Territory territory, - int alternative, enum Alphabet alphabet) { +static int testGetFullTerritoryNameLocalInAlphabet(const char *expectedName, enum Territory territory, + int alternative, enum Alphabet alphabet) { int nrTests = 0; - char gotName[MAX_TERRITORY_FULLNAME_LEN + 1]; - int gotCode = getFullTerritoryNameLocalInAlphabet(gotName, territory, alternative, alphabet); + int expectedCode = (*expectedName ? 1 : 0); + char gotName[MAX_TERRITORY_FULLNAME_UTF8_LEN + 1]; + int gotCode = getFullTerritoryNameLocalInAlphabetUtf8(gotName, territory, alternative, alphabet); ++nrTests; - if (strcmp(expectedName, gotName)) { - char s[MAX_ISOCODE_LEN + 1]; + if (expectedCode && strcmp(expectedName, gotName)) { + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); printf("*** ERROR *** getFullTerritoryNameLocalInAlphabet error, expected name '%s', but got '%s' for territory %s, alternative %d\n", expectedName, gotName, getTerritoryIsoName(s, territory, 0), alternative); } ++nrTests; if ((expectedCode && !gotCode) || (!expectedCode && gotCode)) { - char s[MAX_ISOCODE_LEN + 1]; + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); printf("*** ERROR *** getFullTerritoryNameLocalInAlphabet error, expected return code %d, but got %d (%s) for territory %s, alternative %d\n", expectedCode, gotCode, gotName, getTerritoryIsoName(s, territory, 0), alternative); @@ -1684,172 +1834,167 @@ static int testGetFullTerritoryNameLocalInAlphabet( int testGetFullTerritoryName(void) { int nrTests = 0; enum Territory territory; - int minNames; int nrNames = 0; int maxLength = 0; - char territoryName[2048]; - for (territory = _TERRITORY_MIN + 1; territory < _TERRITORY_MAX; ++territory) { - int alternative = 0; - - // check that every territory has at least one english name - nrTests++; - if (!getFullTerritoryNameEnglish(territoryName, territory, 0)) { - foundError(); - printf("*** ERROR *** getFullTerritoryNameEnglish territory %d has NO name\n", territory); - } - - // check that every territory has at least one local name - nrTests++; - if (!getFullTerritoryNameLocal(territoryName, territory, 0)) { - foundError(); - printf("*** ERROR *** getFullTerritoryNameLocal territory %d has NO name\n", territory); - } - - // check that every territory has a local name in all the common alphabets - nrTests++; - { - const TerritoryAlphabets *territoryAlphabets = getAlphabetsForTerritory(territory); - int i; - for (i = 0; i < territoryAlphabets->count; i++) { - if (!getFullTerritoryNameLocalInAlphabet(territoryName, territory, 0, - territoryAlphabets->alphabet[i])) { - char s[MAX_ISOCODE_LEN + 1]; + int alternative; + int i; + const TerritoryAlphabets *territoryAlphabets; + char territoryName[MAX_TERRITORY_FULLNAME_UTF8_LEN + 1024]; // large so we can test overflow + static const char *locales_to_test[] = { + "AF", "AR", "BE", "CN", "CS", "DA", "DE", "EN", "FI", "ES", "FR", "HE", "HI", + "HR", "ID", "IT", "JA", "KO", "NL", "NO", "PL", "PT", "RU", "SV", "SW", "TR", "UK"}; + + nrTests += testGetFullTerritoryNameInLocale("Sancta Sedes", TERRITORY_VAT, 0, NULL); // Local name. + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, ""); // Wrong locale -> fallback language. + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, "E"); + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, "EN"); + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, "??"); + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, "-"); + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, "_"); + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, "_EN"); + + for (i = 0; i < (int) (sizeof(locales_to_test) / sizeof(locales_to_test[0])); i++) { + const char *locale = locales_to_test[i]; + int nrInLocale = 0; + for (territory = _TERRITORY_MIN + 1; territory < _TERRITORY_MAX; ++territory) { + char expectedLocalName[MAX_TERRITORY_FULLNAME_UTF8_LEN + 1]; + getFullTerritoryNameInLocaleUtf8(expectedLocalName, territory, 0, 0); + + nrTests += testGetFullTerritoryNameInLocale(expectedLocalName, territory, 0, NULL); + nrTests += testGetFullTerritoryNameInLocale("", territory, -1, locale); + nrTests += testGetFullTerritoryNameInLocale("", territory, 999, locale); + for (alternative = 0;; alternative++) { + int len; + if (!getFullTerritoryNameInLocaleUtf8(territoryName, territory, alternative, locale)) { + break; + } + ++nrInLocale; + ++nrNames; + len = (int) strlen(territoryName); + nrTests++; + if (len < 1 || len > MAX_TERRITORY_FULLNAME_UTF8_LEN) { + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); - printf("*** ERROR *** getFullTerritoryNameLocal territory %s has NO name in common alphabet (%d)\n", - getTerritoryIsoName(s, territory, 0), territoryAlphabets->alphabet[0]); + printf("*** ERROR *** Bad %s territoryname %s, %d characters (limit is %d): %s\n", + locale, getTerritoryIsoName(s, territory, 0), len, + MAX_TERRITORY_FULLNAME_UTF8_LEN, territoryName); + } + if (len > maxLength) { + maxLength = len; } } } + } - // check that all names have a correct length - nrTests++; - for (alternative = 0;; alternative++) { - int len; - ++nrNames; - if (!getFullTerritoryNameEnglish(territoryName, territory, alternative)) { - break; - } - len = (int) strlen(territoryName); - if (len < 1 || len > MAX_TERRITORY_FULLNAME_LEN) { + // check that every territory has a local name in all the common alphabets + for (territory = _TERRITORY_MIN + 1; territory < _TERRITORY_MAX; ++territory) { + territoryAlphabets = getAlphabetsForTerritory(territory); + for (i = 0; i < territoryAlphabets->count; i++) { + nrTests++; + if (!getFullTerritoryNameLocalInAlphabetUtf8(territoryName, territory, 0, + territoryAlphabets->alphabet[i])) { + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); - printf("*** ERROR *** Bad territoryname, %d characters (limit is %d): %s\n", len, - MAX_TERRITORY_FULLNAME_LEN, territoryName); - } - if (len > maxLength) { - maxLength = len; + printf("*** ERROR *** getFullTerritoryNameLocal territory %s has NO name in common alphabet (%d)\n", + getTerritoryIsoName(s, territory, 0), territoryAlphabets->alphabet[0]); } } // check that the x-th local name is in the x-th common alphabet nrTests++; - { - const TerritoryAlphabets *territoryAlphabets = getAlphabetsForTerritory(territory); - int i; - for (i = 0; i < territoryAlphabets->count; i++) { - char territoryName2[MAX_TERRITORY_FULLNAME_LEN + 1]; - if (!getFullTerritoryNameLocalInAlphabet(territoryName, territory, 0, - territoryAlphabets->alphabet[i])) { - char s[MAX_ISOCODE_LEN + 1]; - foundError(); - printf("*** ERROR *** getFullTerritoryNameLocal territory %s has NO name in common alphabet (%d)\n", - getTerritoryIsoName(s, territory, 0), territoryAlphabets->alphabet[0]); - } - if (!getFullTerritoryNameLocal(territoryName2, territory, i) || - strcmp(territoryName, territoryName2) != 0) { - char s[MAX_ISOCODE_LEN + 1]; - foundError(); - printf("*** ERROR *** getFullTerritoryNameLocal %d-th (%s) name mismatches %d-th most common language for %s\n", - i, territoryName, i, getTerritoryIsoName(s, territory, 0)); - } - } - } - - for (alternative = 0;; alternative++) { - int len; - ++nrNames; - if (!getFullTerritoryNameLocal(territoryName, territory, alternative)) { - break; - } - len = (int) strlen(territoryName); - if (len > MAX_TERRITORY_FULLNAME_LEN) { + territoryAlphabets = getAlphabetsForTerritory(territory); + for (i = 0; i < territoryAlphabets->count; i++) { + char territoryNameLocal[MAX_TERRITORY_FULLNAME_UTF8_LEN + 1]; + if (!getFullTerritoryNameLocalInAlphabetUtf8(territoryName, territory, 0, territoryAlphabets->alphabet[i])) { + char s[MAX_ISOCODE_ASCII_LEN + 1]; foundError(); - printf("*** ERROR *** Bad territory name, %d characters (limit is %d): %s\n", len, - MAX_TERRITORY_FULLNAME_LEN, territoryName); + printf("*** ERROR *** getFullTerritoryNameLocal Territory %s has NO name in common alphabet %d\n", + getTerritoryIsoName(s, territory, 0), territoryAlphabets->alphabet[i]); } - if (len > maxLength) { - maxLength = len; + if (!getFullTerritoryNameLocalUtf8(territoryNameLocal, territory, i) || + strcmp(territoryName, territoryNameLocal)) { + foundError(); + printf("*** ERROR *** getFullTerritoryNameLocal Territory name %s (%d) does not match local name %s\n", + territoryName, i, territoryNameLocal); } } } printf("%d territory names, max length %d characters\n", nrNames, maxLength); - minNames = 2452; - ++nrTests; - if (nrNames < minNames) { - foundError(); - printf("*** ERROR *** Didn't find enough territory names, found %d, expected >= %d\n", nrNames, minNames); - } - nrTests += testGetFullTerritoryNameEnglish(1, "Netherlands", TERRITORY_NLD, 0); - nrTests += testGetFullTerritoryNameEnglish(1, "The Netherlands", TERRITORY_NLD, 1); - nrTests += testGetFullTerritoryNameEnglish(0, "", TERRITORY_NLD, 2); - - nrTests += testGetFullTerritoryNameEnglish(1, "Russia", TERRITORY_RUS, 0); - nrTests += testGetFullTerritoryNameEnglish(1, "Russian Federation", TERRITORY_RUS, 1); - nrTests += testGetFullTerritoryNameEnglish(0, "", TERRITORY_RUS, 2); - - nrTests += testGetFullTerritoryNameEnglish(1, "Kazakhstan", TERRITORY_KAZ, 0); - nrTests += testGetFullTerritoryNameEnglish(0, "", TERRITORY_KAZ, 1); - - nrTests += testGetFullTerritoryNameEnglish(1, "Turkmenistan", TERRITORY_TKM, 0); - nrTests += testGetFullTerritoryNameEnglish(0, "", TERRITORY_TKM, 1); - - nrTests += testGetFullTerritoryNameLocal(1, "Nederland", TERRITORY_NLD, 0); - nrTests += testGetFullTerritoryNameLocal(0, "", TERRITORY_NLD, 1); - - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "Nederland", TERRITORY_NLD, 0, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_NLD, 1, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_NLD, 0, ALPHABET_GREEK); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_NLD, 0, _ALPHABET_MIN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_NLD, 0, _ALPHABET_MAX); - - nrTests += testGetFullTerritoryNameLocal(1, "Росси́я", TERRITORY_RUS, 0); - nrTests += testGetFullTerritoryNameLocal(0, "", TERRITORY_RUS, 1); - - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "Росси́я", TERRITORY_RUS, 0, ALPHABET_CYRILLIC); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_RUS, 0, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_RUS, 0, ALPHABET_GREEK); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_RUS, 0, _ALPHABET_MIN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_RUS, 0, _ALPHABET_MAX); - - nrTests += testGetFullTerritoryNameLocal(1, "Қазақстан", TERRITORY_KAZ, 0); - nrTests += testGetFullTerritoryNameLocal(1, "Qazaqstan", TERRITORY_KAZ, 1); - nrTests += testGetFullTerritoryNameLocal(1, "Kazakhstan", TERRITORY_KAZ, 2); - nrTests += testGetFullTerritoryNameLocal(0, "", TERRITORY_KAZ, 3); - - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "Қазақстан", TERRITORY_KAZ, 0, ALPHABET_CYRILLIC); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 1, ALPHABET_CYRILLIC); - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "Qazaqstan", TERRITORY_KAZ, 0, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "Kazakhstan", TERRITORY_KAZ, 1, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 2, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 0, ALPHABET_GREEK); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 0, _ALPHABET_MIN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 0, _ALPHABET_MAX); - - nrTests += testGetFullTerritoryNameLocal(1, "Түркменистан", TERRITORY_TKM, 0); - nrTests += testGetFullTerritoryNameLocal(1, "Türkmenistan", TERRITORY_TKM, 1); - nrTests += testGetFullTerritoryNameLocal(1, "تۆركمنيستآن", TERRITORY_TKM, 2); - nrTests += testGetFullTerritoryNameLocal(0, "", TERRITORY_TKM, 3); - - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "Türkmenistan", TERRITORY_TKM, 0, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_TKM, 1, ALPHABET_ROMAN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "Түркменистан", TERRITORY_TKM, 0, ALPHABET_CYRILLIC); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_TKM, 1, ALPHABET_CYRILLIC); - nrTests += testGetFullTerritoryNameLocalInAlphabet(1, "تۆركمنيستآن", TERRITORY_TKM, 0, ALPHABET_ARABIC); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_TKM, 1, ALPHABET_ARABIC); - - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 0, ALPHABET_GREEK); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 0, _ALPHABET_MIN); - nrTests += testGetFullTerritoryNameLocalInAlphabet(0, "", TERRITORY_KAZ, 0, _ALPHABET_MAX); + nrTests += testGetFullTerritoryNameInLocale("Netherlands", TERRITORY_NLD, 0, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("The Netherlands", TERRITORY_NLD, 1, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_NLD, 2, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("Russia", TERRITORY_RUS, 0, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("Russian Federation", TERRITORY_RUS, 1, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_RUS, 2, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("Kazakhstan", TERRITORY_KAZ, 0, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_KAZ, 1, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("Turkmenistan", TERRITORY_TKM, 0, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_TKM, 1, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_TKM, 2, "en_US"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_TKM, 999, "en_US"); + +#ifdef MAPCODE_SUPPORT_LANGUAGE_NL + nrTests += testGetFullTerritoryNameInLocale("Nederland", TERRITORY_NLD, 0, "nl"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_NLD, 1, "nl"); + nrTests += testGetFullTerritoryNameInLocale("Vaticaanstad", TERRITORY_VAT, 0, "nl"); + nrTests += testGetFullTerritoryNameInLocale("Heilige Stoel", TERRITORY_VAT, 1, "nl"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_VAT, 2, "nl"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_VAT, 3, "nl"); +#else + nrTests += testGetFullTerritoryNameInLocale("Netherlands", TERRITORY_NLD, 0, "nl"); +#endif + +#ifdef MAPCODE_SUPPORT_LANGUAGE_FR + nrTests += testGetFullTerritoryNameInLocale("Pays-Bas", TERRITORY_NLD, 0, "fr"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_NLD, 1, "fr"); + nrTests += testGetFullTerritoryNameInLocale("Vatican", TERRITORY_VAT, 0, "fr"); + nrTests += testGetFullTerritoryNameInLocale("Cit\xC3\xA9 du Vatican", TERRITORY_VAT, 1, "fr"); + nrTests += testGetFullTerritoryNameInLocale("Saint-Si\xC3\xA8ge", TERRITORY_VAT, 2, "fr"); + nrTests += testGetFullTerritoryNameInLocale("", TERRITORY_VAT, 3, "fr"); +#else + nrTests += testGetFullTerritoryNameInLocale("Netherlands", TERRITORY_NLD, 0, "fr"); +#endif + + nrTests += testGetFullTerritoryNameLocal("Nederland", TERRITORY_NLD, 0); + nrTests += testGetFullTerritoryNameLocal("", TERRITORY_NLD, 1); + nrTests += testGetFullTerritoryNameLocalInAlphabet("Nederland", TERRITORY_NLD, 0, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_NLD, 1, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_NLD, 0, ALPHABET_GREEK); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_NLD, 0, _ALPHABET_MIN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_NLD, 0, _ALPHABET_MAX); + nrTests += testGetFullTerritoryNameLocal("Росси́я", TERRITORY_RUS, 0); + nrTests += testGetFullTerritoryNameLocal("", TERRITORY_RUS, 1); + nrTests += testGetFullTerritoryNameLocalInAlphabet("Росси́я", TERRITORY_RUS, 0, ALPHABET_CYRILLIC); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_RUS, 0, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_RUS, 0, ALPHABET_GREEK); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_RUS, 0, _ALPHABET_MIN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_RUS, 0, _ALPHABET_MAX); + nrTests += testGetFullTerritoryNameLocal("Қазақстан", TERRITORY_KAZ, 0); + nrTests += testGetFullTerritoryNameLocal("Qazaqstan", TERRITORY_KAZ, 1); + nrTests += testGetFullTerritoryNameLocal("Kazakhstan", TERRITORY_KAZ, 2); + nrTests += testGetFullTerritoryNameLocal("", TERRITORY_KAZ, 3); + nrTests += testGetFullTerritoryNameLocalInAlphabet("Қазақстан", TERRITORY_KAZ, 0, ALPHABET_CYRILLIC); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 1, ALPHABET_CYRILLIC); + nrTests += testGetFullTerritoryNameLocalInAlphabet("Qazaqstan", TERRITORY_KAZ, 0, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("Kazakhstan", TERRITORY_KAZ, 1, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 2, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 0, ALPHABET_GREEK); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 0, _ALPHABET_MIN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 0, _ALPHABET_MAX); + nrTests += testGetFullTerritoryNameLocal("Түркменистан", TERRITORY_TKM, 0); + nrTests += testGetFullTerritoryNameLocal("Türkmenistan", TERRITORY_TKM, 1); + nrTests += testGetFullTerritoryNameLocal("تۆركمنيستآن", TERRITORY_TKM, 2); + nrTests += testGetFullTerritoryNameLocal("", TERRITORY_TKM, 3); + nrTests += testGetFullTerritoryNameLocalInAlphabet("Türkmenistan", TERRITORY_TKM, 0, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_TKM, 1, ALPHABET_ROMAN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("Түркменистан", TERRITORY_TKM, 0, ALPHABET_CYRILLIC); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_TKM, 1, ALPHABET_CYRILLIC); + nrTests += testGetFullTerritoryNameLocalInAlphabet("تۆركمنيستآن", TERRITORY_TKM, 0, ALPHABET_ARABIC); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_TKM, 1, ALPHABET_ARABIC); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 0, ALPHABET_GREEK); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 0, _ALPHABET_MIN); + nrTests += testGetFullTerritoryNameLocalInAlphabet("", TERRITORY_KAZ, 0, _ALPHABET_MAX); return nrTests; } @@ -1961,17 +2106,17 @@ static int testAlphabets(void) { printf("%d alphabets\n", _ALPHABET_MAX); - for (j = 0; j < (sizeof(TEST_PAIRS) / sizeof(TEST_PAIRS[0])); j += 2) { + for (j = 0; j < (int) (sizeof(TEST_PAIRS) / sizeof(TEST_PAIRS[0])); j += 2) { enum Alphabet i; for (i = _ALPHABET_MIN + 1; i < _ALPHABET_MAX; i++) { - UWORD enc[MAX_MAPCODE_RESULT_LEN + 1]; - char dec[MAX_MAPCODE_RESULT_LEN + 1]; + UWORD enc[MAX_MAPCODE_RESULT_UTF16_LEN + 1]; + char dec[MAX_MAPCODE_RESULT_ASCII_LEN + 1]; // see if alphabets (re)convert as expected str = TEST_PAIRS[j]; expect = TEST_PAIRS[j + 1]; convertMapcodeToAlphabetUtf16(enc, str, i); { - char utf8[3 * MAX_MAPCODE_RESULT_LEN + 1]; + char utf8[MAX_MAPCODE_RESULT_UTF8_LEN + 1]; MapcodeElements mapcodeElements; double lat1, lon1, lat2, lon2, lat3, lon3; convertMapcodeToAlphabetUtf8(utf8, str, i); @@ -2011,11 +2156,11 @@ static int testAlphabetRobustness(void) { UWORD *pu; s1[0] = 0; - for (i = 0; i < sizeof(largeString1) - 1; ++i) { + for (i = 0; i < (int) sizeof(largeString1) - 1; ++i) { largeString1[i] = (char) ((i % 223) + 32); } largeString1[sizeof(largeString1) - 1] = 0; - for (i = 0; i < sizeof(largeString2) - 1; ++i) { + for (i = 0; i < (int) sizeof(largeString2) - 1; ++i) { largeString2[i] = (char) ((i % 223) + 32); } largeString2[sizeof(largeString2) - 1] = 0; @@ -2077,6 +2222,78 @@ static int testAlphabetPerTerritory(void) { } +static int testBugFixes(void) { + int nrTests = 0; + + // Issue 1: lat=+Inf or lat=-Inf must return ERR_BAD_COORDINATE (0 results), same as lon=Inf + { + Mapcodes mapcodes; + double pos_inf = 1.0 / 0.0; + double neg_inf = -1.0 / 0.0; + int n; + + n = encodeLatLonToMapcodes(&mapcodes, pos_inf, 0.0, TERRITORY_NONE, 0); + ++nrTests; + if (n != 0) { + foundError(); + printf("*** ERROR *** encodeLatLonToMapcodes(lat=+Inf) should return 0, got %d\n", n); + } + + n = encodeLatLonToMapcodes(&mapcodes, neg_inf, 0.0, TERRITORY_NONE, 0); + ++nrTests; + if (n != 0) { + foundError(); + printf("*** ERROR *** encodeLatLonToMapcodes(lat=-Inf) should return 0, got %d\n", n); + } + } + + // Issue 2: indexOfSelected == nrOfResults is out-of-bounds and must return 0 + { + char mapcode[MAX_MAPCODE_RESULT_ASCII_LEN]; + // lat=52.158993, lon=4.492346 yields 4 results (verified in testSelectedEncodes) + int n = encodeLatLonToSelectedMapcode(mapcode, 52.158993, 4.492346, TERRITORY_NONE, 0, 4); + ++nrTests; + if (n != 0) { + foundError(); + printf("*** ERROR *** encodeLatLonToSelectedMapcode with indexOfSelected==nrOfResults should return 0, got %d\n", n); + } + } + + // Issue 7: encodeLatLonToSingleMapcode must accept TERRITORY_NONE and TERRITORY_UNKNOWN + { + char mapcode[MAX_MAPCODE_RESULT_ASCII_LEN]; + int n; + + n = encodeLatLonToSingleMapcode(mapcode, 52.3, 4.9, TERRITORY_UNKNOWN, 0); + ++nrTests; + if (n <= 0) { + foundError(); + printf("*** ERROR *** encodeLatLonToSingleMapcode(TERRITORY_UNKNOWN) should succeed, got %d\n", n); + } + + n = encodeLatLonToSingleMapcode(mapcode, 52.3, 4.9, TERRITORY_NONE, 0); + ++nrTests; + if (n <= 0) { + foundError(); + printf("*** ERROR *** encodeLatLonToSingleMapcode(TERRITORY_NONE) should succeed, got %d\n", n); + } + } + + // Issue 9: convertMapcodeToAlphabetUtf8 must return the start of the output buffer + { + char utf8[MAX_MAPCODE_RESULT_UTF8_LEN + 1]; + char *result = convertMapcodeToAlphabetUtf8(utf8, "NLD 49.4V", ALPHABET_ROMAN); + ++nrTests; + if (result != utf8) { + foundError(); + printf("*** ERROR *** convertMapcodeToAlphabetUtf8 must return start of buffer, got wrong pointer\n"); + } + } + + return nrTests; +} + + int main(const int argc, const char **argv) { int nrTests = 0; @@ -2130,11 +2347,15 @@ int main(const int argc, const char **argv) { printf("-----------------------------------------------------------\nEncode/decode tests\n"); nrTests += testSingleEncodes(); + nrTests += testSelectedEncodes(); nrTests += testEncodeDecode(); printf("-----------------------------------------------------------\nRe-encode tests\n"); nrTests += testReEncode(); + printf("-----------------------------------------------------------\nBug-fix regression tests\n"); + nrTests += testBugFixes(); + printf("-----------------------------------------------------------\n"); printf("Done.\nExecuted %d tests, found %d errors\n", nrTests, nrErrors); if (nrErrors > 0) { diff --git a/unittest/clean.sh b/unittest/clean.sh deleted file mode 100755 index 4651ad2..0000000 --- a/unittest/clean.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -echo "Clean test files..." -if [ -f unittest.c ] -then - rm -f _*.txt gmon.out *.gcda *.gcno *.gcov ../mapcodelib/*.gcda ../mapcodelib/*.gcno ../mapcodelib/*.gcov -fi diff --git a/unittest/run_all.sh b/unittest/run_all.sh deleted file mode 100755 index 306c5d8..0000000 --- a/unittest/run_all.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh -OUT=_report.txt -echo "Run all tests..." | tee $OUT -date | tee -a $OUT -echo "" | tee -a $OUT -./run_normal.sh | tee -a $OUT -./run_sanitizer.sh | tee -a $OUT -./run_gcov.h | tee -a $OUT -./run_gprof.sh | tee -a $OUT -./run_valgrind.sh | tee -a $OUT -./run_compare.sh | tee -a $OUT -echo "" | tee -a $OUT -echo "Done" | tee -a $OUT diff --git a/unittest/run_gcov.sh b/unittest/run_gcov.sh deleted file mode 100755 index 9c79ebd..0000000 --- a/unittest/run_gcov.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -OPTS="-Wall -Werror -Wno-pointer-to-int-cast -fprofile-arcs -ftest-coverage" -LIB="../mapcodelib/mapcoder.o" - -TEST=`which gcov` -if [ "$TEST" = "" ] -then - echo "No gcov found on this machine - skipping script..." - exit 1 -fi - -echo "!! -------------------------------------------------------------" -echo "Run gcov test coverage..." -date -echo "!! -------------------------------------------------------------" - -echo "" -echo "Run gcov with: -O0" -cd ../mapcodelib -gcc $OPTS -O0 -c mapcoder.c -cd ../unittest -gcc $OPTS -O0 unittest.c -lm -lpthread -o unittest $LIB -./unittest -cd ../mapcodelib -gcov mapcoder.c -cd ../unittest -gcov unittest.c -echo "!! -------------------------------------------------------------" -echo "!! Coverage reports in: *.gcov files" -echo "!! -------------------------------------------------------------" - -echo "" -echo "Report in: $REPORT" diff --git a/unittest/run_normal.sh b/unittest/run_normal.sh deleted file mode 100755 index d378710..0000000 --- a/unittest/run_normal.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -OPTS="-Wall -Werror -Wno-pointer-to-int-cast" - -echo "!! -------------------------------------------------------------" -echo "Run normal..." -date -echo "!! -------------------------------------------------------------" - -echo "" -echo "Run normal with: -O0" -cd ../mapcodelib -gcc $OPTS -O0 -DDEBUG -c mapcoder.c -cd ../unittest -gcc $OPTS -O0 -DDEBUG unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -./unittest -echo "!! -------------------------------------------------------------" - -echo "" -echo "Run normal with: -O3" -cd ../mapcodelib -gcc $OPTS -O3 -c mapcoder.c -cd ../unittest -gcc $OPTS -O3 unittest.c -lm -lpthread -o unittest ../mapcodelib/mapcoder.o -./unittest -echo "!! -------------------------------------------------------------" - -echo "" -echo "Report in: $REPORT" diff --git a/unittest/run_valgrind.sh b/unittest/run_valgrind.sh deleted file mode 100755 index a67cd81..0000000 --- a/unittest/run_valgrind.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -OPTS="-Wall -Werror -Wno-pointer-to-int-cast" -LIB="../mapcodelib/mapcoder.o" - -TEST=`which valgrind` -if [ "$TEST" = "" ] -then - echo "No valgrind found on this machine - skipping script..." - exit 1 -fi - -echo "!! -------------------------------------------------------------" -echo "Run valgrind" -date -echo "!! -------------------------------------------------------------" - -echo "" -echo "Run valgrind with: -O0" -cd ../mapcodelib -gcc $OPTS -g -O0 -c mapcoder.c -cd ../unittest -gcc $OPTS -g -O0 unittest.c -lm -lpthread -o unittest $LIB -valgrind --leak-check=yes ./unittest -echo "!! -------------------------------------------------------------" - -echo "" tee -a $REPORT -echo "Report in: $REPORT" diff --git a/utility/compile.sh b/utility/compile.sh index 2920322..b89dec3 100755 --- a/utility/compile.sh +++ b/utility/compile.sh @@ -1,7 +1,22 @@ #!/bin/sh +# +# Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + echo "Compiling..." cd ../mapcodelib gcc -O3 -c mapcoder.c cd ../utility gcc -O3 mapcode.cpp -lm -o mapcode ../mapcodelib/mapcoder.o - diff --git a/utility/mapcode.cpp b/utility/mapcode.cpp index 2b117e1..05641f3 100644 --- a/utility/mapcode.cpp +++ b/utility/mapcode.cpp @@ -1,18 +1,16 @@ -/* - * Copyright (C) 2014-2016 Stichting Mapcode Foundation (http://www.mapcode.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright (C) 2014-2025 Stichting Mapcode Foundation (http://www.mapcode.com) +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. /** * This application uses the Mapcode C library to encode and decode Mapcodes. @@ -45,7 +43,10 @@ #include #include #include "../mapcodelib/mapcoder.h" -#include "../mapcodelib/internal_territory_names_english.h" + +#define MAPCODE_SUPPORT_LANGUAGE_EN + +#include "../mapcodelib/internal_territory_names_en.h" #include "../mapcodelib/internal_data.h" #include "../mapcodelib/internal_iso3166_data.h" @@ -80,9 +81,9 @@ static double lonLargestNrOfResults = 0.0; * The usage() method explains how this application can be used. It is called * whenever a incorrect amount or combination of parameters is entered. */ -static void usage(const char *appName) { +static void usage(const char* appName) { printf("MAPCODE (version %s)\n", MAPCODE_C_VERSION); - printf("Copyright (C) 2014-2016 Stichting Mapcode Foundation\n"); + printf("Copyright (C) 2014-2025 Stichting Mapcode Foundation\n"); printf("\n"); printf("Usage:\n"); @@ -165,8 +166,7 @@ static double degToRad(double deg) { * (x, y, z) point on a sphere with a radius of 1. */ static void unitToLatLonDeg( - const double unit1, const double unit2, double *latDeg, double *lonDeg) { - + const double unit1, const double unit2, double* latDeg, double* lonDeg) { // Calculate uniformly distributed 3D Point on sphere (radius = 1.0): // http://mathproofs.blogspot.co.il/2005/04/uniform-random-distribution-on-sphere.html const double theta0 = (2.0 * PI) * unit1; @@ -190,7 +190,7 @@ static void unitToLatLonDeg( * The method convertLatLonToXYZ() convertes a lat/lon pair to a (x, y, z) coordinate * on a sphere with radius 1. */ -static void convertLatLonToXYZ(double latDeg, double lonDeg, double *x, double *y, double *z) { +static void convertLatLonToXYZ(double latDeg, double lonDeg, double* x, double* y, double* z) { double latRad = degToRad(latDeg); double lonRad = degToRad(lonDeg); *x = cos(latRad) * cos(lonRad); @@ -202,7 +202,7 @@ static void convertLatLonToXYZ(double latDeg, double lonDeg, double *x, double * /** * This methods provides a self check for encoding lat/lon to Mapcode. */ -static void selfCheckLatLonToMapcode(const double lat, double lon, const char *mapcode, int extraDigits) { +static void selfCheckLatLonToMapcode(const double lat, double lon, const char* mapcode, int extraDigits) { // TODO: Fix self check; read context. // int context = getTerritoryCode(territory, 0); enum Territory context = TERRITORY_NONE; @@ -220,17 +220,16 @@ static void selfCheckLatLonToMapcode(const double lat, double lon, const char *m } int found = 0; for (int i = 0; !found && (i < nrResults); ++i) { - /* Check if the territory and code were found in results. Note that the territory * may be a minimal code, like IN (which may indicate US-IN or RU-IN). */ - const char *foundMapcode = mapcodes.mapcode[i]; + const char* foundMapcode = mapcodes.mapcode[i]; found = (strcmp(mapcode, foundMapcode) == 0); } if (!found) { fprintf(stderr, "error: encoding lat/lon to mapcode failure; " - "mapcode '%s' decodes to lat=%.20g(%.20g), lon=%.20g(%.20g), " - "which does not encode back to '%s'\n", + "mapcode '%s' decodes to lat=%.20g(%.20g), lon=%.20g(%.20g), " + "which does not encode back to '%s'\n", mapcode, lat, limitLat, lon, limitLon, mapcode); if (selfCheckEnabled) { exit(INTERNAL_ERROR); @@ -243,7 +242,7 @@ static void selfCheckLatLonToMapcode(const double lat, double lon, const char *m /** * This method provides a self-check for decoding a Mapcode to lat/lon. */ -static void selfCheckMapcodeToLatLon(const char *mapcode, +static void selfCheckMapcodeToLatLon(const char* mapcode, const double lat, const double lon) { double foundLat; double foundLon; @@ -266,8 +265,8 @@ static void selfCheckMapcodeToLatLon(const char *mapcode, } if ((deltaLat > DELTA) || (deltaLon > DELTA)) { fprintf(stderr, "error: decoding mapcode to lat/lon failure; " - "lat=%.20g, lon=%.20g produces mapcode %s, " - "which decodes to lat=%.20g (delta=%.20g), lon=%.20g (delta=%.20g)\n", + "lat=%.20g, lon=%.20g produces mapcode %s, " + "which decodes to lat=%.20g (delta=%.20g), lon=%.20g (delta=%.20g)\n", lat, lon, mapcode, foundLat, deltaLat, foundLon, deltaLon); if (selfCheckEnabled) { exit(INTERNAL_ERROR); @@ -277,7 +276,6 @@ static void selfCheckMapcodeToLatLon(const char *mapcode, } static void generateAndOutputMapcodes(double lat, double lon, int iShowError, int extraDigits, int useXYZ) { - enum Territory context = TERRITORY_NONE; while (lon > 180.0) { @@ -308,11 +306,12 @@ static void generateAndOutputMapcodes(double lat, double lon, int iShowError, in double z; convertLatLonToXYZ(lat, lon, &x, &y, &z); printf("%d %.20g %.20g %.20g %.20g %.20g\n", nrResults, lat, lon, x, y, z); - } else { + } + else { printf("%d %.20g %.20g\n", nrResults, lat, lon); } for (int j = 0; j < nrResults; ++j) { - const char *foundMapcode = mapcodes.mapcode[j]; + const char* foundMapcode = mapcodes.mapcode[j]; // Output result line. printf("%s\n", foundMapcode); @@ -355,7 +354,7 @@ static void outputStatistics() { fprintf(stderr, "Total number of 3D points generated = %d\n", totalNrOfPoints); fprintf(stderr, "Total number of mapcodes generated = %d\n", totalNrOfResults); fprintf(stderr, "Average number of mapcodes per 3D Point = %.20g\n", - ((float) totalNrOfResults) / ((float) totalNrOfPoints)); + ((float)totalNrOfResults) / ((float)totalNrOfPoints)); fprintf(stderr, "Largest number of results for 1 mapcode = %d at (%.20g, %.20g)\n", largestNrOfResults, latLargestNrOfResults, lonLargestNrOfResults); } @@ -366,7 +365,7 @@ static void outputStatistics() { */ static void showProgress(int i) { fprintf(stderr, "[%d%%] Processed %d of %d regions (generated %d mapcodes)...\r", - (int) ((((float) i / ((float) totalNrOfPoints)) * 100.0) + 0.5), + (int)((((float)i / ((float)totalNrOfPoints)) * 100.0) + 0.5), i, totalNrOfPoints, totalNrOfResults); } @@ -374,7 +373,7 @@ static void showProgress(int i) { * This is the main() method which is called from the command-line. * Return code 0 means success. Any other values means some sort of error occurred. */ -int main(const int argc, const char **argv) { +int main(const int argc, const char** argv) { // Assume no extra digits (unless overridden later. int extraDigits = 0; @@ -382,7 +381,7 @@ int main(const int argc, const char **argv) { int useXYZ = 0; // Provide usage message if no arguments specified. - const char *appName = argv[0]; + const char* appName = argv[0]; selfCheckEnabled = (strstr(appName, "debug") != 0); if (selfCheckEnabled) { fprintf(stderr, "(debug mode: self checking enabled)\n"); @@ -393,9 +392,8 @@ int main(const int argc, const char **argv) { } // First argument: command. - const char *cmd = argv[1]; + const char* cmd = argv[1]; if ((strcmp(cmd, "-d") == 0) || (strcmp(cmd, "--decode") == 0)) { - // ------------------------------------------------------------------ // Decode: [-d | --decode] [ ...] // ------------------------------------------------------------------ @@ -405,7 +403,7 @@ int main(const int argc, const char **argv) { return NORMAL_ERROR; } - const char *defaultTerritory = argv[2]; + const char* defaultTerritory = argv[2]; double lat; double lon; @@ -414,9 +412,8 @@ int main(const int argc, const char **argv) { // Decode every Mapcode. for (int i = 3; i < argc; ++i) { - // Decode the Mapcode to a lat/lon. - const char *mapcode = argv[i]; + const char* mapcode = argv[i]; int err = decodeMapcodeToLatLonUtf8(&lat, &lon, mapcode, context, NULL); if (err != 0) { fprintf(stderr, "error: cannot decode '%s %s'\n", defaultTerritory, mapcode); @@ -428,25 +425,25 @@ int main(const int argc, const char **argv) { // Self-checking code to see if encoder produces this Mapcode for the lat/lon. if (selfCheckEnabled) { - const char *suffix = strstr(mapcode, "-"); + const char* suffix = strstr(mapcode, "-"); extraDigits = 0; if (suffix != 0) { - extraDigits = (int) (strlen(suffix) - 1); + extraDigits = (int)(strlen(suffix) - 1); } selfCheckLatLonToMapcode(lat, lon, mapcode, extraDigits); } } - } else if ((strcmp(cmd, "-e") == 0) || (strcmp(cmd, "-e0") == 0) || - (strcmp(cmd, "-e1") == 0) || (strcmp(cmd, "-e2") == 0) || - (strcmp(cmd, "-e3") == 0) || (strcmp(cmd, "-e4") == 0) || - (strcmp(cmd, "-e5") == 0) || (strcmp(cmd, "-e6") == 0) || - (strcmp(cmd, "-e7") == 0) || (strcmp(cmd, "-e8") == 0) || - (strcmp(cmd, "--encode") == 0) || (strcmp(cmd, "--encode0") == 0) || - (strcmp(cmd, "--encode1") == 0) || (strcmp(cmd, "--encode2") == 0) || - (strcmp(cmd, "--encode3") == 0) || (strcmp(cmd, "--encode4") == 0) || - (strcmp(cmd, "--encode5") == 0) || (strcmp(cmd, "--encode5") == 0) || - (strcmp(cmd, "--encode7") == 0) || (strcmp(cmd, "--encode8") == 0)) { - + } + else if ((strcmp(cmd, "-e") == 0) || (strcmp(cmd, "-e0") == 0) || + (strcmp(cmd, "-e1") == 0) || (strcmp(cmd, "-e2") == 0) || + (strcmp(cmd, "-e3") == 0) || (strcmp(cmd, "-e4") == 0) || + (strcmp(cmd, "-e5") == 0) || (strcmp(cmd, "-e6") == 0) || + (strcmp(cmd, "-e7") == 0) || (strcmp(cmd, "-e8") == 0) || + (strcmp(cmd, "--encode") == 0) || (strcmp(cmd, "--encode0") == 0) || + (strcmp(cmd, "--encode1") == 0) || (strcmp(cmd, "--encode2") == 0) || + (strcmp(cmd, "--encode3") == 0) || (strcmp(cmd, "--encode4") == 0) || + (strcmp(cmd, "--encode5") == 0) || (strcmp(cmd, "--encode6") == 0) || + (strcmp(cmd, "--encode7") == 0) || (strcmp(cmd, "--encode8") == 0)) { // ------------------------------------------------------------------ // Encode: [-e[0-8] | --encode[0-8]] [territory]> // ------------------------------------------------------------------ @@ -465,27 +462,35 @@ int main(const int argc, const char **argv) { if (strstr(cmd, "-e1") || strstr(cmd, "--encode1")) { extraDigits = 1; - } else if (strstr(cmd, "-e2") || strstr(cmd, "--encode2")) { + } + else if (strstr(cmd, "-e2") || strstr(cmd, "--encode2")) { extraDigits = 2; - } else if (strstr(cmd, "-e3") || strstr(cmd, "--encode3")) { + } + else if (strstr(cmd, "-e3") || strstr(cmd, "--encode3")) { extraDigits = 3; - } else if (strstr(cmd, "-e4") || strstr(cmd, "--encode4")) { + } + else if (strstr(cmd, "-e4") || strstr(cmd, "--encode4")) { extraDigits = 4; - } else if (strstr(cmd, "-e5") || strstr(cmd, "--encode5")) { + } + else if (strstr(cmd, "-e5") || strstr(cmd, "--encode5")) { extraDigits = 5; - } else if (strstr(cmd, "-e6") || strstr(cmd, "--encode6")) { + } + else if (strstr(cmd, "-e6") || strstr(cmd, "--encode6")) { extraDigits = 6; - } else if (strstr(cmd, "-e7") || strstr(cmd, "--encode7")) { + } + else if (strstr(cmd, "-e7") || strstr(cmd, "--encode7")) { extraDigits = 7; - } else if (strstr(cmd, "-e8") || strstr(cmd, "--encode8")) { + } + else if (strstr(cmd, "-e8") || strstr(cmd, "--encode8")) { extraDigits = 8; - } else { + } + else { extraDigits = 0; } // Get territory context. enum Territory context = TERRITORY_NONE; - const char *defaultTerritory = "AAA"; + const char* defaultTerritory = "AAA"; if (argc == 5) { context = getTerritoryCode(argv[4], TERRITORY_NONE); defaultTerritory = argv[4]; @@ -502,7 +507,7 @@ int main(const int argc, const char **argv) { // Output the Mapcode. for (int i = 0; i < nrResults; ++i) { - const char *foundMapcode = mapcodes.mapcode[i]; + const char* foundMapcode = mapcodes.mapcode[i]; printf("%s\n", foundMapcode); // Self-checking code to see if decoder produces the lat/lon for all of these Mapcodes. @@ -510,9 +515,9 @@ int main(const int argc, const char **argv) { selfCheckMapcodeToLatLon(foundMapcode, lat, lon); } } - } else if ((strcmp(cmd, "-t") == 0) || - (strcmp(cmd, "--territories") == 0)) { - + } + else if ((strcmp(cmd, "-t") == 0) || + (strcmp(cmd, "--territories") == 0)) { // ------------------------------------------------------------------ // Generate a test set based on the Mapcode territories // ------------------------------------------------------------------ @@ -523,8 +528,8 @@ int main(const int argc, const char **argv) { } printf("ccode,territorycodes(pipe-separated),alphabets(pipe-seperated),names(pipe-separated)\n"); for (int i = _TERRITORY_MIN + 1; i < _TERRITORY_MAX; ++i) { - const enum Territory ccode = (enum Territory) i; - char territoryName[MAX_MAPCODE_RESULT_LEN]; + const enum Territory ccode = (enum Territory)i; + char territoryName[MAX_MAPCODE_RESULT_ASCII_LEN]; printf("%d,", INDEX_OF_TERRITORY(i)); // Use internal knowledge of ALPHA_SEARCH to show aliases of territoryName. @@ -534,7 +539,7 @@ int main(const int argc, const char **argv) { char fullcode[16]; strcpy(fullcode, ALPHA_SEARCH[a].alphaCode); if (fullcode[0] >= '0' && fullcode[0] <= '9') { - static const char *parents2 = "US,IN,CA,AU,MX,BR,RU,CN,"; + static const char* parents2 = "US,IN,CA,AU,MX,BR,RU,CN,"; int p = (fullcode[0] - '0'); memcpy(fullcode, &parents2[p * 3 - 3], 2); fullcode[2] = '-'; @@ -548,7 +553,7 @@ int main(const int argc, const char **argv) { printf(","); // Print alphabets. - const TerritoryAlphabets *territoryAlphabets = getAlphabetsForTerritory(ccode); + const TerritoryAlphabets* territoryAlphabets = getAlphabetsForTerritory(ccode); for (int j = 0; j < territoryAlphabets->count; j++) { if (j > 0) { printf("|"); @@ -558,13 +563,13 @@ int main(const int argc, const char **argv) { printf(","); // Use internal knowledge of TERRITORY_FULL_NAME to show aliases of full territory name. - char *names = strdup(TERRITORY_FULL_NAME[INDEX_OF_TERRITORY(ccode)]); - char *s = names; + char* names = strdup(TERRITORY_FULL_NAME_EN[INDEX_OF_TERRITORY(ccode)]); + char* s = names; while (s) { if (s != names) { printf("|"); } - char *e = strstr(s, " ("); + char* e = strstr(s, " ("); if (e) { *e = 0; if (e[-1] == ')') { @@ -572,7 +577,8 @@ int main(const int argc, const char **argv) { } printf("%s", s); s = e + 2; - } else { + } + else { e = s + strlen(s); if (e[-1] == ')') { e[-1] = 0; @@ -583,77 +589,77 @@ int main(const int argc, const char **argv) { } printf("\n"); } - } else if ((strcmp(cmd, "-a") == 0) || - (strcmp(cmd, "--alphabets") == 0)) { - + } + else if ((strcmp(cmd, "-a") == 0) || + (strcmp(cmd, "--alphabets") == 0)) { // ------------------------------------------------------------------ // Generate a test set based on the Mapcode territories // ------------------------------------------------------------------ - static const char *mapcodeForCSV[] = { - // all characters - "89.EU", - "00.0A", - "BCDF.GHJK", - "LMNP.QRST", - "VWXY.Z123", - "4567.890B", - // all forms - "pq.xy", - "pq.xyz", - "pqx.yz", - "pq.rxyz", - "pqr.xyz", - "pqrx.yz", - "pqr.sxyz", - "pqrs.xyz", - "pqrs.txyz", - "pqrst.vxyz", - // all adjad forms - "p1.xy", - "pq.2y", - "3q.x4", - "5q.6y", - "pq.1yz", - "pq1.yz", - "p2.x3z", - "p2x.3z", - "pq.1xy2", - "pq1.xy2", - "pq1x.y2", - "p3.rx4z", - "p3r.x4z", - "p3rx.4z", - "5q.r6y7", - "5qr.6y7", - "5qr6.y7", - "pq1.sx2z", - "pq1s.x2z", - "p3r.s4yz", - "p3rs.4yz", - "5qr.6xy7", - "5qr6.xy7", - "8q9.sx0z", - "8q9s.x0z", - "1qr2.tx3z", - "p4rs.5xy6", - "p7r8.t9y0", - "pq1st.2xy3", - "p4rs5.vx6z", - "7qr8t.v9yz", - "p1r2t.3x4z", - "5q6s7.v8y9", - // non-mapcode - "^0123456789!@#$^&*()/:;[]{}<>?|~%", - "abcdefghijklmnopqrstuvwxyz", - "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - // special case for digit-like characters - "OI.xx", - "oi.xx", - "oi.xx-oooooooo", - "oi.xx-iiiiiiii", - "PQ.RS-01234567", - "PQ.RS-890", - NULL + static const char* mapcodeForCSV[] = { + // all characters + "89.EU", + "00.0A", + "BCDF.GHJK", + "LMNP.QRST", + "VWXY.Z123", + "4567.890B", + // all forms + "pq.xy", + "pq.xyz", + "pqx.yz", + "pq.rxyz", + "pqr.xyz", + "pqrx.yz", + "pqr.sxyz", + "pqrs.xyz", + "pqrs.txyz", + "pqrst.vxyz", + // all adjad forms + "p1.xy", + "pq.2y", + "3q.x4", + "5q.6y", + "pq.1yz", + "pq1.yz", + "p2.x3z", + "p2x.3z", + "pq.1xy2", + "pq1.xy2", + "pq1x.y2", + "p3.rx4z", + "p3r.x4z", + "p3rx.4z", + "5q.r6y7", + "5qr.6y7", + "5qr6.y7", + "pq1.sx2z", + "pq1s.x2z", + "p3r.s4yz", + "p3rs.4yz", + "5qr.6xy7", + "5qr6.xy7", + "8q9.sx0z", + "8q9s.x0z", + "1qr2.tx3z", + "p4rs.5xy6", + "p7r8.t9y0", + "pq1st.2xy3", + "p4rs5.vx6z", + "7qr8t.v9yz", + "p1r2t.3x4z", + "5q6s7.v8y9", + // non-mapcode + "^0123456789!@#$^&*()/:;[]{}<>?|~%", + "abcdefghijklmnopqrstuvwxyz", + "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + // special case for digit-like characters + "OI.xx", + "oi.xx", + "oi.xx-oooooooo", + "oi.xx-iiiiiiii", + "PQ.RS-01234567", + "PQ.RS-890", + NULL }; if ((argc < 2) || (argc > 2)) { fprintf(stderr, "error: incorrect number of arguments\n\n"); @@ -663,7 +669,7 @@ int main(const int argc, const char **argv) { printf("alphabetNr,MapcodeInRoman,MapcodeInAlphabet\n"); for (enum Alphabet alphabet = ALPHABET_ROMAN; - alphabet < _ALPHABET_MAX; alphabet = (enum Alphabet) (alphabet + 1)) { + alphabet < _ALPHABET_MAX; alphabet = (enum Alphabet)(alphabet + 1)) { int variant; for (variant = 0; variant <= 2; variant++) { int m; @@ -675,7 +681,7 @@ int main(const int argc, const char **argv) { strcpy(mapcode, mapcodeForCSV[m]); strcat(mapcode, (variant == 1) ? "-bc" : (variant == 2) ? "-DFGHJKLM" : ""); for (i = 0; mapcode[i]; ++i) { - mapcode[i] = (char) toupper((int) mapcode[i]); + mapcode[i] = (char)toupper((int)mapcode[i]); } // convert to alphabet, and back to roman convertMapcodeToAlphabetUtf8(asciiString, mapcode, alphabet); @@ -684,9 +690,9 @@ int main(const int argc, const char **argv) { } } } - } else if ((strcmp(cmd, "-b") == 0) || (strcmp(cmd, "-bXYZ") == 0) || - (strcmp(cmd, "--boundaries") == 0) || (strcmp(cmd, "--boundariesXYZ") == 0)) { - + } + else if ((strcmp(cmd, "-b") == 0) || (strcmp(cmd, "-bXYZ") == 0) || + (strcmp(cmd, "--boundaries") == 0) || (strcmp(cmd, "--boundariesXYZ") == 0)) { // ------------------------------------------------------------------ // Generate a test set based on the Mapcode boundaries. // ------------------------------------------------------------------ @@ -714,11 +720,11 @@ int main(const int argc, const char **argv) { double lat; double lon; - const TerritoryBoundary *mm = TERRITORY_BOUNDARY(i); - minLon = ((double) mm->minx) / 1.0E6; - maxLon = ((double) mm->maxx) / 1.0E6; - minLat = ((double) mm->miny) / 1.0E6; - maxLat = ((double) mm->maxy) / 1.0E6; + const TerritoryBoundary* mm = TERRITORY_BOUNDARY(i); + minLon = ((double)mm->minx) / 1.0E6; + maxLon = ((double)mm->maxx) / 1.0E6; + minLat = ((double)mm->miny) / 1.0E6; + maxLat = ((double)mm->maxy) / 1.0E6; // Try center. lat = (maxLat - minLat) / 2.0; @@ -749,11 +755,11 @@ int main(const int argc, const char **argv) { } } outputStatistics(); - } else if ((strcmp(cmd, "-g") == 0) || (strcmp(cmd, "-gXYZ") == 0) || - (strcmp(cmd, "--grid") == 0) || (strcmp(cmd, "--gridXYZ") == 0) || - (strcmp(cmd, "-r") == 0) || (strcmp(cmd, "-rXYZ") == 0) || - (strcmp(cmd, "--random") == 0) || (strcmp(cmd, "--randomXYZ") == 0)) { - + } + else if ((strcmp(cmd, "-g") == 0) || (strcmp(cmd, "-gXYZ") == 0) || + (strcmp(cmd, "--grid") == 0) || (strcmp(cmd, "--gridXYZ") == 0) || + (strcmp(cmd, "-r") == 0) || (strcmp(cmd, "-rXYZ") == 0) || + (strcmp(cmd, "--random") == 0) || (strcmp(cmd, "--randomXYZ") == 0)) { // ------------------------------------------------------------------ // Generate grid test set: [-g | --grid] [] // Generate uniform test set: [-r | --random] [] @@ -781,9 +787,10 @@ int main(const int argc, const char **argv) { if (random) { if (argc == 5) { const int seed = atoi(argv[4]); - srand((unsigned int) seed); - } else { - srand((unsigned int) time(0)); + srand((unsigned int)seed); + } + else { + srand((unsigned int)time(0)); } } useXYZ = (strstr(cmd, "XYZ") != 0); @@ -801,15 +808,17 @@ int main(const int argc, const char **argv) { double unit2; if (random) { - unit1 = ((double) rand()) / RAND_MAX; - unit2 = ((double) rand()) / RAND_MAX; - } else { - unit1 = ((double) gridX) / line; - unit2 = ((double) gridY) / line; + unit1 = ((double)rand()) / RAND_MAX; + unit2 = ((double)rand()) / RAND_MAX; + } + else { + unit1 = ((double)gridX) / line; + unit2 = ((double)gridY) / line; if (gridX < line) { ++gridX; - } else { + } + else { gridX = 0; ++gridY; } @@ -823,8 +832,8 @@ int main(const int argc, const char **argv) { } } outputStatistics(); - } else { - + } + else { // ------------------------------------------------------------------ // Usage. // ------------------------------------------------------------------