1 /***************************************************************************
3 * Project ___| | | | _ \| |
5 * | (__| |_| | _ <| |___
6 * \___|\___/|_| \_\_____|
8 * Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
10 * This software is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at http://curl.haxx.se/docs/copyright.html.
14 * You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 * copies of the Software, and permit persons to whom the Software is
16 * furnished to do so, under the terms of the COPYING file.
18 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 * KIND, either express or implied.
22 ***************************************************************************/
29 #include <curl/curl.h>
32 char *curl_version(void)
34 static char version[200];
36 strcpy(version, LIBCURL_NAME "/" LIBCURL_VERSION );
37 ptr=strchr(version, '\0');
41 #if (SSLEAY_VERSION_NUMBER >= 0x905000)
44 unsigned long ssleay_value;
46 ssleay_value=SSLeay();
47 if(ssleay_value < 0x906000) {
48 ssleay_value=SSLEAY_VERSION_NUMBER;
52 if(ssleay_value&0xff0) {
53 sub[0]=((ssleay_value>>4)&0xff) + 'a' -1;
59 sprintf(ptr, " OpenSSL/%lx.%lx.%lx%s",
60 (ssleay_value>>28)&0xf,
61 (ssleay_value>>20)&0xff,
62 (ssleay_value>>12)&0xff,
67 #if (SSLEAY_VERSION_NUMBER >= 0x900000)
68 sprintf(ptr, " OpenSSL/%lx.%lx.%lx",
69 (SSLEAY_VERSION_NUMBER>>28)&0xff,
70 (SSLEAY_VERSION_NUMBER>>20)&0xff,
71 (SSLEAY_VERSION_NUMBER>>12)&0xf);
76 if(SSLEAY_VERSION_NUMBER&0x0f) {
77 sub[0]=(SSLEAY_VERSION_NUMBER&0x0f) + 'a' -1;
82 sprintf(ptr, " SSL/%x.%x.%x%s",
83 (SSLEAY_VERSION_NUMBER>>12)&0xff,
84 (SSLEAY_VERSION_NUMBER>>8)&0xf,
85 (SSLEAY_VERSION_NUMBER>>4)&0xf, sub);
89 ptr=strchr(ptr, '\0');
93 sprintf(ptr, " krb4");
97 sprintf(ptr, " ipv6");
101 sprintf(ptr, " zlib/%s", zlibVersion());
108 /* data for curl_version_info */
110 static const curl_runtime_protocol_info protocols[] = {
111 #ifndef CURL_DISABLE_FTP
114 #ifndef CURL_DISABLE_GOPHER
117 #ifndef CURL_DISABLE_TELNET
120 #ifndef CURL_DISABLE_DICT
123 #ifndef CURL_DISABLE_LDAP
126 #ifndef CURL_DISABLE_HTTP
129 #ifndef CURL_DISABLE_FILE
134 #ifndef CURL_DISABLE_HTTP
137 #ifndef CURL_DISABLE_FTP
144 static const curl_version_info_data version_info = {
150 const curl_version_info_data *curl_version_info(void)
152 return &version_info;
157 * eval: (load-file "../curl-mode.el")
160 * vim: et sw=2 ts=2 sts=2 tw=78