Skip to content

Commit

Permalink
allfuncs: generate the list from source
Browse files Browse the repository at this point in the history
1. makes it up-to-date automatically
2. include the short description
3. make it a table to look a little easier on the eye
4. no more "deprecated" section in the bottom
  • Loading branch information
bagder committed Jun 30, 2024
1 parent de98ef3 commit cd55a23
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 94 deletions.
5 changes: 4 additions & 1 deletion libcurl/c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,12 @@ allex.gen: $(DOCROOT)/examples/Makefile.inc _example-templ.html
allex-desc.gen:
perl mkexam.pl

allfuncs.html: _allfuncs.html $(MAINPARTS)
allfuncs.html: _allfuncs.html allfunc.gen $(MAINPARTS)
$(ACTION)

allfunc.gen: mkallfunc.pl $(MANROOT)/Makefile
./mkallfunc.pl $(MANROOT) > allfunc.gen

curl_easy_init.html: _curl_easy_init.html $(MAINPARTS_CAPI) curl_easy_init.gen
$(REN)$(MANACTION)
curl_easy_init.gen: $(MANROOT)/curl_easy_init.3 curlopt2href.pl
Expand Down
96 changes: 3 additions & 93 deletions libcurl/c/_allfuncs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,100 +13,10 @@

WHERE3(libcurl, "/libcurl/", API, "/libcurl/c/", All Functions)

TITLE(All functions listed in alphabetical order)
TITLE(All libcurl functions in alphabetical order)
<p>
<a href="curl_easy_cleanup.html">curl_easy_cleanup</a>
<br><a href="curl_easy_duphandle.html">curl_easy_duphandle</a>
<br><a href="curl_easy_escape.html">curl_easy_escape</a>
<br><a href="curl_easy_getinfo.html">curl_easy_getinfo</a>
<br><a href="curl_easy_header.html">curl_easy_header</a>
<br><a href="curl_easy_init.html">curl_easy_init</a>
<br><a href="curl_easy_nextheader.html">curl_easy_nextheader</a>
<br><a href="curl_easy_option_by_id.html">curl_easy_option_by_id</a>
<br><a href="curl_easy_option_by_name.html">curl_easy_option_by_name</a>
<br><a href="curl_easy_option_next.html">curl_easy_option_next</a>
<br><a href="curl_easy_pause.html">curl_easy_pause</a>
<br><a href="curl_easy_perform.html">curl_easy_perform</a>
<br><a href="curl_easy_recv.html">curl_easy_recv</a>
<br><a href="curl_easy_reset.html">curl_easy_reset</a>
<br><a href="curl_easy_send.html">curl_easy_send</a>
<br><a href="curl_easy_setopt.html">curl_easy_setopt</a>
<br><a href="curl_easy_strerror.html">curl_easy_strerror</a>
<br><a href="curl_easy_unescape.html">curl_easy_unescape</a>
<br><a href="curl_easy_upkeep.html">curl_easy_upkeep</a>
<br><a href="curl_formadd.html">curl_formadd</a>
<br><a href="curl_formfree.html">curl_formfree</a>
<br><a href="curl_formget.html">curl_formget</a>
<br><a href="curl_free.html">curl_free</a>
<br><a href="curl_getdate.html">curl_getdate</a>
<br><a href="curl_global_cleanup.html">curl_global_cleanup</a>
<br><a href="curl_global_init.html">curl_global_init</a>
<br><a href="curl_global_init_mem.html">curl_global_init_mem</a>
<br><a href="curl_global_sslset.html">curl_global_sslset</a>
<br><a href="curl_global_trace.html">curl_global_trace</a>
<br><a href="curl_mime_addpart.html">curl_mime_addpart</a>
<br><a href="curl_mime_data.html">curl_mime_data</a>
<br><a href="curl_mime_data_cb.html">curl_mime_data_cb</a>
<br><a href="curl_mime_encoder.html">curl_mime_encoder</a>
<br><a href="curl_mime_filedata.html">curl_mime_filedata</a>
<br><a href="curl_mime_filename.html">curl_mime_filename</a>
<br><a href="curl_mime_free.html">curl_mime_free</a>
<br><a href="curl_mime_headers.html">curl_mime_headers</a>
<br><a href="curl_mime_init.html">curl_mime_init</a>
<br><a href="curl_mime_name.html">curl_mime_name</a>
<br><a href="curl_mime_subparts.html">curl_mime_subparts</a>
<br><a href="curl_mime_type.html">curl_mime_type</a>
<br><a href="curl_multi_add_handle.html">curl_multi_add_handle</a>
<br><a href="curl_multi_assign.html">curl_multi_assign</a>
<br><a href="curl_multi_cleanup.html">curl_multi_cleanup</a>
<br><a href="curl_multi_fdset.html">curl_multi_fdset</a>
<br><a href="curl_multi_get_handles.html">curl_multi_get_handles</a>
<br><a href="curl_multi_info_read.html">curl_multi_info_read</a>
<br><a href="curl_multi_init.html">curl_multi_init</a>
<br><a href="curl_multi_perform.html">curl_multi_perform</a>
<br><a href="curl_multi_remove_handle.html">curl_multi_remove_handle</a>
<br><a href="curl_multi_setopt.html">curl_multi_setopt</a>
<br><a href="curl_multi_socket_action.html">curl_multi_socket_action</a>
<br><a href="curl_multi_strerror.html">curl_multi_strerror</a>
<br><a href="curl_multi_timeout.html">curl_multi_timeout</a>
<br><a href="curl_multi_poll.html">curl_multi_poll</a>
<br><a href="curl_multi_wait.html">curl_multi_wait</a>
<br><a href="curl_multi_waitfds.html">curl_multi_waitfds</a>
<br><a href="curl_multi_wakeup.html">curl_multi_wakeup</a>
<br><a href="curl_pushheader_byname.html">curl_pushheader_byname</a>
<br><a href="curl_pushheader_bynum.html">curl_pushheader_bynum</a>
<br><a href="curl_share_cleanup.html">curl_share_cleanup</a>
<br><a href="curl_share_init.html">curl_share_init</a>
<br><a href="curl_share_setopt.html">curl_share_setopt</a>
<br><a href="curl_share_strerror.html">curl_share_strerror</a>
<br><a href="curl_slist_append.html">curl_slist_append</a>
<br><a href="curl_slist_free_all.html">curl_slist_free_all</a>
<br><a href="curl_url.html">curl_url</a>
<br><a href="curl_url_cleanup.html">curl_url_cleanup</a>
<br><a href="curl_url_dup.html">curl_url_dup</a>
<br><a href="curl_url_get.html">curl_url_get</a>
<br><a href="curl_url_set.html">curl_url_set</a>
<br><a href="curl_url_strerror.html">curl_url_strerror</a>
<br><a href="curl_version.html">curl_version</a>
<br><a href="curl_version_info.html">curl_version_info</a>
<br><a href="curl_ws_recv.html">curl_ws_recv</a>
<br><a href="curl_ws_send.html">curl_ws_send</a>
<br><a href="curl_ws_meta.html">curl_ws_meta</a>

SUBTITLE(Deprecated ones)
<p>
Do not use these functions in new programs. They are subject for removal in
a future libcurl release.
<p>
<a href="curl_escape.html">curl_escape</a>
<br><a href="curl_getenv.html">curl_getenv</a>
<br><a href="curl_mprintf.html">curl_mprintf</a>
<br><a href="curl_multi_socket.html">curl_multi_socket</a>
<br><a href="curl_multi_socket.html">curl_multi_socket_all</a>
<br><a href="curl_strequal.html">curl_strequal</a>
<br><a href="curl_strequal.html">curl_strnequal</a>
<br><a href="curl_unescape.html">curl_unescape</a>

#include "allfunc.gen"

#include "_footer.html"

</body>
Expand Down
65 changes: 65 additions & 0 deletions libcurl/c/mkallfunc.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#!/usr/bin/perl

my $docsdir = $ARGV[0];

opendir(my $dh, $docsdir) || die "Can't opendir $some_dir: $!";
my @manp = grep { /^curl_.*\.md/ } readdir($dh);
closedir $dh;

my %func;
my %file;

sub htmlver {
my ($f)=@_;
$f =~ s/\.md/.html/;
$f =~ s/^.*\///;
return $f;
}

sub manpage {
my ($file)=@_;
open(P, "<$file");
my $name = 0;
my @f;
while(<P>) {
my $l = $_;
chomp $l;
if(/^# NAME/) {
$name = 1;
}
elsif(/^#/ && $name) {
last;
}
elsif($name) {
my $desc;
if($l =~ /(.*) - (.*)/) {
$desc = $2;
$l = $1;
}
for(split(/, */, $l)) {
push @f, $_;
}
if($desc) {
for(@f) {
$func{$_} = $desc;
$file{$_} = htmlver($file);
}
}
}
}
}


for my $d (@manp) {
manpage("$docsdir/$d");
}

print "<table>\n";
my $even = 0;
for my $f (sort keys %func) {
printf "<tr class=\"%s\"><td><a href=\"%s\">%s</a></td><td>%s</td></tr>\n",
$even ? "even" : "odd",
$file{$f}, $f, $func{$f};
$even ^= 1;
}
print "</table>\n";

0 comments on commit cd55a23

Please sign in to comment.