diff options
author | Mike Holmes <mike.holmes@linaro.org> | 2015-02-23 12:15:39 -0500 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-02-25 12:46:40 +0300 |
commit | 0bd60f3ac71fb963ae5f63ed1f3eba23fdece156 (patch) | |
tree | e591cdf0b8a270a8a7cf7b738ff42a42c7438c8b /include/odp | |
parent | b52447ada6b8a96cd6982860a9a6345773e3df12 (diff) |
api: errno: add api to public api
The errno API was not exposed in the public interface.
Make errno API visible as part of the ODP API.
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
Reviewed-by: Petri Savolainen <petri.savolainen@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp')
-rw-r--r-- | include/odp/api/errno.h | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/include/odp/api/errno.h b/include/odp/api/errno.h new file mode 100644 index 000000000..527214ef1 --- /dev/null +++ b/include/odp/api/errno.h @@ -0,0 +1,68 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +/** + * @file + * + * ODP errno API + */ + +#ifndef ODP_ERRNO_H_ +#define ODP_ERRNO_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @addtogroup odp_ver_abt_log_dbg + * @{ + */ + +/** +* Return latest ODP errno +* +* @return ODP errno +* @retval 0 No error +*/ +int odp_errno(void); + +/** +* Set ODP errno to zero +*/ +void odp_errno_zero(void); + +/** +* Print ODP errno +* +* Interprets the value of ODP errno as an error message, and prints it, +* optionally preceding it with the custom message specified in str. +* +* @param str NULL, or pointer to the string to be appended +*/ +void odp_errno_print(const char *str); + +/** +* Error message string +* +* Interprets the value of ODP errno, generating a string with a +* message that describes the error. +* It uses the system definition of errno. +* +* @param errnum Error code +* +* @retval Pointer to the string +*/ +const char *odp_errno_str(int errnum); + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif |