diff mbox

[1/2] api: errno: add api to public api

Message ID 1424711740-21699-1-git-send-email-mike.holmes@linaro.org
State Accepted
Commit 0bd60f3ac71fb963ae5f63ed1f3eba23fdece156
Headers show

Commit Message

Mike Holmes Feb. 23, 2015, 5:15 p.m. UTC
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>
---
 include/odp.h                              |  1 +
 include/odp/api/errno.h                    | 68 ++++++++++++++++++++++++++++++
 platform/linux-generic/Makefile.am         |  1 +
 platform/linux-generic/include/odp/errno.h | 41 ++----------------
 4 files changed, 73 insertions(+), 38 deletions(-)
 create mode 100644 include/odp/api/errno.h

Comments

Maxim Uvarov Feb. 25, 2015, 9:47 a.m. UTC | #1
Merged,
Maxim.

On 02/23/2015 08:15 PM, Mike Holmes wrote:
> 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>
> ---
>   include/odp.h                              |  1 +
>   include/odp/api/errno.h                    | 68 ++++++++++++++++++++++++++++++
>   platform/linux-generic/Makefile.am         |  1 +
>   platform/linux-generic/include/odp/errno.h | 41 ++----------------
>   4 files changed, 73 insertions(+), 38 deletions(-)
>   create mode 100644 include/odp/api/errno.h
>
> diff --git a/include/odp.h b/include/odp.h
> index 777b327..2bac510 100644
> --- a/include/odp.h
> +++ b/include/odp.h
> @@ -52,6 +52,7 @@ extern "C" {
>   #include <odp/rwlock.h>
>   #include <odp/event.h>
>   #include <odp/random.h>
> +#include <odp/errno.h>
>   
>   #ifdef __cplusplus
>   }
> diff --git a/include/odp/api/errno.h b/include/odp/api/errno.h
> new file mode 100644
> index 0000000..527214e
> --- /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
> diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
> index eac8fec..9aed113 100644
> --- a/platform/linux-generic/Makefile.am
> +++ b/platform/linux-generic/Makefile.am
> @@ -78,6 +78,7 @@ odpapiinclude_HEADERS = \
>   		  $(top_srcdir)/include/odp/api/cpumask.h \
>   		  $(top_srcdir)/include/odp/api/crypto.h \
>   		  $(top_srcdir)/include/odp/api/debug.h \
> +		  $(top_srcdir)/include/odp/api/errno.h \
>   		  $(top_srcdir)/include/odp/api/event.h \
>   		  $(top_srcdir)/include/odp/api/hints.h \
>   		  $(top_srcdir)/include/odp/api/init.h \
> diff --git a/platform/linux-generic/include/odp/errno.h b/platform/linux-generic/include/odp/errno.h
> index 527214e..3e9e1fa 100644
> --- a/platform/linux-generic/include/odp/errno.h
> +++ b/platform/linux-generic/include/odp/errno.h
> @@ -10,8 +10,8 @@
>    * ODP errno API
>    */
>   
> -#ifndef ODP_ERRNO_H_
> -#define ODP_ERRNO_H_
> +#ifndef ODP_PLAT_ERRNO_H_
> +#define ODP_PLAT_ERRNO_H_
>   
>   #ifdef __cplusplus
>   extern "C" {
> @@ -22,44 +22,9 @@ extern "C" {
>    */
>   
>   /**
> -* 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);
> -
> -/**
>    * @}
>    */
> +#include <odp/api/errno.h>
>   
>   #ifdef __cplusplus
>   }
diff mbox

Patch

diff --git a/include/odp.h b/include/odp.h
index 777b327..2bac510 100644
--- a/include/odp.h
+++ b/include/odp.h
@@ -52,6 +52,7 @@  extern "C" {
 #include <odp/rwlock.h>
 #include <odp/event.h>
 #include <odp/random.h>
+#include <odp/errno.h>
 
 #ifdef __cplusplus
 }
diff --git a/include/odp/api/errno.h b/include/odp/api/errno.h
new file mode 100644
index 0000000..527214e
--- /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
diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am
index eac8fec..9aed113 100644
--- a/platform/linux-generic/Makefile.am
+++ b/platform/linux-generic/Makefile.am
@@ -78,6 +78,7 @@  odpapiinclude_HEADERS = \
 		  $(top_srcdir)/include/odp/api/cpumask.h \
 		  $(top_srcdir)/include/odp/api/crypto.h \
 		  $(top_srcdir)/include/odp/api/debug.h \
+		  $(top_srcdir)/include/odp/api/errno.h \
 		  $(top_srcdir)/include/odp/api/event.h \
 		  $(top_srcdir)/include/odp/api/hints.h \
 		  $(top_srcdir)/include/odp/api/init.h \
diff --git a/platform/linux-generic/include/odp/errno.h b/platform/linux-generic/include/odp/errno.h
index 527214e..3e9e1fa 100644
--- a/platform/linux-generic/include/odp/errno.h
+++ b/platform/linux-generic/include/odp/errno.h
@@ -10,8 +10,8 @@ 
  * ODP errno API
  */
 
-#ifndef ODP_ERRNO_H_
-#define ODP_ERRNO_H_
+#ifndef ODP_PLAT_ERRNO_H_
+#define ODP_PLAT_ERRNO_H_
 
 #ifdef __cplusplus
 extern "C" {
@@ -22,44 +22,9 @@  extern "C" {
  */
 
 /**
-* 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);
-
-/**
  * @}
  */
+#include <odp/api/errno.h>
 
 #ifdef __cplusplus
 }