diff options
author | Szczepan Zalega <szczepan@nitrokey.com> | 2020-07-28 12:29:43 +0200 |
---|---|---|
committer | Szczepan Zalega <szczepan@nitrokey.com> | 2020-07-28 12:29:56 +0200 |
commit | dc1cfa6252073ac345412e7df9c5cc0365bb7f11 (patch) | |
tree | a62eccae0fbc7317c3bf67db4cb8ceb79dfd96e7 /libnitrokey | |
parent | 145149d65915e3f2eb068032b428ee5cfc0295c9 (diff) | |
download | libnitrokey-dc1cfa6252073ac345412e7df9c5cc0365bb7f11.tar.gz libnitrokey-dc1cfa6252073ac345412e7df9c5cc0365bb7f11.tar.bz2 |
Extract Nitrokey Storage only features to separate unit
Diffstat (limited to 'libnitrokey')
-rw-r--r-- | libnitrokey/NitrokeyManager.h | 11 | ||||
-rw-r--r-- | libnitrokey/nk_strndup.h | 9 |
2 files changed, 17 insertions, 3 deletions
diff --git a/libnitrokey/NitrokeyManager.h b/libnitrokey/NitrokeyManager.h index 163a799..ba61793 100644 --- a/libnitrokey/NitrokeyManager.h +++ b/libnitrokey/NitrokeyManager.h @@ -40,10 +40,15 @@ namespace nitrokey { using namespace nitrokey::proto; using namespace nitrokey::log; +template <typename T> +typename T::CommandPayload get_payload(){ + //Create, initialize and return by value command payload + typename T::CommandPayload st; + bzero(&st, sizeof(st)); + return st; +} -#ifdef __WIN32 -char * strndup(const char* str, size_t maxlen); -#endif +#include "nk_strndup.h" class NitrokeyManager { public: diff --git a/libnitrokey/nk_strndup.h b/libnitrokey/nk_strndup.h new file mode 100644 index 0000000..0c96726 --- /dev/null +++ b/libnitrokey/nk_strndup.h @@ -0,0 +1,9 @@ +#ifndef LIBNITROKEY_NK_STRNDUP_H +#define LIBNITROKEY_NK_STRNDUP_H + +#ifdef __WIN32 +char * strndup(const char* str, size_t maxlen); +#endif + + +#endif // LIBNITROKEY_NK_STRNDUP_H |