From 063507ca70086e0b40faf74212fbaf9bfc5384dc Mon Sep 17 00:00:00 2001 From: Krzysztof Opasiak Date: Mon, 3 Mar 2014 14:33:27 +0100 Subject: libusbg: Change usbg_get_function_attrs() to return error code. usbg_get_function_attrs() may fail due to many reasons so it should notify the user about exact reason of failure instead of returning only NULL pointer. Add also USBG_ERROR_NOT_SUPPORTED to usbg_set_function_attrs(). Signed-off-by: Krzysztof Opasiak --- include/usbg/usbg.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/usbg/usbg.h b/include/usbg/usbg.h index 1bb652e..ae53d22 100644 --- a/include/usbg/usbg.h +++ b/include/usbg/usbg.h @@ -189,6 +189,7 @@ typedef enum { USBG_ERROR_EXIST = -6, USBG_ERROR_NO_DEV = -7, USBG_ERROR_BUSY = -8, + USBG_ERROR_NOT_SUPPORTED = -9, USBG_ERROR_OTHER_ERROR = -99 } usbg_error; @@ -641,9 +642,9 @@ extern usbg_function_type usbg_get_function_type(usbg_function *f); * @brief Get attributes of given function * @param f Pointer to function * @param f_attrs Union to be filled - * @return Pointer to filled structure or NULL if error occurred. + * @return 0 on success usbg_error if error occurred. */ -extern usbg_function_attrs *usbg_get_function_attrs(usbg_function *f, +extern int usbg_get_function_attrs(usbg_function *f, usbg_function_attrs *f_attrs); /** -- cgit v1.2.3