A library should expose its version

This commit is contained in:
Frank Denis
2013-01-20 16:04:43 -08:00
parent 97d651b3a3
commit cfd84663b9
3 changed files with 31 additions and 6 deletions
+2 -1
View File
@@ -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) \
+9 -5
View File
@@ -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
+20
View File
@@ -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;
}