Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare the error string from inside library #134

Merged
merged 2 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
saynb marked this conversation as resolved.
Show resolved Hide resolved
}

#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
Loading