summaryrefslogtreecommitdiff
path: root/include/usbg
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2014-02-13 15:13:29 +0100
committerKrzysztof Opasiak <k.opasiak@samsung.com>2014-02-19 21:17:20 +0100
commit060f4f7de5e487d6d67a5bde8ca5177a3ee0ae21 (patch)
treede1327e5939184156ca353ffb15cea185e8d161b /include/usbg
parent1bda361fd565f2af15cd3203590ce914780f2145 (diff)
downloadlibusbg-060f4f7de5e487d6d67a5bde8ca5177a3ee0ae21.tar.gz
libusbg-060f4f7de5e487d6d67a5bde8ca5177a3ee0ae21.tar.bz2
libusbg-060f4f7de5e487d6d67a5bde8ca5177a3ee0ae21.zip
libusbg: Add getter for binding name and target.
Add usbg_get_binding_target() to avoid direct binding structure members access. Add also usbg_get_binding_name_len() and usbg_get_binding_name() to allow getting binding name. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com>
Diffstat (limited to 'include/usbg')
-rw-r--r--include/usbg/usbg.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/usbg/usbg.h b/include/usbg/usbg.h
index 5b8f482..603a4a3 100644
--- a/include/usbg/usbg.h
+++ b/include/usbg/usbg.h
@@ -562,6 +562,29 @@ extern void usbg_set_config_string(struct config *c, int lang, char *string);
*/
extern int usbg_add_config_function(struct config *c, char *name, struct function *f);
+/**
+ * @brief Get target function of given binding
+ * @param b Binding between configuration and function
+ * @return Pointer to USB function which is target for this binding
+ */
+extern struct function *usbg_get_binding_target(struct binding *b);
+
+/**
+ * @brief Get binding name length
+ * @param b Binding which name length should be returned
+ * @return Length of name string or -1 if error occurred.
+ */
+extern size_t usbg_get_binding_name_len(struct binding *b);
+
+/**
+ * @brief Get binding name
+ * @param b Pointer to binding
+ * @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_binding_name(struct binding *b, char *buf, size_t len);
+
/* USB gadget setup and teardown */
/**