Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
dc9e4156
Commit
dc9e4156
authored
22 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
get an argument and add a 'age' field to the struct
parent
84fa12c8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/libcurl/curl_version_info.3
+15
-3
15 additions, 3 deletions
docs/libcurl/curl_version_info.3
include/curl/curl.h
+17
-3
17 additions, 3 deletions
include/curl/curl.h
lib/version.c
+13
-11
13 additions, 11 deletions
lib/version.c
with
45 additions
and
17 deletions
docs/libcurl/curl_version_info.3
+
15
−
3
View file @
dc9e4156
...
...
@@ -2,17 +2,23 @@
.\" nroff -man [file]
.\" $Id$
.\"
.TH curl_version_info 3 "
25
Sep 2002" "libcurl 7.10" "libcurl Manual"
.TH curl_version_info 3 "
30
Sep 2002" "libcurl 7.10" "libcurl Manual"
.SH NAME
curl_version_info - returns run-time libcurl version info
.SH SYNOPSIS
.B #include <curl/curl.h>
.sp
.BI "curl_version_info_data *curl_version_info( );"
.BI "curl_version_info_data *curl_version_info(
CURLversion "type "
);"
.ad
.SH DESCRIPTION
Returns a pointer to a filled in struct with information about various
run-time features in libcurl.
run-time features in libcurl. \fItype\fP should be set to the version of this
functionality by the time you write your program. This way, libcurl will
always return a proper struct that your program understands, while programs in
the future might get an different struct. CURLVERSION_NOW will be the most
recent one for the library you have installed:
data = curl_version_info(CURLVERSION_NOW);
Applications should use this information to judge if things are possible to do
or not, instead of using compile-time checks, as dynamic/DLL libraries can be
...
...
@@ -22,6 +28,7 @@ The curl_version_info_data struct looks like this
.nf
typedef struct {
CURLversion age; /* 0 - this kind of struct */
const char *version; /* human readable string */
unsigned int version_num; /* numeric representation */
const char *host; /* human readable string */
...
...
@@ -33,6 +40,11 @@ typedef struct {
} curl_version_info_data;
.fi
\fIage\fP describes what kind of struct this is. It is always 0 now. In a
future libcurl, if this struct changes, this age counter may be increased, and
then the struct for number 1 will look different (except for this first struct
field).
\fIversion\fP is just an ascii string for the libcurl version.
\fIversion_num\fP is a 6 digit hexadecimal number created like this: <2 digits
...
...
This diff is collapsed.
Click to expand it.
include/curl/curl.h
+
17
−
3
View file @
dc9e4156
...
...
@@ -688,7 +688,8 @@ int curl_formparse(char *, struct curl_httppost **,
#undef CFINIT
#endif
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus)
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
defined(__HP_aCC)
#define CFINIT(name) CURLFORM_ ## name
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
...
...
@@ -916,7 +917,20 @@ CURLcode curl_share_destroy (curl_share *);
* Structures for querying information about the curl library at runtime.
*/
typedef
enum
{
CURLVERSION_FIRST
,
CURLVERSION_LAST
/* never actually use this */
}
CURLversion
;
/* The 'CURLVERSION_NOW' is the symbolic name meant to be used by
basicly all programs ever, that want to get version information. It is
meant to be a built-in version number for what kind of struct the caller
expects. If the struct ever changes, we redfine the NOW to another enum
from above. */
#define CURLVERSION_NOW CURLVERSION_FIRST
typedef
struct
{
CURLversion
age
;
/* age of the returned struct */
const
char
*
version
;
/* LIBCURL_VERSION */
unsigned
int
version_num
;
/* LIBCURL_VERSION_NUM */
const
char
*
host
;
/* OS/host/cpu/machine when configured */
...
...
@@ -925,7 +939,7 @@ typedef struct {
long
ssl_version_num
;
/* number */
const
char
*
libz_version
;
/* human readable string */
/* protocols is terminated by an entry with a NULL protoname */
const
char
*
protocols
[
1
]
;
const
char
*
*
protocols
;
}
curl_version_info_data
;
#define CURL_VERSION_IPV6 (1<<0)
...
...
@@ -934,7 +948,7 @@ typedef struct {
#define CURL_VERSION_LIBZ (1<<3)
/* returns a pointer to a static copy of the version info struct */
curl_version_info_data
*
curl_version_info
(
void
);
curl_version_info_data
*
curl_version_info
(
CURLversion
);
#ifdef __cplusplus
}
...
...
This diff is collapsed.
Click to expand it.
lib/version.c
+
13
−
11
View file @
dc9e4156
...
...
@@ -122,39 +122,40 @@ char *curl_version(void)
static
const
char
*
protocols
[]
=
{
#ifndef CURL_DISABLE_FTP
{
"ftp"
}
,
"ftp"
,
#endif
#ifndef CURL_DISABLE_GOPHER
{
"gopher"
}
,
"gopher"
,
#endif
#ifndef CURL_DISABLE_TELNET
{
"telnet"
}
,
"telnet"
,
#endif
#ifndef CURL_DISABLE_DICT
{
"dict"
}
,
"dict"
,
#endif
#ifndef CURL_DISABLE_LDAP
{
"ldap"
}
,
"ldap"
,
#endif
#ifndef CURL_DISABLE_HTTP
{
"http"
}
,
"http"
,
#endif
#ifndef CURL_DISABLE_FILE
{
"file"
}
,
"file"
,
#endif
#ifdef USE_SSLEAY
#ifndef CURL_DISABLE_HTTP
{
"https"
}
,
"https"
,
#endif
#ifndef CURL_DISABLE_FTP
{
"ftps"
}
,
"ftps"
,
#endif
#endif
{
NULL
}
NULL
};
static
curl_version_info_data
version_info
=
{
CURLVERSION_FIRST
,
LIBCURL_VERSION
,
LIBCURL_VERSION_NUM
,
OS
,
/* as found by configure or set by hand at build-time */
...
...
@@ -178,7 +179,7 @@ static curl_version_info_data version_info = {
protocols
};
curl_version_info_data
*
curl_version_info
(
void
)
curl_version_info_data
*
curl_version_info
(
CURLversion
stamp
)
{
#ifdef USE_SSLEAY
static
char
ssl_buffer
[
80
];
...
...
@@ -194,6 +195,7 @@ curl_version_info_data *curl_version_info(void)
version_info
.
libz_version
=
zlibVersion
();
/* libz left NULL if non-existing */
#endif
(
void
)
stamp
;
/* avoid compiler warnings, we don't use this */
return
&
version_info
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment