diff options
Diffstat (limited to 'lib/libdms_version.c')
| -rw-r--r-- | lib/libdms_version.c | 112 |
1 files changed, 0 insertions, 112 deletions
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 | ||
| 56 | int dms_lib_version(void) | ||
| 57 | { | ||
| 58 | return(DMS_LIB_VERSION); | ||
| 59 | } | ||
| 60 | |||
| 61 | |||
| 62 | /// returns the GNU Libtool LIB_VERSION_AGE value | ||
| 63 | int 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 | ||
| 71 | int 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 | ||
| 86 | int dms_lib_version_current(void) | ||
| 87 | { | ||
| 88 | return(DMS_LIB_VERSION_CURRENT); | ||
| 89 | } | ||
| 90 | |||
| 91 | |||
| 92 | /// returns the GNU Libtool LIB_VERSION_INFO string | ||
| 93 | const 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 | ||
| 100 | int dms_lib_version_revision(void) | ||
| 101 | { | ||
| 102 | return(DMS_LIB_VERSION_REVISION); | ||
| 103 | } | ||
| 104 | |||
| 105 | |||
| 106 | /// returns version info string for library | ||
| 107 | const char * dms_version(void) | ||
| 108 | { | ||
| 109 | return("libdms.la (" PACKAGE_NAME ") " DMS_LIB_VERSION_INFO); | ||
| 110 | } | ||
| 111 | |||
| 112 | /* end of source code */ | ||
