summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2016-12-15 17:08:13 +0100
committerKrzysztof Opasiak <k.opasiak@samsung.com>2017-03-03 14:02:26 +0100
commit49879b8fc0831512d0dc137952fc85e91a43753b (patch)
tree24a0cfb2d1f5fc8ec18e9a0fed8ffeea1ec3f0b5
parent4247abdab150d333d9afd807c9837f9313e265fd (diff)
downloadlibusbg-49879b8fc0831512d0dc137952fc85e91a43753b.tar.gz
libusbg-49879b8fc0831512d0dc137952fc85e91a43753b.tar.bz2
libusbg-49879b8fc0831512d0dc137952fc85e91a43753b.zip
libusbgx: Add usbg_get_config_str_langs()
Add a function which allows to get the list of languages in which config strings are currently available. Thanks to this function now we may iterate through all strings languages available in particular config and print their values. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
-rw-r--r--include/usbg/usbg.h8
-rw-r--r--src/usbg.c5
2 files changed, 13 insertions, 0 deletions
diff --git a/include/usbg/usbg.h b/include/usbg/usbg.h
index ba760f5..31d9862 100644
--- a/include/usbg/usbg.h
+++ b/include/usbg/usbg.h
@@ -816,6 +816,14 @@ extern int usbg_get_config_strs(usbg_config *c, int lang,
struct usbg_config_strs *c_strs);
/**
+ * @brief Get the array of languages available in this config
+ * @param c Pointer to configuration
+ * @param langs array of available language codes
+ * @return 0 on success usbg_error if error occurred
+ */
+extern int usbg_get_config_strs_langs(usbg_config *c, int **langs);
+
+/**
* @brief Free configuration strings
* @details This function releases the memory allocated for strings
* not for struct usbg_config_strs itself.
diff --git a/src/usbg.c b/src/usbg.c
index 5bd1090..fb6ee4b 100644
--- a/src/usbg.c
+++ b/src/usbg.c
@@ -1705,6 +1705,11 @@ int usbg_get_gadget_strs_langs(usbg_gadget *g, int **langs)
return usbg_get_strs_langs_by_path(g->path, g->name, langs);
}
+int usbg_get_config_strs_langs(usbg_config *c, int **langs)
+{
+ return usbg_get_strs_langs_by_path(c->path, c->name, langs);
+}
+
int usbg_set_gadget_str(usbg_gadget *g, usbg_gadget_str str, int lang,
const char *val)
{