aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-03 10:36:53 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-03 10:36:53 +0100
commit2d7fcb1c1a5fac062005d77e2702bdf2b8395931 (patch)
tree195847b7e24486191d79f23fcf71badff6d85e6e /src/mds-kbdc
parentmds-kbdc: beginning of actual compilation (diff)
downloadmds-2d7fcb1c1a5fac062005d77e2702bdf2b8395931.tar.gz
mds-2d7fcb1c1a5fac062005d77e2702bdf2b8395931.tar.bz2
mds-2d7fcb1c1a5fac062005d77e2702bdf2b8395931.tar.xz
mds-kbdc: m misc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-kbdc/mds-kbdc.c2
-rw-r--r--src/mds-kbdc/parsed.c6
-rw-r--r--src/mds-kbdc/parsed.h36
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;