From 2d7fcb1c1a5fac062005d77e2702bdf2b8395931 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 3 Dec 2014 10:36:53 +0100 Subject: mds-kbdc: m misc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-kbdc/mds-kbdc.c | 2 +- src/mds-kbdc/parsed.c | 6 ++++++ src/mds-kbdc/parsed.h | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3-70-g09d2