File: version.c

package info (click to toggle)
shishi 1.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 18,852 kB
  • sloc: ansic: 67,959; sh: 8,403; yacc: 1,856; makefile: 1,194; xml: 83; sed: 16
file content (46 lines) | stat: -rw-r--r-- 1,521 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* version.c --- Version handling.
 * Copyright (C) 2002-2022 Simon Josefsson
 *
 * This file is part of Shishi.
 *
 * Shishi is free software; you can redistribute it and/or modify it it
 * under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * Shishi is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Shishi; if not, see http://www.gnu.org/licenses or write
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 *
 */

#include "internal.h"

/**
 * shishi_check_version:
 * @req_version: Oldest acceptable version, or %NULL.
 *
 * Checks that the installed library version is at least
 * as recent as the one provided in @req_version.
 * The version string is formatted like "1.0.2".
 *
 * Whenever %NULL is passed to this function, the check is
 * suppressed, but the library version is still returned.
 *
 * Return value: Returns the active library version,
 *   or %NULL, should the running library be too old.
 **/
const char *
shishi_check_version (const char *req_version)
{
  if (!req_version || strverscmp (req_version, PACKAGE_VERSION) <= 0)
    return PACKAGE_VERSION;

  return NULL;
}