diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2019-01-28 12:00:51 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2019-01-28 12:11:53 +0100 |
commit | 290c1d82bf0f700248382808c9fe0fb1d190da14 (patch) | |
tree | 2538baca7bd4ab3c47e74ad1a1642409cc0371ce | |
parent | 146f94df39372490756ca7014e9c02a99cb08ac9 (diff) | |
download | libnitrokey-290c1d82bf0f700248382808c9fe0fb1d190da14.tar.gz libnitrokey-290c1d82bf0f700248382808c9fe0fb1d190da14.tar.bz2 |
Replace NK_status with NK_get_status_as_string
For naming consistency, this patch adds the NK_get_status_as_string
function to replace NK_status and marks NK_status as deprecated.
-rw-r--r-- | NK_C_API.cc | 4 | ||||
-rw-r--r-- | NK_C_API.h | 14 |
2 files changed, 16 insertions, 2 deletions
diff --git a/NK_C_API.cc b/NK_C_API.cc index 6905ef4..e560c3f 100644 --- a/NK_C_API.cc +++ b/NK_C_API.cc @@ -252,6 +252,10 @@ extern "C" { NK_C_API char * NK_status() { + return NK_get_status_as_string(); + } + + NK_C_API char * NK_get_status_as_string() { auto m = NitrokeyManager::instance(); return get_with_string_result([&]() { string && s = m->get_status_as_string(); @@ -353,12 +353,22 @@ extern "C" { NK_C_API enum NK_device_model NK_get_device_model(); /** - * Return the debug status string. Debug purposes. - * @return command processing error code + * Return the debug status string. Debug purposes. This function is + * deprecated in favor of NK_get_status_as_string. + * @return string representation of the status or an empty string + * if the command failed */ + DEPRECATED NK_C_API char * NK_status(); /** + * Return the debug status string. Debug purposes. + * @return string representation of the status or an empty string + * if the command failed + */ + NK_C_API char * NK_get_status_as_string(); + + /** * Get the stick status common to all Nitrokey devices and return the * command processing error code. If the code is zero, i. e. the * command was successful, the storage status is written to the output |