[PATCH 10/12] libusbg: Make usbg_lookup_function_type() publicly available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Users of library may often receive function type as a string.
Instead of implementing parsing of such string in each program
it would be more convenient to provide such support in library.

Signed-off-by: Krzysztof Opasiak <k.opasiak@xxxxxxxxxxx>
---
 include/usbg/usbg.h |    7 +++++++
 src/usbg.c          |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/include/usbg/usbg.h b/include/usbg/usbg.h
index 2c191eb..eea49c8 100644
--- a/include/usbg/usbg.h
+++ b/include/usbg/usbg.h
@@ -658,6 +658,13 @@ extern int usbg_cpy_function_instance(usbg_function *f, char *buf, size_t len);
  */
 extern const char *usbg_get_function_type_str(usbg_function_type type);
 
+/**
+ * @brief Lookup function type sutable for given name
+ * @param name Name of function
+ * @return Function type enum or negative error code
+ */
+extern int usbg_lookup_function_type(const char *name);
+
 /* USB configurations allocation and configuration */
 
 /**
diff --git a/src/usbg.c b/src/usbg.c
index 4d74a0d..6e0ce6f 100644
--- a/src/usbg.c
+++ b/src/usbg.c
@@ -310,7 +310,7 @@ const char *usbg_strerror(usbg_error e)
 	return ret;
 }
 
-static int usbg_lookup_function_type(const char *name)
+int usbg_lookup_function_type(const char *name)
 {
 	int i = 0;
 	int max = sizeof(function_names)/sizeof(char *);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux