Skip to content

Commit 2baba5e

Browse files
committed
symbols-in-versions/by-name: offer new sort
The symbols-in-versions page now sorts the list on intro-version, and there is a new symbols-by-name page for the same list but alpha sorted. All shown version numbers link to the changelog emtry for that version. Closes #313
1 parent c16a852 commit 2baba5e

File tree

6 files changed

+133
-5
lines changed

6 files changed

+133
-5
lines changed

_menu.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
<a href="/libcurl/features.html">Features</a>
6666
<a href="/mail/list.cgi?list=curl-library">Mailing list</a>
6767
<a href="/libcurl/relatedlibs.html">Related libs</a>
68+
<a href="/libcurl/c/symbols-in-versions.html">Symbols</a>
6869
<a href="/libcurl/using/">Using libcurl</a>
6970
<a href="/libcurl/c/libcurl-tutorial.html">Tutorial</a>
7071
<a href="/libcurl/theysay.html">Testimonials</a>

libcurl/_menu.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<a href="/libcurl/relatedlibs.html">Related libs</a>
2828
<a href="/libcurl/using/">Using libcurl</a>
2929
<a href="/libcurl/security.html">Security</a>
30+
<a href="/libcurl/c/symbols-in-versions.html">Symbols</a>
3031
<a href="/libcurl/c/libcurl-tutorial.html">Tutorial</a>
3132
<a href="/libcurl/theysay.html">Testimonials</a>
3233
</div>

libcurl/c/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ PAGES = \
141141
allexamples.zip \
142142
options-in-examples.html \
143143
symbols-in-versions.html \
144+
symbols-by-name.html \
144145
threadsafe.html \
145146
libcurl-env.html \
146147
$(MIME) \
@@ -521,8 +522,13 @@ options-in-examples.gen: allex.gen options-used-in-examples.pl
521522

522523
symbols-in-versions.html: _symbols-in-versions.html $(MAINPARTS) symbols-in-versions.gen
523524
$(ACTION)
524-
symbols-in-versions.gen: $(MANROOT)/symbols-in-versions
525-
$(TXT2PLAIN) < $< > $@
525+
symbols-in-versions.gen: $(MANROOT)/symbols-in-versions syminver.pl
526+
./syminver.pl $< 1 > $@
527+
528+
symbols-by-name.html: _symbols-by-name.html $(MAINPARTS) symbols-by-name.gen
529+
$(ACTION)
530+
symbols-by-name.gen: $(MANROOT)/symbols-in-versions syminver.pl
531+
./syminver.pl $< > $@
526532

527533
curl_mime_init.html: _curl_mime_init.html $(MAINPARTS_CAPI) curl_mime_init.gen
528534
$(ACTION)

libcurl/c/_symbols-by-name.html

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#include "_doctype.html"
2+
<html>
3+
<head> <title>libcurl - symbols by name</title>
4+
#include "css.t"
5+
</head>
6+
7+
#define DOCS_SYMBOLS
8+
#define CURL_URL libcurl/c/symbols-by-name.html
9+
10+
#include "_menu.html"
11+
#include "setup.t"
12+
13+
WHERE3(libcurl, "/libcurl/", API, "/libcurl/c/", Symbols By Name)
14+
15+
TITLE(Symbols By Name)
16+
<p>
17+
These symbols are present in libcurl. Here is information about the first
18+
libcurl version that provides the symbol, the first version in which the
19+
symbol was marked as deprecated and for a few symbols the last version that
20+
featured it.
21+
<p>
22+
[ sort on name | <a href="symbols-in-versions.html">sort on intro version</a> ]
23+
<p>
24+
#include "symbols-by-name.gen"
25+
26+
#include "_footer.html"
27+
28+
</body>
29+
</html>

libcurl/c/_symbols-in-versions.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@
1313
WHERE3(libcurl, "/libcurl/", API, "/libcurl/c/", Symbols In Versions)
1414

1515
TITLE(Symbols In Versions)
16-
17-
<pre>
16+
<p>
17+
These symbols are present in libcurl. Here is information about the first
18+
libcurl version that provides the symbol, the first version in which the
19+
symbol was marked as deprecated and for a few symbols the last version that
20+
featured it.
21+
<p>
22+
[ <a href="symbols-by-name.html">sort on name</a> | <b>sort on intro version</b> ]
23+
<p>
1824
#include "symbols-in-versions.gen"
19-
</pre>
2025

2126
#include "_footer.html"
2227

libcurl/c/syminver.pl

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
#!/usr/bin/perl
2+
#***************************************************************************
3+
# _ _ ____ _
4+
# Project ___| | | | _ \| |
5+
# / __| | | | |_) | |
6+
# | (__| |_| | _ <| |___
7+
# \___|\___/|_| \_\_____|
8+
#
9+
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
10+
#
11+
# This software is licensed as described in the file COPYING, which
12+
# you should have received as part of this distribution. The terms
13+
# are also available at https://curl.se/docs/copyright.html.
14+
#
15+
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
16+
# copies of the Software, and permit persons to whom the Software is
17+
# furnished to do so, under the terms of the COPYING file.
18+
#
19+
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20+
# KIND, either express or implied.
21+
#
22+
# SPDX-License-Identifier: curl
23+
#
24+
###########################################################################
25+
26+
# symbols-in-versions
27+
my $siv = $ARGV[0];
28+
29+
# sort by version
30+
my $bynumber = $ARGV[1];
31+
32+
my $html = "manpage.html";
33+
my $changelog = "/changes.html";
34+
35+
print "<table>\n";
36+
print "<tr><th>Name</th>".
37+
"<th>Added</th>".
38+
"<th>Deprecated</th>".
39+
"<th>Last</th>".
40+
"</tr>\n";
41+
42+
sub vernum {
43+
my ($ver)= @_;
44+
my @a = split(/\./, $ver);
45+
return $a[0] * 10000 + $a[1] * 100 + $a[2];
46+
}
47+
48+
sub verlink {
49+
my ($v)=@_;
50+
if($v && ($v ne "-")) {
51+
my $link = $v;
52+
$link =~ s/\./_/g;
53+
return "<a href=\"$changelog#$link\">$v</a>";
54+
}
55+
return "";
56+
}
57+
58+
open(O, "<$siv");
59+
while(<O>) {
60+
chomp;
61+
if($_ =~ /^(\S+) +([0-9.]+) *([^ ]*) *([0-9.]*)/) {
62+
my ($sym, $intro, $depr, $last) = ($1, $2, $3, $4);
63+
push @syms, $sym;
64+
$sintro{$sym}=$intro;
65+
$sdepr{$sym}=$depr;
66+
$slast{$sym}=$last;
67+
}
68+
}
69+
close(O);
70+
71+
my @sorted;
72+
if($bynumber) {
73+
@sorted = reverse sort {vernum($sintro{$a}) <=> vernum($sintro{$b})} @syms;
74+
}
75+
else {
76+
# byname
77+
@sorted = sort @syms;
78+
}
79+
80+
for my $s (@sorted) {
81+
printf "<tr><td>$s</td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
82+
verlink($sintro{$s}),
83+
verlink($sdepr{$s}),
84+
verlink($slast{$s});
85+
}
86+
print "</table>\n";

0 commit comments

Comments
 (0)