summaryrefslogtreecommitdiff
path: root/include/usbg
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2014-02-14 15:57:59 +0100
committerKrzysztof Opasiak <k.opasiak@samsung.com>2014-02-19 21:17:19 +0100
commita4464434115b712cd4d0d96432e203ca10aa3c32 (patch)
tree038ad5df74943d53f28b1ec25cde6441219b931a /include/usbg
parent03852c992e39fbbf2bdaa891616497ab151aed48 (diff)
downloadlibusbg-a4464434115b712cd4d0d96432e203ca10aa3c32.tar.gz
libusbg-a4464434115b712cd4d0d96432e203ca10aa3c32.tar.bz2
libusbg-a4464434115b712cd4d0d96432e203ca10aa3c32.zip
libusbg: Add getter for config name.
Add usbg_get_config_name() and usbg_get_config_name_len() to avoid direct config structure members access. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'include/usbg')
-rw-r--r--include/usbg/usbg.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/usbg/usbg.h b/include/usbg/usbg.h
index 458bb6d..3317ed0 100644
--- a/include/usbg/usbg.h
+++ b/include/usbg/usbg.h
@@ -480,6 +480,22 @@ extern struct config *usbg_create_config(struct gadget *g, char *name,
struct config_attrs *c_attrs, struct config_strs *c_strs);
/**
+ * @brief Get config name length
+ * @param c Config which name length should be returned
+ * @return Length of name string or -1 if error occurred.
+ */
+extern size_t usbg_get_config_name_len(struct config *c);
+
+/**
+ * @brieg Get config name
+ * @param c Pointer to config
+ * @param buf Buffer where name should be copied
+ * @param len Length of given buffer
+ * @return Pointer to destination or NULL if error occurred.
+ */
+extern char *usbg_get_config_name(struct config *c, char *buf, size_t len);
+
+/**
* @brief Set the USB configuration attributes
* @param c Pointer to configuration
* @param c_attrs Configuration attributes