new
[libcurl.git] / lib / version.c
blobed04ecc4f580d0104aa688881cb9c7f77fbe53e8
1 /*****************************************************************************
2 * _ _ ____ _
3 * Project ___| | | | _ \| |
4 * / __| | | | |_) | |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * The contents of this file are subject to the Mozilla Public License
9 * Version 1.0 (the "License"); you may not use this file except in
10 * compliance with the License. You may obtain a copy of the License at
11 * http://www.mozilla.org/MPL/
13 * Software distributed under the License is distributed on an "AS IS"
14 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
15 * License for the specific language governing rights and limitations
16 * under the License.
18 * The Original Code is Curl.
20 * The Initial Developer of the Original Code is Daniel Stenberg.
22 * Portions created by the Initial Developer are Copyright (C) 1998.
23 * All Rights Reserved.
25 * ------------------------------------------------------------
26 * Main author:
27 * - Daniel Stenberg <Daniel.Stenberg@haxx.nu>
29 * http://curl.haxx.nu
31 * $Source: /cvsroot/curl/curl/lib/version.c,v $
32 * $Revision: 1.1.1.1 $
33 * $Date: 1999-12-29 14:21:42 $
34 * $Author: bagder $
35 * $State: Exp $
36 * $Locker: $
38 * ------------------------------------------------------------
39 ****************************************************************************/
41 #include <string.h>
42 #include <stdio.h>
44 #include "setup.h"
45 #include <curl/curl.h>
46 #include "urldata.h"
48 char *curl_version(void)
50 static char version[200];
51 char *ptr;
52 #if defined(USE_SSLEAY)
53 static char sub[2];
54 #endif
55 strcpy(version, LIBCURL_NAME " " LIBCURL_VERSION );
56 ptr=strchr(version, '\0');
58 #ifdef USE_SSLEAY
60 #if (SSLEAY_VERSION_NUMBER >= 0x900000)
61 sprintf(ptr, " (SSL %x.%x.%x)",
62 (SSLEAY_VERSION_NUMBER>>28)&0xff,
63 (SSLEAY_VERSION_NUMBER>>20)&0xff,
64 (SSLEAY_VERSION_NUMBER>>12)&0xf);
65 #else
66 if(SSLEAY_VERSION_NUMBER&0x0f) {
67 sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1;
69 else
70 sub[0]=0;
72 sprintf(ptr, " (SSL %x.%x.%x%s)",
73 (SSLEAY_VERSION_NUMBER>>12)&0xff,
74 (SSLEAY_VERSION_NUMBER>>8)&0xf,
75 (SSLEAY_VERSION_NUMBER>>4)&0xf, sub);
77 #endif
78 ptr=strchr(ptr, '\0');
79 #endif
81 #ifdef USE_ZLIB
82 sprintf(ptr, " (zlib %s)", zlibVersion());
83 #endif
85 return version;