Variable arguments are a string pointer and a CCSID (unsigned int) for
options:
CURLOPT_ABSTRACT_UNIX_SOCKET
+ CURLOPT_ACCEPT_ENCODING
CURLOPT_ALTSVC
CURLOPT_AWS_SIGV4
CURLOPT_CAINFO
CURLOPT_COOKIEFILE
CURLOPT_COOKIEJAR
CURLOPT_COOKIELIST
- CURLOPT_COPYPOSTFIELDS
CURLOPT_CRLFILE
CURLOPT_CUSTOMREQUEST
CURLOPT_DEFAULT_PROTOCOL
+ CURLOPT_DNS_INTERFACE
+ CURLOPT_DNS_LOCAL_IP4
+ CURLOPT_DNS_LOCAL_IP6
CURLOPT_DNS_SERVERS
CURLOPT_DOH_URL
CURLOPT_EGDSOCKET
- CURLOPT_ENCODING
CURLOPT_FTPPORT
CURLOPT_FTP_ACCOUNT
CURLOPT_FTP_ALTERNATIVE_TO_USER
+ CURLOPT_HAPROXY_CLIENT_IP
CURLOPT_HSTS
CURLOPT_INTERFACE
CURLOPT_ISSUERCERT
CURLOPT_PROXY_CAINFO
CURLOPT_PROXY_CAPATH
CURLOPT_PROXY_CRLFILE
+ CURLOPT_PROXY_ISSUERCERT
CURLOPT_PROXY_KEYPASSWD
CURLOPT_PROXY_PINNEDPUBLICKEY
CURLOPT_PROXY_SERVICE_NAME
CURLOPT_REDIR_PROTOCOLS_STR
CURLOPT_REFERER
CURLOPT_REQUEST_TARGET
- CURLOPT_RTSP_SESSION_UID
+ CURLOPT_RTSP_SESSION_ID
CURLOPT_RTSP_STREAM_URI
CURLOPT_RTSP_TRANSPORT
CURLOPT_SASL_AUTHZID
CURLOPT_SSLKEY
CURLOPT_SSLKEYTYPE
CURLOPT_SSL_CIPHER_LIST
+ CURLOPT_SSL_EC_CURVES
CURLOPT_TLS13_CIPHERS
CURLOPT_TLSAUTH_PASSWORD
CURLOPT_TLSAUTH_TYPE
_ curl_formadd_ccsid()
In the variable argument list, string pointers should be followed by a (long)
CCSID for the following options:
- CURLFORM_FILENAME
- CURLFORM_CONTENTTYPE
CURLFORM_BUFFER
- CURLFORM_FILE
- CURLFORM_FILECONTENT
+ CURLFORM_CONTENTTYPE
CURLFORM_COPYCONTENTS
CURLFORM_COPYNAME
+ CURLFORM_FILE
+ CURLFORM_FILECONTENT
+ CURLFORM_FILENAME
CURLFORM_PTRNAME
If taken from an argument array, an additional array entry must follow each
entry containing one of the above option. This additional entry holds the CCSID
The following options are followed by a 'char * *' and a CCSID. Unlike
curl_easy_getinfo(), the value returned in the pointer should be released with
curl_free() after use:
- CURLINFO_EFFECTIVE_URL
CURLINFO_CONTENT_TYPE
+ CURLINFO_EFFECTIVE_URL
CURLINFO_FTP_ENTRY_PATH
+ CURLINFO_LOCAL_IP
+ CURLINFO_PRIMARY_IP
CURLINFO_REDIRECT_URL
CURLINFO_REFERER
- CURLINFO_PRIMARY_IP
CURLINFO_RTSP_SESSION_ID
- CURLINFO_LOCAL_IP
CURLINFO_SCHEME
Likewise, the following options are followed by a struct curl_slist * * and a
CCSID.
- CURLINFO_SSL_ENGINES
CURLINFO_COOKIELIST
+ CURLINFO_SSL_ENGINES
Lists returned should be released with curl_slist_free_all() after use.
Option CURLINFO_CERTINFO is followed by a struct curl_certinfo * * and a
CCSID. Returned structures should be freed with curl_certinfo_free_all()
switch(tag) {
+ /* BEGIN TRANSLATABLE STRING OPTIONS */
+ /* Keep option symbols in alphanumeric order and retain the BEGIN/END
+ armor comments. */
case CURLOPT_ABSTRACT_UNIX_SOCKET:
+ case CURLOPT_ACCEPT_ENCODING:
case CURLOPT_ALTSVC:
case CURLOPT_AWS_SIGV4:
case CURLOPT_CAINFO:
case CURLOPT_CRLFILE:
case CURLOPT_CUSTOMREQUEST:
case CURLOPT_DEFAULT_PROTOCOL:
- case CURLOPT_DNS_SERVERS:
case CURLOPT_DNS_INTERFACE:
case CURLOPT_DNS_LOCAL_IP4:
case CURLOPT_DNS_LOCAL_IP6:
+ case CURLOPT_DNS_SERVERS:
case CURLOPT_DOH_URL:
case CURLOPT_EGDSOCKET:
- case CURLOPT_ENCODING:
case CURLOPT_FTPPORT:
case CURLOPT_FTP_ACCOUNT:
case CURLOPT_FTP_ALTERNATIVE_TO_USER:
+ case CURLOPT_HAPROXY_CLIENT_IP:
case CURLOPT_HSTS:
case CURLOPT_INTERFACE:
case CURLOPT_ISSUERCERT:
case CURLOPT_PROXY_CAINFO:
case CURLOPT_PROXY_CAPATH:
case CURLOPT_PROXY_CRLFILE:
+ case CURLOPT_PROXY_ISSUERCERT:
case CURLOPT_PROXY_KEYPASSWD:
case CURLOPT_PROXY_PINNEDPUBLICKEY:
case CURLOPT_PROXY_SERVICE_NAME:
case CURLOPT_USERNAME:
case CURLOPT_USERPWD:
case CURLOPT_XOAUTH2_BEARER:
- case CURLOPT_HAPROXY_CLIENT_IP:
+ /* END TRANSLATABLE STRING OPTIONS */
s = va_arg(arg, char *);
ccsid = va_arg(arg, unsigned int);
--- /dev/null
+#!/usr/bin/env perl
+#***************************************************************************
+# _ _ ____ _
+# Project ___| | | | _ \| |
+# / __| | | | |_) | |
+# | (__| |_| | _ <| |___
+# \___|\___/|_| \_\_____|
+#
+# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
+#
+# This software is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at https://curl.se/docs/copyright.html.
+#
+# You may opt to use, copy, modify, merge, publish, distribute and/or sell
+# copies of the Software, and permit persons to whom the Software is
+# furnished to do so, under the terms of the COPYING file.
+#
+# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+# KIND, either express or implied.
+#
+# SPDX-License-Identifier: curl
+#
+#
+###########################################################################
+#
+# Check the OS/400 translating wrapper properly handles all translatable
+# string options.
+
+use strict;
+use warnings;
+
+my $root=$ARGV[0] || ".";
+my $incdir = "$root/include/curl";
+my $os400dir = "$root/packages/OS400";
+my $errcount = 0;
+
+# Scan header file for string option definitions.
+sub scan_header {
+ my ($f)=@_;
+ my $line = "";
+ my $incomment = 0;
+ my @stringopts;
+
+ open(my $h, "<", "$f");
+ while(<$h>) {
+ s/^\s*(.*?)\s*$/$1/; # Trim.
+ # Remove multi-line comment trail.
+ if($incomment) {
+ if($_ !~ /.*?\*\/\s*(.*)$/) {
+ next;
+ }
+ $_ = $1;
+ $incomment = 0;
+ }
+ if($line ne "") {
+ # Unfold line.
+ $_ = "$line $1";
+ $line = "";
+ }
+ if($_ =~ /^(.*)\\$/) {
+ $line = "$1 ";
+ next;
+ }
+ # Remove comments.
+ while($_ =~ /^(.*?)\/\*.*?\*\/(.*)$/) {
+ $_ = "$1 $2";
+ }
+ if($_ =~ /^(.*)\/\*/) {
+ $_ = "$1 ";
+ $incomment = 1;
+ }
+ s/^\s*(.*?)\s*$/$1/; # Trim again.
+ # Ignore preprocessor directives and blank lines.
+ if($_ =~ /^(?:#|$)/) {
+ next;
+ }
+ # Handle lines that may be continued as if they were folded.
+ if($_ !~ /[;,{}]$/ || $_ =~ /[^)],$/) {
+ # Folded line.
+ $line = $_;
+ next;
+ }
+ # Keep string options only.
+ if($_ =~ /CURLOPT(?:DEPRECATED)?\s*\(\s*([^, \t]+)\s*,\s*CURLOPTTYPE_STRINGPOINT/) {
+ push(@stringopts, $1);
+ }
+ }
+ close $h;
+ return @stringopts;
+}
+
+# Scan packages/OS400/ccsidcurl.c for translatable string option cases.
+sub scan_wrapper_for_strings {
+ my ($f)=@_;
+ my $inarmor = 0;
+ my @stringopts;
+
+ open(my $h, "<", "$f");
+ while(<$h>) {
+ if($_ =~ /(BEGIN|END) TRANSLATABLE STRING OPTIONS/) {
+ $inarmor = $1 eq "BEGIN";
+ }
+ elsif($inarmor && $_ =~ /case\s+([^:]+):/) {
+ push(@stringopts, $1);
+ }
+ }
+ close $h;
+ return @stringopts;
+}
+
+# Get tranlatable string options from header file.
+my @stringdefs = scan_header("$incdir/curl.h");
+
+# Get translated string options.
+my @stringrefs = scan_wrapper_for_strings("$os400dir/ccsidcurl.c");
+
+# Lists should be equal: check differences.
+my %diff;
+@diff{@stringdefs} = 0..$#stringdefs;
+delete @diff{@stringrefs};
+
+foreach(keys %diff) {
+ print "$_ is not translated\n";
+ delete $diff{$_};
+ $errcount++;
+}
+
+@diff{@stringrefs} = 0..$#stringrefs;
+delete @diff{@stringdefs};
+
+foreach(keys %diff) {
+ print "translated option $_ does not exist\n";
+ $errcount++;
+}
+
+# Check translated string option cases are sorted alphanumerically.
+foreach(my $i = 1; $i < $#stringrefs; $i++) {
+ if($stringrefs[$i] lt $stringrefs[$i - 1]) {
+ print("Translated string options are not sorted (" . $stringrefs[$i - 1] .
+ "/" . $stringrefs[$i] . ")\n");
+ $errcount++;
+ last;
+ }
+}
+
+exit !!$errcount;