-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version: add a feature names array to curl_version_info_data #9583
Conversation
3adef61
to
34073e8
Compare
34073e8
to
3881d12
Compare
4eaf738
to
f9dfa20
Compare
docs/libcurl/curl_version_info.3
Outdated
|
||
\fIfeature_names\fP is a pointer to an array of string pointers, containing the | ||
names of the features that libcurl supports. The array is terminated by a NULL | ||
entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mentions that features
is deprecated, but the man page still only documents the bits in that bitmask. It says nothing about the potential names in feature_names
that users of this function probably are very interested in. The list above should probably list both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I can do it. Note this means the man page will still have to be updated when a new feature is introduced.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was always the case. How is a user supposed to know what the feature means if it isn't documented?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As features
is deprecated, do you expect me to remove the bit definitions in the doc ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is way too early for that. The documentation also needs to work as a resource for people reading existing code, and there will be code using these flags for the foreseeable future and then the documentation needs to describe them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is way too early for that.
Then the doc should be ready now !
f9dfa20
to
3065804
Compare
libcurl was built with support for Unix domain sockets. | ||
.IP zstd | ||
supports HTTP zstd content encoding using zstd library. | ||
.RE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is much better, but now you've duplicated the documentation for each feature, and they're not duplicated identically. I suggest we instead list each feature with both name and bitmask define name, and have one explanation for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I drop descriptions of CURL_VERSION_CONV
and CURL_VERSION_KERBEROS4
? They're obsolete and have no associated name. Reason: I want to label descriptions by names and these are not named! Or do I associate a dummy name that can never occur :-( ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each feature with both name and bitmask define name, and have one explanation for it.
Done.
(I wish man had a built-in .TABLE
macro!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops! It seems the new documentation format causes test 1177 to fail :-(
d777418
to
f3ce058
Compare
f3ce058
to
7c2de16
Compare
7c2de16
to
07d5d8e
Compare
5ec6880
to
5d08759
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If libcurl returns more/other features in its name list than the list in tool_libinfo.c knows about, I assume they will still get output fine?
docs/libcurl/curl_version_info.3
Outdated
@@ -106,6 +110,9 @@ typedef struct { | |||
/* when 'age' is CURLVERSION_TENTH or higher (>= 7.77.0), the members | |||
below exist */ | |||
const char *gsasl_version; /* human readable string. */ | |||
/* when 'age' is CURLVERSION_ELEVENTH or higher (>= 7.86.0), the members |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7.87.0 now!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time past soooo fast !
docs/libcurl/symbols-in-versions
Outdated
@@ -1097,6 +1097,7 @@ CURLUSESSL_CONTROL 7.17.0 | |||
CURLUSESSL_NONE 7.17.0 | |||
CURLUSESSL_TRY 7.17.0 | |||
CURLVERSION_EIGHTH 7.72.0 | |||
CURLVERSION_ELEVENTH 7.86.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
7.87.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idem
src/tool_libinfo.c
Outdated
{"Kerberos", NULL, CURL_VERSION_KERBEROS5}, | ||
{"Largefile", NULL, CURL_VERSION_LARGEFILE}, | ||
{"libz", &feature_libz, CURL_VERSION_LIBZ}, | ||
{"MIME", NULL, 0}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an actual feature is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it isn't. This is a leftover from local tests. Does not harm, but useless. Removed now.
5d08759
to
f8b8dc4
Compare
All your remarks taken into account now. Thanks for pointing on them.
Yes. the feature list is taken directly from the name array: https://github.com/curl/curl/blob/f8b8dc4113d4a3115e56933980b9ab0f76de32a8/src/tool_help.c#L177-L182 In case an old library does not provide the feature array, the later is built by the tool from the flags: |
f8b8dc4
to
ef124a8
Compare
Field feature_names contains a null-terminated sorted array of feature names. Bitmask field features is deprecated. Documentation is updated. Test 1177 and tests/version-scan.pl updated to match new documentation format and extended to check feature names too.
If the run-time libcurl is too old to support feature names, the name array is created locally from the bit masks. This is the only sequence left that uses feature bit masks.
ef124a8
to
ae33f69
Compare
If the run-time libcurl is too old to support feature names, the name array is created locally from the bit masks. This is the only sequence left that uses feature bit masks. Closes #9583
Thanks! |
New field
feature_names
contains a pointer to a null-terminated sorted array of feature names. Bitmask fieldfeatures
is deprecated.This will allow us to support more than 32 features.
Whether the
strcasecmp4sort
() procedure should be moved to strcase.c is questionable.