Commit d2266937 authored by npzacs's avatar npzacs Committed by Ano Nymous

Added version information to API

parent 73a0a8d8
...@@ -21,6 +21,7 @@ configure ...@@ -21,6 +21,7 @@ configure
libtool libtool
.deps .deps
.libs .libs
src/libaacs/aacs-version.h
src/examples/parser_test src/examples/parser_test
src/keydbcfg-lexer.c src/keydbcfg-lexer.c
src/keydbcfg-parser.c src/keydbcfg-parser.c
......
...@@ -175,9 +175,17 @@ if [[ $use_debug = "yes" ]]; then ...@@ -175,9 +175,17 @@ if [[ $use_debug = "yes" ]]; then
SET_DEBUG_OPTS="$SET_DEBUG_OPTS -g" SET_DEBUG_OPTS="$SET_DEBUG_OPTS -g"
fi fi
# export library version number
AACS_VERSION_MAJOR=aacs_major()
AC_SUBST(AACS_VERSION_MAJOR)
AACS_VERSION_MINOR=aacs_minor()
AC_SUBST(AACS_VERSION_MINOR)
AACS_VERSION_MICRO=aacs_micro()
AC_SUBST(AACS_VERSION_MICRO)
# generate output files # generate output files
AC_SUBST(SET_WARNINGS) AC_SUBST(SET_WARNINGS)
AC_SUBST(SET_OPTIMIZATIONS) AC_SUBST(SET_OPTIMIZATIONS)
AC_SUBST(SET_DEBUG_OPTS) AC_SUBST(SET_DEBUG_OPTS)
AC_CONFIG_FILES([Makefile src/Makefile src/examples/Makefile src/libaacs.pc]) AC_CONFIG_FILES([Makefile src/Makefile src/examples/Makefile src/libaacs.pc src/libaacs/aacs-version.h])
AC_OUTPUT AC_OUTPUT
...@@ -52,7 +52,7 @@ libaacs_la_SOURCES+= \ ...@@ -52,7 +52,7 @@ libaacs_la_SOURCES+= \
endif endif
libaacs_ladir= $(includedir)/libaacs libaacs_ladir= $(includedir)/libaacs
libaacs_la_HEADERS= libaacs/aacs.h file/filesystem.h libaacs_la_HEADERS= libaacs/aacs.h file/filesystem.h libaacs/aacs-version.h
libaacs_la_LDFLAGS= $(LIBGCRYPT_LIBS) -version-info $(LIB_VERSION_INFO) libaacs_la_LDFLAGS= $(LIBGCRYPT_LIBS) -version-info $(LIB_VERSION_INFO)
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libaacs.pc pkgconfig_DATA = libaacs.pc
......
/*
* This file is part of libaacs
* Copyright (C) 2011 libaacs
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see
* <http://www.gnu.org/licenses/>.
*/
#ifndef AACS_VERSION_H_
#define AACS_VERSION_H_
#define AACS_VERSION_CODE(major, minor, micro) \
(((major) * 10000) + \
((minor) * 100) + \
((micro) * 1))
#define AACS_VERSION_MAJOR @AACS_VERSION_MAJOR@
#define AACS_VERSION_MINOR @AACS_VERSION_MINOR@
#define AACS_VERSION_MICRO @AACS_VERSION_MICRO@
#define AACS_VERSION_STRING "@AACS_VERSION_MAJOR@.@AACS_VERSION_MINOR@.@AACS_VERSION_MICRO@"
#define AACS_VERSION \
AACS_VERSION_CODE(AACS_VERSION_MAJOR, AACS_VERSION_MINOR, AACS_VERSION_MICRO)
#endif /* AACS_VERSION_H_ */
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <util/attributes.h> #include <util/attributes.h>
#include "aacs-version.h"
#include "aacs.h" #include "aacs.h"
#include "crypto.h" #include "crypto.h"
#include "mmc.h" #include "mmc.h"
...@@ -600,6 +601,13 @@ static int _load_config(AACS *aacs, const char *configfile_path) ...@@ -600,6 +601,13 @@ static int _load_config(AACS *aacs, const char *configfile_path)
return config_ok; return config_ok;
} }
void aacs_get_version(int *major, int *minor, int *micro)
{
*major = AACS_VERSION_MAJOR;
*minor = AACS_VERSION_MINOR;
*micro = AACS_VERSION_MICRO;
}
AACS *aacs_open(const char *path, const char *configfile_path) AACS *aacs_open(const char *path, const char *configfile_path)
{ {
DEBUG(DBG_AACS, "libaacs [%zd]\n", sizeof(AACS)); DEBUG(DBG_AACS, "libaacs [%zd]\n", sizeof(AACS));
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
typedef struct aacs AACS; typedef struct aacs AACS;
AACS_PUBLIC void aacs_get_version(int *major, int *minor, int *micro);
AACS_PUBLIC AACS *aacs_open(const char *path, const char *keyfile_path); AACS_PUBLIC AACS *aacs_open(const char *path, const char *keyfile_path);
AACS_PUBLIC void aacs_close(AACS *aacs); AACS_PUBLIC void aacs_close(AACS *aacs);
AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title); /* 0 - top menu, 0xffff - first play */ AACS_PUBLIC void aacs_select_title(AACS *aacs, uint32_t title); /* 0 - top menu, 0xffff - first play */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment