Branch data Line data Source code
1 : : /* version.c --- Version handling.
2 : : * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
3 : : * 2010 Simon Josefsson
4 : : *
5 : : * This file is part of the Generic Security Service (GSS).
6 : : *
7 : : * GSS is free software; you can redistribute it and/or modify it
8 : : * under the terms of the GNU General Public License as published by
9 : : * the Free Software Foundation; either version 3 of the License, or
10 : : * (at your option) any later version.
11 : : *
12 : : * GSS is distributed in the hope that it will be useful, but WITHOUT
13 : : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 : : * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 : : * License for more details.
16 : : *
17 : : * You should have received a copy of the GNU General Public License
18 : : * along with GSS; if not, see http://www.gnu.org/licenses or write to
19 : : * the Free Software Foundation, Inc., 51 Franklin Street, Fifth
20 : : * Floor, Boston, MA 02110-1301, USA.
21 : : *
22 : : */
23 : :
24 : : #include "internal.h"
25 : :
26 : : #include <string.h> /* for strverscmp */
27 : :
28 : : /**
29 : : * gss_check_version:
30 : : * @req_version: version string to compare with, or NULL
31 : : *
32 : : * Check that the version of the library is at minimum the one
33 : : * given as a string in @req_version.
34 : : *
35 : : * WARNING: This function is a GNU GSS specific extension, and is not
36 : : * part of the official GSS API.
37 : : *
38 : : * Return value: The actual version string of the library; NULL if the
39 : : * condition is not met. If NULL is passed to this function no
40 : : * check is done and only the version string is returned.
41 : : **/
42 : : const char *
43 : 0 : gss_check_version (const char *req_version)
44 : : {
45 [ # # ][ # # ]: 0 : if (!req_version || strverscmp (req_version, PACKAGE_VERSION) <= 0)
46 : 0 : return PACKAGE_VERSION;
47 : :
48 : 0 : return NULL;
49 : : }
|