From f07279ca6caa78e1a38d7c40ea3c4857e014d48c Mon Sep 17 00:00:00 2001 From: "Vishnu Swaroop Kumar Sarma, Duddu" Date: Fri, 16 Feb 2024 08:25:58 +0530 Subject: [PATCH] Declare the error string from inside library (#134) * Declare the error string from inside library --- include/tdi/common/tdi_defs.h | 2 +- src/CMakeLists.txt | 2 +- src/tdi_utils.cpp | 4 ++-- tdi_python/tdicli.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/tdi/common/tdi_defs.h b/include/tdi/common/tdi_defs.h index 5b7bf74..dad4a63 100644 --- a/include/tdi/common/tdi_defs.h +++ b/include/tdi/common/tdi_defs.h @@ -359,7 +359,7 @@ typedef uint32_t tdi_dev_pipe_t; * @param[out] err_str Pointer to error string. Doesn't require user to allocate *space */ -// void tdi_err_str(tdi_status_t sts, const char **err_str); +void tdi_get_err_str(tdi_status_t sts, const char **err_str); #ifdef __cplusplus } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index da7ca87..a01a827 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -14,7 +14,7 @@ set(TDI_SRCS #tdi_cjson.cpp #tdi_info_impl.cpp #tdi_table_info.cpp - #tdi_utils.cpp + tdi_utils.cpp ) set(TDI_C_FRONTEND_SRCS diff --git a/src/tdi_utils.cpp b/src/tdi_utils.cpp index cb3a37d..d7cd368 100644 --- a/src/tdi_utils.cpp +++ b/src/tdi_utils.cpp @@ -25,8 +25,8 @@ extern "C" { #include #include -void tdi_err_str(tdi_status_t sts, const char **err_str) { - *err_str = bf_err_str(sts); +void tdi_get_err_str(tdi_status_t sts, const char **err_str) { + *err_str = tdi_err_str(sts); } #ifdef __cplusplus diff --git a/tdi_python/tdicli.py b/tdi_python/tdicli.py index 329d7fe..ff31f5c 100644 --- a/tdi_python/tdicli.py +++ b/tdi_python/tdicli.py @@ -256,7 +256,7 @@ def _abort_transaction(self): def err_str(self, sts): estr = c_char_p() - self._driver.bf_rt_err_str(c_int(sts), byref(estr)) + self._driver.tdi_get_err_str(c_int(sts), byref(estr)) return estr.value.decode('ascii') class TdiHandle(Structure): _fields_ = [("unused", c_int)]