Add a function to retrieve the run-time version info.
This commit is contained in:
parent
e803369364
commit
0976932501
@ -48,6 +48,7 @@ libdivecomputer_la_LDFLAGS = \
|
||||
-export-symbols libdivecomputer.exp
|
||||
|
||||
libdivecomputer_la_SOURCES = \
|
||||
version.c \
|
||||
device.h device-private.h device.c \
|
||||
parser.h parser-private.h parser.c \
|
||||
datetime.h datetime.c \
|
||||
|
||||
@ -1,3 +1,5 @@
|
||||
dc_version
|
||||
|
||||
dc_buffer_new
|
||||
dc_buffer_free
|
||||
dc_buffer_clear
|
||||
|
||||
33
src/version.c
Normal file
33
src/version.c
Normal file
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* libdivecomputer
|
||||
*
|
||||
* Copyright (C) 2010 Jef Driesen
|
||||
*
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "version.h"
|
||||
|
||||
void
|
||||
dc_version (dc_version_t *version)
|
||||
{
|
||||
if (version) {
|
||||
version->major = DC_VERSION_MAJOR;
|
||||
version->minor = DC_VERSION_MINOR;
|
||||
version->micro = DC_VERSION_MICRO;
|
||||
version->extra = DC_VERSION_EXTRA;
|
||||
}
|
||||
}
|
||||
@ -31,6 +31,16 @@ extern "C" {
|
||||
#define DC_VERSION_MICRO @DC_VERSION_MICRO@
|
||||
#define DC_VERSION_EXTRA "@DC_VERSION_EXTRA@"
|
||||
|
||||
typedef struct dc_version_t {
|
||||
unsigned int major;
|
||||
unsigned int minor;
|
||||
unsigned int micro;
|
||||
const char *extra;
|
||||
} dc_version_t;
|
||||
|
||||
void
|
||||
dc_version (dc_version_t *version);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user