2
0

mksymbolsmanpage.pl 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. #!/usr/bin/env 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. use POSIX qw(strftime);
  26. my @ts;
  27. if (defined($ENV{SOURCE_DATE_EPOCH})) {
  28. @ts = localtime($ENV{SOURCE_DATE_EPOCH});
  29. } else {
  30. @ts = localtime;
  31. }
  32. my $date = strftime "%b %e, %Y", @ts;
  33. my $year = strftime "%Y", @ts;
  34. print <<HEADER
  35. ---
  36. c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  37. SPDX-License-Identifier: curl
  38. Title: libcurl-symbols
  39. Section: 3
  40. Source: libcurl
  41. Protocol:
  42. - All
  43. See-also:
  44. - libcurl (3)
  45. - libcurl-easy (3)
  46. - libcurl-multi (3)
  47. - libcurl-security (3)
  48. - libcurl-thread (3)
  49. ---
  50. # libcurl symbols
  51. This man page details version information for public symbols provided in the
  52. libcurl header files. This lists the first version in which the symbol was
  53. introduced and for some symbols two additional information pieces:
  54. The first version in which the symbol is marked "deprecated" - meaning that
  55. since that version no new code should be written to use the symbol as it is
  56. marked for getting removed in a future.
  57. The last version that featured the specific symbol. Using the symbol in source
  58. code will make it no longer compile error-free after that specified version.
  59. This man page is automatically generated from the symbols-in-versions file.
  60. HEADER
  61. ;
  62. sub nameref {
  63. my ($n)=@_;
  64. if($n =~ /^CURLOPT_/) {
  65. if($n eq "CURLOPT_RTSPHEADER") {
  66. $n = "CURLOPT_HTTPHEADER";
  67. }
  68. elsif($n eq "CURLOPT_WRITEHEADER") {
  69. $n = "CURLOPT_HEADERDATA";
  70. }
  71. elsif($n eq "CURLOPT_WRITEINFO") {
  72. ; # now obsolete
  73. }
  74. else {
  75. return "$n(3)";
  76. }
  77. }
  78. elsif($n =~ /^CURLMOPT_/) {
  79. return "$n(3)";
  80. }
  81. elsif($n =~ /^CURLINFO_/) {
  82. my %infotypes = (
  83. 'CURLINFO_TEXT' => 1,
  84. 'CURLINFO_HEADER_IN' => 1,
  85. 'CURLINFO_HEADER_OUT' => 1,
  86. 'CURLINFO_DATA_IN' => 1,
  87. 'CURLINFO_DATA_OUT' => 1,
  88. 'CURLINFO_SSL_DATA_IN' => 1,
  89. 'CURLINFO_SSL_DATA_OUT' => 1,
  90. );
  91. if($infotypes{$n}) {
  92. return "CURLOPT_DEBUGFUNCTION(3)";
  93. }
  94. }
  95. elsif($n =~ /^CURLALTSVC_/) {
  96. return "CURLOPT_ALTSVC_CTRL(3)";
  97. }
  98. elsif($n =~ /^CURLAUTH_/) {
  99. return "CURLOPT_HTTPAUTH(3)";
  100. }
  101. elsif($n =~ /^CURLFORM_/) {
  102. return "curl_formadd(3)";
  103. }
  104. elsif($n =~ /^CURLKH/) {
  105. return "CURLOPT_SSH_KEYFUNCTION(3)";
  106. }
  107. elsif($n =~ /^CURLE_/) {
  108. return "libcurl-errors(3)";
  109. }
  110. elsif($n =~ /^CURLM_/) {
  111. return "libcurl-errors(3)";
  112. }
  113. elsif($n =~ /^CURLUE_/) {
  114. return "libcurl-errors(3)";
  115. }
  116. elsif($n =~ /^CURLHE_/) {
  117. return "libcurl-errors(3)";
  118. }
  119. elsif($n =~ /^CURLSHE_/) {
  120. return "libcurl-errors(3)";
  121. }
  122. elsif($n =~ /^CURLPROTO_/) {
  123. return "CURLINFO_PROTOCOL(3)";
  124. }
  125. elsif($n =~ /^CURLPX_/) {
  126. return "CURLINFO_PROXY_ERROR(3)";
  127. }
  128. elsif($n =~ /^CURLPROXY_/) {
  129. return "CURLOPT_PROXYTYPE(3)";
  130. }
  131. elsif($n =~ /^CURLSSLBACKEND_/) {
  132. return "curl_global_sslset(3)";
  133. }
  134. elsif($n =~ /^CURLSSLOPT_/) {
  135. return "CURLOPT_SSL_OPTIONS(3)";
  136. }
  137. elsif($n =~ /^CURLSSLSET_/) {
  138. return "curl_global_sslset(3)";
  139. }
  140. elsif($n =~ /^CURLUPART_/) {
  141. return "curl_url_get(3)";
  142. }
  143. elsif($n =~ /^CURLU_/) {
  144. return "curl_url_get(3)";
  145. }
  146. elsif($n =~ /^CURLVERSION_/) {
  147. return "curl_version_info(3)";
  148. }
  149. elsif($n =~ /^CURLSHOPT_/) {
  150. if($n eq "CURLSHOPT_NONE") {
  151. $n = "curl_share_setopt";
  152. }
  153. return "$n(3)";
  154. }
  155. elsif($n =~ /^CURLWS_/) {
  156. return "curl_ws_send(3)";
  157. }
  158. elsif($n =~ /^CURL_FORMADD_/) {
  159. return "curl_formadd(3)";
  160. }
  161. elsif($n =~ /^CURL_HTTPPOST_/) {
  162. return "curl_formadd(3)";
  163. }
  164. elsif($n =~ /^CURL_GLOBAL_/) {
  165. return "curl_global_init(3)";
  166. }
  167. elsif($n =~ /^CURL_HTTP_VERSION_/) {
  168. return "CURLOPT_HTTP_VERSION(3)";
  169. }
  170. elsif($n =~ /^CURL_LOCK_/) {
  171. return "CURLSHOPT_SHARE(3)";
  172. }
  173. elsif($n =~ /^CURL_SSLVERSION_/) {
  174. return "CURLOPT_SSLVERSION(3)";
  175. }
  176. elsif($n =~ /^CURL_VERSION_/) {
  177. return "curl_version_info(3)";
  178. }
  179. elsif($n =~ /^CURL_RTSPREQ_/) {
  180. return "CURLOPT_RTSP_REQUEST(3)";
  181. }
  182. elsif($n =~ /^CURLH_/) {
  183. return "curl_easy_header(3)";
  184. }
  185. elsif($n =~ /^CURL_TRAILERFUNC_/) {
  186. return "CURLOPT_TRAILERFUNCTION(3)";
  187. }
  188. elsif($n =~ /^CURLOT_/) {
  189. return "curl_easy_option_next(3)";
  190. }
  191. elsif($n =~ /^CURLFINFOFLAG_/) {
  192. return "CURLOPT_CHUNK_BGN_FUNCTION(3)";
  193. }
  194. elsif($n =~ /^CURLFILETYPE_/) {
  195. return "CURLOPT_CHUNK_BGN_FUNCTION(3)";
  196. }
  197. elsif($n =~ /^CURL_CHUNK_BGN_FUNC_/) {
  198. return "CURLOPT_CHUNK_BGN_FUNCTION(3)";
  199. }
  200. elsif($n =~ /^CURL_CHUNK_END_FUNC_/) {
  201. return "CURLOPT_CHUNK_END_FUNCTION(3)";
  202. }
  203. elsif($n =~ /^CURLSSH_AUTH_/) {
  204. return "CURLOPT_SSH_AUTH_TYPES(3)";
  205. }
  206. elsif($n =~ /^CURL_POLL_/) {
  207. return "CURLMOPT_SOCKETFUNCTION(3)";
  208. }
  209. elsif($n =~ /^CURLMSG_/) {
  210. return "curl_multi_info_read(3)";
  211. }
  212. elsif($n =~ /^CURLFTPAUTH_/) {
  213. return "CURLOPT_FTPSSLAUTH(3)";
  214. }
  215. elsif($n =~ /^CURLFTPMETHOD_/) {
  216. return "CURLOPT_FTP_FILEMETHOD(3)";
  217. }
  218. elsif($n =~ /^CURLFTPSSL_/) {
  219. return "CURLOPT_USE_SSL(3)";
  220. }
  221. elsif($n =~ /^CURLFTP_CREATE_/) {
  222. return "CURLOPT_FTP_CREATE_MISSING_DIRS(3)";
  223. }
  224. elsif($n =~ /^CURLGSSAPI_DELEGATION_/) {
  225. return "CURLOPT_GSSAPI_DELEGATION(3)";
  226. }
  227. elsif($n =~ /^CURLHEADER_/) {
  228. return "CURLOPT_HEADEROPT(3)";
  229. }
  230. elsif($n =~ /^CURLHSTS_/) {
  231. return "CURLOPT_HSTS_CTRL(3)";
  232. }
  233. elsif($n =~ /^CURLIOCMD_/) {
  234. return "CURLOPT_IOCTLFUNCTION(3)";
  235. }
  236. elsif($n =~ /^CURLIOE_/) {
  237. return "CURLOPT_IOCTLFUNCTION(3)";
  238. }
  239. elsif($n =~ /^CURLMIMEOPT_/) {
  240. return "CURLOPT_MIME_OPTIONS(3)";
  241. }
  242. elsif($n =~ /^CURLPAUSE_/) {
  243. return "curl_easy_pause(3)";
  244. }
  245. elsif($n =~ /^CURLPIPE_/) {
  246. return "CURLMOPT_PIPELINING(3)";
  247. }
  248. elsif($n =~ /^CURLSOCKTYPE_/) {
  249. return "CURLOPT_SOCKOPTFUNCTION(3)";
  250. }
  251. elsif($n =~ /^CURLSTS_/) {
  252. return "CURLOPT_HSTSREADFUNCTION(3)";
  253. }
  254. elsif($n =~ /^CURLUSESSL_/) {
  255. return "CURLOPT_USE_SSL(3)";
  256. }
  257. elsif($n =~ /^CURL_CSELECT_/) {
  258. return "curl_multi_socket_action(3)";
  259. }
  260. elsif($n =~ /^CURL_FNMATCHFUNC_/) {
  261. return "CURLOPT_FNMATCH_FUNCTION(3)";
  262. }
  263. elsif($n =~ /^CURL_HET_/) {
  264. return "CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS(3)";
  265. }
  266. elsif($n =~ /^CURL_IPRESOLVE_/) {
  267. return "CURLOPT_IPRESOLVE(3)";
  268. }
  269. elsif($n =~ /^CURL_SEEKFUNC_/) {
  270. return "CURLOPT_SEEKFUNCTION(3)";
  271. }
  272. elsif($n =~ /^CURL_TIMECOND_/) {
  273. return "CURLOPT_TIMECONDITION(3)";
  274. }
  275. elsif($n =~ /^CURL_REDIR_POST_/) {
  276. return "CURLOPT_POSTREDIR(3)";
  277. }
  278. }
  279. while(<STDIN>) {
  280. if($_ =~ /^(CURL[A-Z0-9_.]*) *(.*)/i) {
  281. my ($symbol, $rest)=($1,$2);
  282. my ($intro, $dep, $rem);
  283. if($rest =~ s/^([0-9.]*) *//) {
  284. $intro = $1;
  285. }
  286. if($rest =~ s/^([0-9.]*) *//) {
  287. $dep = $1;
  288. }
  289. if($rest =~ s/^- *([0-9.]*)//) {
  290. $rem = $1;
  291. }
  292. print "\n## $symbol\nIntroduced in $intro.";
  293. if($dep) {
  294. print " Deprecated since $dep.";
  295. }
  296. if($rem) {
  297. print " Last used in $rem.";
  298. }
  299. my $see = $rem || $dep ? "" : nameref($symbol);
  300. if($see) {
  301. print " See $see.";
  302. }
  303. print "\n";
  304. }
  305. }