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

Add getters for the library version #117

Merged
merged 1 commit into from
Jun 19, 2018

Conversation

robinkrahl
Copy link
Contributor

CMake generates version.h from version.h.in and sets the major and minor version as specified in CMakeLists.txt and the current git version as returned by git describe --always. These values are also added to the C API as NK_get{_major,_minor,}_library_version.

This patch fixes issue #35 and is based on the pull request #62, addressing the issues mentioned in the discussion.

CMake generates version.h from version.h.in and sets the major and minor
version as specified in CMakeLists.txt and the current git version as
returned by `git describe --always`.  These values are also added to the
C API as NK_get{_major,_minor,}_library_version.

namespace nitrokey {
unsigned int get_major_library_version() {
return @PROJECT_VERSION_MAJOR@;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation in header file makes a small problem - it will probably not be possible (until some compiler/optimization trick is used) to use these functions in other compilation units (e.g. in C++ API - NitrokeyManager) due to name's clash. Otherwise all good!
I will split it to .h and .cc and merge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Can you have another look at the test case? I think it will fail if you are on a release commit, see this comment.

@szszszsz szszszsz merged commit 6e3ae31 into Nitrokey:master Jun 19, 2018
szszszsz added a commit that referenced this pull request Jun 19, 2018
Library version getter for C API

Fixes #117
Fixes #35
Fixes #62
@robinkrahl robinkrahl deleted the get-library-version branch June 19, 2018 19:21
sgued pushed a commit to sgued/libnitrokey that referenced this pull request Feb 14, 2022
Due to NetHSM issue Nitrokey#117, the generated API client currently does not
work for the /keys/{key_id}/cert endpoint.  Therefore, this patch
replaces the generated code with a manual implementation.
sgued pushed a commit to sgued/libnitrokey that referenced this pull request Feb 14, 2022
nk3: Remove unnecessary print statement
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants