diff options
-rw-r--r-- | src/mds-kbdc/mds-kbdc.c | 2 | ||||
-rw-r--r-- | src/mds-kbdc/parsed.c | 6 | ||||
-rw-r--r-- | src/mds-kbdc/parsed.h | 36 |
3 files changed, 43 insertions, 1 deletions
diff --git a/src/mds-kbdc/mds-kbdc.c b/src/mds-kbdc/mds-kbdc.c index 4262f5d..14a72aa 100644 --- a/src/mds-kbdc/mds-kbdc.c +++ b/src/mds-kbdc/mds-kbdc.c @@ -37,7 +37,7 @@ /** * Parse command line arguments */ -void parse_cmdline(void) +static void parse_cmdline(void) { int i; for (i = 0; i < argc; i++) diff --git a/src/mds-kbdc/parsed.c b/src/mds-kbdc/parsed.c index 45abd23..125259a 100644 --- a/src/mds-kbdc/parsed.c +++ b/src/mds-kbdc/parsed.c @@ -46,6 +46,12 @@ void mds_kbdc_parsed_destroy(mds_kbdc_parsed_t* restrict this) free(this->source_code); free(this->pathname); mds_kbdc_parse_error_free_all(this->errors); + while (this->languages_ptr--) + free(this->languages[this->languages_ptr]); + free(this->languages); + while (this->countries_ptr--) + free(this->countries[this->countries_ptr]); + free(this->countries); memset(this, 0, sizeof(mds_kbdc_parsed_t)); } diff --git a/src/mds-kbdc/parsed.h b/src/mds-kbdc/parsed.h index 567168c..32d76ee 100644 --- a/src/mds-kbdc/parsed.h +++ b/src/mds-kbdc/parsed.h @@ -100,6 +100,42 @@ typedef struct mds_kbdc_parsed */ int severest_error_level; + /** + * List of languages for which the layout is designed + */ + char** languages; + + /** + * The number of elements allocated to `languages` + */ + size_t languages_size; + + /** + * The number of elements stored in `languages` + */ + size_t languages_ptr; + + /** + * List of countries for which the layout is designed + */ + char** countries; + + /** + * The number of elements allocated to `countries` + */ + size_t countries_size; + + /** + * The number of elements stored in `countries` + */ + size_t countries_ptr; + + /** + * The variant of the keyboard for the languages/countries, + * `NULL` if not specified + */ + char* variant; + } mds_kbdc_parsed_t; |