| 1 | /* |
| 2 | * |
| 3 | * Print plug-in driver utility functions for the GIMP. |
| 4 | * |
| 5 | * Copyright 1997-2000 Michael Sweet ([email protected]) and |
| 6 | * Robert Krawitz ([email protected]) |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public License as published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, but |
| 14 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
| 15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 16 | * for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 20 | */ |
| 21 | |
| 22 | /* |
| 23 | * This file must include only standard C header files. The core code must |
| 24 | * compile on generic platforms that don't support glib, gimp, etc. |
| 25 | */ |
| 26 | |
| 27 | |
| 28 | #ifdef HAVE_CONFIG_H |
| 29 | #include <config.h> |
| 30 | #endif |
| 31 | #include <gutenprint/gutenprint.h> |
| 32 | #include "gutenprint-internal.h" |
| 33 | #include <gutenprint/gutenprint-intl-internal.h> |
| 34 | |
| 35 | const unsigned int stp_major_version = STP_MAJOR_VERSION; |
| 36 | const unsigned int stp_minor_version = STP_MINOR_VERSION; |
| 37 | const unsigned int stp_micro_version = STP_MICRO_VERSION; |
| 38 | const unsigned int stp_current_interface = STP_CURRENT_INTERFACE; |
| 39 | const unsigned int stp_binary_age = STP_BINARY_AGE; |
| 40 | const unsigned int stp_interface_age = STP_INTERFACE_AGE; |
| 41 | |
| 42 | |
| 43 | const char * |
| 44 | stp_check_version (unsigned int required_major, |
| 45 | unsigned int required_minor, unsigned int required_micro) |
| 46 | { |
| 47 | if (required_major > stp_major_version) |
| 48 | return "Gutenprint version too old (major mismatch)"; |
| 49 | if (required_major < stp_major_version) |
| 50 | return "Gutenprint version too new (major mismatch)"; |
| 51 | if (required_minor > stp_minor_version) |
| 52 | return "Gutenprint version too old (minor mismatch)"; |
| 53 | if (required_minor < stp_minor_version) |
| 54 | return "Gutenprint version too new (minor mismatch)"; |
| 55 | if (required_micro < stp_micro_version - stp_binary_age) |
| 56 | return "Gutenprint version too new (micro mismatch)"; |
| 57 | if (required_micro > stp_micro_version) |
| 58 | return "Gutenprint version too old (micro mismatch)"; |
| 59 | return NULL; |
| 60 | } |
| 61 | |
| 62 | const char * |
| 63 | stp_get_version(void) |
| 64 | { |
| 65 | static const char *version_id = VERSION; |
| 66 | return version_id; |
| 67 | } |
| 68 | |
| 69 | const char * |
| 70 | stp_get_release_version(void) |
| 71 | { |
| 72 | static const char *release_version_id = GUTENPRINT_RELEASE_VERSION; |
| 73 | return release_version_id; |
| 74 | } |