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