Add `gnutls/dtls.h' to the distribution.
[gnutls.git] / lib / minitasn1 / version.c
blobad7b43eb36225daa687b7fb6671d627028d694de
1 /*
2 * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010 Free
3 * Software Foundation, Inc.
5 * This file is part of LIBTASN1.
7 * The LIBTASN1 library is free software; you can redistribute it
8 * and/or modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 * 02110-1301, USA
23 #ifdef HAVE_CONFIG_H
24 # include <config.h>
25 #endif
27 #include <string.h> /* for strverscmp */
29 #include "libtasn1.h"
31 /**
32 * asn1_check_version:
33 * @req_version: Required version number, or %NULL.
35 * Check that the version of the library is at minimum the
36 * requested one and return the version string; return %NULL if the
37 * condition is not satisfied. If a %NULL is passed to this function,
38 * no check is done, but the version string is simply returned.
40 * See %ASN1_VERSION for a suitable @req_version string.
42 * Returns: Version string of run-time library, or %NULL if the
43 * run-time library does not meet the required version number.
45 const char *
46 asn1_check_version (const char *req_version)
48 if (!req_version || strverscmp (req_version, ASN1_VERSION) <= 0)
49 return ASN1_VERSION;
51 return NULL;