Skip to content

Commit

Permalink
Declare the error string from inside library (#134)
Browse files Browse the repository at this point in the history
* Declare the error string from inside library
  • Loading branch information
swaroopsarma authored Feb 16, 2024
1 parent f8ff8c1 commit f07279c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/tdi/common/tdi_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/tdi_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ extern "C" {
#include <target-sys/bf_sal/bf_sys_mem.h>
#include <tdi/common/tdi_defs.h>

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
Expand Down
2 changes: 1 addition & 1 deletion tdi_python/tdicli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down

0 comments on commit f07279c

Please sign in to comment.