1 /* version.c --- Version handling.
2 * Copyright (C) 2002, 2003, 2004, 2006, 2007, 2008, 2009 Simon Josefsson
4 * This file is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This file is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this file; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "stringprep.h"
26 #include <string.h> /* for strverscmp */
29 * stringprep_check_version - check for library version
30 * @req_version: Required version number, or NULL.
32 * Check that the version of the library is at minimum the requested one
33 * and return the version string; return NULL if the condition is not
34 * satisfied. If a NULL is passed to this function, no check is done,
35 * but the version string is simply returned.
37 * See %STRINGPREP_VERSION for a suitable @req_version string.
39 * Return value: Version string of run-time library, or NULL if the
40 * run-time library does not meet the required version number.
43 stringprep_check_version (const char *req_version)
45 if (!req_version || strverscmp (req_version, STRINGPREP_VERSION) <= 0)
46 return STRINGPREP_VERSION;