diff options
| -rw-r--r-- | Makefile.am | 24 | ||||
| -rw-r--r-- | configure.ac | 7 | ||||
| -rw-r--r-- | dmstools.xcodeproj/project.pbxproj | 6 | ||||
| -rw-r--r-- | include/dms.h | 19 | ||||
| -rw-r--r-- | include/dmsversion.h.in | 48 | ||||
| -rw-r--r-- | lib/libdms.sym | 6 | ||||
| -rw-r--r-- | lib/libdms_version.c | 53 | ||||
| -rw-r--r-- | src/dmsversion.c | 10 |
8 files changed, 165 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index a2e7189..e6bec2f 100644 --- a/Makefile.am +++ b/Makefile.am | |||
| @@ -33,14 +33,14 @@ AM_LDFLAGS = @LTLIBINTL@ | |||
| 33 | AM_CFLAGS = -O2 -W -Wall -Werror | 33 | AM_CFLAGS = -O2 -W -Wall -Werror |
| 34 | AM_CXXFLAGS = -O2 -W -Wall -Werror | 34 | AM_CXXFLAGS = -O2 -W -Wall -Werror |
| 35 | AM_OBJCFLAGS = -O2 -W -Wall -Werror | 35 | AM_OBJCFLAGS = -O2 -W -Wall -Werror |
| 36 | AM_CPPFLAGS = -O2 -W -Wall -Werror -DHAVE_COMMON_H=1 -I$(top_srcdir)/include | 36 | AM_CPPFLAGS = -O2 -W -Wall -Werror -DHAVE_COMMON_H=1 -I$(top_builddir)/include -I$(top_srcdir)/include |
| 37 | ACLOCAL_AMFLAGS = -I m4 | 37 | ACLOCAL_AMFLAGS = -I m4 |
| 38 | DEFS = -DLOCALEDIR="\"$(localedir)\"" @DEFS@ | 38 | DEFS = -DLOCALEDIR="\"$(localedir)\"" @DEFS@ |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | # automake targets | 41 | # automake targets |
| 42 | bin_PROGRAMS = src/bindump src/bitcopy src/bitops src/dmsversion src/numconvert src/typedef-info | 42 | bin_PROGRAMS = src/bindump src/bitcopy src/bitops src/dmsversion src/numconvert src/typedef-info |
| 43 | include_HEADERS = include/dms.h | 43 | include_HEADERS = include/dms.h include/dmsversion.h |
| 44 | lib_LTLIBRARIES = lib/libdms.la | 44 | lib_LTLIBRARIES = lib/libdms.la |
| 45 | noinst_PROGRAMS = | 45 | noinst_PROGRAMS = |
| 46 | noinst_HEADERS = src/common.h | 46 | noinst_HEADERS = src/common.h |
| @@ -57,6 +57,7 @@ lib_libdms_la_LDFLAGS = -rpath '$(libdir)' \ | |||
| 57 | -pthread \ | 57 | -pthread \ |
| 58 | -export-symbols $(srcdir)/lib/libdms.sym | 58 | -export-symbols $(srcdir)/lib/libdms.sym |
| 59 | lib_libdms_la_SOURCES = include/dms.h \ | 59 | lib_libdms_la_SOURCES = include/dms.h \ |
| 60 | include/dmsversion.h \ | ||
| 60 | lib/libdms.h \ | 61 | lib/libdms.h \ |
| 61 | lib/libdms_version.c \ | 62 | lib/libdms_version.c \ |
| 62 | lib/libdms_version.h | 63 | lib/libdms_version.h |
| @@ -141,10 +142,12 @@ src_typedef_info_SOURCES = $(noinst_HEADERS) \ | |||
| 141 | 142 | ||
| 142 | 143 | ||
| 143 | # lists | 144 | # lists |
| 145 | BUILT_SOURCES = include/dmsversion.h | ||
| 144 | TESTS = | 146 | TESTS = |
| 145 | XFAIL_TESTS = | 147 | XFAIL_TESTS = |
| 146 | EXTRA_DIST = build-aux/config.rpath \ | 148 | EXTRA_DIST = build-aux/config.rpath \ |
| 147 | build-aux/git-package-version \ | 149 | build-aux/git-package-version \ |
| 150 | include/dmsversion.h.in \ | ||
| 148 | include/gettext.h \ | 151 | include/gettext.h \ |
| 149 | lib/libdms.sym \ | 152 | lib/libdms.sym \ |
| 150 | $(srcdir)/dmstools.tags \ | 153 | $(srcdir)/dmstools.tags \ |
| @@ -164,6 +167,7 @@ CLEANFILES = \ | |||
| 164 | $(builddir)/*/a.out $(srcdir)/*/a.out \ | 167 | $(builddir)/*/a.out $(srcdir)/*/a.out \ |
| 165 | config.h.in~ $(srcdir)/config.h.in~ \ | 168 | config.h.in~ $(srcdir)/config.h.in~ \ |
| 166 | $(man_MANS) \ | 169 | $(man_MANS) \ |
| 170 | include/dmsversion.h \ | ||
| 167 | @PACKAGE_TARNAME@-*.tar.* \ | 171 | @PACKAGE_TARNAME@-*.tar.* \ |
| 168 | @PACKAGE_TARNAME@-*.zip | 172 | @PACKAGE_TARNAME@-*.zip |
| 169 | 173 | ||
| @@ -176,12 +180,22 @@ do_subst = sed \ | |||
| 176 | -e 's,[@]PACKAGE_TARNAME[@],@PACKAGE_TARNAME@,g' \ | 180 | -e 's,[@]PACKAGE_TARNAME[@],@PACKAGE_TARNAME@,g' \ |
| 177 | -e 's,[@]PACKAGE_BUGREPORT[@],@PACKAGE_BUGREPORT@,g' \ | 181 | -e 's,[@]PACKAGE_BUGREPORT[@],@PACKAGE_BUGREPORT@,g' \ |
| 178 | -e 's|[@]PACKAGE_COPYRIGHT[@]|@PACKAGE_COPYRIGHT@|g' \ | 182 | -e 's|[@]PACKAGE_COPYRIGHT[@]|@PACKAGE_COPYRIGHT@|g' \ |
| 183 | -e 's,[@]LIB_VERSION_CURRENT[@],@LIB_VERSION_CURRENT@,g' \ | ||
| 184 | -e 's,[@]LIB_VERSION_REVISION[@],@LIB_VERSION_REVISION@,g' \ | ||
| 185 | -e 's,[@]LIB_VERSION_AGE[@],@LIB_VERSION_AGE@,g' \ | ||
| 186 | -e 's,[@]LIB_VERSION_INFO[@],@LIB_VERSION_INFO@,g' \ | ||
| 187 | -e 's,[@]LIB_RELEASE_INFO[@],@LIB_RELEASE_INFO@,g' \ | ||
| 179 | -e 's,[@]RELEASE_MONTH[@],@RELEASE_MONTH@,g' | 188 | -e 's,[@]RELEASE_MONTH[@],@RELEASE_MONTH@,g' |
| 180 | do_subst_fn = \ | 189 | do_subst_fn = \ |
| 181 | echo "do_subst < ${@}.in > ${@}"; \ | 190 | echo "do_subst < ${@}.in > ${@}"; \ |
| 182 | mkdir -p `dirname ${@}` || exit 1; \ | 191 | mkdir -p `dirname ${@}` || exit 1; \ |
| 183 | ${do_subst} < $(srcdir)/${@}.in > ${@} || exit 1; \ | 192 | ${do_subst} < $(srcdir)/${@}.in > ${@} || exit 1; \ |
| 184 | chmod 0755 ${@} | 193 | chmod 0755 ${@} |
| 194 | do_subst_dt = \ | ||
| 195 | echo "do_subst < ${@}.in > ${@}"; \ | ||
| 196 | mkdir -p `dirname ${@}` || exit 1; \ | ||
| 197 | ${do_subst} < $(srcdir)/${@}.in > ${@} || exit 1; \ | ||
| 198 | chmod 0644 ${@} | ||
| 185 | 199 | ||
| 186 | 200 | ||
| 187 | # custom targets | 201 | # custom targets |
| @@ -203,7 +217,11 @@ build-aux/git-package-version: | |||
| 203 | $(top_builddir)/config.status --recheck | 217 | $(top_builddir)/config.status --recheck |
| 204 | 218 | ||
| 205 | doc/codetagger.1: Makefile $(srcdir)/doc/codetagger.1.in | 219 | doc/codetagger.1: Makefile $(srcdir)/doc/codetagger.1.in |
| 206 | @$(do_subst_fn) | 220 | @$(do_subst_dt) |
| 221 | |||
| 222 | include/dmsversion.h: Makefile $(srcdir)/include/dmsversion.h.in | ||
| 223 | $(mkdir_p) include | ||
| 224 | @$(do_subst_dt) | ||
| 207 | 225 | ||
| 208 | license-tags: $(srcdir)/dmstools.tags $(builddir)/src/codetagger | 226 | license-tags: $(srcdir)/dmstools.tags $(builddir)/src/codetagger |
| 209 | $(builddir)/src/codetagger -f $(srcdir)/dmstools.tags $(srcdir)/AUTHORS | 227 | $(builddir)/src/codetagger -f $(srcdir)/dmstools.tags $(srcdir)/AUTHORS |
diff --git a/configure.ac b/configure.ac index 57319e1..1186cf4 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -38,8 +38,11 @@ AC_DEFINE_UNQUOTED(PACKAGE_COPYRIGHT, ["$PACKAGE_COPYRIGHT"], ["Copyright info"] | |||
| 38 | # Age -- How many seqential past API versions is supported by | 38 | # Age -- How many seqential past API versions is supported by |
| 39 | # this implementation | 39 | # this implementation |
| 40 | # Format => Current:Revision:Age | 40 | # Format => Current:Revision:Age |
| 41 | AC_SUBST(LIB_VERSION_INFO, 2:1:1) | 41 | AC_SUBST([LIB_VERSION_CURRENT], [0]) |
| 42 | AC_SUBST(LIB_RELEASE_INFO, 2) # used by Win32 DLLs | 42 | AC_SUBST([LIB_VERSION_REVISION], [0]) |
| 43 | AC_SUBST([LIB_VERSION_AGE], [0]) | ||
| 44 | AC_SUBST([LIB_VERSION_INFO], [${LIB_VERSION_CURRENT}:${LIB_VERSION_REVISION}:${LIB_VERSION_AGE}]) | ||
| 45 | AC_SUBST([LIB_RELEASE_INFO], [${LIB_VERSION_CURRENT}]) # used by Win32 DLLs | ||
| 43 | 46 | ||
| 44 | AC_CONFIG_AUX_DIR([build-aux]) | 47 | AC_CONFIG_AUX_DIR([build-aux]) |
| 45 | AC_CONFIG_SRCDIR([dmstools.tags]) | 48 | AC_CONFIG_SRCDIR([dmstools.tags]) |
diff --git a/dmstools.xcodeproj/project.pbxproj b/dmstools.xcodeproj/project.pbxproj index 368e3ad..afb91c5 100644 --- a/dmstools.xcodeproj/project.pbxproj +++ b/dmstools.xcodeproj/project.pbxproj | |||
| @@ -30,9 +30,11 @@ | |||
| 30 | A07BC6F10F0210CF00219629 /* bitops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitops.c; sourceTree = "<group>"; }; | 30 | A07BC6F10F0210CF00219629 /* bitops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bitops.c; sourceTree = "<group>"; }; |
| 31 | A08B43A010FCD1580091D7C8 /* dms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dms.h; sourceTree = "<group>"; }; | 31 | A08B43A010FCD1580091D7C8 /* dms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dms.h; sourceTree = "<group>"; }; |
| 32 | A08B43A310FCD1670091D7C8 /* libdms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libdms.h; sourceTree = "<group>"; }; | 32 | A08B43A310FCD1670091D7C8 /* libdms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libdms.h; sourceTree = "<group>"; }; |
| 33 | A08B43A410FCD1670091D7C8 /* libdms.sym */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = libdms.sym; sourceTree = "<group>"; }; | 33 | A08B43A410FCD1670091D7C8 /* libdms.sym */ = {isa = PBXFileReference; explicitFileType = text.script; fileEncoding = 4; path = libdms.sym; sourceTree = "<group>"; }; |
| 34 | A08B43A710FCD1670091D7C8 /* libdms_version.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libdms_version.c; sourceTree = "<group>"; }; | 34 | A08B43A710FCD1670091D7C8 /* libdms_version.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = libdms_version.c; sourceTree = "<group>"; }; |
| 35 | A08B43A810FCD1670091D7C8 /* libdms_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libdms_version.h; sourceTree = "<group>"; }; | 35 | A08B43A810FCD1670091D7C8 /* libdms_version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = libdms_version.h; sourceTree = "<group>"; }; |
| 36 | A08B43AD10FCD73F0091D7C8 /* dmsversion.h.in */ = {isa = PBXFileReference; explicitFileType = sourcecode.c; fileEncoding = 4; path = dmsversion.h.in; sourceTree = "<group>"; }; | ||
| 37 | A08B43D110FD0B280091D7C8 /* dmsversion.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dmsversion.c; sourceTree = "<group>"; }; | ||
| 36 | A0AE375510EAAA3C006B1ADB /* typedef-info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "typedef-info.c"; sourceTree = "<group>"; }; | 38 | A0AE375510EAAA3C006B1ADB /* typedef-info.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "typedef-info.c"; sourceTree = "<group>"; }; |
| 37 | A0AF031210F540EB00CBC28C /* bindump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bindump.c; sourceTree = "<group>"; }; | 39 | A0AF031210F540EB00CBC28C /* bindump.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = bindump.c; sourceTree = "<group>"; }; |
| 38 | A0B6D45D1033A3BA004E87EE /* numconvert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = numconvert.c; sourceTree = "<group>"; }; | 40 | A0B6D45D1033A3BA004E87EE /* numconvert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = numconvert.c; sourceTree = "<group>"; }; |
| @@ -75,6 +77,7 @@ | |||
| 75 | A07BC6F10F0210CF00219629 /* bitops.c */, | 77 | A07BC6F10F0210CF00219629 /* bitops.c */, |
| 76 | A004228B0E0E3C4200B0ED60 /* codetagger.c */, | 78 | A004228B0E0E3C4200B0ED60 /* codetagger.c */, |
| 77 | A004228C0E0E3C4200B0ED60 /* common.h */, | 79 | A004228C0E0E3C4200B0ED60 /* common.h */, |
| 80 | A08B43D110FD0B280091D7C8 /* dmsversion.c */, | ||
| 78 | A0B6D45D1033A3BA004E87EE /* numconvert.c */, | 81 | A0B6D45D1033A3BA004E87EE /* numconvert.c */, |
| 79 | A004228D0E0E3C4200B0ED60 /* posixregex.c */, | 82 | A004228D0E0E3C4200B0ED60 /* posixregex.c */, |
| 80 | A007E66F0EB09C51008A1261 /* recurse.c */, | 83 | A007E66F0EB09C51008A1261 /* recurse.c */, |
| @@ -104,6 +107,7 @@ | |||
| 104 | isa = PBXGroup; | 107 | isa = PBXGroup; |
| 105 | children = ( | 108 | children = ( |
| 106 | A08B43A010FCD1580091D7C8 /* dms.h */, | 109 | A08B43A010FCD1580091D7C8 /* dms.h */, |
| 110 | A08B43AD10FCD73F0091D7C8 /* dmsversion.h.in */, | ||
| 107 | ); | 111 | ); |
| 108 | path = include; | 112 | path = include; |
| 109 | sourceTree = "<group>"; | 113 | sourceTree = "<group>"; |
diff --git a/include/dms.h b/include/dms.h index 1c9a5dd..2aa3374 100644 --- a/include/dms.h +++ b/include/dms.h | |||
| @@ -106,6 +106,7 @@ | |||
| 106 | /////////////// | 106 | /////////////// |
| 107 | 107 | ||
| 108 | #include <inttypes.h> | 108 | #include <inttypes.h> |
| 109 | #include <dmsversion.h> | ||
| 109 | 110 | ||
| 110 | 111 | ||
| 111 | /////////////////// | 112 | /////////////////// |
| @@ -134,6 +135,24 @@ | |||
| 134 | ////////////////// | 135 | ////////////////// |
| 135 | BEGIN_C_DECLS | 136 | BEGIN_C_DECLS |
| 136 | 137 | ||
| 138 | // returns the binary GNU Libtool LIB_VERSION_INFO value | ||
| 139 | DMS_F(int) dms_lib_version PARAMS((void)); | ||
| 140 | |||
| 141 | // returns the GNU Libtool LIB_VERSION_AGE value | ||
| 142 | DMS_F(int) dms_lib_version_age PARAMS((void)); | ||
| 143 | |||
| 144 | // checks for library binary compatability | ||
| 145 | DMS_F(int) dms_lib_version_check PARAMS((int version)); | ||
| 146 | |||
| 147 | // returns the GNU Libtool LIB_VERSION_CURRENT value | ||
| 148 | DMS_F(int) dms_lib_version_current PARAMS((void)); | ||
| 149 | |||
| 150 | // returns the GNU Libtool LIB_VERSION_INFO string | ||
| 151 | DMS_F(const char *) dms_lib_version_info PARAMS((void)); | ||
| 152 | |||
| 153 | // returns the GNU Libtool LIB_VERSION_REVISION value | ||
| 154 | DMS_F(int) dms_lib_version_revision PARAMS((void)); | ||
| 155 | |||
| 137 | // returns version info string for library | 156 | // returns version info string for library |
| 138 | DMS_F(const char *) dms_version PARAMS((void)); | 157 | DMS_F(const char *) dms_version PARAMS((void)); |
| 139 | 158 | ||
diff --git a/include/dmsversion.h.in b/include/dmsversion.h.in new file mode 100644 index 0000000..646d547 --- /dev/null +++ b/include/dmsversion.h.in | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | /* | ||
| 2 | * DMS Tools and Utilities | ||
| 3 | * Copyright (C) 2010 David M. Syzdek <david@syzdek.net>. | ||
| 4 | * | ||
| 5 | * @SYZDEK_LICENSE_HEADER_START@ | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License Version 2 as | ||
| 9 | * published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | * | ||
| 20 | * @SYZDEK_LICENSE_HEADER_END@ | ||
| 21 | */ | ||
| 22 | /** | ||
| 23 | * @file lib/dms.h defines API for libdms.la | ||
| 24 | */ | ||
| 25 | #ifndef _DMSVERSION_H | ||
| 26 | #define _DMSVERSION_H 1 | ||
| 27 | |||
| 28 | /////////////////// | ||
| 29 | // // | ||
| 30 | // Definitions // | ||
| 31 | // // | ||
| 32 | /////////////////// | ||
| 33 | |||
| 34 | // Module Version Info (similar to libtool's library version) | ||
| 35 | // Current -- the current version number of this API | ||
| 36 | // Revision -- the software revision of this API version | ||
| 37 | // Age -- How many seqential past API versions is supported by | ||
| 38 | // this API version | ||
| 39 | #define DMS_LIB_VERSION_CURRENT @LIB_VERSION_CURRENT@ | ||
| 40 | #define DMS_LIB_VERSION_REVISION @LIB_VERSION_REVISION@ | ||
| 41 | #define DMS_LIB_VERSION_AGE @LIB_VERSION_AGE@ | ||
| 42 | #define DMS_LIB_VERSION_INFO "@LIB_VERSION_INFO@" | ||
| 43 | #define DMS_LIB_VERSION ( ((@LIB_VERSION_CURRENT@ & 0xFFFF) << 16) | \ | ||
| 44 | ((@LIB_VERSION_REVISION@ & 0xFF) << 8) | \ | ||
| 45 | (@LIB_VERSION_AGE@ & 0xFF) ) | ||
| 46 | |||
| 47 | |||
| 48 | #endif /* end of header file */ | ||
diff --git a/lib/libdms.sym b/lib/libdms.sym index 5334bd1..65aa576 100644 --- a/lib/libdms.sym +++ b/lib/libdms.sym | |||
| @@ -38,5 +38,11 @@ | |||
| 38 | # Clean: | 38 | # Clean: |
| 39 | # libtool --mode=clean rm -f libdms.la libdms_version.lo | 39 | # libtool --mode=clean rm -f libdms.la libdms_version.lo |
| 40 | # | 40 | # |
| 41 | dms_lib_version | ||
| 42 | dms_lib_version_age | ||
| 43 | dms_lib_version_check | ||
| 44 | dms_lib_version_current | ||
| 45 | dms_lib_version_info | ||
| 46 | dms_lib_version_revision | ||
| 41 | dms_version | 47 | dms_version |
| 42 | # end of symbol export file | 48 | # end of symbol export file |
diff --git a/lib/libdms_version.c b/lib/libdms_version.c index 1ce7745..19c8663 100644 --- a/lib/libdms_version.c +++ b/lib/libdms_version.c | |||
| @@ -40,10 +40,61 @@ | |||
| 40 | // // | 40 | // // |
| 41 | ///////////////// | 41 | ///////////////// |
| 42 | 42 | ||
| 43 | /// returns the binary GNU Libtool LIB_VERSION_INFO value | ||
| 44 | int dms_lib_version(void) | ||
| 45 | { | ||
| 46 | return(DMS_LIB_VERSION); | ||
| 47 | } | ||
| 48 | |||
| 49 | |||
| 50 | /// returns the GNU Libtool LIB_VERSION_AGE value | ||
| 51 | int dms_lib_version_age(void) | ||
| 52 | { | ||
| 53 | return(DMS_LIB_VERSION_AGE); | ||
| 54 | } | ||
| 55 | |||
| 56 | |||
| 57 | /// checks for library binary compatability | ||
| 58 | /// @param[in] info version info to compare | ||
| 59 | int dms_lib_version_check(int version) | ||
| 60 | { | ||
| 61 | int lib_cur = ((DMS_LIB_VERSION_CURRENT >> 16) & 0xFFFF); | ||
| 62 | int lib_age = ((DMS_LIB_VERSION_AGE >> 0) & 0xFF); | ||
| 63 | int ver_cur = ((version >> 16) & 0xFFFF); | ||
| 64 | int ver_age = ((version >> 0) & 0xFF); | ||
| 65 | if (ver_cur < (lib_cur-lib_age)) | ||
| 66 | return(1); | ||
| 67 | if (lib_cur < (ver_cur-ver_age)) | ||
| 68 | return(1); | ||
| 69 | return(0); | ||
| 70 | } | ||
| 71 | |||
| 72 | |||
| 73 | /// returns the GNU Libtool LIB_VERSION_CURRENT value | ||
| 74 | int dms_lib_version_current(void) | ||
| 75 | { | ||
| 76 | return(DMS_LIB_VERSION_CURRENT); | ||
| 77 | } | ||
| 78 | |||
| 79 | |||
| 80 | /// returns the GNU Libtool LIB_VERSION_INFO string | ||
| 81 | const char * dms_lib_version_info(void) | ||
| 82 | { | ||
| 83 | return(DMS_LIB_VERSION_INFO); | ||
| 84 | } | ||
| 85 | |||
| 86 | |||
| 87 | /// returns the GNU Libtool LIB_VERSION_REVISION value | ||
| 88 | int dms_lib_version_revision(void) | ||
| 89 | { | ||
| 90 | return(DMS_LIB_VERSION_REVISION); | ||
| 91 | } | ||
| 92 | |||
| 93 | |||
| 43 | /// returns version info string for library | 94 | /// returns version info string for library |
| 44 | const char * dms_version(void) | 95 | const char * dms_version(void) |
| 45 | { | 96 | { |
| 46 | return("libdms.la (" PACKAGE_NAME ") " PACKAGE_VERSION); | 97 | return("libdms.la (" PACKAGE_NAME ") " DMS_LIB_VERSION_INFO); |
| 47 | } | 98 | } |
| 48 | 99 | ||
| 49 | /* end of source code */ | 100 | /* end of source code */ |
diff --git a/src/dmsversion.c b/src/dmsversion.c index d95eaab..865a984 100644 --- a/src/dmsversion.c +++ b/src/dmsversion.c | |||
| @@ -123,7 +123,15 @@ int main(int argc, char * argv[]) | |||
| 123 | { | 123 | { |
| 124 | if (argc == -1) | 124 | if (argc == -1) |
| 125 | printf("%s\n", argv[0]); | 125 | printf("%s\n", argv[0]); |
| 126 | printf("%s\n", dms_version()); | 126 | printf(_("%s (%s) %s\n" |
| 127 | "%s\n" | ||
| 128 | "Written by David M. Syzdek\n" | ||
| 129 | "\n" | ||
| 130 | "Copyright (C) 2010 David M. Syzdek\n" | ||
| 131 | "This is free software; see the source for copying conditions. There is NO\n" | ||
| 132 | "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n" | ||
| 133 | ), PROGRAM_NAME, PACKAGE_NAME, PACKAGE_VERSION, dms_version() | ||
| 134 | ); | ||
| 127 | return(0); | 135 | return(0); |
| 128 | } | 136 | } |
| 129 | 137 | ||
