mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
A library should expose its version
This commit is contained in:
@@ -73,7 +73,8 @@ libsodium_la_SOURCES = \
|
||||
crypto_sign/ed25519/ref/ge25519.h \
|
||||
crypto_sign/ed25519/ref/ge25519_ed25519.c \
|
||||
crypto_sign/ed25519/ref/sc25519.h \
|
||||
crypto_sign/ed25519/ref/sc25519_ed25519.c
|
||||
crypto_sign/ed25519/ref/sc25519_ed25519.c \
|
||||
version.c
|
||||
|
||||
libsodium_la_LDFLAGS = \
|
||||
$(AM_LDFLAGS) \
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
|
||||
#ifndef __NACL_VERSION_H__
|
||||
#define __NACL_VERSION_H__
|
||||
#ifndef __SODIUM_VERSION_H__
|
||||
#define __SODIUM_VERSION_H__
|
||||
|
||||
#define NACL_VERSION_STRING "@VERSION@"
|
||||
#define SODIUM_VERSION_STRING "@VERSION@"
|
||||
|
||||
#define NACL_VERSION_MAJOR 0
|
||||
#define NACL_VERSION_MINOR 1
|
||||
#define SODIUM_VERSION_MAJOR 0
|
||||
#define SODIUM_VERSION_MINOR 1
|
||||
|
||||
const char *sodium_version_string(void);
|
||||
const int sodium_version_major(void);
|
||||
const int sodium_version_minor(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
#include "version.h"
|
||||
|
||||
const char *
|
||||
sodium_version_string(void)
|
||||
{
|
||||
return SODIUM_VERSION_STRING;
|
||||
}
|
||||
|
||||
const int
|
||||
sodium_version_major(void)
|
||||
{
|
||||
return SODIUM_VERSION_MAJOR;
|
||||
}
|
||||
|
||||
const int
|
||||
sodium_version_minor(void)
|
||||
{
|
||||
return SODIUM_VERSION_MINOR;
|
||||
}
|
||||
Reference in New Issue
Block a user