aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile.am40
-rw-r--r--acinclude.m425
-rw-r--r--configure.ac2
-rw-r--r--include/dms.h173
-rw-r--r--include/dmsversion.h.in60
-rw-r--r--lib/libdms.h80
-rw-r--r--lib/libdms.sym60
-rw-r--r--lib/libdms_version.c112
-rw-r--r--lib/libdms_version.h40
9 files changed, 3 insertions, 589 deletions
diff --git a/Makefile.am b/Makefile.am
index 82adaa7..1d45fd2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,9 +56,8 @@ DEFS = -DLOCALEDIR="\"$(localedir)\"" @DEFS@
56 56
57# automake targets 57# automake targets
58bin_PROGRAMS = 58bin_PROGRAMS =
59include_HEADERS = include/dms.h \ 59include_HEADERS =
60 include/dmsversion.h 60lib_LTLIBRARIES =
61lib_LTLIBRARIES = lib/libdms.la
62noinst_PROGRAMS = 61noinst_PROGRAMS =
63noinst_HEADERS = src/common.h 62noinst_HEADERS = src/common.h
64man_MANS = 63man_MANS =
@@ -67,7 +66,6 @@ EXTRA = src/bindump \
67 src/bitops \ 66 src/bitops \
68 src/codetagger \ 67 src/codetagger \
69 src/colors \ 68 src/colors \
70 src/dmsversion \
71 src/endian \ 69 src/endian \
72 src/macaddrinfo \ 70 src/macaddrinfo \
73 src/netcalc \ 71 src/netcalc \
@@ -78,24 +76,9 @@ EXTRA = src/bindump \
78 src/typedef-info 76 src/typedef-info
79 77
80 78
81# macros for lib/libotadm.la
82lib_libdms_la_DEPENDENCIES = Makefile lib/libdms.sym
83lib_libdms_la_CFLAGS = $(AM_CFLAGS)
84lib_libdms_la_LIBADD = $(AM_LIBS)
85lib_libdms_la_LDFLAGS = -rpath '$(libdir)' \
86 -version-info $(LIB_VERSION_INFO) \
87 $(AM_LDFLAGS) \
88 -export-symbols $(srcdir)/lib/libdms.sym
89lib_libdms_la_SOURCES = include/dms.h \
90 include/dmsversion.h \
91 lib/libdms.h \
92 lib/libdms_version.c \
93 lib/libdms_version.h
94
95
96# lists 79# lists
97AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = 80AM_INSTALLCHECK_STD_OPTIONS_EXEMPT =
98BUILT_SOURCES = include/dmsversion.h 81BUILT_SOURCES =
99TESTS = 82TESTS =
100XFAIL_TESTS = 83XFAIL_TESTS =
101EXTRA_MANS = 84EXTRA_MANS =
@@ -106,8 +89,6 @@ EXTRA_DIST = autogen.sh \
106 doc/macaddrinfo.1.in \ 89 doc/macaddrinfo.1.in \
107 doc/numconvert.1.in \ 90 doc/numconvert.1.in \
108 doc/posixregex.1.in \ 91 doc/posixregex.1.in \
109 include/dmsversion.h.in \
110 lib/libdms.sym \
111 m4/dmstools_gcc.m4 \ 92 m4/dmstools_gcc.m4 \
112 m4/dmstools_git.m4 \ 93 m4/dmstools_git.m4 \
113 $(srcdir)/build-aux/dmstools.tags \ 94 $(srcdir)/build-aux/dmstools.tags \
@@ -129,7 +110,6 @@ CLEANFILES = \
129 config.h.in~ $(srcdir)/config.h.in~ \ 110 config.h.in~ $(srcdir)/config.h.in~ \
130 configure.scan $(srcdir)/configure.scan \ 111 configure.scan $(srcdir)/configure.scan \
131 $(man_MANS) \ 112 $(man_MANS) \
132 include/dmsversion.h \
133 @PACKAGE_TARNAME@-*.tar.* \ 113 @PACKAGE_TARNAME@-*.tar.* \
134 @PACKAGE_TARNAME@-*.zip 114 @PACKAGE_TARNAME@-*.zip
135DISTCHECK_CONFIGURE_FLAGS = --enable-strictwarnings \ 115DISTCHECK_CONFIGURE_FLAGS = --enable-strictwarnings \
@@ -184,16 +164,6 @@ if WANT_COLORS
184endif 164endif
185 165
186 166
187# macros for src/dmsversion
188src_dmsversion_DEPENDENCIES = $(lib_LTLIBRARIES) Makefile
189src_dmsversion_CPPFLAGS = -DPROGRAM_NAME="\"dmsversion\"" $(AM_CPPFLAGS)
190src_dmsversion_LDADD = $(AM_LDADD) lib/libdms.la
191src_dmsversion_SOURCES = $(noinst_HEADERS) src/dmsversion.c
192if WANT_DMSVERSION
193 bin_PROGRAMS += src/dmsversion
194endif
195
196
197# macros for src/endian 167# macros for src/endian
198src_endian_DEPENDENCIES = $(lib_LTLIBRARIES) Makefile 168src_endian_DEPENDENCIES = $(lib_LTLIBRARIES) Makefile
199src_endian_CPPFLAGS = -DPROGRAM_NAME="\"endian\"" $(AM_CPPFLAGS) 169src_endian_CPPFLAGS = -DPROGRAM_NAME="\"endian\"" $(AM_CPPFLAGS)
@@ -291,10 +261,6 @@ doc/numconvert.1: Makefile $(srcdir)/doc/numconvert.1.in
291doc/posixregex.1: Makefile $(srcdir)/doc/posixregex.1.in 261doc/posixregex.1: Makefile $(srcdir)/doc/posixregex.1.in
292 $(do_subst_dt) 262 $(do_subst_dt)
293 263
294include/dmsversion.h: Makefile $(srcdir)/include/dmsversion.h.in
295 $(mkdir_p) include
296 $(do_subst_dt)
297
298 264
299# local targets 265# local targets
300install-exec-local: 266install-exec-local:
diff --git a/acinclude.m4 b/acinclude.m4
index 476450f..75d54cd 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -219,31 +219,6 @@ AC_DEFUN([AC_DMS_TOOL_COLORS],[dnl
219])dnl 219])dnl
220 220
221 221
222# AC_DMS_TOOL_DMSVERSION
223# ______________________________________________________________________________
224AC_DEFUN([AC_DMS_TOOL_DMSVERSION],[dnl
225
226 AC_REQUIRE([AC_DMS_TOOL_ALL])
227
228 enableval=""
229 AC_ARG_ENABLE(
230 dmsversion,
231 [AS_HELP_STRING([--enable-dmsversion], [enable building dmsversion])],
232 [ EDMSVERSION=$enableval ],
233 [ EDMSVERSION=$enableval ]
234 )
235
236 if test "x${EDMSVERSION}" == "x";then
237 EDMSVERSION="${EALL}"
238 fi
239 if test "x${EDMSVERSION}" == "xauto";then
240 EDMSVERSION=no
241 fi
242
243 AM_CONDITIONAL([WANT_DMSVERSION], [test "$EDMSVERSION" = "yes"])
244])dnl
245
246
247# AC_DMS_TOOL_ENDIAN 222# AC_DMS_TOOL_ENDIAN
248# ______________________________________________________________________________ 223# ______________________________________________________________________________
249AC_DEFUN([AC_DMS_TOOL_ENDIAN],[dnl 224AC_DEFUN([AC_DMS_TOOL_ENDIAN],[dnl
diff --git a/configure.ac b/configure.ac
index 05804aa..aaa7550 100644
--- a/configure.ac
+++ b/configure.ac
@@ -189,7 +189,6 @@ AC_DMS_TOOL_BITCOPY
189AC_DMS_TOOL_BITOPS 189AC_DMS_TOOL_BITOPS
190AC_DMS_TOOL_CODETAGGER 190AC_DMS_TOOL_CODETAGGER
191AC_DMS_TOOL_COLORS 191AC_DMS_TOOL_COLORS
192AC_DMS_TOOL_DMSVERSION
193AC_DMS_TOOL_ENDIAN 192AC_DMS_TOOL_ENDIAN
194AC_DMS_TOOL_MACADDRINFO 193AC_DMS_TOOL_MACADDRINFO
195AC_DMS_TOOL_NETCALC 194AC_DMS_TOOL_NETCALC
@@ -212,7 +211,6 @@ AC_MSG_NOTICE([ build bitcopy $EBITCOPY])
212AC_MSG_NOTICE([ build bitops $EBITOPS]) 211AC_MSG_NOTICE([ build bitops $EBITOPS])
213AC_MSG_NOTICE([ build codetagger $ECODETAGGER]) 212AC_MSG_NOTICE([ build codetagger $ECODETAGGER])
214AC_MSG_NOTICE([ build colors $ECOLORS]) 213AC_MSG_NOTICE([ build colors $ECOLORS])
215AC_MSG_NOTICE([ build dmsversion $EDMSVERSION])
216AC_MSG_NOTICE([ build endian $EENDIAN]) 214AC_MSG_NOTICE([ build endian $EENDIAN])
217AC_MSG_NOTICE([ build macaddrinfo $EMACADDRINFO]) 215AC_MSG_NOTICE([ build macaddrinfo $EMACADDRINFO])
218AC_MSG_NOTICE([ build netcalc $ENETCALC]) 216AC_MSG_NOTICE([ build netcalc $ENETCALC])
diff --git a/include/dms.h b/include/dms.h
deleted file mode 100644
index 7d68728..0000000
--- a/include/dms.h
+++ /dev/null
@@ -1,173 +0,0 @@
1/*
2 * DMS Tools and Utilities
3 * Copyright (C) 2010 David M. Syzdek <david@syzdek.net>.
4 *
5 * @SYZDEK_LICENSE_HEADER_START@
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of David M. Syzdek nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @SYZDEK_LICENSE_HEADER_END@
33 */
34/**
35 * @file lib/dms.h defines API for libdms.la
36 */
37#ifndef _DMS_H
38#define _DMS_H 1
39
40//////////////
41// //
42// Macros //
43// //
44//////////////
45
46/*
47 * The macros "BEGIN_C_DECLS" and "END_C_DECLS" are taken verbatim
48 * from section 7.1 of the Libtool 1.5.14 manual.
49 */
50/* BEGIN_C_DECLS should be used at the beginning of your declarations,
51 so that C++ compilers don't mangle their names. Use END_C_DECLS at
52 the end of C declarations. */
53#undef BEGIN_C_DECLS
54#undef END_C_DECLS
55#if defined(__cplusplus) || defined(c_plusplus)
56# define BEGIN_C_DECLS extern "C" { ///< exports as C functions
57# define END_C_DECLS } ///< exports as C functions
58#else
59# define BEGIN_C_DECLS /* empty */ ///< exports as C functions
60# define END_C_DECLS /* empty */ ///< exports as C functions
61#endif
62
63
64/*
65 * The macro "PARAMS" is taken verbatim from section 7.1 of the
66 * Libtool 1.5.14 manual.
67 */
68/* PARAMS is a macro used to wrap function prototypes, so that
69 compilers that don't understand ANSI C prototypes still work,
70 and ANSI C compilers can issue warnings about type mismatches. */
71#undef PARAMS
72#if defined (__STDC__) || defined (_AIX) \
73 || (defined (__mips) && defined (_SYSTYPE_SVR4)) \
74 || defined(WIN32) || defined (__cplusplus)
75# define PARAMS(protos) protos ///< wraps function arguments in order to support ANSI C
76#else
77# define PARAMS(protos) () ///< wraps function arguments in order to support ANSI C
78#endif
79
80
81/*
82 * The following macro is taken verbatim from section 5.40 of the GCC
83 * 4.0.2 manual.
84 */
85#if __STDC_VERSION__ < 199901L
86# if __GNUC__ >= 2
87# define __func__ __FUNCTION__
88# else
89# define __func__ "<unknown>"
90# endif
91#endif
92
93
94// Exports function type
95#ifdef WIN32
96# ifdef DMS_LIBS_DYNAMIC
97# define DMS_F(type) extern __declspec(dllexport) type ///< used for library calls
98# define DMS_V(type) extern __declspec(dllexport) type ///< used for library calls
99# else
100# define DMS_F(type) extern __declspec(dllimport) type ///< used for library calls
101# define DMS_V(type) extern __declspec(dllimport) type ///< used for library calls
102# endif
103#else
104# ifdef DMS_LIBS_DYNAMIC
105# define DMS_F(type) type ///< used for library calls
106# define DMS_V(type) type ///< used for library calls
107# else
108# define DMS_F(type) extern type ///< used for library calls
109# define DMS_V(type) extern type ///< used for library calls
110# endif
111#endif
112
113
114///////////////
115// //
116// Headers //
117// //
118///////////////
119
120#include <inttypes.h>
121#include <dmsversion.h>
122
123
124///////////////////
125// //
126// Definitions //
127// //
128///////////////////
129
130#define DMS_TRUE 0x01
131#define DMS_FALSE 0x00
132#define DMS_YES 0x01
133#define DMS_NO 0x00
134
135
136/////////////////
137// //
138// Datatypes //
139// //
140/////////////////
141
142
143//////////////////
144// //
145// Prototypes //
146// //
147//////////////////
148BEGIN_C_DECLS
149
150// returns the binary GNU Libtool LIB_VERSION_INFO value
151DMS_F(int) dms_lib_version PARAMS((void));
152
153// returns the GNU Libtool LIB_VERSION_AGE value
154DMS_F(int) dms_lib_version_age PARAMS((void));
155
156// checks for library binary compatability
157DMS_F(int) dms_lib_version_check PARAMS((int version));
158
159// returns the GNU Libtool LIB_VERSION_CURRENT value
160DMS_F(int) dms_lib_version_current PARAMS((void));
161
162// returns the GNU Libtool LIB_VERSION_INFO string
163DMS_F(const char *) dms_lib_version_info PARAMS((void));
164
165// returns the GNU Libtool LIB_VERSION_REVISION value
166DMS_F(int) dms_lib_version_revision PARAMS((void));
167
168// returns version info string for library
169DMS_F(const char *) dms_version PARAMS((void));
170
171
172END_C_DECLS
173#endif /* end of header file */
diff --git a/include/dmsversion.h.in b/include/dmsversion.h.in
deleted file mode 100644
index 9f7de55..0000000
--- a/include/dmsversion.h.in
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * DMS Tools and Utilities
3 * Copyright (C) 2010 David M. Syzdek <david@syzdek.net>.
4 *
5 * @SYZDEK_LICENSE_HEADER_START@
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of David M. Syzdek nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @SYZDEK_LICENSE_HEADER_END@
33 */
34/**
35 * @file lib/dms.h defines API for libdms.la
36 */
37#ifndef _DMSVERSION_H
38#define _DMSVERSION_H 1
39
40///////////////////
41// //
42// Definitions //
43// //
44///////////////////
45
46// Module Version Info (similar to libtool's library version)
47// Current -- the current version number of this API
48// Revision -- the software revision of this API version
49// Age -- How many seqential past API versions is supported by
50// this API version
51#define DMS_LIB_VERSION_CURRENT @LIB_VERSION_CURRENT@
52#define DMS_LIB_VERSION_REVISION @LIB_VERSION_REVISION@
53#define DMS_LIB_VERSION_AGE @LIB_VERSION_AGE@
54#define DMS_LIB_VERSION_INFO "@LIB_VERSION_INFO@"
55#define DMS_LIB_VERSION ( ((@LIB_VERSION_CURRENT@ & 0xFFFF) << 16) | \
56 ((@LIB_VERSION_REVISION@ & 0xFF) << 8) | \
57 (@LIB_VERSION_AGE@ & 0xFF) )
58
59
60#endif /* end of header file */
diff --git a/lib/libdms.h b/lib/libdms.h
deleted file mode 100644
index fb26d4b..0000000
--- a/lib/libdms.h
+++ /dev/null
@@ -1,80 +0,0 @@
1/*
2 * DMS Tools and Utilities
3 * Copyright (C) 2010 David M. Syzdek <david@syzdek.net>.
4 *
5 * @SYZDEK_LICENSE_HEADER_START@
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of David M. Syzdek nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @SYZDEK_LICENSE_HEADER_END@
33 */
34/**
35 * @file lib/libdms.h internal directives for libdms.la
36 */
37#ifndef _OTADM_LIB_LIBDMS_H
38#define _OTADM_LIB_LIBDMS_H 1
39
40///////////////
41// //
42// Headers //
43// //
44///////////////
45
46#ifdef HAVE_CONFIG_H
47#include <config.h>
48#endif
49
50#include <dms.h>
51
52
53///////////////////
54// //
55// Definitions //
56// //
57///////////////////
58
59#ifndef DMS_LIBS_DYNAMIC
60#define DMS_LIBS_DYNAMIC 1
61#endif
62
63#ifndef PACKAGE_TARNAME
64#define PACKAGE_TARNAME "dmstools"
65#endif
66
67#ifndef SYSCONFDIR
68#define SYSCONFDIR "/usr/local/etc"
69#endif
70
71#ifndef LIBEXECDIR
72#define LIBEXECDIR "/usr/local/libexec"
73#endif
74
75#ifndef MODULEDIR
76#define MODULEDIR "/usr/local/libexec/otadm"
77#endif
78
79
80#endif /* end of header file */
diff --git a/lib/libdms.sym b/lib/libdms.sym
deleted file mode 100644
index bcdc307..0000000
--- a/lib/libdms.sym
+++ /dev/null
@@ -1,60 +0,0 @@
1#
2# DMS Tools and Utilities
3# Copyright (C) 2010 David M. Syzdek <david@syzdek.net>.
4#
5# @SYZDEK_LICENSE_HEADER_START@
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are
9# met:
10#
11# * Redistributions of source code must retain the above copyright
12# notice, this list of conditions and the following disclaimer.
13# * Redistributions in binary form must reproduce the above copyright
14# notice, this list of conditions and the following disclaimer in the
15# documentation and/or other materials provided with the distribution.
16# * Neither the name of David M. Syzdek nor the
17# names of its contributors may be used to endorse or promote products
18# derived from this software without specific prior written permission.
19#
20# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
24# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30# SUCH DAMAGE.
31#
32# @SYZDEK_LICENSE_HEADER_END@
33#
34# lib/libdms.sym - list of symbols to export in libdms.la
35#
36# Build:
37# CFLAGS="-g -O2 -W -Wall -Werror -I../include"
38# LDFLAGS="-g -O2 -export-symbols libdms.sym -rpath /usr/local/lib"
39# export CFLAGS LDFLAGS
40#
41# libtool --mode=compile gcc ${CFLAGS} -c libdms_version.c
42# libtool --mode=link gcc ${LDFLAGS} -o libdms.la libdms_version.lo
43#
44# Install:
45# libtool --mode=install install -c libotadm.la /usr/local/lib/libacs-utils.la
46#
47# Uninstall:
48# libtool --mode=uninstall rm -f /usr/local/lib/libdms.la
49#
50# Clean:
51# libtool --mode=clean rm -f libdms.la libdms_version.lo
52#
53dms_lib_version
54dms_lib_version_age
55dms_lib_version_check
56dms_lib_version_current
57dms_lib_version_info
58dms_lib_version_revision
59dms_version
60# end of symbol export file
diff --git a/lib/libdms_version.c b/lib/libdms_version.c
deleted file mode 100644
index 64a56c7..0000000
--- a/lib/libdms_version.c
+++ /dev/null
@@ -1,112 +0,0 @@
1/*
2 * DMS Tools and Utilities
3 * Copyright (C) 2010 David M. Syzdek <david@syzdek.net>.
4 *
5 * @SYZDEK_LICENSE_HEADER_START@
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of David M. Syzdek nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @SYZDEK_LICENSE_HEADER_END@
33 */
34/**
35 * @file lib/dms_version.c functions for querying information about the library
36 */
37#define _DMS_LIB_LIBDMS_VERSION_C 1
38#include "libdms_version.h"
39
40///////////////
41// //
42// Headers //
43// //
44///////////////
45
46#include "libdms.h"
47
48
49/////////////////
50// //
51// Functions //
52// //
53/////////////////
54
55/// returns the binary GNU Libtool LIB_VERSION_INFO value
56int dms_lib_version(void)
57{
58 return(DMS_LIB_VERSION);
59}
60
61
62/// returns the GNU Libtool LIB_VERSION_AGE value
63int dms_lib_version_age(void)
64{
65 return(DMS_LIB_VERSION_AGE);
66}
67
68
69/// checks for library binary compatability
70/// @param[in] info version info to compare
71int dms_lib_version_check(int version)
72{
73 int lib_cur = ((DMS_LIB_VERSION_CURRENT >> 16) & 0xFFFF);
74 int lib_age = ((DMS_LIB_VERSION_AGE >> 0) & 0xFF);
75 int ver_cur = ((version >> 16) & 0xFFFF);
76 int ver_age = ((version >> 0) & 0xFF);
77 if (ver_cur < (lib_cur-lib_age))
78 return(1);
79 if (lib_cur < (ver_cur-ver_age))
80 return(1);
81 return(0);
82}
83
84
85/// returns the GNU Libtool LIB_VERSION_CURRENT value
86int dms_lib_version_current(void)
87{
88 return(DMS_LIB_VERSION_CURRENT);
89}
90
91
92/// returns the GNU Libtool LIB_VERSION_INFO string
93const char * dms_lib_version_info(void)
94{
95 return(DMS_LIB_VERSION_INFO);
96}
97
98
99/// returns the GNU Libtool LIB_VERSION_REVISION value
100int dms_lib_version_revision(void)
101{
102 return(DMS_LIB_VERSION_REVISION);
103}
104
105
106/// returns version info string for library
107const char * dms_version(void)
108{
109 return("libdms.la (" PACKAGE_NAME ") " DMS_LIB_VERSION_INFO);
110}
111
112/* end of source code */
diff --git a/lib/libdms_version.h b/lib/libdms_version.h
deleted file mode 100644
index 8d6c27f..0000000
--- a/lib/libdms_version.h
+++ /dev/null
@@ -1,40 +0,0 @@
1/*
2 * DMS Tools and Utilities
3 * Copyright (C) 2010 David M. Syzdek <david@syzdek.net>.
4 *
5 * @SYZDEK_LICENSE_HEADER_START@
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * * Neither the name of David M. Syzdek nor the
17 * names of its contributors may be used to endorse or promote products
18 * derived from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
21 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M. SYZDEK BE LIABLE FOR
24 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * @SYZDEK_LICENSE_HEADER_END@
33 */
34/**
35 * @file lib/dms_version.h functions for querying information about the library
36 */
37#ifndef _DMS_LIB_LIBDMS_VERSION_H
38#define _DMS_LIB_LIBDMS_VERSION_H 1
39
40#endif /* end of source code */