Initialize Tizen 2.3
[external/libtasn1.git] / lib / version.c
1 /*
2  * Copyright (C) 2000, 2001, 2004, 2006, 2007, 2008, 2009, 2010 Free
3  * Software Foundation, Inc.
4  *
5  * This file is part of LIBTASN1.
6  *
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.
11  *
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.
16  *
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
21  */
22
23 #ifdef HAVE_CONFIG_H
24 # include <config.h>
25 #endif
26
27 #include <string.h>             /* for strverscmp */
28
29 #include "libtasn1.h"
30
31 /**
32  * asn1_check_version:
33  * @req_version: Required version number, or %NULL.
34  *
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.
39  *
40  * See %ASN1_VERSION for a suitable @req_version string.
41  *
42  * Returns: Version string of run-time library, or %NULL if the
43  *   run-time library does not meet the required version number.
44  */
45 const char *
46 asn1_check_version (const char *req_version)
47 {
48   if (!req_version || strverscmp (req_version, ASN1_VERSION) <= 0)
49     return ASN1_VERSION;
50
51   return NULL;
52 }