[Feature][ZXW-88]merge P50 version

Only Configure: No
Affected branch: master
Affected module: unknown
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I34667719d9e0e7e29e8e4368848601cde0a48408
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/README.OS400 b/ap/lib/libcurl/curl-7.86.0/packages/OS400/README.OS400
new file mode 100755
index 0000000..e245aff
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/README.OS400
@@ -0,0 +1,352 @@
+
+Implementation notes:
+
+  This is a true OS/400 implementation, not a PASE implementation (for PASE,
+use AIX implementation).
+
+  The biggest problem with OS/400 is EBCDIC. Libcurl implements an internal
+conversion mechanism, but it has been designed for computers that have a
+single native character set. OS/400 default native character set varies
+depending on the country for which it has been localized. And more, a job
+may dynamically alter its "native" character set.
+  Several characters that do not have fixed code in EBCDIC variants are
+used in libcurl strings. As a consequence, using the existing conversion
+mechanism would have lead in a localized binary library - not portable across
+countries.
+  For this reason, and because libcurl was originally designed for ASCII based
+operating systems, the current OS/400 implementation uses ASCII as internal
+character set. This has been accomplished using the QADRT library and
+include files, a C and system procedures ASCII wrapper library. See IBM QADRT
+description for more information.
+  This then results in libcurl being an ASCII library: any function string
+argument is taken/returned in ASCII and a C/C++ calling program built around
+QADRT may use libcurl functions as on any other platform.
+  QADRT does not define ASCII wrappers for all C/system procedures: the
+OS/400 configuration header file and an additional module (os400sys.c) define
+some more of them, that are used by libcurl and that QADRT left out.
+  To support all the different variants of EBCDIC, non-standard wrapper
+procedures have been added to libcurl on OS/400: they provide an additional
+CCSID (numeric Coded Character Set ID specific to OS/400) parameter for each
+string argument. Callback procedures arguments giving access to strings are
+NOT converted, so text gathered this way is (probably !) ASCII.
+
+  Another OS/400 problem comes from the fact that the last fixed argument of a
+vararg procedure may not be of type char, unsigned char, short or unsigned
+short. Enums that are internally implemented by the C compiler as one of these
+types are also forbidden. Libcurl uses enums as vararg procedure tagfields...
+Happily, there is a pragma forcing enums to type "int". The original libcurl
+header files are thus altered during build process to use this pragma, in
+order to force libcurl enums of being type int (the pragma disposition in use
+before inclusion is restored before resuming the including unit compilation).
+
+  Secure socket layer is provided by the IBM GSKit API: unlike other SSL
+implementations, GSKit is based on "certificate stores" or keyrings
+rather than individual certificate/key files. Certificate stores, as well as
+"certificate labels" are managed by external IBM-defined applications.
+  There are two ways to specify an SSL context:
+- By an application identifier.
+- By a keyring file pathname and (optionally) certificate label.
+  To identify an SSL context by application identifier, use option
+SETOPT_SSLCERT to specify the application identifier.
+  To address an SSL context by keyring and certificate label, use CURLOPT_CAINFO
+to set-up the keyring pathname, CURLOPT_SSLCERT to define the certificate label
+(omitting it will cause the default certificate in keyring to be used) and
+CURLOPT_KEYPASSWD to give the keyring password. If SSL is used without
+defining any of these options, the default (i.e.: system) keyring is used for
+server certificate validation.
+
+  Non-standard EBCDIC wrapper prototypes are defined in an additional header
+file: ccsidcurl.h. These should be self-explanatory to an OS/400-aware
+designer. CCSID 0 can be used to select the current job's CCSID.
+  Wrapper procedures with variable arguments are described below:
+
+_ curl_easy_setopt_ccsid()
+  Variable arguments are a string pointer and a CCSID (unsigned int) for
+options:
+        CURLOPT_ABSTRACT_UNIX_SOCKET
+        CURLOPT_ALTSVC
+        CURLOPT_AWS_SIGV4
+        CURLOPT_CAINFO
+        CURLOPT_CAPATH
+        CURLOPT_COOKIE
+        CURLOPT_COOKIEFILE
+        CURLOPT_COOKIEJAR
+        CURLOPT_COOKIELIST
+        CURLOPT_COPYPOSTFIELDS
+        CURLOPT_CRLFILE
+        CURLOPT_CUSTOMREQUEST
+        CURLOPT_DEFAULT_PROTOCOL
+        CURLOPT_DNS_SERVERS
+        CURLOPT_DOH_URL
+        CURLOPT_EGDSOCKET
+        CURLOPT_ENCODING
+        CURLOPT_FTPPORT
+        CURLOPT_FTP_ACCOUNT
+        CURLOPT_FTP_ALTERNATIVE_TO_USER
+        CURLOPT_HSTS
+        CURLOPT_INTERFACE
+        CURLOPT_ISSUERCERT
+        CURLOPT_KEYPASSWD
+        CURLOPT_KRBLEVEL
+        CURLOPT_LOGIN_OPTIONS
+        CURLOPT_MAIL_AUTH
+        CURLOPT_MAIL_FROM
+        CURLOPT_NETRC_FILE
+        CURLOPT_NOPROXY
+        CURLOPT_PASSWORD
+        CURLOPT_PINNEDPUBLICKEY
+        CURLOPT_PRE_PROXY
+        CURLOPT_PROXY
+        CURLOPT_PROXYPASSWORD
+        CURLOPT_PROXYUSERNAME
+        CURLOPT_PROXYUSERPWD
+        CURLOPT_PROXY_CAINFO
+        CURLOPT_PROXY_CAPATH
+        CURLOPT_PROXY_CRLFILE
+        CURLOPT_PROXY_KEYPASSWD
+        CURLOPT_PROXY_PINNEDPUBLICKEY
+        CURLOPT_PROXY_SERVICE_NAME
+        CURLOPT_PROXY_SSLCERT
+        CURLOPT_PROXY_SSLCERTTYPE
+        CURLOPT_PROXY_SSLKEY
+        CURLOPT_PROXY_SSLKEYTYPE
+        CURLOPT_PROXY_SSL_CIPHER_LIST
+        CURLOPT_PROXY_TLS13_CIPHERS
+        CURLOPT_PROXY_TLSAUTH_PASSWORD
+        CURLOPT_PROXY_TLSAUTH_TYPE
+        CURLOPT_PROXY_TLSAUTH_USERNAME
+        CURLOPT_RANDOM_FILE
+        CURLOPT_RANGE
+        CURLOPT_REFERER
+        CURLOPT_REQUEST_TARGET
+        CURLOPT_RTSP_SESSION_UID
+        CURLOPT_RTSP_STREAM_URI
+        CURLOPT_RTSP_TRANSPORT
+        CURLOPT_SASL_AUTHZID
+        CURLOPT_SERVICE_NAME
+        CURLOPT_SOCKS5_GSSAPI_SERVICE
+        CURLOPT_SSH_HOST_PUBLIC_KEY_MD5
+        CURLOPT_SSH_KNOWNHOSTS
+        CURLOPT_SSH_PRIVATE_KEYFILE
+        CURLOPT_SSH_PUBLIC_KEYFILE
+        CURLOPT_SSLCERT
+        CURLOPT_SSLCERTTYPE
+        CURLOPT_SSLENGINE
+        CURLOPT_SSLKEY
+        CURLOPT_SSLKEYTYPE
+        CURLOPT_SSL_CIPHER_LIST
+        CURLOPT_TLS13_CIPHERS
+        CURLOPT_TLSAUTH_PASSWORD
+        CURLOPT_TLSAUTH_TYPE
+        CURLOPT_TLSAUTH_USERNAME
+        CURLOPT_UNIX_SOCKET_PATH
+        CURLOPT_URL
+        CURLOPT_USERAGENT
+        CURLOPT_USERNAME
+        CURLOPT_USERPWD
+        CURLOPT_XOAUTH2_BEARER
+  Else it is the same as for curl_easy_setopt().
+  Note that CURLOPT_ERRORBUFFER is not in the list above, since it gives the
+address of an (empty) character buffer, not the address of a string.
+CURLOPT_POSTFIELDS stores the address of static binary data (of type void *) and
+thus is not converted. If CURLOPT_COPYPOSTFIELDS is issued after
+CURLOPT_POSTFIELDSIZE != -1, the data size is adjusted according to the
+CCSID conversion result length.
+
+_ 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_COPYCONTENTS
+        CURLFORM_COPYNAME
+        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
+in its value field, and the option field is meaningless.
+  It is not possible to have a string pointer and its CCSID across a function
+parameter/array boundary.
+  Please note that CURLFORM_PTRCONTENTS and CURLFORM_BUFFERPTR are considered
+unconvertible strings and thus are NOT followed by a CCSID.
+
+_ curl_easy_getinfo_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_FTP_ENTRY_PATH
+        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
+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()
+after use.
+  Other options are processed like in curl_easy_getinfo().
+
+_ curl_pushheader_bynum_cssid() and curl_pushheader_byname_ccsid()
+  Although the prototypes are self-explanatory, the returned string pointer
+should be released with curl_free() after use, as opposite to the non-ccsid
+versions of these procedures.
+  Please note that HTTP2 is not (yet) implemented on OS/400, thus these
+functions will always return NULL.
+
+_ curl_easy_option_by_name_ccsid() returns a pointer to an untranslated option
+metadata structure. As each curl_easyoption structure holds the option name in
+ASCII, the curl_easy_option_get_name_ccsid() function allows getting it in any
+supported ccsid. However the caller should release the returned pointer with
+curl_free() after use.
+
+
+  Standard compilation environment does support neither autotools nor make;
+in fact, very few common utilities are available. As a consequence, the
+config-os400.h has been coded manually and the compilation scripts are
+a set of shell scripts stored in subdirectory packages/OS400.
+
+  The "curl" command and the test environment are currently not supported on
+OS/400.
+
+
+Protocols currently implemented on OS/400:
+_ DICT
+_ FILE
+_ FTP
+_ FTPS
+_ FTP with secure transmission
+_ GOPHER
+_ HTTP
+_ HTTPS
+_ IMAP
+_ IMAPS
+_ IMAP with secure transmission
+_ LDAP
+_ POP3
+_ POP3S
+_ POP3 with secure transmission
+_ RTSP
+_ SCP if libssh2 is enabled
+_ SFTP if libssh2 is enabled
+_ SMTP
+_ SMTPS
+_ SMTP with secure transmission
+_ TELNET
+_ TFTP
+
+
+
+Compiling on OS/400:
+
+  These instructions targets people who knows about OS/400, compiling, IFS and
+archive extraction. Do not ask questions about these subjects if you're not
+familiar with.
+
+_ As a prerequisite, QADRT development environment must be installed.
+  For more information on downloading and installing the QADRT development kit,
+  please see https://www.ibm.com/support/pages/node/6258183
+_ If data compression has to be supported, ZLIB development environment must
+  be installed.
+_ Likewise, if SCP and SFTP protocols have to be compiled in, LIBSSH2
+  developent environment must be installed.
+_ Install the curl source directory in IFS. Do NOT install it in the
+  installation target directory (which defaults to /curl).
+_ Enter Qshell (QSH, not PASE)
+_ Change current directory to the curl installation directory
+_ Change current directory to ./packages/OS400
+_ Edit file iniscript.sh. You may want to change tunable configuration
+  parameters, like debug info generation, optimization level, listing option,
+  target library, ZLIB/LIBSSH2 availability and location, etc.
+_ Copy any file in the current directory to makelog (i.e.:
+  cp initscript.sh makelog): this is intended to create the makelog file with
+  an ASCII CCSID!
+_ Enter the command "sh makefile.sh > makelog 2>&1"
+_ Examine the makelog file to check for compilation errors.
+
+  Leaving file initscript.sh unchanged, this will produce the following OS/400
+objects:
+_ Library CURL. All other objects will be stored in this library.
+_ Modules for all libcurl units.
+_ Binding directory CURL_A, to be used at calling program link time for
+  statically binding the modules (specify BNDSRVPGM(QADRTTS QGLDCLNT QGLDBRDR)
+  when creating a program using CURL_A).
+_ Service program CURL.<soname>, where <soname> is extracted from the
+  lib/Makefile.am VERSION variable. To be used at calling program run-time
+  when this program has dynamically bound curl at link time.
+_ Binding directory CURL. To be used to dynamically bind libcurl when linking a
+  calling program.
+_ Source file H. It contains all the include members needed to compile a C/C++
+  module using libcurl, and an ILE/RPG /copy member for support in this
+  language.
+_ Standard C/C++ libcurl include members in file H.
+_ CCSIDCURL member in file H. This defines the non-standard EBCDIC wrappers for
+  C and C++.
+_ CURL.INC member in file H. This defines everything needed by an ILE/RPG
+  program using libcurl.
+_ LIBxxx modules and programs. Although the test environment is not supported
+  on OS/400, the libcurl test programs are compiled for manual tests.
+_ IFS directory /curl/include/curl containing the C header files for IFS source
+  C/C++ compilation and curl.inc.rpgle for IFS source ILE/RPG compilation.
+
+
+
+Special programming consideration:
+
+QADRT being used, the following points must be considered:
+_ If static binding is used, service program QADRTTS must be linked too.
+_ The EBCDIC CCSID used by QADRT is 37 by default, NOT THE JOB'S CCSID. If
+  another EBCDIC CCSID is required, it must be set via a locale through a call
+  to setlocale_a (QADRT's setlocale() ASCII wrapper) with category LC_ALL or
+  LC_CTYPE, or by setting environment variable QADRT_ENV_LOCALE to the locale
+  object path before executing the program.
+_ Do not use original source include files unless you know what you are doing.
+  Use the installed members instead (in /QSYS.LIB/CURL.LIB/H.FILE and
+  /curl/include/curl).
+
+
+
+ILE/RPG support:
+
+  Since 95% of the OS/400 programmers use ILE/RPG exclusively, a definition
+  /INCLUDE member is provided for this language. To include all libcurl
+  definitions in an ILE/RPG module, line
+
+     h bnddir('CURL/CURL')
+
+must figure in the program header, and line
+
+     d/include curl/h,curl.inc
+
+in the global data section of the module's source code.
+
+  No vararg procedure support exists in ILE/RPG: for this reason, the following
+considerations apply:
+_ Procedures curl_easy_setopt_long(), curl_easy_setopt_object(),
+  curl_easy_setopt_function() and curl_easy_setopt_offset() are all alias
+  prototypes to curl_easy_setopt(), but with different parameter lists.
+_ Procedures curl_easy_getinfo_string(), curl_easy_getinfo_long(),
+  curl_easy_getinfo_double(), curl_easy_getinfo_slist(),
+  curl_easy_getinfo_ptr(), curl_easy_getinfo_socket() and
+  curl_easy_getinfo_off_t() are all alias prototypes to curl_easy_getinfo(),
+  but with different parameter lists.
+_ Procedures curl_multi_setopt_long(), curl_multi_setopt_object(),
+  curl_multi_setopt_function() and curl_multi_setopt_offset() are all alias
+  prototypes to curl_multi_setopt(), but with different parameter lists.
+_ The prototype of procedure curl_formadd() allows specifying a pointer option
+  and the CURLFORM_END option. This makes possible to use an option array
+  without any additional definition. If some specific incompatible argument
+  list is used in the ILE/RPG program, the latter must define a specialised
+  alias. The same applies to curl_formadd_ccsid() too.
+
+  Since RPG cannot cast a long to a pointer, procedure curl_form_long_value()
+is provided for that purpose: this allows storing a long value in the curl_forms
+array.
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/ccsidcurl.c b/ap/lib/libcurl/curl-7.86.0/packages/OS400/ccsidcurl.c
new file mode 100755
index 0000000..da696ca
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/ccsidcurl.c
@@ -0,0 +1,1462 @@
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2022, 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
+ *
+ *
+ ***************************************************************************/
+
+/* CCSID API wrappers for OS/400. */
+
+#include <iconv.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <errno.h>
+#include <stdarg.h>
+
+#pragma enum(int)
+
+#include "curl.h"
+#include "mprintf.h"
+#include "slist.h"
+#include "urldata.h"
+#include "url.h"
+#include "setopt.h"
+#include "getinfo.h"
+#include "ccsidcurl.h"
+
+#include "os400sys.h"
+
+#ifndef SIZE_MAX
+#define SIZE_MAX        ((size_t) ~0)   /* Is unsigned on OS/400. */
+#endif
+
+
+#define ASCII_CCSID     819     /* Use ISO-8859-1 as ASCII. */
+#define NOCONV_CCSID    65535   /* No conversion. */
+#define ICONV_ID_SIZE   32      /* Size of iconv_open() code identifier. */
+#define ICONV_OPEN_ERROR(t)     ((t).return_value == -1)
+
+#define ALLOC_GRANULE   8       /* Alloc. granule for curl_formadd_ccsid(). */
+
+
+static void
+makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid)
+{
+  /**
+  *** Convert a CCSID to the corresponding IBM iconv_open() character
+  ***  code identifier.
+  ***  This code is specific to the OS400 implementation of the iconv library.
+  ***  CCSID 65535 (no conversion) is replaced by the ASCII CCSID.
+  ***  CCSID 0 is interpreted by the OS400 as the job's CCSID.
+  **/
+
+  ccsid &= 0xFFFF;
+
+  if(ccsid == NOCONV_CCSID)
+    ccsid = ASCII_CCSID;
+
+  memset(buf, 0, ICONV_ID_SIZE);
+  curl_msprintf(buf, "IBMCCSID%05u0000000", ccsid);
+}
+
+
+static iconv_t
+iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin,
+                 unsigned int cstr)
+{
+  char fromcode[ICONV_ID_SIZE];
+  char tocode[ICONV_ID_SIZE];
+
+  /**
+  ***  Like iconv_open(), but character codes are given as CCSIDs.
+  ***  If `cstr' is non-zero, conversion is set up to stop whenever a
+  ***   null character is encountered.
+  ***  See iconv_open() IBM description in "National Language Support API".
+  **/
+
+  makeOS400IconvCode(fromcode, ccsidin);
+  makeOS400IconvCode(tocode, ccsidout);
+  memset(tocode + 13, 0, sizeof(tocode) - 13);   /* Dest. code id format. */
+
+  if(cstr)
+    fromcode[18] = '1';                         /* Set null-terminator flag. */
+
+  return iconv_open(tocode, fromcode);
+}
+
+
+static int
+convert(char *d, size_t dlen, int dccsid,
+        const char *s, int slen, int sccsid)
+{
+  int i;
+  iconv_t cd;
+  size_t lslen;
+
+  /**
+  ***  Convert `sccsid'-coded `slen'-data bytes at `s' into `dccsid'-coded
+  ***   data stored in the `dlen'-byte buffer at `d'.
+  ***  If `slen' < 0, source string is null-terminated.
+  ***  CCSID 65535 (no conversion) is replaced by the ASCII CCSID.
+  ***  Return the converted destination byte count, or -1 if error.
+  **/
+
+  if(sccsid == 65535)
+    sccsid = ASCII_CCSID;
+
+  if(dccsid == 65535)
+    dccsid = ASCII_CCSID;
+
+  if(sccsid == dccsid) {
+    lslen = slen >= 0? slen: strlen(s) + 1;
+    i = lslen < dlen? lslen: dlen;
+
+    if(s != d && i > 0)
+      memcpy(d, s, i);
+
+    return i;
+    }
+
+  if(slen < 0) {
+    lslen = 0;
+    cd = iconv_open_CCSID(dccsid, sccsid, 1);
+    }
+  else {
+    lslen = (size_t) slen;
+    cd = iconv_open_CCSID(dccsid, sccsid, 0);
+    }
+
+  if(ICONV_OPEN_ERROR(cd))
+    return -1;
+
+  i = dlen;
+
+  if((int) iconv(cd, (char * *) &s, &lslen, &d, &dlen) < 0)
+    i = -1;
+  else
+    i -= dlen;
+
+  iconv_close(cd);
+  return i;
+}
+
+
+static char *dynconvert(int dccsid, const char *s, int slen, int sccsid)
+{
+  char *d;
+  char *cp;
+  size_t dlen;
+  int l;
+  static const char nullbyte = 0;
+
+  /* Like convert, but the destination is allocated and returned. */
+
+  dlen = (size_t) (slen < 0? strlen(s): slen) + 1;
+  dlen *= MAX_CONV_EXPANSION;           /* Allow some expansion. */
+  d = malloc(dlen);
+
+  if(!d)
+    return (char *) NULL;
+
+  l = convert(d, dlen, dccsid, s, slen, sccsid);
+
+  if(l < 0) {
+    free(d);
+    return (char *) NULL;
+    }
+
+  if(slen < 0) {
+    /* Need to null-terminate even when source length is given.
+       Since destination code size is unknown, use a conversion to generate
+       terminator. */
+
+    int l2 = convert(d + l, dlen - l, dccsid, &nullbyte, -1, ASCII_CCSID);
+
+    if(l2 < 0) {
+      free(d);
+      return (char *) NULL;
+      }
+
+    l += l2;
+    }
+
+  if((size_t) l < dlen) {
+    cp = realloc(d, l);         /* Shorten to minimum needed. */
+
+    if(cp)
+      d = cp;
+    }
+
+  return d;
+}
+
+
+static struct curl_slist *
+slist_convert(int dccsid, struct curl_slist *from, int sccsid)
+{
+  struct curl_slist *to = (struct curl_slist *) NULL;
+
+  for(; from; from = from->next) {
+    struct curl_slist *nl;
+    char *cp = dynconvert(dccsid, from->data, -1, sccsid);
+
+    if(!cp) {
+      curl_slist_free_all(to);
+      return (struct curl_slist *) NULL;
+    }
+    nl = Curl_slist_append_nodup(to, cp);
+    if(!nl) {
+      curl_slist_free_all(to);
+      free(cp);
+      return NULL;
+    }
+    to = nl;
+  }
+  return to;
+}
+
+
+char *curl_version_ccsid(unsigned int ccsid)
+{
+  int i;
+  char *aversion;
+  char *eversion;
+
+  aversion = curl_version();
+
+  if(!aversion)
+    return aversion;
+
+  i = strlen(aversion) + 1;
+  i *= MAX_CONV_EXPANSION;
+
+  eversion = Curl_thread_buffer(LK_CURL_VERSION, i);
+  if(!eversion)
+    return (char *) NULL;
+
+  if(convert(eversion, i, ccsid, aversion, -1, ASCII_CCSID) < 0)
+    return (char *) NULL;
+
+  return eversion;
+}
+
+
+char *
+curl_easy_escape_ccsid(CURL *handle, const char *string, int length,
+                       unsigned int sccsid, unsigned int dccsid)
+{
+  char *s;
+  char *d;
+
+  if(!string) {
+    errno = EINVAL;
+    return (char *) NULL;
+    }
+
+  s = dynconvert(ASCII_CCSID, string, length? length: -1, sccsid);
+
+  if(!s)
+    return (char *) NULL;
+
+  d = curl_easy_escape(handle, s, 0);
+  free(s);
+
+  if(!d)
+    return (char *) NULL;
+
+  s = dynconvert(dccsid, d, -1, ASCII_CCSID);
+  free(d);
+  return s;
+}
+
+
+char *
+curl_easy_unescape_ccsid(CURL *handle, const char *string, int length,
+                         int *outlength,
+                         unsigned int sccsid, unsigned int dccsid)
+{
+  char *s;
+  char *d;
+
+  if(!string) {
+    errno = EINVAL;
+    return (char *) NULL;
+    }
+
+  s = dynconvert(ASCII_CCSID, string, length? length: -1, sccsid);
+
+  if(!s)
+    return (char *) NULL;
+
+  d = curl_easy_unescape(handle, s, 0, outlength);
+  free(s);
+
+  if(!d)
+    return (char *) NULL;
+
+  s = dynconvert(dccsid, d, -1, ASCII_CCSID);
+  free(d);
+
+  if(s && outlength)
+    *outlength = strlen(s);
+
+  return s;
+}
+
+
+struct curl_slist *
+curl_slist_append_ccsid(struct curl_slist *list,
+                        const char *data, unsigned int ccsid)
+{
+  char *s;
+
+  s = (char *) NULL;
+
+  if(!data)
+    return curl_slist_append(list, data);
+
+  s = dynconvert(ASCII_CCSID, data, -1, ccsid);
+
+  if(!s)
+    return (struct curl_slist *) NULL;
+
+  list = curl_slist_append(list, s);
+  free(s);
+  return list;
+}
+
+
+time_t
+curl_getdate_ccsid(const char *p, const time_t *unused, unsigned int ccsid)
+{
+  char *s;
+  time_t t;
+
+  if(!p)
+    return curl_getdate(p, unused);
+
+  s = dynconvert(ASCII_CCSID, p, -1, ccsid);
+
+  if(!s)
+    return (time_t) -1;
+
+  t = curl_getdate(s, unused);
+  free(s);
+  return t;
+}
+
+
+static int
+convert_version_info_string(const char **stringp,
+                            char **bufp, int *left, unsigned int ccsid)
+{
+  /* Helper for curl_version_info_ccsid(): convert a string if defined.
+     Result is stored in the `*left'-byte buffer at `*bufp'.
+     `*bufp' and `*left' are updated accordingly.
+     Return 0 if ok, else -1. */
+
+  if(*stringp) {
+    int l = convert(*bufp, *left, ccsid, *stringp, -1, ASCII_CCSID);
+
+    if(l <= 0)
+      return -1;
+
+    *stringp = *bufp;
+    *bufp += l;
+    *left -= l;
+    }
+
+  return 0;
+}
+
+
+curl_version_info_data *
+curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid)
+{
+  curl_version_info_data *p;
+  char *cp;
+  int n;
+  int nproto;
+  curl_version_info_data *id;
+  int i;
+  const char **cpp;
+  static const size_t charfields[] = {
+    offsetof(curl_version_info_data, version),
+    offsetof(curl_version_info_data, host),
+    offsetof(curl_version_info_data, ssl_version),
+    offsetof(curl_version_info_data, libz_version),
+    offsetof(curl_version_info_data, ares),
+    offsetof(curl_version_info_data, libidn),
+    offsetof(curl_version_info_data, libssh_version),
+    offsetof(curl_version_info_data, brotli_version),
+    offsetof(curl_version_info_data, nghttp2_version),
+    offsetof(curl_version_info_data, quic_version),
+    offsetof(curl_version_info_data, cainfo),
+    offsetof(curl_version_info_data, capath),
+    offsetof(curl_version_info_data, zstd_version),
+    offsetof(curl_version_info_data, hyper_version),
+    offsetof(curl_version_info_data, gsasl_version)
+  };
+
+  /* The assertion below is possible, because although the second operand
+     is an enum member, the first is a #define. In that case, the OS/400 C
+     compiler seems to compare string values after substitution. */
+
+#if CURLVERSION_NOW != CURLVERSION_TENTH
+#error curl_version_info_data structure has changed: upgrade this procedure.
+#endif
+
+  /* If caller has been compiled with a new version, error. */
+
+  if(stamp > CURLVERSION_NOW)
+    return (curl_version_info_data *) NULL;
+
+  p = curl_version_info(stamp);
+
+  if(!p)
+    return p;
+
+  /* Measure thread space needed. */
+
+  n = 0;
+  nproto = 0;
+
+  if(p->protocols) {
+    while(p->protocols[nproto])
+      n += strlen(p->protocols[nproto++]);
+
+    n += nproto++;
+    }
+
+  for(i = 0; i < sizeof(charfields) / sizeof(charfields[0]); i++) {
+    cpp = (const char **) ((char *) p + charfields[i]);
+    if(*cpp)
+      n += strlen(*cpp) + 1;
+  }
+
+  /* Allocate thread space. */
+
+  n *= MAX_CONV_EXPANSION;
+
+  if(nproto)
+    n += nproto * sizeof(const char *);
+
+  cp = Curl_thread_buffer(LK_VERSION_INFO_DATA, n);
+  id = (curl_version_info_data *) Curl_thread_buffer(LK_VERSION_INFO,
+                                                     sizeof(*id));
+
+  if(!id || !cp)
+    return (curl_version_info_data *) NULL;
+
+  /* Copy data and convert strings. */
+
+  memcpy((char *) id, (char *) p, sizeof(*p));
+
+  if(id->protocols) {
+    int i = nproto * sizeof(id->protocols[0]);
+
+    id->protocols = (const char * const *) cp;
+    memcpy(cp, (char *) p->protocols, i);
+    cp += i;
+    n -= i;
+
+    for(i = 0; id->protocols[i]; i++)
+      if(convert_version_info_string(((const char * *) id->protocols) + i,
+                                      &cp, &n, ccsid))
+        return (curl_version_info_data *) NULL;
+  }
+
+  for(i = 0; i < sizeof(charfields) / sizeof(charfields[0]); i++) {
+    cpp = (const char **) ((char *) p + charfields[i]);
+    if (*cpp && convert_version_info_string(cpp, &cp, &n, ccsid))
+      return (curl_version_info_data *) NULL;
+  }
+
+  return id;
+}
+
+
+const char *
+curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid)
+{
+  int i;
+  const char *s;
+  char *buf;
+
+  s = curl_easy_strerror(error);
+
+  if(!s)
+    return s;
+
+  i = MAX_CONV_EXPANSION * (strlen(s) + 1);
+
+  buf = Curl_thread_buffer(LK_EASY_STRERROR, i);
+  if(!buf)
+    return (const char *) NULL;
+
+  if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
+    return (const char *) NULL;
+
+  return (const char *) buf;
+}
+
+
+const char *
+curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid)
+{
+  int i;
+  const char *s;
+  char *buf;
+
+  s = curl_share_strerror(error);
+
+  if(!s)
+    return s;
+
+  i = MAX_CONV_EXPANSION * (strlen(s) + 1);
+
+  buf = Curl_thread_buffer(LK_SHARE_STRERROR, i);
+  if(!buf)
+    return (const char *) NULL;
+
+  if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
+    return (const char *) NULL;
+
+  return (const char *) buf;
+}
+
+
+const char *
+curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid)
+{
+  int i;
+  const char *s;
+  char *buf;
+
+  s = curl_multi_strerror(error);
+
+  if(!s)
+    return s;
+
+  i = MAX_CONV_EXPANSION * (strlen(s) + 1);
+
+  buf = Curl_thread_buffer(LK_MULTI_STRERROR, i);
+  if(!buf)
+    return (const char *) NULL;
+
+  if(convert(buf, i, ccsid, s, -1, ASCII_CCSID) < 0)
+    return (const char *) NULL;
+
+  return (const char *) buf;
+}
+
+
+void
+curl_certinfo_free_all(struct curl_certinfo *info)
+{
+  /* Free all memory used by certificate info. */
+  if(info) {
+    if(info->certinfo) {
+      int i;
+
+      for(i = 0; i < info->num_of_certs; i++)
+        curl_slist_free_all(info->certinfo[i]);
+      free((char *) info->certinfo);
+    }
+    free((char *) info);
+  }
+}
+
+
+CURLcode
+curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...)
+{
+  va_list arg;
+  void *paramp;
+  CURLcode ret;
+  struct Curl_easy *data;
+
+  /* WARNING: unlike curl_easy_getinfo(), the strings returned by this
+     procedure have to be free'ed. */
+
+  data = (struct Curl_easy *) curl;
+  va_start(arg, info);
+  paramp = va_arg(arg, void *);
+  ret = Curl_getinfo(data, info, paramp);
+
+  if(ret == CURLE_OK) {
+    unsigned int ccsid;
+    char **cpp;
+    struct curl_slist **slp;
+    struct curl_certinfo *cipf;
+    struct curl_certinfo *cipt;
+
+    switch((int) info & CURLINFO_TYPEMASK) {
+
+    case CURLINFO_STRING:
+      ccsid = va_arg(arg, unsigned int);
+      cpp = (char * *) paramp;
+
+      if(*cpp) {
+        *cpp = dynconvert(ccsid, *cpp, -1, ASCII_CCSID);
+
+        if(!*cpp)
+          ret = CURLE_OUT_OF_MEMORY;
+      }
+
+      break;
+
+    case CURLINFO_SLIST:
+      ccsid = va_arg(arg, unsigned int);
+      switch(info) {
+      case CURLINFO_CERTINFO:
+        cipf = *(struct curl_certinfo * *) paramp;
+        if(cipf) {
+          cipt = (struct curl_certinfo *) malloc(sizeof(*cipt));
+          if(!cipt)
+            ret = CURLE_OUT_OF_MEMORY;
+          else {
+            cipt->certinfo = (struct curl_slist **)
+              calloc(cipf->num_of_certs +
+                     1, sizeof(struct curl_slist *));
+            if(!cipt->certinfo)
+              ret = CURLE_OUT_OF_MEMORY;
+            else {
+              int i;
+
+              cipt->num_of_certs = cipf->num_of_certs;
+              for(i = 0; i < cipf->num_of_certs; i++)
+                if(cipf->certinfo[i])
+                  if(!(cipt->certinfo[i] = slist_convert(ccsid,
+                                                          cipf->certinfo[i],
+                                                          ASCII_CCSID))) {
+                    ret = CURLE_OUT_OF_MEMORY;
+                    break;
+                  }
+              }
+            }
+
+          if(ret != CURLE_OK) {
+            curl_certinfo_free_all(cipt);
+            cipt = (struct curl_certinfo *) NULL;
+          }
+
+          *(struct curl_certinfo * *) paramp = cipt;
+        }
+
+        break;
+
+      case CURLINFO_TLS_SESSION:
+      case CURLINFO_TLS_SSL_PTR:
+      case CURLINFO_SOCKET:
+        break;
+
+      default:
+        slp = (struct curl_slist **) paramp;
+        if(*slp) {
+          *slp = slist_convert(ccsid, *slp, ASCII_CCSID);
+          if(!*slp)
+            ret = CURLE_OUT_OF_MEMORY;
+        }
+        break;
+      }
+    }
+  }
+
+  va_end(arg);
+  return ret;
+}
+
+
+static int
+Curl_is_formadd_string(CURLformoption option)
+{
+  switch(option) {
+
+  case CURLFORM_FILENAME:
+  case CURLFORM_CONTENTTYPE:
+  case CURLFORM_BUFFER:
+  case CURLFORM_FILE:
+  case CURLFORM_FILECONTENT:
+  case CURLFORM_COPYCONTENTS:
+  case CURLFORM_COPYNAME:
+    return 1;
+  }
+
+  return 0;
+}
+
+
+static void
+Curl_formadd_release_local(struct curl_forms *forms, int nargs, int skip)
+{
+  while(nargs--)
+    if(nargs != skip)
+      if(Curl_is_formadd_string(forms[nargs].option))
+        if(forms[nargs].value)
+          free((char *) forms[nargs].value);
+
+  free((char *) forms);
+}
+
+
+static int
+Curl_formadd_convert(struct curl_forms *forms,
+                     int formx, int lengthx, unsigned int ccsid)
+{
+  int l;
+  char *cp;
+  char *cp2;
+
+  if(formx < 0 || !forms[formx].value)
+    return 0;
+
+  if(lengthx >= 0)
+    l = (int) forms[lengthx].value;
+  else
+    l = strlen(forms[formx].value) + 1;
+
+  cp = malloc(MAX_CONV_EXPANSION * l);
+
+  if(!cp)
+    return -1;
+
+  l = convert(cp, MAX_CONV_EXPANSION * l, ASCII_CCSID,
+              forms[formx].value, l, ccsid);
+
+  if(l < 0) {
+    free(cp);
+    return -1;
+    }
+
+  cp2 = realloc(cp, l);         /* Shorten buffer to the string size. */
+
+  if(cp2)
+    cp = cp2;
+
+  forms[formx].value = cp;
+
+  if(lengthx >= 0)
+    forms[lengthx].value = (char *) l;  /* Update length after conversion. */
+
+  return l;
+}
+
+
+CURLFORMcode
+curl_formadd_ccsid(struct curl_httppost **httppost,
+                   struct curl_httppost **last_post, ...)
+{
+  va_list arg;
+  CURLformoption option;
+  CURLFORMcode result;
+  struct curl_forms *forms;
+  struct curl_forms *lforms;
+  struct curl_forms *tforms;
+  unsigned int lformlen;
+  const char *value;
+  unsigned int ccsid;
+  int nargs;
+  int namex;
+  int namelengthx;
+  int contentx;
+  int lengthx;
+  unsigned int contentccsid;
+  unsigned int nameccsid;
+
+  /* A single curl_formadd() call cannot be split in several calls to deal
+     with all parameters: the original parameters are thus copied to a local
+     curl_forms array and converted to ASCII when needed.
+     CURLFORM_PTRNAME is processed as if it were CURLFORM_COPYNAME.
+     CURLFORM_COPYNAME and CURLFORM_NAMELENGTH occurrence order in
+     parameters is not defined; for this reason, the actual conversion is
+     delayed to the end of parameter processing. The same applies to
+     CURLFORM_COPYCONTENTS/CURLFORM_CONTENTSLENGTH, but these may appear
+     several times in the parameter list; the problem resides here in knowing
+     which CURLFORM_CONTENTSLENGTH applies to which CURLFORM_COPYCONTENTS and
+     when we can be sure to have both info for conversion: end of parameter
+     list is such a point, but CURLFORM_CONTENTTYPE is also used here as a
+     natural separator between content data definitions; this seems to be
+     in accordance with FormAdd() behavior. */
+
+  /* Allocate the local curl_forms array. */
+
+  lformlen = ALLOC_GRANULE;
+  lforms = malloc(lformlen * sizeof(*lforms));
+
+  if(!lforms)
+    return CURL_FORMADD_MEMORY;
+
+  /* Process the arguments, copying them into local array, latching conversion
+     indexes and converting when needed. */
+
+  result = CURL_FORMADD_OK;
+  nargs = 0;
+  contentx = -1;
+  lengthx = -1;
+  namex = -1;
+  namelengthx = -1;
+  forms = (struct curl_forms *) NULL;
+  va_start(arg, last_post);
+
+  for(;;) {
+    /* Make sure there is still room for an item in local array. */
+
+    if(nargs >= lformlen) {
+      lformlen += ALLOC_GRANULE;
+      tforms = realloc(lforms, lformlen * sizeof(*lforms));
+
+      if(!tforms) {
+        result = CURL_FORMADD_MEMORY;
+        break;
+        }
+
+      lforms = tforms;
+      }
+
+    /* Get next option. */
+
+    if(forms) {
+      /* Get option from array. */
+
+      option = forms->option;
+      value = forms->value;
+      forms++;
+      }
+    else {
+      /* Get option from arguments. */
+
+      option = va_arg(arg, CURLformoption);
+
+      if(option == CURLFORM_END)
+        break;
+      }
+
+    /* Dispatch by option. */
+
+    switch(option) {
+
+    case CURLFORM_END:
+      forms = (struct curl_forms *) NULL;       /* Leave array mode. */
+      continue;
+
+    case CURLFORM_ARRAY:
+      if(!forms) {
+        forms = va_arg(arg, struct curl_forms *);
+        continue;
+        }
+
+      result = CURL_FORMADD_ILLEGAL_ARRAY;
+      break;
+
+    case CURLFORM_COPYNAME:
+      option = CURLFORM_PTRNAME;                /* Static for now. */
+
+    case CURLFORM_PTRNAME:
+      if(namex >= 0)
+        result = CURL_FORMADD_OPTION_TWICE;
+
+      namex = nargs;
+
+      if(!forms) {
+        value = va_arg(arg, char *);
+        nameccsid = (unsigned int) va_arg(arg, long);
+        }
+      else {
+        nameccsid = (unsigned int) forms->value;
+        forms++;
+        }
+
+      break;
+
+    case CURLFORM_COPYCONTENTS:
+      if(contentx >= 0)
+        result = CURL_FORMADD_OPTION_TWICE;
+
+      contentx = nargs;
+
+      if(!forms) {
+        value = va_arg(arg, char *);
+        contentccsid = (unsigned int) va_arg(arg, long);
+        }
+      else {
+        contentccsid = (unsigned int) forms->value;
+        forms++;
+        }
+
+      break;
+
+    case CURLFORM_PTRCONTENTS:
+    case CURLFORM_BUFFERPTR:
+      if(!forms)
+        value = va_arg(arg, char *);            /* No conversion. */
+
+      break;
+
+    case CURLFORM_CONTENTSLENGTH:
+      lengthx = nargs;
+
+      if(!forms)
+        value = (char *) va_arg(arg, long);
+
+      break;
+
+    case CURLFORM_CONTENTLEN:
+      lengthx = nargs;
+
+      if(!forms)
+        value = (char *) va_arg(arg, curl_off_t);
+
+      break;
+
+    case CURLFORM_NAMELENGTH:
+      namelengthx = nargs;
+
+      if(!forms)
+        value = (char *) va_arg(arg, long);
+
+      break;
+
+    case CURLFORM_BUFFERLENGTH:
+      if(!forms)
+        value = (char *) va_arg(arg, long);
+
+      break;
+
+    case CURLFORM_CONTENTHEADER:
+      if(!forms)
+        value = (char *) va_arg(arg, struct curl_slist *);
+
+      break;
+
+    case CURLFORM_STREAM:
+      if(!forms)
+        value = (char *) va_arg(arg, void *);
+
+      break;
+
+    case CURLFORM_CONTENTTYPE:
+      /* If a previous content has been encountered, convert it now. */
+
+      if(Curl_formadd_convert(lforms, contentx, lengthx, contentccsid) < 0) {
+        result = CURL_FORMADD_MEMORY;
+        break;
+        }
+
+      contentx = -1;
+      lengthx = -1;
+      /* Fall into default. */
+
+    default:
+      /* Must be a convertible string. */
+
+      if(!Curl_is_formadd_string(option)) {
+        result = CURL_FORMADD_UNKNOWN_OPTION;
+        break;
+        }
+
+      if(!forms) {
+        value = va_arg(arg, char *);
+        ccsid = (unsigned int) va_arg(arg, long);
+        }
+      else {
+        ccsid = (unsigned int) forms->value;
+        forms++;
+        }
+
+      /* Do the conversion. */
+
+      lforms[nargs].value = value;
+
+      if(Curl_formadd_convert(lforms, nargs, -1, ccsid) < 0) {
+        result = CURL_FORMADD_MEMORY;
+        break;
+        }
+
+      value = lforms[nargs].value;
+      }
+
+    if(result != CURL_FORMADD_OK)
+      break;
+
+    lforms[nargs].value = value;
+    lforms[nargs++].option = option;
+    }
+
+  va_end(arg);
+
+  /* Convert the name and the last content, now that we know their lengths. */
+
+  if(result == CURL_FORMADD_OK && namex >= 0) {
+    if(Curl_formadd_convert(lforms, namex, namelengthx, nameccsid) < 0)
+      result = CURL_FORMADD_MEMORY;
+    else
+      lforms[namex].option = CURLFORM_COPYNAME;         /* Force copy. */
+    }
+
+  if(result == CURL_FORMADD_OK) {
+    if(Curl_formadd_convert(lforms, contentx, lengthx, contentccsid) < 0)
+      result = CURL_FORMADD_MEMORY;
+    else
+      contentx = -1;
+    }
+
+  /* Do the formadd with our converted parameters. */
+
+  if(result == CURL_FORMADD_OK) {
+    lforms[nargs].option = CURLFORM_END;
+    result = curl_formadd(httppost, last_post,
+                          CURLFORM_ARRAY, lforms, CURLFORM_END);
+    }
+
+  /* Terminate. */
+
+  Curl_formadd_release_local(lforms, nargs, contentx);
+  return result;
+}
+
+
+struct cfcdata {
+  curl_formget_callback append;
+  void *                arg;
+  unsigned int          ccsid;
+};
+
+
+static size_t
+Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len)
+{
+  struct cfcdata *p;
+  char *b;
+  int l;
+  size_t ret;
+
+  p = (struct cfcdata *) arg;
+
+  if((long) len <= 0)
+    return (*p->append)(p->arg, buf, len);
+
+  b = malloc(MAX_CONV_EXPANSION * len);
+
+  if(!b)
+    return (size_t) -1;
+
+  l = convert(b, MAX_CONV_EXPANSION * len, p->ccsid, buf, len, ASCII_CCSID);
+
+  if(l < 0) {
+    free(b);
+    return (size_t) -1;
+    }
+
+  ret = (*p->append)(p->arg, b, l);
+  free(b);
+  return ret == l? len: -1;
+}
+
+
+int
+curl_formget_ccsid(struct curl_httppost *form, void *arg,
+                   curl_formget_callback append, unsigned int ccsid)
+{
+  struct cfcdata lcfc;
+
+  lcfc.append = append;
+  lcfc.arg = arg;
+  lcfc.ccsid = ccsid;
+  return curl_formget(form, (void *) &lcfc, Curl_formget_callback_ccsid);
+}
+
+
+CURLcode
+curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...)
+{
+  CURLcode result;
+  va_list arg;
+  struct Curl_easy *data;
+  char *s;
+  char *cp;
+  unsigned int ccsid;
+  curl_off_t pfsize;
+
+  data = (struct Curl_easy *) curl;
+  va_start(arg, tag);
+
+  switch(tag) {
+
+  case CURLOPT_ABSTRACT_UNIX_SOCKET:
+  case CURLOPT_ALTSVC:
+  case CURLOPT_AWS_SIGV4:
+  case CURLOPT_CAINFO:
+  case CURLOPT_CAPATH:
+  case CURLOPT_COOKIE:
+  case CURLOPT_COOKIEFILE:
+  case CURLOPT_COOKIEJAR:
+  case CURLOPT_COOKIELIST:
+  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_DOH_URL:
+  case CURLOPT_EGDSOCKET:
+  case CURLOPT_ENCODING:
+  case CURLOPT_FTPPORT:
+  case CURLOPT_FTP_ACCOUNT:
+  case CURLOPT_FTP_ALTERNATIVE_TO_USER:
+  case CURLOPT_HSTS:
+  case CURLOPT_INTERFACE:
+  case CURLOPT_ISSUERCERT:
+  case CURLOPT_KEYPASSWD:
+  case CURLOPT_KRBLEVEL:
+  case CURLOPT_LOGIN_OPTIONS:
+  case CURLOPT_MAIL_AUTH:
+  case CURLOPT_MAIL_FROM:
+  case CURLOPT_NETRC_FILE:
+  case CURLOPT_NOPROXY:
+  case CURLOPT_PASSWORD:
+  case CURLOPT_PINNEDPUBLICKEY:
+  case CURLOPT_PRE_PROXY:
+  case CURLOPT_PROXY:
+  case CURLOPT_PROXYPASSWORD:
+  case CURLOPT_PROXYUSERNAME:
+  case CURLOPT_PROXYUSERPWD:
+  case CURLOPT_PROXY_CAINFO:
+  case CURLOPT_PROXY_CAPATH:
+  case CURLOPT_PROXY_CRLFILE:
+  case CURLOPT_PROXY_KEYPASSWD:
+  case CURLOPT_PROXY_PINNEDPUBLICKEY:
+  case CURLOPT_PROXY_SERVICE_NAME:
+  case CURLOPT_PROXY_SSLCERT:
+  case CURLOPT_PROXY_SSLCERTTYPE:
+  case CURLOPT_PROXY_SSLKEY:
+  case CURLOPT_PROXY_SSLKEYTYPE:
+  case CURLOPT_PROXY_SSL_CIPHER_LIST:
+  case CURLOPT_PROXY_TLS13_CIPHERS:
+  case CURLOPT_PROXY_TLSAUTH_PASSWORD:
+  case CURLOPT_PROXY_TLSAUTH_TYPE:
+  case CURLOPT_PROXY_TLSAUTH_USERNAME:
+  case CURLOPT_RANDOM_FILE:
+  case CURLOPT_RANGE:
+  case CURLOPT_REFERER:
+  case CURLOPT_REQUEST_TARGET:
+  case CURLOPT_RTSP_SESSION_ID:
+  case CURLOPT_RTSP_STREAM_URI:
+  case CURLOPT_RTSP_TRANSPORT:
+  case CURLOPT_SASL_AUTHZID:
+  case CURLOPT_SERVICE_NAME:
+  case CURLOPT_SOCKS5_GSSAPI_SERVICE:
+  case CURLOPT_SSH_HOST_PUBLIC_KEY_MD5:
+  case CURLOPT_SSH_KNOWNHOSTS:
+  case CURLOPT_SSH_PRIVATE_KEYFILE:
+  case CURLOPT_SSH_PUBLIC_KEYFILE:
+  case CURLOPT_SSLCERT:
+  case CURLOPT_SSLCERTTYPE:
+  case CURLOPT_SSLENGINE:
+  case CURLOPT_SSLKEY:
+  case CURLOPT_SSLKEYTYPE:
+  case CURLOPT_SSL_CIPHER_LIST:
+  case CURLOPT_SSL_EC_CURVES:
+  case CURLOPT_TLS13_CIPHERS:
+  case CURLOPT_TLSAUTH_PASSWORD:
+  case CURLOPT_TLSAUTH_TYPE:
+  case CURLOPT_TLSAUTH_USERNAME:
+  case CURLOPT_UNIX_SOCKET_PATH:
+  case CURLOPT_URL:
+  case CURLOPT_USERAGENT:
+  case CURLOPT_USERNAME:
+  case CURLOPT_USERPWD:
+  case CURLOPT_XOAUTH2_BEARER:
+    s = va_arg(arg, char *);
+    ccsid = va_arg(arg, unsigned int);
+
+    if(s) {
+      s = dynconvert(ASCII_CCSID, s, -1, ccsid);
+
+      if(!s) {
+        result = CURLE_OUT_OF_MEMORY;
+        break;
+      }
+    }
+
+    result = curl_easy_setopt(curl, tag, s);
+    free(s);
+    break;
+
+  case CURLOPT_COPYPOSTFIELDS:
+    /* Special case: byte count may have been given by CURLOPT_POSTFIELDSIZE
+       prior to this call. In this case, convert the given byte count and
+       replace the length according to the conversion result. */
+    s = va_arg(arg, char *);
+    ccsid = va_arg(arg, unsigned int);
+
+    pfsize = data->set.postfieldsize;
+
+    if(!s || !pfsize || ccsid == NOCONV_CCSID || ccsid == ASCII_CCSID) {
+      result = curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, s);
+      break;
+    }
+
+    if(pfsize == -1) {
+      /* Data is null-terminated. */
+      s = dynconvert(ASCII_CCSID, s, -1, ccsid);
+
+      if(!s) {
+        result = CURLE_OUT_OF_MEMORY;
+        break;
+        }
+      }
+    else {
+      /* Data length specified. */
+      size_t len;
+
+      if(pfsize < 0 || pfsize > SIZE_MAX) {
+        result = CURLE_OUT_OF_MEMORY;
+        break;
+      }
+
+      len = pfsize;
+      pfsize = len * MAX_CONV_EXPANSION;
+
+      if(pfsize > SIZE_MAX)
+        pfsize = SIZE_MAX;
+
+      cp = malloc(pfsize);
+
+      if(!cp) {
+        result = CURLE_OUT_OF_MEMORY;
+        break;
+      }
+
+      pfsize = convert(cp, pfsize, ASCII_CCSID, s, len, ccsid);
+
+      if(pfsize < 0) {
+        free(cp);
+        result = CURLE_OUT_OF_MEMORY;
+        break;
+      }
+
+      data->set.postfieldsize = pfsize;         /* Replace data size. */
+      s = cp;
+    }
+
+    result = curl_easy_setopt(curl, CURLOPT_POSTFIELDS, s);
+    data->set.str[STRING_COPYPOSTFIELDS] = s;   /* Give to library. */
+    break;
+
+  case CURLOPT_ERRORBUFFER:                     /* This is an output buffer. */
+  default:
+    result = Curl_vsetopt(curl, tag, arg);
+    break;
+  }
+
+  va_end(arg);
+  return result;
+}
+
+
+char *
+curl_form_long_value(long value)
+{
+  /* ILE/RPG cannot cast an integer to a pointer. This procedure does it. */
+
+  return (char *) value;
+}
+
+
+char *
+curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
+                            size_t num, unsigned int ccsid)
+{
+  char *d = (char *) NULL;
+  char *s = curl_pushheader_bynum(h, num);
+
+  if(s)
+    d = dynconvert(ccsid, s, -1, ASCII_CCSID);
+
+  return d;
+}
+
+
+char *
+curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header,
+                             unsigned int ccsidin, unsigned int ccsidout)
+{
+  char *d = (char *) NULL;
+
+  if(header) {
+    header = dynconvert(ASCII_CCSID, header, -1, ccsidin);
+
+    if(header) {
+      char *s = curl_pushheader_byname(h, header);
+      free((char *) header);
+
+      if(s)
+        d = dynconvert(ccsidout, s, -1, ASCII_CCSID);
+    }
+  }
+
+  return d;
+}
+
+static CURLcode
+mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid,
+                 CURLcode (*mimefunc)(curl_mimepart *part, const char *string))
+{
+  char *s = (char *) NULL;
+  CURLcode result;
+
+  if(!string)
+    return mimefunc(part, string);
+  s = dynconvert(ASCII_CCSID, string, -1, ccsid);
+  if(!s)
+    return CURLE_OUT_OF_MEMORY;
+
+  result = mimefunc(part, s);
+  free(s);
+  return result;
+}
+
+CURLcode
+curl_mime_name_ccsid(curl_mimepart *part, const char *name, unsigned int ccsid)
+{
+  return mime_string_call(part, name, ccsid, curl_mime_name);
+}
+
+CURLcode
+curl_mime_filename_ccsid(curl_mimepart *part,
+                         const char *filename, unsigned int ccsid)
+{
+  return mime_string_call(part, filename, ccsid, curl_mime_filename);
+}
+
+CURLcode
+curl_mime_type_ccsid(curl_mimepart *part,
+                     const char *mimetype, unsigned int ccsid)
+{
+  return mime_string_call(part, mimetype, ccsid, curl_mime_type);
+}
+
+CURLcode
+curl_mime_encoder_ccsid(curl_mimepart *part,
+                       const char *encoding, unsigned int ccsid)
+{
+  return mime_string_call(part, encoding, ccsid, curl_mime_encoder);
+}
+
+CURLcode
+curl_mime_filedata_ccsid(curl_mimepart *part,
+                         const char *filename, unsigned int ccsid)
+{
+  return mime_string_call(part, filename, ccsid, curl_mime_filedata);
+}
+
+CURLcode
+curl_mime_data_ccsid(curl_mimepart *part,
+                     const char *data, size_t datasize, unsigned int ccsid)
+{
+  char *s = (char *) NULL;
+  CURLcode result;
+
+  if(!data)
+    return curl_mime_data(part, data, datasize);
+  s = dynconvert(ASCII_CCSID, data, datasize, ccsid);
+  if(!s)
+    return CURLE_OUT_OF_MEMORY;
+
+  result = curl_mime_data(part, s, datasize);
+  free(s);
+  return result;
+}
+
+CURLUcode
+curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part,
+                   unsigned int flags, unsigned int ccsid)
+{
+  char *s = (char *)NULL;
+  CURLUcode result;
+
+  if(!part)
+    return CURLUE_BAD_PARTPOINTER;
+
+  *part = (char *)NULL;
+  result = curl_url_get(handle, what, &s, flags);
+  if(result == CURLUE_OK) {
+    if(s) {
+      *part = dynconvert(ccsid, s, -1, ASCII_CCSID);
+      if(!*part)
+        result = CURLUE_OUT_OF_MEMORY;
+    }
+  }
+  if(s)
+    free(s);
+  return result;
+}
+
+CURLUcode
+curl_url_set_ccsid(CURLU *handle, CURLUPart what, const char *part,
+                   unsigned int flags, unsigned int ccsid)
+{
+  char *s = (char *)NULL;
+  CURLUcode result;
+
+  if(part) {
+    s = dynconvert(ASCII_CCSID, part, -1, ccsid);
+    if(!s)
+      return CURLUE_OUT_OF_MEMORY;
+  }
+  result = curl_url_set(handle, what, s, flags);
+  if(s)
+    free(s);
+  return result;
+}
+
+const struct curl_easyoption *
+curl_easy_option_by_name_ccsid(const char *name, unsigned int ccsid)
+{
+  const struct curl_easyoption *option = NULL;
+
+  if(name) {
+    char *s = dynconvert(ASCII_CCSID, name, -1, ccsid);
+
+    if(s) {
+      option = curl_easy_option_by_name(s);
+      free(s);
+    }
+  }
+
+  return option;
+}
+
+/* Return option name in the given ccsid. */
+const char *
+curl_easy_option_get_name_ccsid(const struct curl_easyoption *option,
+                                unsigned int ccsid)
+{
+  char *name = NULL;
+
+  if(option && option->name)
+    name = dynconvert(ccsid, option->name, -1, ASCII_CCSID);
+
+  return (const char *) name;
+}
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/ccsidcurl.h b/ap/lib/libcurl/curl-7.86.0/packages/OS400/ccsidcurl.h
new file mode 100755
index 0000000..9bd2ae7
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/ccsidcurl.h
@@ -0,0 +1,100 @@
+#ifndef CURLINC_CCSIDCURL_H
+#define CURLINC_CCSIDCURL_H
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2022, 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
+ *
+ *
+ ***************************************************************************/
+#include "curl.h"
+#include "easy.h"
+#include "multi.h"
+
+
+CURL_EXTERN char *curl_version_ccsid(unsigned int ccsid);
+CURL_EXTERN char *curl_easy_escape_ccsid(CURL *handle,
+                                         const char *string, int length,
+                                         unsigned int sccsid,
+                                         unsigned int dccsid);
+CURL_EXTERN char *curl_easy_unescape_ccsid(CURL *handle, const char *string,
+                                           int length, int *outlength,
+                                           unsigned int sccsid,
+                                           unsigned int dccsid);
+CURL_EXTERN struct curl_slist *curl_slist_append_ccsid(struct curl_slist *l,
+                                                       const char *data,
+                                                       unsigned int ccsid);
+CURL_EXTERN time_t curl_getdate_ccsid(const char *p, const time_t *unused,
+                                      unsigned int ccsid);
+CURL_EXTERN curl_version_info_data *curl_version_info_ccsid(CURLversion stamp,
+                                                            unsigned int cid);
+CURL_EXTERN const char *curl_easy_strerror_ccsid(CURLcode error,
+                                                 unsigned int ccsid);
+CURL_EXTERN const char *curl_share_strerror_ccsid(CURLSHcode error,
+                                                  unsigned int ccsid);
+CURL_EXTERN const char *curl_multi_strerror_ccsid(CURLMcode error,
+                                                  unsigned int ccsid);
+CURL_EXTERN CURLcode curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...);
+CURL_EXTERN CURLFORMcode curl_formadd_ccsid(struct curl_httppost **httppost,
+                                            struct curl_httppost **last_post,
+                                            ...);
+CURL_EXTERN char *curl_form_long_value(long value);
+CURL_EXTERN int curl_formget_ccsid(struct curl_httppost *form, void *arg,
+                                   curl_formget_callback append,
+                                   unsigned int ccsid);
+CURL_EXTERN CURLcode curl_easy_setopt_ccsid(CURL *curl, CURLoption tag, ...);
+CURL_EXTERN void curl_certinfo_free_all(struct curl_certinfo *info);
+CURL_EXTERN char *curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
+                                              size_t num, unsigned int ccsid);
+CURL_EXTERN char *curl_pushheader_byname_ccsid(struct curl_pushheaders *h,
+                                               const char *header,
+                                               unsigned int ccsidin,
+                                               unsigned int ccsidout);
+CURL_EXTERN CURLcode curl_mime_name_ccsid(curl_mimepart *part,
+                                          const char *name,
+                                          unsigned int ccsid);
+CURL_EXTERN CURLcode curl_mime_filename_ccsid(curl_mimepart *part,
+                                              const char *filename,
+                                              unsigned int ccsid);
+CURL_EXTERN CURLcode curl_mime_type_ccsid(curl_mimepart *part,
+                                          const char *mimetype,
+                                          unsigned int ccsid);
+CURL_EXTERN CURLcode curl_mime_encoder_ccsid(curl_mimepart *part,
+                                             const char *encoding,
+                                             unsigned int ccsid);
+CURL_EXTERN CURLcode curl_mime_filedata_ccsid(curl_mimepart *part,
+                                              const char *filename,
+                                              unsigned int ccsid);
+CURL_EXTERN CURLcode curl_mime_data_ccsid(curl_mimepart *part,
+                                          const char *data, size_t datasize,
+                                          unsigned int ccsid);
+CURL_EXTERN CURLUcode curl_url_get_ccsid(CURLU *handle, CURLUPart what,
+                                         char **part, unsigned int flags,
+                                         unsigned int ccsid);
+CURL_EXTERN CURLUcode curl_url_set_ccsid(CURLU *handle, CURLUPart what,
+                                         const char *part, unsigned int flags,
+                                         unsigned int ccsid);
+CURL_EXTERN const struct curl_easyoption *curl_easy_option_by_name_ccsid(
+                                         const char *name, unsigned int ccsid);
+CURL_EXTERN const char *curl_easy_option_get_name_ccsid(
+                                         const struct curl_easyoption *option,
+                                         unsigned int ccsid);
+
+#endif
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/chkstrings.c b/ap/lib/libcurl/curl-7.86.0/packages/OS400/chkstrings.c
new file mode 100755
index 0000000..6f8d38b
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/chkstrings.c
@@ -0,0 +1,64 @@
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2022, 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
+ *
+ ***************************************************************************/
+
+#include <stdlib.h>
+#pragma enum(int)
+#include "curl_setup.h"
+#include "urldata.h"
+
+/* The following defines indicate the expected dupstring enum values in
+ * curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c. If a mismatch is
+ * flagged during the build, it indicates that curl_easy_setopt_ccsid() may
+ * need updating to perform data EBCDIC to ASCII data conversion on the
+ * string.
+ *
+ * Once any applicable changes to curl_easy_setopt_ccsid() have been
+ * made, the EXPECTED_STRING_LASTZEROTERMINATED/EXPECTED_STRING_LAST
+ * values can be updated to match the latest enum values in urldata.h.
+ */
+#define EXPECTED_STRING_LASTZEROTERMINATED  (STRING_SSL_EC_CURVES + 1)
+#define EXPECTED_STRING_LAST                (STRING_AWS_SIGV4 + 1)
+
+int main(int argc, char *argv[])
+{
+  int rc = 0;
+
+  if(STRING_LASTZEROTERMINATED != EXPECTED_STRING_LASTZEROTERMINATED) {
+    fprintf(stderr,
+            "STRING_LASTZEROTERMINATED(%d) is not expected value(%d).\n",
+            STRING_LASTZEROTERMINATED, EXPECTED_STRING_LASTZEROTERMINATED);
+    rc += 1;
+  }
+  if(STRING_LAST != EXPECTED_STRING_LAST) {
+    fprintf(stderr, "STRING_LAST(%d) is not expected value(%d).\n",
+            STRING_LAST, EXPECTED_STRING_LAST);
+    rc += 2;
+  }
+  if(rc) {
+    fprintf(stderr, "curl_easy_setopt_ccsid() in packages/OS400/ccsidcurl.c"
+            " may need updating if new strings are provided as"
+            " input via the curl API.\n");
+  }
+  return rc;
+}
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/curl.inc.in b/ap/lib/libcurl/curl-7.86.0/packages/OS400/curl.inc.in
new file mode 100755
index 0000000..6508b96
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/curl.inc.in
@@ -0,0 +1,3129 @@
+      **************************************************************************
+      *                                  _   _ ____  _
+      *  Project                     ___| | | |  _ \| |
+      *                             / __| | | | |_) | |
+      *                            | (__| |_| |  _ <| |___
+      *                             \___|\___/|_| \_\_____|
+      *
+      * Copyright (C) 1998 - 2022, 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
+      *
+      *
+      **************************************************************************
+      *
+      /if not defined(CURL_CURL_INC_)
+      /define CURL_CURL_INC_
+      *
+      *     WARNING: this file should be kept in sync with C include files.
+      *
+      **************************************************************************
+      *                               Constants
+      **************************************************************************
+      *
+     d LIBCURL_VERSION...
+     d                 c                   '@LIBCURL_VERSION@'
+     d LIBCURL_VERSION_MAJOR...
+     d                 c                   @LIBCURL_VERSION_MAJOR@
+     d LIBCURL_VERSION_MINOR...
+     d                 c                   @LIBCURL_VERSION_MINOR@
+     d LIBCURL_VERSION_PATCH...
+     d                 c                   @LIBCURL_VERSION_PATCH@
+     d LIBCURL_VERSION_NUM...
+     d                 c                   X'00@LIBCURL_VERSION_NUM@'
+     d LIBCURL_TIMESTAMP...
+     d                 c                   '@LIBCURL_TIMESTAMP@'
+      *
+     d CURL_SOCKET_BAD...
+     d                 c                   -1
+     d CURL_SOCKET_TIMEOUT...
+     d                 c                   -1
+      *
+      /if not defined(CURL_MAX_WRITE_SIZE)
+      /define CURL_MAX_WRITE_SIZE
+     d CURL_MAX_WRITE_SIZE...
+     d                 c                   16384
+      /endif
+      *
+      /if not defined(CURL_MAX_HTTP_HEADER)
+      /define CURL_MAX_HTTP_HEADER
+     d CURL_MAX_HTTP_HEADER...
+     d                 c                   102400
+      /endif
+      *
+     d CURLINFO_STRING...
+     d                 c                   X'00100000'
+     d CURLINFO_LONG   c                   X'00200000'
+     d CURLINFO_DOUBLE...
+     d                 c                   X'00300000'
+     d CURLINFO_SLIST  c                   X'00400000'
+     d CURLINFO_PTR    c                   X'00400000'
+     d CURLINFO_SOCKET...
+     d                 c                   X'00500000'
+     d CURLINFO_OFF_T...
+     d                 c                   X'00600000'
+     d CURLINFO_MASK   c                   X'000FFFFF'
+     d CURLINFO_TYPEMASK...
+     d                 c                   X'00F00000'
+      *
+     d CURL_GLOBAL_SSL...
+     d                 c                   X'00000001'
+     d CURL_GLOBAL_WIN32...
+     d                 c                   X'00000002'
+     d CURL_GLOBAL_ALL...
+     d                 c                   X'00000003'
+     d CURL_GLOBAL_NOTHING...
+     d                 c                   X'00000000'
+     d CURL_GLOBAL_DEFAULT...
+     d                 c                   X'00000003'
+     d CURL_GLOBAL_ACK_EINTR...
+     d                 c                   X'00000004'
+      *
+     d CURL_VERSION_IPV6...
+     d                 c                   X'00000001'
+     d CURL_VERSION_KERBEROS4...
+     d                 c                   X'00000002'
+     d CURL_VERSION_SSL...
+     d                 c                   X'00000004'
+     d CURL_VERSION_LIBZ...
+     d                 c                   X'00000008'
+     d CURL_VERSION_NTLM...
+     d                 c                   X'00000010'
+     d CURL_VERSION_GSSNEGOTIATE...
+     d                 c                   X'00000020'                          Deprecated
+     d CURL_VERSION_DEBUG...
+     d                 c                   X'00000040'
+     d CURL_VERSION_ASYNCHDNS...
+     d                 c                   X'00000080'
+     d CURL_VERSION_SPNEGO...
+     d                 c                   X'00000100'
+     d CURL_VERSION_LARGEFILE...
+     d                 c                   X'00000200'
+     d CURL_VERSION_IDN...
+     d                 c                   X'00000400'
+     d CURL_VERSION_SSPI...
+     d                 c                   X'00000800'
+     d CURL_VERSION_CONV...
+     d                 c                   X'00001000'
+     d CURL_VERSION_CURLDEBUG...
+     d                 c                   X'00002000'
+     d CURL_VERSION_TLSAUTH_SRP...
+     d                 c                   X'00004000'
+     d CURL_VERSION_NTLM_WB...
+     d                 c                   X'00008000'
+     d CURL_VERSION_HTTP2...
+     d                 c                   X'00010000'
+     d CURL_VERSION_GSSAPI...
+     d                 c                   X'00020000'
+     d CURL_VERSION_KERBEROS5...
+     d                 c                   X'00040000'
+     d CURL_VERSION_UNIX_SOCKETS...
+     d                 c                   X'00080000'
+     d CURL_VERSION_PSL...
+     d                 c                   X'00100000'
+     d CURL_VERSION_HTTPS_PROXY...
+     d                 c                   X'00200000'
+     d CURL_VERSION_MULTI_SSL...
+     d                 c                   X'00400000'
+     d CURL_VERSION_BROTLI...
+     d                 c                   X'00800000'
+     d CURL_VERSION_ALTSVC...
+     d                 c                   X'01000000'
+     d CURL_VERSION_HTTP3...
+     d                 c                   X'02000000'
+     d CURL_VERSION_ZSTD...
+     d                 c                   X'04000000'
+     d CURL_VERSION_UNICODE...
+     d                 c                   X'08000000'
+     d CURL_VERSION_HSTS...
+     d                 c                   X'10000000'
+     d CURL_VERSION_GSASL...
+     d                 c                   X'20000000'
+     d CURL_VERSION_THREADSAFE...
+     d                 c                   X'40000000'
+      *
+     d CURL_HTTPPOST_FILENAME...
+     d                 c                   X'00000001'
+     d CURL_HTTPPOST_READFILE...
+     d                 c                   X'00000002'
+     d CURL_HTTPPOST_PTRNAME...
+     d                 c                   X'00000004'
+     d CURL_HTTPPOST_PTRCONTENTS...
+     d                 c                   X'00000008'
+     d CURL_HTTPPOST_BUFFER...
+     d                 c                   X'00000010'
+     d CURL_HTTPPOST_PTRBUFFER...
+     d                 c                   X'00000020'
+     d CURL_HTTPPOST_CALLBACK...
+     d                 c                   X'00000040'
+     d CURL_HTTPPOST_LARGE...
+     d                 c                   X'00000080'
+      *
+     d CURL_SEEKFUNC_OK...
+     d                 c                   0
+     d CURL_SEEKFUNC_FAIL...
+     d                 c                   1
+     d CURL_SEEKFUNC_CANTSEEK...
+     d                 c                   2
+      *
+     d CURL_READFUNC_ABORT...
+     d                 c                   X'10000000'
+     d CURL_READFUNC_PAUSE...
+     d                 c                   X'10000001'
+      *
+     d CURL_WRITEFUNC_PAUSE...
+     d                 c                   X'10000001'
+      *
+     d CURL_TRAILERFUNC_OK...
+     d                 c                   0
+     d CURL_TRAILERFUNC_ABORT...
+     d                 c                   1
+      *
+     d CURLAUTH_NONE   c                   X'00000000'
+     d CURLAUTH_BASIC  c                   X'00000001'
+     d CURLAUTH_DIGEST...
+     d                 c                   X'00000002'
+     d CURLAUTH_NEGOTIATE...
+     d                 c                   X'00000004'
+     d CURLAUTH_NTLM   c                   X'00000008'
+     d CURLAUTH_DIGEST_IE...
+     d                 c                   X'00000010'
+     d CURLAUTH_NTLM_WB...
+     d                 c                   X'00000020'
+     d CURLAUTH_BEARER...
+     d                 c                   X'00000040'
+     d CURLAUTH_AWS_SIGV4...
+     d                 c                   X'00000080'
+     d CURLAUTH_ONLY...
+     d                 c                   X'80000000'
+     d CURLAUTH_ANY    c                   X'7FFFFFEF'
+     d CURLAUTH_ANYSAFE...
+     d                 c                   X'7FFFFFEE'
+      *
+     d CURLSSH_AUTH_ANY...
+     d                 c                   X'7FFFFFFF'
+     d CURLSSH_AUTH_NONE...
+     d                 c                   X'00000000'
+     d CURLSSH_AUTH_PUBLICKEY...
+     d                 c                   X'00000001'
+     d CURLSSH_AUTH_PASSWORD...
+     d                 c                   X'00000002'
+     d CURLSSH_AUTH_HOST...
+     d                 c                   X'00000004'
+     d CURLSSH_AUTH_KEYBOARD...
+     d                 c                   X'00000008'
+     d CURLSSH_AUTH_AGENT...
+     d                 c                   X'00000010'
+     d CURLSSH_AUTH_DEFAULT...
+     d                 c                   X'7FFFFFFF'                          CURLSSH_AUTH_ANY
+      *
+     d CURLGSSAPI_DELEGATION_NONE...
+     d                 c                   0
+     d CURLGSSAPI_DELEGATION_POLICY_FLAG...
+     d                 c                   X'00000001'
+     d CURLGSSAPI_DELEGATION_FLAG...
+     d                 c                   X'00000002'
+      *
+     d CURL_ERROR_SIZE...
+     d                 c                   256
+      *
+     d CURLOPTTYPE_LONG...
+     d                 c                   0
+     d CURLOPTTYPE_VALUES...
+     d                 c                   0
+     d CURLOPTTYPE_OBJECTPOINT...
+     d                 c                   10000
+     d CURLOPTTYPE_STRINGPOINT...
+     d                 c                   10000
+     d CURLOPTTYPE_SLISTPOINT...
+     d                 c                   10000
+     d CURLOPTTYPE_CBPOINT...
+     d                 c                   10000
+     d CURLOPTTYPE_FUNCTIONPOINT...
+     d                 c                   20000
+     d CURLOPTTYPE_OFF_T...
+     d                 c                   30000
+     d CURLOPTTYPE_BLOB...
+     d                 c                   40000
+      *
+     d CURL_IPRESOLVE_WHATEVER...
+     d                 c                   0
+     d CURL_IPRESOLVE_V4...
+     d                 c                   1
+     d CURL_IPRESOLVE_V6...
+     d                 c                   2
+      *
+     d CURL_HTTP_VERSION_NONE...
+     d                 c                   0
+     d CURL_HTTP_VERSION_1_0...
+     d                 c                   1
+     d CURL_HTTP_VERSION_1_1...
+     d                 c                   2
+     d CURL_HTTP_VERSION_2_0...
+     d                 c                   3
+     d CURL_HTTP_VERSION_2...
+     d                 c                   3
+     d CURL_HTTP_VERSION_2TLS...
+     d                 c                   4
+     d CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE...
+     d                 c                   5
+      *
+     d CURL_NETRC_IGNORED...
+     d                 c                   0
+     d CURL_NETRC_OPTIONAL...
+     d                 c                   1
+     d CURL_NETRC_REQUIRED...
+     d                 c                   2
+      *
+     d CURL_SSLVERSION_DEFAULT...
+     d                 c                   0
+     d CURL_SSLVERSION_TLSv1...
+     d                 c                   1
+     d CURL_SSLVERSION_SSLv2...
+     d                 c                   2
+     d CURL_SSLVERSION_SSLv3...
+     d                 c                   3
+     d CURL_SSLVERSION_TLSv1_0...
+     d                 c                   4
+     d CURL_SSLVERSION_TLSv1_1...
+     d                 c                   5
+     d CURL_SSLVERSION_TLSv1_2...
+     d                 c                   6
+     d CURL_SSLVERSION_TLSv1_3...
+     d                 c                   7
+     d CURL_SSLVERSION_MAX_DEFAULT...
+     d                 c                   X'00010000'
+     d CURL_SSLVERSION_MAX_TLSv1_0...
+     d                 c                   X'00040000'
+     d CURL_SSLVERSION_MAX_TLSv1_1...
+     d                 c                   X'00050000'
+     d CURL_SSLVERSION_MAX_TLSv1_2...
+     d                 c                   X'00060000'
+     d CURL_SSLVERSION_MAX_TLSv1_3...
+     d                 c                   X'00070000'
+      *
+     d CURL_TLSAUTH_NONE...
+     d                 c                   0
+     d CURL_TLSAUTH_SRP...
+     d                 c                   1
+      *
+     d CURL_REDIR_GET_ALL...
+     d                 c                   0
+     d CURL_REDIR_POST_301...
+     d                 c                   1
+     d CURL_REDIR_POST_302...
+     d                 c                   2
+     d CURL_REDIR_POST_303...
+     d                 c                   4
+     d CURL_REDIR_POST_ALL...
+     d                 c                   7
+      *
+     d CURL_ZERO_TERMINATED...
+     d                 c                   -1
+      *
+     d CURL_POLL_NONE  c                   0
+     d CURL_POLL_IN    c                   1
+     d CURL_POLL_OUT   c                   2
+     d CURL_POLL_INOUT...
+     d                 c                   3
+     d CURL_POLL_REMOVE...
+     d                 c                   4
+      *
+     d CURL_CSELECT_IN...
+     d                 c                   X'00000001'
+     d CURL_CSELECT_OUT...
+     d                 c                   X'00000002'
+     d CURL_CSELECT_ERR...
+     d                 c                   X'00000004'
+      *
+     d CURL_PUSH_OK    c                   0
+     d CURL_PUSH_DENY  c                   1
+      *
+     d CURLPAUSE_RECV  c                   X'00000001'
+     d CURLPAUSE_RECV_CONT...
+     d                 c                   X'00000000'
+     d CURLPAUSE_SEND  c                   X'00000004'
+     d CURLPAUSE_SEND_CONT...
+     d                 c                   X'00000000'
+     d CURLPAUSE_ALL   c                   X'00000005'
+     d CURLPAUSE_CONT  c                   X'00000000'
+      *
+     d CURLINFOFLAG_KNOWN_FILENAME...
+     d                 c                   X'00000001'
+     d CURLINFOFLAG_KNOWN_FILETYPE...
+     d                 c                   X'00000002'
+     d CURLINFOFLAG_KNOWN_TIME...
+     d                 c                   X'00000004'
+     d CURLINFOFLAG_KNOWN_PERM...
+     d                 c                   X'00000008'
+     d CURLINFOFLAG_KNOWN_UID...
+     d                 c                   X'00000010'
+     d CURLINFOFLAG_KNOWN_GID...
+     d                 c                   X'00000020'
+     d CURLINFOFLAG_KNOWN_SIZE...
+     d                 c                   X'00000040'
+     d CURLINFOFLAG_KNOWN_HLINKCOUNT...
+     d                 c                   X'00000080'
+      *
+     d CURL_CHUNK_BGN_FUNC_OK...
+     d                 c                   0
+     d CURL_CHUNK_BGN_FUNC_FAIL...
+     d                 c                   1
+     d CURL_CHUNK_BGN_FUNC_SKIP...
+     d                 c                   2
+      *
+     d CURL_CHUNK_END_FUNC_OK...
+     d                 c                   0
+     d CURL_CHUNK_END_FUNC_FAIL...
+     d                 c                   1
+      *
+     d CURL_FNMATCHFUNC_MATCH...
+     d                 c                   0
+     d CURL_FNMATCHFUNC_NOMATCH...
+     d                 c                   1
+     d CURL_FNMATCHFUNC_FAIL...
+     d                 c                   2
+      *
+     d CURL_WAIT_POLLIN...
+     d                 c                   X'0001'
+     d CURL_WAIT_POLLPRI...
+     d                 c                   X'0002'
+     d CURL_WAIT_POLLOUT...
+     d                 c                   X'0004'
+      *
+     d CURLU_DEFAULT_PORT...
+     d                 c                   X'00000001'
+     d CURLU_NO_DEFAULT_PORT...
+     d                 c                   X'00000002'
+     d CURLU_DEFAULT_SCHEME...
+     d                 c                   X'00000004'
+     d CURLU_NON_SUPPORT_SCHEME...
+     d                 c                   X'00000008'
+     d CURLU_PATH_AS_IS...
+     d                 c                   X'00000010'
+     d CURLU_DISALLOW_USER...
+     d                 c                   X'00000020'
+     d CURLU_URLDECODE...
+     d                 c                   X'00000040'
+     d CURLU_URLENCODE...
+     d                 c                   X'00000080'
+     d CURLU_APPENDQUERY...
+     d                 c                   X'00000100'
+     d CURLU_GUESS_SCHEME...
+     d                 c                   X'00000200'
+     d CURLU_NO_AUTHORITY...
+     d                 c                   X'00000400'
+      *
+     d CURLOT_FLAG_ALIAS...
+     d                 c                   X'00000001'
+      *
+      **************************************************************************
+      *                                Types
+      **************************************************************************
+      *
+     d curl_socket_t   s             10i 0 based(######ptr######)
+      *
+     d curl_off_t      s             20i 0 based(######ptr######)
+      *
+     d CURLcode        s             10i 0 based(######ptr######)               Enum
+     d  CURLE_OK       c                   0
+     d  CURLE_UNSUPPORTED_PROTOCOL...
+     d                 c                   1
+     d  CURLE_FAILED_INIT...
+     d                 c                   2
+     d  CURLE_URL_MALFORMAT...
+     d                 c                   3
+     d  CURLE_NOT_BUILT_IN...
+     d                 c                   4
+     d  CURLE_COULDNT_RESOLVE_PROXY...
+     d                 c                   5
+     d  CURLE_COULDNT_RESOLVE_HOST...
+     d                 c                   6
+     d  CURLE_COULDNT_CONNECT...
+     d                 c                   7
+     d  CURLE_WEIRD_SERVER_REPLY...
+     d                 c                   8
+     d  CURLE_REMOTE_ACCESS_DENIED...
+     d                 c                   9
+     d  CURLE_FTP_ACCEPT_FAILED...
+     d                 c                   10
+     d  CURLE_FTP_WEIRD_PASS_REPLY...
+     d                 c                   11
+     d  CURLE_FTP_ACCEPT_TIMEOUT...
+     d                 c                   12
+     d  CURLE_FTP_WEIRD_PASV_REPLY...
+     d                 c                   13
+     d  CURLE_FTP_WEIRD_227_FORMAT...
+     d                 c                   14
+     d  CURLE_FTP_CANT_GET_HOST...
+     d                 c                   15
+     d  CURLE_HTTP2    c                   16
+     d  CURLE_FTP_COULDNT_SET_TYPE...
+     d                 c                   17
+     d  CURLE_PARTIAL_FILE...
+     d                 c                   18
+     d  CURLE_FTP_COULDNT_RETR_FILE...
+     d                 c                   19
+     d  CURLE_OBSOLETE20...
+     d                 c                   20
+     d  CURLE_QUOTE_ERROR...
+     d                 c                   21
+     d  CURLE_HTTP_RETURNED_ERROR...
+     d                 c                   22
+     d  CURLE_WRITE_ERROR...
+     d                 c                   23
+     d  CURLE_OBSOLETE24...
+     d                 c                   24
+     d  CURLE_UPLOAD_FAILED...
+     d                 c                   25
+     d  CURLE_READ_ERROR...
+     d                 c                   26
+     d  CURLE_OUT_OF_MEMORY...
+     d                 c                   27
+     d  CURLE_OPERATION_TIMEDOUT...
+     d                 c                   28
+     d  CURLE_OBSOLETE29...
+     d                 c                   29
+     d  CURLE_FTP_PORT_FAILED...
+     d                 c                   30
+     d  CURLE_FTP_COULDNT_USE_REST...
+     d                 c                   31
+     d  CURLE_OBSOLETE32...
+     d                 c                   32
+     d  CURLE_RANGE_ERROR...
+     d                 c                   33
+     d  CURLE_HTTP_POST_ERROR...
+     d                 c                   34
+     d  CURLE_SSL_CONNECT_ERROR...
+     d                 c                   35
+     d  CURLE_BAD_DOWNLOAD_RESUME...
+     d                 c                   36
+     d  CURLE_FILE_COULDNT_READ_FILE...
+     d                 c                   37
+     d  CURLE_LDAP_CANNOT_BIND...
+     d                 c                   38
+     d  CURLE_LDAP_SEARCH_FAILED...
+     d                 c                   39
+     d  CURLE_OBSOLETE40...
+     d                 c                   40
+     d  CURLE_FUNCTION_NOT_FOUND...
+     d                 c                   41
+     d  CURLE_ABORTED_BY_CALLBACK...
+     d                 c                   42
+     d  CURLE_BAD_FUNCTION_ARGUMENT...
+     d                 c                   43
+     d  CURLE_OBSOLETE44...
+     d                 c                   44
+     d  CURLE_INTERFACE_FAILED...
+     d                 c                   45
+     d  CURLE_OBSOLETE46...
+     d                 c                   46
+     d  CURLE_TOO_MANY_REDIRECTS...
+     d                 c                   47
+     d  CURLE_UNKNOWN_OPTION...
+     d                 c                   48
+     d  CURLE_TELNET_OPTION_SYNTAX...
+     d                 c                   49
+     d  CURLE_OBSOLETE50...
+     d                 c                   50
+     d  CURLE_OBSOLETE51...
+     d                 c                   51
+     d  CURLE_GOT_NOTHING...
+     d                 c                   52
+     d  CURLE_SSL_ENGINE_NOTFOUND...
+     d                 c                   53
+     d  CURLE_SSL_ENGINE_SETFAILED...
+     d                 c                   54
+     d  CURLE_SEND_ERROR...
+     d                 c                   55
+     d  CURLE_RECV_ERROR...
+     d                 c                   56
+     d  CURLE_OBSOLETE57...
+     d                 c                   57
+     d  CURLE_SSL_CERTPROBLEM...
+     d                 c                   58
+     d  CURLE_SSL_CIPHER...
+     d                 c                   59
+     d  CURLE_PEER_FAILED_VERIFICATION...
+     d                 c                   60
+     d  CURLE_BAD_CONTENT_ENCODING...
+     d                 c                   61
+     d  CURLE_LDAP_INVALID_URL...
+     d                 c                   62
+     d  CURLE_FILESIZE_EXCEEDED...
+     d                 c                   63
+     d  CURLE_USE_SSL_FAILED...
+     d                 c                   64
+     d  CURLE_SEND_FAIL_REWIND...
+     d                 c                   65
+     d  CURLE_SSL_ENGINE_INITFAILED...
+     d                 c                   66
+     d  CURLE_LOGIN_DENIED...
+     d                 c                   67
+     d  CURLE_TFTP_NOTFOUND...
+     d                 c                   68
+     d  CURLE_TFTP_PERM...
+     d                 c                   69
+     d  CURLE_REMOTE_DISK_FULL...
+     d                 c                   70
+     d  CURLE_TFTP_ILLEGAL...
+     d                 c                   71
+     d  CURLE_TFTP_UNKNOWNID...
+     d                 c                   72
+     d  CURLE_REMOTE_FILE_EXISTS...
+     d                 c                   73
+     d  CURLE_TFTP_NOSUCHUSER...
+     d                 c                   74
+     d  CURLE_CONV_FAILED...
+     d                 c                   75
+     d  CURLE_CONV_REQD...
+     d                 c                   76
+     d  CURLE_SSL_CACERT_BADFILE...
+     d                 c                   77
+     d  CURLE_REMOTE_FILE_NOT_FOUND...
+     d                 c                   78
+     d  CURLE_SSH...
+     d                 c                   79
+     d  CURLE_SSL_SHUTDOWN_FAILED...
+     d                 c                   80
+     d  CURLE_AGAIN...
+     d                 c                   81
+     d  CURLE_SSL_CRL_BADFILE...
+     d                 c                   82
+     d  CURLE_SSL_ISSUER_ERROR...
+     d                 c                   83
+     d  CURLE_FTP_PRET_FAILED...
+     d                 c                   84
+     d  CURLE_RTSP_CSEQ_ERROR...
+     d                 c                   85
+     d  CURLE_RTSP_SESSION_ERROR...
+     d                 c                   86
+     d  CURLE_FTP_BAD_FILE_LIST...
+     d                 c                   87
+     d  CURLE_CHUNK_FAILED...
+     d                 c                   88
+     d  CURLE_NO_CONNECTION_AVAILABLE...
+     d                 c                   89
+     d  CURLE_SSL_PINNEDPUBKEYNOTMATCH...
+     d                 c                   90
+     d  CURLE_SSL_INVALIDCERTSTATUS...
+     d                 c                   91
+     d  CURLE_HTTP2_STREAM...
+     d                 c                   92
+     d  CURLE_RECURSIVE_API_CALL...
+     d                 c                   93
+     d  CURLE_AUTH_ERROR...
+     d                 c                   94
+     d  CURLE_HTTP3...
+     d                 c                   95
+     d  CURLE_QUIC_CONNECT_ERROR...
+     d                 c                   96
+     d  CURLE_PROXY...
+     d                 c                   97
+      *
+      /if not defined(CURL_NO_OLDIES)
+     d  CURLE_URL_MALFORMAT_USER...
+     d                 c                   4
+     d  CURLE_FTP_WEIRD_SERVER_REPLY...
+     d                 c                   8
+     d  CURLE_FTP_ACCESS_DENIED...
+     d                 c                   9
+     d  CURLE_FTP_USER_PASSWORD_INCORRECT...
+     d                 c                   10
+     d  CURLE_FTP_WEIRD_USER_REPLY...
+     d                 c                   12
+     d  CURLE_FTP_CANT_RECONNECT...
+     d                 c                   16
+     d  CURLE_FTP_COULDNT_SET_BINARY...
+     d                 c                   17
+     d  CURLE_FTP_PARTIAL_FILE...
+     d                 c                   18
+     d  CURLE_FTP_WRITE_ERROR...
+     d                 c                   20
+     d  CURLE_FTP_QUOTE_ERROR...
+     d                 c                   21
+     d  CURLE_HTTP_NOT_FOUND...
+     d                 c                   22
+     d  CURLE_MALFORMAT_USER...
+     d                 c                   24
+     d  CURLE_FTP_COULDNT_STOR_FILE...
+     d                 c                   25
+     d  CURLE_OPERATION_TIMEOUTED...
+     d                 c                   28
+     d  CURLE_FTP_COULDNT_SET_ASCII...
+     d                 c                   29
+     d  CURLE_FTP_COULDNT_GET_SIZE...
+     d                 c                   32
+     d  CURLE_HTTP_RANGE_ERROR...
+     d                 c                   33
+     d  CURLE_FTP_BAD_DOWNLOAD_RESUME...
+     d                 c                   36
+     d  CURLE_LIBRARY_NOT_FOUND...
+     d                 c                   40
+     d  CURLE_BAD_CALLING_ORDER...
+     d                 c                   44
+     d  CURLE_HTTP_PORT_FAILED...
+     d                 c                   45
+     d  CURLE_BAD_PASSWORD_ENTERED...
+     d                 c                   46
+     d  CURLE_UNKNOWN_TELNET_OPTION...
+     d                 c                   48
+     d  CURLE_OBSOLETE...
+     d                 c                   50
+     d  CURLE_SHARE_IN_USE...
+     d                 c                   57
+     d  CURLE_SSL_CACERT...
+     d                 c                   60
+     d  CURLE_SSL_PEER_CERTIFICATE...
+     d                 c                   60
+     d  CURLE_FTP_SSL_FAILED...
+     d                 c                   64
+     d  CURLE_TFTP_DISKFULL...
+     d                 c                   70
+     d  CURLE_TFTP_EXISTS...
+     d                 c                   73
+     d  CURLE_ALREADY_COMPLETE...
+     d                 c                   99999
+      /endif
+      *
+     d CURLproxycode   s             10i 0 based(######ptr######)               Enum
+     d  CURLPX_OK      c                   0
+     d  CURLPX_BAD_ADDRESS_TYPE...
+     d                 c                   1
+     d  CURLPX_BAD_VERSION...
+     d                 c                   2
+     d  CURLPX_CLOSED...
+     d                 c                   3
+     d  CURLPX_GSSAPI...
+     d                 c                   4
+     d  CURLPX_GSSAPI_PERMSG...
+     d                 c                   5
+     d  CURLPX_GSSAPI_PROTECTION...
+     d                 c                   6
+     d  CURLPX_IDENTD...
+     d                 c                   7
+     d  CURLPX_IDENTD_DIFFER...
+     d                 c                   8
+     d  CURLPX_LONG_HOSTNAME...
+     d                 c                   9
+     d  CURLPX_LONG_PASSWD...
+     d                 c                   10
+     d  CURLPX_LONG_USER...
+     d                 c                   11
+     d  CURLPX_NO_AUTH...
+     d                 c                   12
+     d  CURLPX_RECV_ADDRESS...
+     d                 c                   13
+     d  CURLPX_RECV_AUTH...
+     d                 c                   14
+     d  CURLPX_RECV_CONNECT...
+     d                 c                   15
+     d  CURLPX_RECV_REQACK...
+     d                 c                   16
+     d  CURLPX_REPLY_ADDRESS_TYPE_NOT_SUPPORTED...
+     d                 c                   17
+     d  CURLPX_REPLY_COMMAND_NOT_SUPPORTED...
+     d                 c                   18
+     d  CURLPX_REPLY_CONNECTION_REFUSED...
+     d                 c                   10
+     d  CURLPX_REPLY_GENERAL_SERVER_FAILURE...
+     d                 c                   20
+     d  CURLPX_REPLY_HOST_UNREACHABLE...
+     d                 c                   21
+     d  CURLPX_REPLY_NETWORK_UNREACHABLE...
+     d                 c                   22
+     d  CURLPX_REPLY_NOT_ALLOWED...
+     d                 c                   23
+     d  CURLPX_REPLY_TTL_EXPIRED...
+     d                 c                   24
+     d  CURLPX_REPLY_UNASSIGNED...
+     d                 c                   25
+     d  CURLPX_REQUEST_FAILED...
+     d                 c                   26
+     d  CURLPX_RESOLVE_HOST...
+     d                 c                   27
+     d  CURLPX_SEND_AUTH...
+     d                 c                   28
+     d  CURLPX_SEND_CONNECT...
+     d                 c                   29
+     d  CURLPX_SEND_REQUEST...
+     d                 c                   30
+     d  CURLPX_UNKNOWN_FAIL...
+     d                 c                   31
+     d  CURLPX_UNKNOWN_MODE...
+     d                 c                   32
+     d  CURLPX_USER_REJECTED...
+     d                 c                   33
+      *
+     d curlioerr       s             10i 0 based(######ptr######)               Enum
+     d  CURLIOE_OK     c                   0
+     d  CURLIOE_UNKNOWNCMD...
+     d                 c                   1
+     d  CURLIOE_FAILRESTART...
+     d                 c                   2
+      *
+     d curlfiletype    s             10i 0 based(######ptr######)               Enum
+     d  CURLFILETYPE_FILE...
+     d                 c                   0
+     d  CURLFILETYPE_DIRECTORY...
+     d                 c                   1
+     d  CURLFILETYPE_SYMLINK...
+     d                 c                   2
+     d  CURLFILETYPE_DEVICE_BLOCK...
+     d                 c                   3
+     d  CURLFILETYPE_DEVICE_CHAR...
+     d                 c                   4
+     d  CURLFILETYPE_NAMEDPIPE...
+     d                 c                   5
+     d  CURLFILETYPE_SOCKET...
+     d                 c                   6
+     d  CURLFILETYPE_DOOR...
+     d                 c                   7
+      *
+     d curliocmd       s             10i 0 based(######ptr######)               Enum
+     d  CURLIOCMD_NOP  c                   0
+     d  CURLIOCMD_RESTARTREAD...
+     d                 c                   1
+      *
+     d curl_infotype   s             10i 0 based(######ptr######)               Enum
+     d  CURLINFO_TEXT...
+     d                 c                   0
+     d  CURLINFO_HEADER_IN...
+     d                 c                   1
+     d  CURLINFO_HEADER_OUT...
+     d                 c                   2
+     d  CURLINFO_DATA_IN...
+     d                 c                   3
+     d  CURLINFO_DATA_OUT...
+     d                 c                   4
+     d  CURLINFO_SSL_DATA_IN...
+     d                 c                   5
+     d  CURLINFO_SSL_DATA_OUT...
+     d                 c                   6
+     d  CURLINFO_END...
+     d                 c                   7
+      *
+     d curl_proxytype  s             10i 0 based(######ptr######)               Enum
+     d  CURLPROXY_HTTP...
+     d                 c                   0
+     d  CURLPROXY_HTTP_1_0...
+     d                 c                   1
+     d  CURLPROXY_HTTPS...
+     d                 c                   2
+     d  CURLPROXY_SOCKS4...
+     d                 c                   4
+     d  CURLPROXY_SOCKS5...
+     d                 c                   5
+     d  CURLPROXY_SOCKS4A...
+     d                 c                   6
+     d  CURLPROXY_SOCKS5_HOSTNAME...
+     d                 c                   7
+      *
+     d curl_khstat     s             10i 0 based(######ptr######)               Enum
+     d  CURLKHSTAT_FINE_ADD_TO_FILE...
+     d                 c                   0
+     d  CURLKHSTAT_FINE...
+     d                 c                   1
+     d  CURLKHSTAT_REJECT...
+     d                 c                   2
+     d  CURLKHSTAT_DEFER...
+     d                 c                   3
+     d  CURLKHSTAT_FINE_REPLACE...
+     d                 c                   4
+     d  CURLKHSTAT_LAST...
+     d                 c                   5
+      *
+     d curl_khmatch    s             10i 0 based(######ptr######)               Enum
+     d  CURLKHMATCH_OK...
+     d                 c                   0
+     d  CURLKHMATCH_MISMATCH...
+     d                 c                   1
+     d  CURLKHMATCH_MISSING...
+     d                 c                   2
+     d  CURLKHMATCH_LAST...
+     d                 c                   3
+      *
+     d curl_usessl     s             10i 0 based(######ptr######)               Enum
+     d  CURLUSESSL_NONE...
+     d                 c                   0
+     d  CURLUSESSL_TRY...
+     d                 c                   1
+     d  CURLUSESSL_CONTROL...
+     d                 c                   2
+     d  CURLUSESSL_ALL...
+     d                 c                   3
+      *
+     d CURLSSLOPT_ALLOW_BEAST...
+     d                 c                   X'0001'
+     d CURLSSLOPT_NO_REVOKE...
+     d                 c                   X'0002'
+     d CURLSSLOPT_NO_PARTIALCHAIN...
+     d                 c                   X'0004'
+     d CURLSSLOPT_REVOKE_BEST_EFFORT...
+     d                 c                   X'0008'
+     d CURLSSLOPT_NATIVE_CA...
+     d                 c                   X'0010'
+     d CURLSSLOPT_AUTO_CLIENT_CERT...
+     d                 c                   X'0020'
+      *
+     d CURL_HET_DEFAULT...
+     d                 c                   200
+      *
+     d CURL_UPKEEP_INTERVAL_DEFAULT...
+     d                 c                   60000
+      *
+      /if not defined(CURL_NO_OLDIES)
+     d curl_ftpssl     s                   like(curl_usessl)
+     d                                     based(######ptr######)
+     d  CURLFTPSSL_NONE...
+     d                 c                   0
+     d  CURLFTPSSL_TRY...
+     d                 c                   1
+     d  CURLFTPSSL_CONTROL...
+     d                 c                   2
+     d  CURLFTPSSL_ALL...
+     d                 c                   3
+      /endif
+      *
+     d curl_ftpccc     s             10i 0 based(######ptr######)               Enum
+     d  CURLFTPSSL_CCC_NONE...
+     d                 c                   0
+     d  CURLFTPSSL_CCC_PASSIVE...
+     d                 c                   1
+     d  CURLFTPSSL_CCC_ACTIVE...
+     d                 c                   2
+      *
+     d curl_ftpauth    s             10i 0 based(######ptr######)               Enum
+     d  CURLFTPAUTH_DEFAULT...
+     d                 c                   0
+     d  CURLFTPAUTH_SSL...
+     d                 c                   1
+     d  CURLFTPAUTH_TLS...
+     d                 c                   2
+      *
+     d curl_ftpcreatedir...
+     d                 s             10i 0 based(######ptr######)               Enum
+     d  CURLFTP_CREATE_DIR_NONE...
+     d                 c                   0
+     d  CURLFTP_CREATE_DIR...
+     d                 c                   1
+     d  CURLFTP_CREATE_DIR_RETRY...
+     d                 c                   2
+      *
+     d curl_ftpmethod  s             10i 0 based(######ptr######)               Enum
+     d  CURLFTPMETHOD_DEFAULT...
+     d                 c                   0
+     d  CURLFTPMETHOD_MULTICWD...
+     d                 c                   1
+     d  CURLFTPMETHOD_NOCWD...
+     d                 c                   2
+     d  CURLFTPMETHOD_SINGLECWD...
+     d                 c                   3
+      *
+     d  CURLHEADER_UNIFIED...
+     d                 c                   X'00000000'
+     d  CURLHEADER_SEPARATE...
+     d                 c                   X'00000001'
+      *
+     d  CURLALTSVC_READONLYFILE...
+     d                 c                   X'00000004'
+     d  CURLALTSVC_H1...
+     d                 c                   X'00000008'
+     d  CURLALTSVC_H2...
+     d                 c                   X'00000010'
+     d  CURLALTSVC_H3...
+     d                 c                   X'00000020'
+      *
+     d  CURLHSTS_ENABLE...
+     d                 c                   X'00000001'
+     d  CURLHSTS_READONLYFILE...
+     d                 c                   X'00000002'
+      *
+     d  CURLPROTO_HTTP...
+     d                 c                   X'00000001'
+     d  CURLPROTO_HTTPS...
+     d                 c                   X'00000002'
+     d  CURLPROTO_FTP...
+     d                 c                   X'00000004'
+     d  CURLPROTO_FTPS...
+     d                 c                   X'00000008'
+     d  CURLPROTO_SCP...
+     d                 c                   X'00000010'
+     d  CURLPROTO_SFTP...
+     d                 c                   X'00000020'
+     d  CURLPROTO_TELNET...
+     d                 c                   X'00000040'
+     d  CURLPROTO_LDAP...
+     d                 c                   X'00000080'
+     d  CURLPROTO_LDAPS...
+     d                 c                   X'00000100'
+     d  CURLPROTO_DICT...
+     d                 c                   X'00000200'
+     d  CURLPROTO_FILE...
+     d                 c                   X'00000400'
+     d  CURLPROTO_TFTP...
+     d                 c                   X'00000800'
+     d  CURLPROTO_IMAP...
+     d                 c                   X'00001000'
+     d  CURLPROTO_IMAPS...
+     d                 c                   X'00002000'
+     d  CURLPROTO_POP3...
+     d                 c                   X'00004000'
+     d  CURLPROTO_POP3S...
+     d                 c                   X'00008000'
+     d  CURLPROTO_SMTP...
+     d                 c                   X'00010000'
+     d  CURLPROTO_SMTPS...
+     d                 c                   X'00020000'
+     d  CURLPROTO_RTSP...
+     d                 c                   X'00040000'
+     d  CURLPROTO_RTMP...
+     d                 c                   X'00080000'
+     d  CURLPROTO_RTMPT...
+     d                 c                   X'00100000'
+     d  CURLPROTO_RTMPTE...
+     d                 c                   X'00200000'
+     d  CURLPROTO_RTMPE...
+     d                 c                   X'00400000'
+     d  CURLPROTO_RTMPS...
+     d                 c                   X'00800000'
+     d  CURLPROTO_RTMPTS...
+     d                 c                   X'01000000'
+     d  CURLPROTO_GOPHER...
+     d                 c                   X'02000000'
+     d  CURLPROTO_SMB...
+     d                 c                   X'04000000'
+     d  CURLPROTO_SMBS...
+     d                 c                   X'08000000'
+     d  CURLPROTO_MQTT...
+     d                 c                   X'10000000'
+     d  CURLPROTO_GOPHERS...
+     d                 c                   X'20000000'
+      *
+     d CURLoption      s             10i 0 based(######ptr######)               Enum
+     d  CURLOPT_WRITEDATA...
+     d                 c                   10001
+     d  CURLOPT_URL    c                   10002
+     d  CURLOPT_PORT   c                   00003
+     d  CURLOPT_PROXY  c                   10004
+     d  CURLOPT_USERPWD...
+     d                 c                   10005
+     d  CURLOPT_PROXYUSERPWD...
+     d                 c                   10006
+     d  CURLOPT_RANGE  c                   10007
+     d  CURLOPT_READDATA...
+     d                 c                   10009
+     d  CURLOPT_ERRORBUFFER...
+     d                 c                   10010
+     d  CURLOPT_WRITEFUNCTION...
+     d                 c                   20011
+     d  CURLOPT_READFUNCTION...
+     d                 c                   20012
+     d  CURLOPT_TIMEOUT...
+     d                 c                   00013
+     d  CURLOPT_INFILESIZE...
+     d                 c                   00014
+     d  CURLOPT_POSTFIELDS...
+     d                 c                   10015
+     d  CURLOPT_REFERER...
+     d                 c                   10016
+     d  CURLOPT_FTPPORT...
+     d                 c                   10017
+     d  CURLOPT_USERAGENT...
+     d                 c                   10018
+     d  CURLOPT_LOW_SPEED_LIMIT...
+     d                 c                   00019
+     d  CURLOPT_LOW_SPEED_TIME...
+     d                 c                   00020
+     d  CURLOPT_RESUME_FROM...
+     d                 c                   00021
+     d  CURLOPT_COOKIE...
+     d                 c                   10022
+     d  CURLOPT_HTTPHEADER...
+     d                 c                   10023
+     d  CURLOPT_RTSPHEADER...
+     d                 c                   10023
+     d  CURLOPT_HTTPPOST...
+     d                 c                   10024
+     d  CURLOPT_SSLCERT...
+     d                 c                   10025
+     d  CURLOPT_KEYPASSWD...
+     d                 c                   10026
+     d  CURLOPT_CRLF   c                   00027
+     d  CURLOPT_QUOTE  c                   10028
+     d  CURLOPT_HEADERDATA...
+     d                 c                   10029
+     d  CURLOPT_COOKIEFILE...
+     d                 c                   10031
+     d  CURLOPT_SSLVERSION...
+     d                 c                   00032
+     d  CURLOPT_TIMECONDITION...
+     d                 c                   00033
+     d  CURLOPT_TIMEVALUE...
+     d                 c                   00034
+     d  CURLOPT_CUSTOMREQUEST...
+     d                 c                   10036
+     d  CURLOPT_STDERR...
+     d                 c                   10037
+     d  CURLOPT_POSTQUOTE...
+     d                 c                   10039
+     d  CURLOPT_VERBOSE...
+     d                 c                   00041
+     d  CURLOPT_HEADER...
+     d                 c                   00042
+     d  CURLOPT_NOPROGRESS...
+     d                 c                   00043
+     d  CURLOPT_NOBODY...
+     d                 c                   00044
+     d  CURLOPT_FAILONERROR...
+     d                 c                   00045
+     d  CURLOPT_UPLOAD...
+     d                 c                   00046
+     d  CURLOPT_POST   c                   00047
+     d  CURLOPT_DIRLISTONLY...
+     d                 c                   00048
+     d  CURLOPT_APPEND...
+     d                 c                   00050
+     d  CURLOPT_NETRC  c                   00051
+     d  CURLOPT_FOLLOWLOCATION...
+     d                 c                   00052
+     d  CURLOPT_TRANSFERTEXT...
+     d                 c                   00053
+     d  CURLOPT_PUT    c                   00054
+     d  CURLOPT_PROGRESSFUNCTION...
+     d                 c                   20056
+     d  CURLOPT_PROGRESSDATA...
+     d                 c                   10057
+     d  CURLOPT_XFERINFODATA...
+     d                 c                   10057                                PROGRESSDATA alias
+     d  CURLOPT_AUTOREFERER...
+     d                 c                   00058
+     d  CURLOPT_PROXYPORT...
+     d                 c                   00059
+     d  CURLOPT_POSTFIELDSIZE...
+     d                 c                   00060
+     d  CURLOPT_HTTPPROXYTUNNEL...
+     d                 c                   00061
+     d  CURLOPT_INTERFACE...
+     d                 c                   10062
+     d  CURLOPT_KRBLEVEL...
+     d                 c                   10063
+     d  CURLOPT_SSL_VERIFYPEER...
+     d                 c                   00064
+     d  CURLOPT_CAINFO...
+     d                 c                   10065
+     d  CURLOPT_MAXREDIRS...
+     d                 c                   00068
+     d  CURLOPT_FILETIME...
+     d                 c                   00069
+     d  CURLOPT_TELNETOPTIONS...
+     d                 c                   10070
+     d  CURLOPT_MAXCONNECTS...
+     d                 c                   00071
+     d  CURLOPT_FRESH_CONNECT...
+     d                 c                   00074
+     d  CURLOPT_FORBID_REUSE...
+     d                 c                   00075
+     d  CURLOPT_RANDOM_FILE...
+     d                 c                   10076
+     d  CURLOPT_EGDSOCKET...
+     d                 c                   10077
+     d  CURLOPT_CONNECTTIMEOUT...
+     d                 c                   00078
+     d  CURLOPT_HEADERFUNCTION...
+     d                 c                   20079
+     d  CURLOPT_HTTPGET...
+     d                 c                   00080
+     d  CURLOPT_SSL_VERIFYHOST...
+     d                 c                   00081
+     d  CURLOPT_COOKIEJAR...
+     d                 c                   10082
+     d  CURLOPT_SSL_CIPHER_LIST...
+     d                 c                   10083
+     d  CURLOPT_HTTP_VERSION...
+     d                 c                   00084
+     d  CURLOPT_FTP_USE_EPSV...
+     d                 c                   00085
+     d  CURLOPT_SSLCERTTYPE...
+     d                 c                   10086
+     d  CURLOPT_SSLKEY...
+     d                 c                   10087
+     d  CURLOPT_SSLKEYTYPE...
+     d                 c                   10088
+     d  CURLOPT_SSLENGINE...
+     d                 c                   10089
+     d  CURLOPT_SSLENGINE_DEFAULT...
+     d                 c                   00090
+     d  CURLOPT_DNS_USE_GLOBAL_CACHE...
+     d                 c                   00091
+     d  CURLOPT_DNS_CACHE_TIMEOUT...
+     d                 c                   00092
+     d  CURLOPT_PREQUOTE...
+     d                 c                   10093
+     d  CURLOPT_DEBUGFUNCTION...
+     d                 c                   20094
+     d  CURLOPT_DEBUGDATA...
+     d                 c                   10095
+     d  CURLOPT_COOKIESESSION...
+     d                 c                   00096
+     d  CURLOPT_CAPATH...
+     d                 c                   10097
+     d  CURLOPT_BUFFERSIZE...
+     d                 c                   00098
+     d  CURLOPT_NOSIGNAL...
+     d                 c                   00099
+     d  CURLOPT_SHARE  c                   10100
+     d  CURLOPT_PROXYTYPE...
+     d                 c                   00101
+     d  CURLOPT_ACCEPT_ENCODING...
+     d                 c                   10102
+     d  CURLOPT_PRIVATE...
+     d                 c                   10103
+     d  CURLOPT_HTTP200ALIASES...
+     d                 c                   10104
+     d  CURLOPT_UNRESTRICTED_AUTH...
+     d                 c                   00105
+     d  CURLOPT_FTP_USE_EPRT...
+     d                 c                   00106
+     d  CURLOPT_HTTPAUTH...
+     d                 c                   00107
+     d  CURLOPT_SSL_CTX_FUNCTION...
+     d                 c                   20108
+     d  CURLOPT_SSL_CTX_DATA...
+     d                 c                   10109
+     d  CURLOPT_FTP_CREATE_MISSING_DIRS...
+     d                 c                   00110
+     d  CURLOPT_PROXYAUTH...
+     d                 c                   00111
+     d  CURLOPT_SERVER_RESPONSE_TIMEOUT...
+     d                 c                   00112
+     d  CURLOPT_SERVER_RESPONSE_TIMEOUT...                                      Alias
+     d                 c                   00112
+     d  CURLOPT_IPRESOLVE...
+     d                 c                   00113
+     d  CURLOPT_MAXFILESIZE...
+     d                 c                   00114
+     d  CURLOPT_INFILESIZE_LARGE...
+     d                 c                   30115
+     d  CURLOPT_RESUME_FROM_LARGE...
+     d                 c                   30116
+     d  CURLOPT_MAXFILESIZE_LARGE...
+     d                 c                   30117
+     d  CURLOPT_NETRC_FILE...
+     d                 c                   10118
+     d  CURLOPT_USE_SSL...
+     d                 c                   00119
+     d  CURLOPT_POSTFIELDSIZE_LARGE...
+     d                 c                   30120
+     d  CURLOPT_TCP_NODELAY...
+     d                 c                   00121
+     d  CURLOPT_FTPSSLAUTH...
+     d                 c                   00129
+     d  CURLOPT_IOCTLFUNCTION...
+     d                 c                   20130
+     d  CURLOPT_IOCTLDATA...
+     d                 c                   10131
+     d  CURLOPT_FTP_ACCOUNT...
+     d                 c                   10134
+     d  CURLOPT_COOKIELIST...
+     d                 c                   10135
+     d  CURLOPT_IGNORE_CONTENT_LENGTH...
+     d                 c                   00136
+     d  CURLOPT_FTP_SKIP_PASV_IP...
+     d                 c                   00137
+     d  CURLOPT_FTP_FILEMETHOD...
+     d                 c                   00138
+     d  CURLOPT_LOCALPORT...
+     d                 c                   00139
+     d  CURLOPT_LOCALPORTRANGE...
+     d                 c                   00140
+     d  CURLOPT_CONNECT_ONLY...
+     d                 c                   00141
+     d  CURLOPT_CONV_FROM_NETWORK_FUNCTION...
+     d                 c                   20142
+     d  CURLOPT_CONV_TO_NETWORK_FUNCTION...
+     d                 c                   20143
+     d  CURLOPT_CONV_FROM_UTF8_FUNCTION...
+     d                 c                   20144
+     d  CURLOPT_MAX_SEND_SPEED_LARGE...
+     d                 c                   30145
+     d  CURLOPT_MAX_RECV_SPEED_LARGE...
+     d                 c                   30146
+     d  CURLOPT_FTP_ALTERNATIVE_TO_USER...
+     d                 c                   10147
+     d  CURLOPT_SOCKOPTFUNCTION...
+     d                 c                   20148
+     d  CURLOPT_SOCKOPTDATA...
+     d                 c                   10149
+     d  CURLOPT_SSL_SESSIONID_CACHE...
+     d                 c                   00150
+     d  CURLOPT_SSH_AUTH_TYPES...
+     d                 c                   00151
+     d  CURLOPT_SSH_PUBLIC_KEYFILE...
+     d                 c                   10152
+     d  CURLOPT_SSH_PRIVATE_KEYFILE...
+     d                 c                   10153
+     d  CURLOPT_FTP_SSL_CCC...
+     d                 c                   00154
+     d  CURLOPT_TIMEOUT_MS...
+     d                 c                   00155
+     d  CURLOPT_CONNECTTIMEOUT_MS...
+     d                 c                   00156
+     d  CURLOPT_HTTP_TRANSFER_DECODING...
+     d                 c                   00157
+     d  CURLOPT_HTTP_CONTENT_DECODING...
+     d                 c                   00158
+     d  CURLOPT_NEW_FILE_PERMS...
+     d                 c                   00159
+     d  CURLOPT_NEW_DIRECTORY_PERMS...
+     d                 c                   00160
+     d  CURLOPT_POSTREDIR...
+     d                 c                   00161
+     d  CURLOPT_SSH_HOST_PUBLIC_KEY_MD5...
+     d                 c                   10162
+     d  CURLOPT_OPENSOCKETFUNCTION...
+     d                 c                   20163
+     d  CURLOPT_OPENSOCKETDATA...
+     d                 c                   10164
+     d  CURLOPT_COPYPOSTFIELDS...
+     d                 c                   10165
+     d  CURLOPT_PROXY_TRANSFER_MODE...
+     d                 c                   00166
+     d  CURLOPT_SEEKFUNCTION...
+     d                 c                   20167
+     d  CURLOPT_SEEKDATA...
+     d                 c                   10168
+     d  CURLOPT_CRLFILE...
+     d                 c                   10169
+     d  CURLOPT_ISSUERCERT...
+     d                 c                   10170
+     d  CURLOPT_ADDRESS_SCOPE...
+     d                 c                   00171
+     d  CURLOPT_CERTINFO...
+     d                 c                   00172
+     d  CURLOPT_USERNAME...
+     d                 c                   10173
+     d  CURLOPT_PASSWORD...
+     d                 c                   10174
+     d  CURLOPT_PROXYUSERNAME...
+     d                 c                   10175
+     d  CURLOPT_PROXYPASSWORD...
+     d                 c                   10176
+     d  CURLOPT_NOPROXY...
+     d                 c                   10177
+     d  CURLOPT_TFTP_BLKSIZE...
+     d                 c                   00178
+     d  CURLOPT_SOCKS5_GSSAPI_SERVICE...
+     d                 c                   10179
+     d  CURLOPT_SOCKS5_GSSAPI_NEC...
+     d                 c                   00180
+     d  CURLOPT_PROTOCOLS...
+     d                 c                   00181
+     d  CURLOPT_REDIR_PROTOCOLS...
+     d                 c                   00182
+     d  CURLOPT_SSH_KNOWNHOSTS...
+     d                 c                   10183
+     d  CURLOPT_SSH_KEYFUNCTION...
+     d                 c                   20184
+     d  CURLOPT_SSH_KEYDATA...
+     d                 c                   10185
+     d  CURLOPT_MAIL_FROM...
+     d                 c                   10186
+     d  CURLOPT_MAIL_RCPT...
+     d                 c                   10187
+     d  CURLOPT_FTP_USE_PRET...
+     d                 c                   00188
+     d  CURLOPT_RTSP_REQUEST...
+     d                 c                   00189
+     d  CURLOPT_RTSP_SESSION_ID...
+     d                 c                   10190
+     d  CURLOPT_RTSP_STREAM_URI...
+     d                 c                   10191
+     d  CURLOPT_RTSP_TRANSPORT...
+     d                 c                   10192
+     d  CURLOPT_RTSP_CLIENT_CSEQ...
+     d                 c                   00193
+     d  CURLOPT_RTSP_SERVER_CSEQ...
+     d                 c                   00194
+     d  CURLOPT_INTERLEAVEDATA...
+     d                 c                   10195
+     d  CURLOPT_INTERLEAVEFUNCTION...
+     d                 c                   20196
+     d  CURLOPT_WILDCARDMATCH...
+     d                 c                   00197
+     d  CURLOPT_CHUNK_BGN_FUNCTION...
+     d                 c                   20198
+     d  CURLOPT_CHUNK_END_FUNCTION...
+     d                 c                   20199
+     d  CURLOPT_FNMATCH_FUNCTION...
+     d                 c                   20200
+     d  CURLOPT_CHUNK_DATA...
+     d                 c                   10201
+     d  CURLOPT_FNMATCH_DATA...
+     d                 c                   10202
+     d  CURLOPT_RESOLVE...
+     d                 c                   10203
+     d  CURLOPT_TLSAUTH_USERNAME...
+     d                 c                   10204
+     d  CURLOPT_TLSAUTH_PASSWORD...
+     d                 c                   10205
+     d  CURLOPT_TLSAUTH_TYPE...
+     d                 c                   10206
+     d  CURLOPT_TRANSFER_ENCODING...
+     d                 c                   00207
+     d  CURLOPT_CLOSESOCKETFUNCTION...
+     d                 c                   20208
+     d  CURLOPT_CLOSESOCKETDATA...
+     d                 c                   10209
+     d  CURLOPT_GSSAPI_DELEGATION...
+     d                 c                   00210
+     d  CURLOPT_DNS_SERVERS...
+     d                 c                   10211
+     d  CURLOPT_ACCEPTTIMEOUT_MS...
+     d                 c                   00212
+     d  CURLOPT_TCP_KEEPALIVE...
+     d                 c                   00213
+     d  CURLOPT_TCP_KEEPIDLE...
+     d                 c                   00214
+     d  CURLOPT_TCP_KEEPINTVL...
+     d                 c                   00215
+     d  CURLOPT_SSL_OPTIONS...
+     d                 c                   00216
+     d  CURLOPT_MAIL_AUTH...
+     d                 c                   10217
+     d  CURLOPT_SASL_IR...
+     d                 c                   00218
+     d  CURLOPT_XFERINFOFUNCTION...
+     d                 c                   20219
+     d  CURLOPT_XOAUTH2_BEARER...
+     d                 c                   10220
+     d  CURLOPT_DNS_INTERFACE...
+     d                 c                   10221
+     d  CURLOPT_DNS_LOCAL_IP4...
+     d                 c                   10222
+     d  CURLOPT_DNS_LOCAL_IP6...
+     d                 c                   10223
+     d  CURLOPT_LOGIN_OPTIONS...
+     d                 c                   10224
+     d  CURLOPT_SSL_ENABLE_NPN...
+     d                 c                   00225
+     d  CURLOPT_SSL_ENABLE_ALPN...
+     d                 c                   00226
+     d  CURLOPT_EXPECT_100_TIMEOUT_MS...
+     d                 c                   00227
+     d  CURLOPT_PROXYHEADER...
+     d                 c                   10228
+     d  CURLOPT_HEADEROPT...
+     d                 c                   00229
+     d  CURLOPT_PINNEDPUBLICKEY...
+     d                 c                   10230
+     d  CURLOPT_UNIX_SOCKET_PATH...
+     d                 c                   10231
+     d  CURLOPT_SSL_VERIFYSTATUS...
+     d                 c                   00232
+     d  CURLOPT_SSL_FALSESTART...
+     d                 c                   00233
+     d  CURLOPT_PATH_AS_IS...
+     d                 c                   00234
+     d  CURLOPT_PROXY_SERVICE_NAME...
+     d                 c                   10235
+     d  CURLOPT_SERVICE_NAME...
+     d                 c                   10236
+     d  CURLOPT_PIPEWAIT...
+     d                 c                   00237
+     d  CURLOPT_DEFAULT_PROTOCOL...
+     d                 c                   10238
+     d  CURLOPT_STREAM_WEIGHT...
+     d                 c                   00239
+     d  CURLOPT_STREAM_DEPENDS...
+     d                 c                   10240
+     d  CURLOPT_STREAM_DEPENDS_E...
+     d                 c                   10241
+     d  CURLOPT_TFTP_NO_OPTIONS...
+     d                 c                   00242
+     d  CURLOPT_CONNECT_TO...
+     d                 c                   10243
+     d  CURLOPT_TCP_FASTOPEN...
+     d                 c                   00244
+     d  CURLOPT_KEEP_SENDING_ON_ERROR...
+     d                 c                   00245
+     d  CURLOPT_PROXY_CAINFO...
+     d                 c                   10246
+     d  CURLOPT_PROXY_CAPATH...
+     d                 c                   10247
+     d  CURLOPT_PROXY_SSL_VERIFYPEER...
+     d                 c                   00248
+     d  CURLOPT_PROXY_SSL_VERIFYHOST...
+     d                 c                   00249
+     d  CURLOPT_PROXY_SSLVERSION...
+     d                 c                   00250
+     d  CURLOPT_PROXY_TLSAUTH_USERNAME...
+     d                 c                   10251
+     d  CURLOPT_PROXY_TLSAUTH_PASSWORD...
+     d                 c                   10252
+     d  CURLOPT_PROXY_TLSAUTH_TYPE...
+     d                 c                   10253
+     d  CURLOPT_PROXY_SSLCERT...
+     d                 c                   10254
+     d  CURLOPT_PROXY_SSLCERTTYPE...
+     d                 c                   10255
+     d  CURLOPT_PROXY_SSLKEY...
+     d                 c                   10256
+     d  CURLOPT_PROXY_SSLKEYTYPE...
+     d                 c                   10257
+     d  CURLOPT_PROXY_KEYPASSWD...
+     d                 c                   10258
+     d  CURLOPT_PROXY_SSL_CIPHER_LIST...
+     d                 c                   10259
+     d  CURLOPT_PROXY_CRLFILE...
+     d                 c                   10260
+     d  CURLOPT_PROXY_SSL_OPTIONS...
+     d                 c                   00261
+     d  CURLOPT_PRE_PROXY...
+     d                 c                   10262
+     d  CURLOPT_PROXY_PINNEDPUBLICKEY...
+     d                 c                   10263
+     d  CURLOPT_ABSTRACT_UNIX_SOCKET...
+     d                 c                   10264
+     d  CURLOPT_SUPPRESS_CONNECT_HEADERS...
+     d                 c                   00265
+     d  CURLOPT_REQUEST_TARGET...
+     d                 c                   10266
+     d  CURLOPT_SOCKS5_AUTH...
+     d                 c                   00267
+     d  CURLOPT_SSH_COMPRESSION...
+     d                 c                   00268
+     d  CURLOPT_MIMEPOST...
+     d                 c                   10269
+     d  CURLOPT_TIMEVALUE_LARGE...
+     d                 c                   30270
+     d  CURLOPT_HAPPY_EYEBALLS_TIMEOUT_MS...
+     d                 c                   00271
+     d  CURLOPT_RESOLVER_START_FUNCTION...
+     d                 c                   20272
+     d  CURLOPT_RESOLVER_START_DATA...
+     d                 c                   10273
+     d  CURLOPT_HAPROXYPROTOCOL...
+     d                 c                   00274
+     d  CURLOPT_DNS_SHUFFLE_ADDRESSES...
+     d                 c                   00275
+     d  CURLOPT_TLS13_CIPHERS...
+     d                 c                   10276
+     d  CURLOPT_PROXY_TLS13_CIPHERS...
+     d                 c                   10277
+     d  CURLOPT_DISALLOW_USERNAME_IN_URL...
+     d                 c                   00278
+     d  CURLOPT_DOH_URL...
+     d                 c                   10279
+     d  CURLOPT_UPLOAD_BUFFERSIZE...
+     d                 c                   00280
+     d  CURLOPT_UPKEEP_INTERVAL_MS...
+     d                 c                   00281
+     d  CURLOPT_CURLU  c                   10282
+     d  CURLOPT_TRAILERFUNCTION...
+     d                 c                   20283
+     d  CURLOPT_TRAILERDATA...
+     d                 c                   10284
+     d  CURLOPT_HTTP09_ALLOWED...
+     d                 c                   00285
+     d  CURLOPT_ALTSVC_CTRL...
+     d                 c                   00286
+     d  CURLOPT_ALTSVC...
+     d                 c                   10287
+     d  CURLOPT_MAXAGE_CONN...
+     d                 c                   00288
+     d  CURLOPT_SASL_AUTHZID...
+     d                 c                   10289
+     d  CURLOPT_MAIL_RCPT_ALLLOWFAILS...
+     d                 c                   00290
+     d  CURLOPT_SSLCERT_BLOB...
+     d                 c                   40291
+     d  CURLOPT_SSLKEY_BLOB...
+     d                 c                   40292
+     d  CURLOPT_PROXY_SSLCERT_BLOB...
+     d                 c                   40293
+     d  CURLOPT_PROXY_SSLKEY_BLOB...
+     d                 c                   40294
+     d  CURLOPT_ISSUERCERT_BLOB...
+     d                 c                   40295
+     d  CURLOPT_PROXY_ISSUERCERT...
+     d                 c                   10296
+     d  CURLOPT_PROXY_ISSUERCERT_BLOB...
+     d                 c                   40297
+     d  CURLOPT_SSL_EC_CURVES...
+     d                 c                   10298
+     d  CURLOPT_HSTS_CTRL...
+     d                 c                   00299
+     d  CURLOPT_HSTS...
+     d                 c                   10300
+     d  CURLOPT_HSTSREADFUNCTION...
+     d                 c                   20301
+     d  CURLOPT_HSTSREADDATA...
+     d                 c                   10302
+     d  CURLOPT_HSTSWRITEFUNCTION...
+     d                 c                   20303
+     d  CURLOPT_HSTSWRITEDATA...
+     d                 c                   10304
+     d  CURLOPT_AWS_SIG4...
+     d                 c                   10305
+     d  CURLOPT_DOH_SSL_VERIFYPEER...
+     d                 c                   00306
+     d  CURLOPT_DOH_SSL_VERIFYHOST...
+     d                 c                   00307
+     d  CURLOPT_DOH_SSL_VERIFYSTATUS...
+     d                 c                   00308
+     d  CURLOPT_CAINFO_BLOB...
+     d                 c                   40309
+     d  CURLOPT_PROXY_CAINFO_BLOB...
+     d                 c                   40310
+     d  CURLOPT_MAXLIFETIME_CONN...
+     d                 c                   00314
+     d  CURLOPT_MIME_OPTIONS...
+     d                 c                   00315
+      *
+      /if not defined(CURL_NO_OLDIES)
+     d  CURLOPT_FILE   c                   10001
+     d  CURLOPT_INFILE...
+     d                 c                   10009
+     d  CURLOPT_SSLKEYPASSWD...
+     d                 c                   10026
+     d  CURLOPT_SSLCERTPASSWD...
+     d                 c                   10026
+     d  CURLOPT_WRITEHEADER...
+     d                 c                   10029
+     d  CURLOPT_WRITEINFO...
+     d                 c                   10040
+     d  CURLOPT_FTPLISTONLY...
+     d                 c                   00048
+     d  CURLOPT_FTPAPPEND...
+     d                 c                   00050
+     d  CURLOPT_CLOSEPOLICY...
+     d                 c                   00072
+     d  CURLOPT_KRB4LEVEL...
+     d                 c                   10063
+     d  CURLOPT_ENCODING...
+     d                 c                   10102
+     d  CURLOPT_FTP_SSL...
+     d                 c                   00119
+     d  CURLOPT_POST301...
+     d                 c                   00161
+      /endif
+      *
+     d CURLFORMcode    s             10i 0 based(######ptr######)               Enum
+     d  CURL_FORMADD_OK...
+     d                 c                   0
+     d  CURL_FORMADD_MEMORY...
+     d                 c                   1
+     d  CURL_FORMADD_OPTION_TWICE...
+     d                 c                   2
+     d  CURL_FORMADD_NULL...
+     d                 c                   3
+     d  CURL_FORMADD_UNKNOWN_OPTION...
+     d                 c                   4
+     d  CURL_FORMADD_INCOMPLETE...
+     d                 c                   5
+     d  CURL_FORMADD_ILLEGAL_ARRAY...
+     d                 c                   6
+     d  CURL_FORMADD_DISABLED...
+     d                 c                   7
+      *
+     d CURLformoption  s             10i 0 based(######ptr######)               Enum
+     d  CURLFORM_NOTHING...
+     d                 c                   0
+     d  CURLFORM_COPYNAME...
+     d                 c                   1
+     d  CURLFORM_PTRNAME...
+     d                 c                   2
+     d  CURLFORM_NAMELENGTH...
+     d                 c                   3
+     d  CURLFORM_COPYCONTENTS...
+     d                 c                   4
+     d  CURLFORM_PTRCONTENTS...
+     d                 c                   5
+     d  CURLFORM_CONTENTSLENGTH...
+     d                 c                   6
+     d  CURLFORM_FILECONTENT...
+     d                 c                   7
+     d  CURLFORM_ARRAY...
+     d                 c                   8
+     d  CURLFORM_OBSOLETE...
+     d                 c                   9
+     d  CURLFORM_FILE...
+     d                 c                   10
+     d  CURLFORM_BUFFER...
+     d                 c                   11
+     d  CURLFORM_BUFFERPTR...
+     d                 c                   12
+     d  CURLFORM_BUFFERLENGTH...
+     d                 c                   13
+     d  CURLFORM_CONTENTTYPE...
+     d                 c                   14
+     d  CURLFORM_CONTENTHEADER...
+     d                 c                   15
+     d  CURLFORM_FILENAME...
+     d                 c                   16
+     d  CURLFORM_END...
+     d                 c                   17
+     d  CURLFORM_OBSOLETE2...
+     d                 c                   18
+     d  CURLFORM_STREAM...
+     d                 c                   19
+     d  CURLFORM_CONTENTLEN...
+     d                 c                   20
+      *
+     d CURLMIMEOPT_FORMESCAPE...
+     d                 c                   X'00000001'
+      *
+     d CURLINFO        s             10i 0 based(######ptr######)               Enum
+     d  CURLINFO_EFFECTIVE_URL...                                               CURLINFO_STRING + 1
+     d                 c                   X'00100001'
+     d  CURLINFO_RESPONSE_CODE...                                               CURLINFO_LONG   + 2
+     d                 c                   X'00200002'
+     d  CURLINFO_TOTAL_TIME...                                                  CURLINFO_DOUBLE + 3
+     d                 c                   X'00300003'
+     d  CURLINFO_NAMELOOKUP_TIME...                                             CURLINFO_DOUBLE + 4
+     d                 c                   X'00300004'
+     d  CURLINFO_CONNECT_TIME...                                                CURLINFO_DOUBLE + 5
+     d                 c                   X'00300005'
+     d  CURLINFO_PRETRANSFER_TIME...                                            CURLINFO_DOUBLE + 6
+     d                 c                   X'00300006'
+     d  CURLINFO_SIZE_UPLOAD...                                                 CURLINFO_DOUBLE + 7
+     d                 c                   X'00300007'
+     d  CURLINFO_SIZE_UPLOAD_T...                                               CURLINFO_OFF_T  + 7
+     d                 c                   X'00600007'
+     d  CURLINFO_SIZE_DOWNLOAD...                                               CURLINFO_DOUBLE + 8
+     d                 c                   X'00300008'
+     d  CURLINFO_SIZE_DOWNLOAD_T...                                             CURLINFO_OFF_T  + 8
+     d                 c                   X'00600008'
+     d  CURLINFO_SPEED_DOWNLOAD...                                              CURLINFO_DOUBLE + 9
+     d                 c                   X'00300009'
+     d  CURLINFO_SPEED_DOWNLOAD_T...                                            CURLINFO_OFF_T  + 9
+     d                 c                   X'00600009'
+     d  CURLINFO_SPEED_UPLOAD...                                                CURLINFO_DOUBLE + 10
+     d                 c                   X'0030000A'
+     d  CURLINFO_SPEED_UPLOAD_T...                                              CURLINFO_OFF_T  + 10
+     d                 c                   X'0060000A'
+     d  CURLINFO_HEADER_SIZE...                                                 CURLINFO_LONG   + 11
+     d                 c                   X'0020000B'
+     d  CURLINFO_REQUEST_SIZE...                                                CURLINFO_LONG   + 12
+     d                 c                   X'0020000C'
+     d  CURLINFO_SSL_VERIFYRESULT...                                            CURLINFO_LONG   + 13
+     d                 c                   X'0020000D'
+     d  CURLINFO_FILETIME...                                                    CURLINFO_LONG   + 14
+     d                 c                   X'0020000E'
+     d  CURLINFO_FILETIME_T...                                                  CURLINFO_OFF_T  + 14
+     d                 c                   X'0060000E'
+     d  CURLINFO_CONTENT_LENGTH_DOWNLOAD...                                     CURLINFO_DOUBLE + 15
+     d                 c                   X'0030000F'
+     d  CURLINFO_CONTENT_LENGTH_DOWNLOAD_T...                                   CURLINFO_OFF_T  + 15
+     d                 c                   X'0060000F'
+     d  CURLINFO_CONTENT_LENGTH_UPLOAD...                                       CURLINFO_DOUBLE + 16
+     d                 c                   X'00300010'
+     d  CURLINFO_CONTENT_LENGTH_UPLOAD_T...                                     CURLINFO_OFF_T  + 16
+     d                 c                   X'00600010'
+     d  CURLINFO_STARTTRANSFER_TIME...                                          CURLINFO_DOUBLE + 17
+     d                 c                   X'00300011'
+     d  CURLINFO_CONTENT_TYPE...                                                CURLINFO_STRING + 18
+     d                 c                   X'00100012'
+     d  CURLINFO_REDIRECT_TIME...                                               CURLINFO_DOUBLE + 19
+     d                 c                   X'00300013'
+     d  CURLINFO_REDIRECT_COUNT...                                              CURLINFO_LONG   + 20
+     d                 c                   X'00200014'
+     d  CURLINFO_PRIVATE...                                                     CURLINFO_STRING + 21
+     d                 c                   X'00100015'
+     d  CURLINFO_HTTP_CONNECTCODE...                                            CURLINFO_LONG   + 22
+     d                 c                   X'00200016'
+     d  CURLINFO_HTTPAUTH_AVAIL...                                              CURLINFO_LONG   + 23
+     d                 c                   X'00200017'
+     d  CURLINFO_PROXYAUTH_AVAIL...                                             CURLINFO_LONG   + 24
+     d                 c                   X'00200018'
+     d  CURLINFO_OS_ERRNO...                                                    CURLINFO_LONG   + 25
+     d                 c                   X'00200019'
+     d  CURLINFO_NUM_CONNECTS...                                                CURLINFO_LONG   + 26
+     d                 c                   X'0020001A'
+     d  CURLINFO_SSL_ENGINES...                                                 CURLINFO_SLIST  + 27
+     d                 c                   X'0040001B'
+     d  CURLINFO_COOKIELIST...                                                  CURLINFO_SLIST  + 28
+     d                 c                   X'0040001C'
+     d  CURLINFO_LASTSOCKET...                                                  CURLINFO_LONG   + 29
+     d                 c                   X'0020001D'
+     d  CURLINFO_FTP_ENTRY_PATH...                                              CURLINFO_STRING + 30
+     d                 c                   X'0010001E'
+     d  CURLINFO_REDIRECT_URL...                                                CURLINFO_STRING + 31
+     d                 c                   X'0010001F'
+     d  CURLINFO_PRIMARY_IP...                                                  CURLINFO_STRING + 32
+     d                 c                   X'00100020'
+     d  CURLINFO_APPCONNECT_TIME...                                             CURLINFO_DOUBLE + 33
+     d                 c                   X'00300021'
+     d  CURLINFO_CERTINFO...                                                    CURLINFO_SLIST + 34
+     d                 c                   X'00400022'
+     d  CURLINFO_CONDITION_UNMET...                                             CURLINFO_LONG + 35
+     d                 c                   X'00200023'
+     d  CURLINFO_RTSP_SESSION_ID...                                             CURLINFO_STRING + 36
+     d                 c                   X'00100024'
+     d  CURLINFO_RTSP_CLIENT_CSEQ...                                            CURLINFO_LONG + 37
+     d                 c                   X'00200025'
+     d  CURLINFO_RTSP_SERVER_CSEQ...                                            CURLINFO_LONG + 38
+     d                 c                   X'00200026'
+     d  CURLINFO_RTSP_CSEQ_RECV...                                              CURLINFO_LONG + 39
+     d                 c                   X'00200027'
+     d  CURLINFO_PRIMARY_PORT...                                                CURLINFO_LONG + 40
+     d                 c                   X'00200028'
+     d  CURLINFO_LOCAL_IP...                                                    CURLINFO_STRING + 41
+     d                 c                   X'00100029'
+     d  CURLINFO_LOCAL_PORT...                                                  CURLINFO_LONG + 42
+     d                 c                   X'0020002A'
+     d  CURLINFO_TLS_SESSION...                                                 CURLINFO_SLIST + 43
+     d                 c                   X'0040002B'
+     d  CURLINFO_ACTIVESOCKET...                                                CURLINFO_SOCKET + 44
+     d                 c                   X'0050002C'
+     d  CURLINFO_TLS_SSL_PTR...                                                 CURLINFO_SLIST + 45
+     d                 c                   X'0040002D'
+     d  CURLINFO_HTTP_VERSION...                                                CURLINFO_LONG + 46
+     d                 c                   X'0020002E'
+     d  CURLINFO_PROXY_SSL_VERIFYRESULT...                                      CURLINFO_LONG + 47
+     d                 c                   X'0020002F'
+     d  CURLINFO_PROTOCOL...                                                    CURLINFO_LONG + 48
+     d                 c                   X'00200030'
+     d  CURLINFO_SCHEME...                                                      CURLINFO_STRING + 49
+     d                 c                   X'00100031'
+     d  CURLINFO_TOTAL_TIME_T...                                                CURLINFO_OFF_T  + 50
+     d                 c                   X'00600032'
+     d  CURLINFO_NAMELOOKUP_TIME_T...                                           CURLINFO_OFF_T  + 51
+     d                 c                   X'00600033'
+     d  CURLINFO_CONNECT_TIME_T...                                              CURLINFO_OFF_T  + 52
+     d                 c                   X'00600034'
+     d  CURLINFO_PRETRANSFER_TIME_T...                                          CURLINFO_OFF_T  + 53
+     d                 c                   X'00600035'
+     d  CURLINFO_STARTTRANSFER_TIME_T...                                        CURLINFO_OFF_T  + 54
+     d                 c                   X'00600036'
+     d  CURLINFO_REDIRECT_TIME_T...                                             CURLINFO_OFF_T  + 55
+     d                 c                   X'00600037'
+     d  CURLINFO_APPCONNECT_TIME_T...                                           CURLINFO_OFF_T  + 56
+     d                 c                   X'00600038'
+     d  CURLINFO_RETRY_AFTER...                                                 CURLINFO_OFF_T  + 57
+     d                 c                   X'00600039'
+     d  CURLINFO_EFFECTIVE_METHOD...                                            CURLINFO_STRING + 58
+     d                 c                   X'0010003A'
+     d  CURLINFO_PROXY_ERROR...                                                 CURLINFO_LONG + 59
+     d                 c                   X'0020003B'
+     d  CURLINFO_REFERER...                                                     CURLINFO_STRING + 60
+     d                 c                   X'0010003C'
+      *
+     d  CURLINFO_HTTP_CODE...                                                   Old ...RESPONSE_CODE
+     d                 c                   X'00200002'
+      *
+     d curl_sslbackend...
+     d                 s             10i 0 based(######ptr######)               Enum
+     d  CURLSSLBACKEND_NONE...
+     d                 c                   0
+     d  CURLSSLBACKEND_OPENSSL...
+     d                 c                   1
+     d  CURLSSLBACKEND_GNUTLS...
+     d                 c                   2
+     d  CURLSSLBACKEND_NSS...
+     d                 c                   3
+     d  CURLSSLBACKEND_OBSOLETE4...
+     d                 c                   4
+     d  CURLSSLBACKEND_GSKIT...
+     d                 c                   5
+     d  CURLSSLBACKEND_POLARSSL...
+     d                 c                   6
+     d  CURLSSLBACKEND_CYASSL...
+     d                 c                   7
+     d  CURLSSLBACKEND_SCHANNEL...
+     d                 c                   8
+     d  CURLSSLBACKEND_DARWINSSL...
+     d                 c                   9
+     d  CURLSSLBACKEND_AXTLS...
+     d                 c                   10
+     d  CURLSSLBACKEND_MBEDTLS...
+     d                 c                   11
+     d  CURLSSLBACKEND_MESALINK...
+     d                 c                   12
+     d  CURLSSLBACKEND_BEARSSL...
+     d                 c                   13
+     d  CURLSSLBACKEND_RUSTLS...
+     d                 c                   14
+      * Aliases for clones.
+     d  CURLSSLBACKEND_LIBRESSL...
+     d                 c                   1
+     d  CURLSSLBACKEND_BORINGSSL...
+     d                 c                   1
+     d  CURLSSLBACKEND_WOLFSSL...
+     d                 c                   6
+      *
+     d curl_closepolicy...
+     d                 s             10i 0 based(######ptr######)               Enum
+     d  CURLCLOSEPOLICY_OLDEST...
+     d                 c                   1
+     d  CURLCLOSEPOLICY_LEAST_RECENTLY_USED...
+     d                 c                   2
+     d  CURLCLOSEPOLICY_LEAST_TRAFFIC...
+     d                 c                   3
+     d  CURLCLOSEPOLICY_SLOWEST...
+     d                 c                   4
+     d  CURLCLOSEPOLICY_CALLBACK...
+     d                 c                   5
+      *
+     d curl_lock_data...
+     d                 s             10i 0 based(######ptr######)               Enum
+     d  CURL_LOCK_DATA_NONE...
+     d                 c                   0
+     d  CURL_LOCK_DATA_SHARE...
+     d                 c                   1
+     d  CURL_LOCK_DATA_COOKIE...
+     d                 c                   2
+     d  CURL_LOCK_DATA_DNS...
+     d                 c                   3
+     d  CURL_LOCK_DATA_SSL_SESSION...
+     d                 c                   4
+     d  CURL_LOCK_DATA_CONNECT...
+     d                 c                   5
+     d  CURL_LOCK_DATA_PSL...
+     d                 c                   6
+     d  CURL_LOCK_DATA_LAST...
+     d                 c                   7
+      *
+     d curl_lock_access...
+     d                 s             10i 0 based(######ptr######)               Enum
+     d  CURL_LOCK_ACCESS_NONE...
+     d                 c                   0
+     d  CURL_LOCK_ACCESS_SHARED...
+     d                 c                   1
+     d  CURL_LOCK_ACCESS_SINGLE...
+     d                 c                   2
+      *
+     d curl_TimeCond   s             10i 0 based(######ptr######)               Enum
+     d  CURL_TIMECOND_NONE...
+     d                 c                   0
+     d  CURL_TIMECOND_IFMODSINCE...
+     d                 c                   1
+     d  CURL_TIMECOND_LASTMOD...
+     d                 c                   2
+     d  CURL_TIMECOND_LAST...
+     d                 c                   3
+      *
+     d curl_easytype   s             10i 0 based(######ptr######)               Enum
+     d  CURLOT_LONG    c                   0
+     d  CURLOT_VALUES...
+     d                 c                   1
+     d  CURLOT_OFF_T   c                   2
+     d  CURLOT_OBJECT...
+     d                 c                   3
+     d  CURLOT_STRING...
+     d                 c                   4
+     d  CURLOT_SLIST   c                   5
+     d  CURLOT_CBPTR   c                   6
+     d  CURLOT_BLOB    c                   7
+     d  CURLOT_FUNCTION...
+     d                 c                   8
+      *
+     d CURLSHcode      s             10i 0 based(######ptr######)               Enum
+     d  CURLSHE_OK     c                   0
+     d  CURLSHE_BAD_OPTION...
+     d                 c                   1
+     d  CURLSHE_IN_USE...
+     d                 c                   2
+     d  CURLSHE_INVALID...
+     d                 c                   3
+     d  CURLSHE_NOMEM...
+     d                 c                   4
+     d  CURLSHE_NOT_BUILT_IN...
+     d                 c                   5
+      *
+     d CURLSHoption...
+     d                 s             10i 0 based(######ptr######)               Enum
+     d  CURLSHOPT_SHARE...
+     d                 c                   1
+     d  CURLSHOPT_UNSHARE...
+     d                 c                   2
+     d  CURLSHOPT_LOCKFUNC...
+     d                 c                   3
+     d  CURLSHOPT_UNLOCKFUNC...
+     d                 c                   4
+     d  CURLSHOPT_USERDATA...
+     d                 c                   5
+      *
+     d CURLversion     s             10i 0 based(######ptr######)               Enum
+     d  CURLVERSION_FIRST...
+     d                 c                   0
+     d  CURLVERSION_SECOND...
+     d                 c                   1
+     d  CURLVERSION_THIRD...
+     d                 c                   2
+     d  CURLVERSION_FOURTH...
+     d                 c                   3
+     d  CURLVERSION_FIFTH...
+     d                 c                   4
+     d  CURLVERSION_SIXTH...
+     d                 c                   5
+     d  CURLVERSION_SEVENTH...
+     d                 c                   6
+     d  CURLVERSION_EIGHTH...
+     d                 c                   7
+     d  CURLVERSION_NINTH...
+     d                 c                   8
+     d  CURLVERSION_TENTH...
+     d                 c                   9
+     d  CURLVERSION_NOW...
+     d                 c                   9                                    CURLVERSION_TENTH
+      *
+     d curlsocktype    s             10i 0 based(######ptr######)               Enum
+     d  CURLSOCKTYPE_IPCXN...
+     d                 c                   0
+     d  CURLSOCKTYPE_ACCEPT...
+     d                 c                   1
+      *
+     d  CURL_SOCKOPT_OK...
+     d                 c                   0
+     d  CURL_SOCKOPT_ERROR...
+     d                 c                   1
+     d  CURL_SOCKOPT_ALREADY_CONNECTED...
+     d                 c                   2
+      *
+     d CURLMcode       s             10i 0 based(######ptr######)               Enum
+     d  CURLM_CALL_MULTI_PERFORM...
+     d                 c                   -1
+     d  CURLM_CALL_MULTI_SOCKET...
+     d                 c                   -1
+     d  CURLM_OK       c                   0
+     d  CURLM_BAD_HANDLE...
+     d                 c                   1
+     d  CURLM_BAD_EASY_HANDLE...
+     d                 c                   2
+     d  CURLM_OUT_OF_MEMORY...
+     d                 c                   3
+     d  CURLM_INTERNAL_ERROR...
+     d                 c                   4
+     d  CURLM_BAD_SOCKET...
+     d                 c                   5
+     d  CURLM_UNKNOWN_OPTION...
+     d                 c                   6
+     d  CURLM_ADDED_ALREADY...
+     d                 c                   7
+     d  CURLM_RECURSIVE_API_CALL...
+     d                 c                   8
+     d  CURLM_WAKEUP_FAILURE...
+     d                 c                   9
+     d  CURLM_BAD_FUNCTION_ARGUMENT...
+     d                 c                   10
+     d  CURLM_LAST     c                   11
+      *
+     d CURLMSG         s             10i 0 based(######ptr######)               Enum
+     d  CURLMSG_NONE   c                   0
+     d  CURLMSG_DONE   c                   1
+      *
+     d CURLMoption     s             10i 0 based(######ptr######)               Enum
+     d  CURLMOPT_SOCKETFUNCTION...
+     d                 c                   20001
+     d  CURLMOPT_SOCKETDATA...
+     d                 c                   10002
+     d  CURLMOPT_PIPELINING...
+     d                 c                   00003
+     d  CURLMOPT_TIMERFUNCTION...
+     d                 c                   20004
+     d  CURLMOPT_TIMERDATA...
+     d                 c                   10005
+     d  CURLMOPT_MAXCONNECTS...
+     d                 c                   00006
+     d  CURLMOPT_MAX_HOST_CONNECTIONS...
+     d                 c                   00007
+     d  CURLMOPT_MAX_PIPELINE_LENGTH...
+     d                 c                   00008
+     d  CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE...
+     d                 c                   30009
+     d  CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE...
+     d                 c                   30010
+     d  CURLMOPT_PIPELINING_SITE_BL...
+     d                 c                   10011
+     d  CURLMOPT_PIPELINING_SERVER_BL...
+     d                 c                   10012
+     d  CURLMOPT_MAX_TOTAL_CONNECTIONS...
+     d                 c                   00013
+     d  CURLMOPT_PUSHFUNCTION...
+     d                 c                   20014
+     d  CURLMOPT_PUSHDATA...
+     d                 c                   10015
+     d  CURLMOPT_MAX_CONCURRENT_STREAMS...
+     d                 c                   10016
+      *
+      * Bitmask bits for CURLMOPT_PIPELING.
+      *
+     d CURLPIPE_NOTHING...
+     d                 c                   x'00000000'
+     d CURLPIPE_HTTP1  c                   x'00000001'
+     d CURLPIPE_MULTIPLEX...
+     d                 c                   x'00000002'
+      *
+      *  Public API enums for RTSP requests.
+      *
+     d CURLRTSPREQ_NONE...
+     d                 c                   0
+     d CURL_RTSPREQ_OPTIONS...
+     d                 c                   1
+     d CURL_RTSPREQ_DESCRIBE...
+     d                 c                   2
+     d CURL_RTSPREQ_ANNOUNCE...
+     d                 c                   3
+     d CURL_RTSPREQ_SETUP...
+     d                 c                   4
+     d CURL_RTSPREQ_PLAY...
+     d                 c                   5
+     d CURL_RTSPREQ_PAUSE...
+     d                 c                   6
+     d CURL_RTSPREQ_TEARDOWN...
+     d                 c                   7
+     d CURL_RTSPREQ_GET_PARAMETER...
+     d                 c                   8
+     d CURL_RTSPREQ_SET_PARAMETER...
+     d                 c                   9
+     d CURL_RTSPREQ_RECORD...
+     d                 c                   10
+     d CURL_RTSPREQ_RECEIVE...
+     d                 c                   12
+     d CURL_RTSPREQ_LAST...
+     d                 c                   13
+      *
+     d CURLUcode       s             10i 0 based(######ptr######)               Enum
+     d  CURLUE_OK      c                   0
+     d  CURLUE_BAD_HANDLE...
+     d                 c                   1
+     d  CURLUE_BAD_PARTPOINTER...
+     d                 c                   2
+     d  CURLUE_MALFORMED_INPUT...
+     d                 c                   3
+     d  CURLUE_BAD_PORT_NUMBER...
+     d                 c                   4
+     d  CURLUE_UNSUPPORTED_SCHEME...
+     d                 c                   5
+     d  CURLUE_URLDECODE...
+     d                 c                   6
+     d  CURLUE_OUT_OF_MEMORY...
+     d                 c                   7
+     d  CURLUE_USER_NOT_ALLOWED...
+     d                 c                   8
+     d  CURLUE_UNKNOWN_PART...
+     d                 c                   9
+     d  CURLUE_NO_SCHEME...
+     d                 c                   10
+     d  CURLUE_NO_USER...
+     d                 c                   11
+     d  CURLUE_NO_PASSWORD...
+     d                 c                   12
+     d  CURLUE_NO_OPTIONS...
+     d                 c                   13
+     d  CURLUE_NO_HOST...
+     d                 c                   14
+     d  CURLUE_NO_PORT...
+     d                 c                   15
+     d  CURLUE_NO_QUERY...
+     d                 c                   16
+     d  CURLUE_NO_FRAGMENT...
+     d                 c                   17
+      *
+     d CURLUPart       s             10i 0 based(######ptr######)               Enum
+     d  CURLUPART_URL  c                   0
+     d  CURLUPART_SCHEME...
+     d                 c                   1
+     d  CURLUPART_USER...
+     d                 c                   2
+     d  CURLUPART_PASSWORD...
+     d                 c                   3
+     d  CURLUPART_OPTIONS...
+     d                 c                   4
+     d  CURLUPART_HOST...
+     d                 c                   5
+     d  CURLUPART_PORT...
+     d                 c                   6
+     d  CURLUPART_PATH...
+     d                 c                   7
+     d  CURLUPART_QUERY...
+     d                 c                   8
+     d  CURLUPART_FRAGMENT...
+     d                 c                   9
+     d  CURLUPART_ZONEID...
+     d                 c                   10
+      *
+      *
+     d CURLSTScode     s             10i 0 based(######ptr######)               Enum
+     d  CURLSTS_OK     c                   0
+     d  CURLSTS_DONE   c                   1
+     d  CURLSTS_FAIL   c                   2
+      *
+      *  Renaming CURLMsg to CURL_Msg to avoid case-insensivity name clash.
+      *
+     d CURL_Msg        ds                  based(######ptr######)
+     d                                     qualified
+     d  msg                                like(CURLMSG)
+     d  easy_handle                    *                                        CURL *
+     d  data                           *
+     d   whatever                      *   overlay(data)                        void *
+     d   result                            overlay(data) like(CURLcode)
+      *
+     d curl_waitfd...
+     d                 ds                  based(######ptr######)
+     d                                     qualified
+     d  fd                                 like(curl_socket_t)
+     d  events                        5i 0
+     d  revents                       5i 0
+      *
+     d curl_http_post...
+     d                 ds                  based(######ptr######)
+     d                                     qualified
+     d  next                           *                                        curl_httppost *
+     d  name                           *                                        char *
+     d  namelength                   10i 0                                      long
+     d  contents                       *                                        char *
+     d  contentslength...
+     d                               10i 0                                      long
+     d  buffer                         *                                        char *
+     d  bufferlength...
+     d                               10i 0                                      long
+     d  contenttype                    *                                        char *
+     d  contentheader...
+     d                                 *                                        curl_slist *
+     d  more                           *                                        curl_httppost *
+     d  flags                        10i 0                                      long
+     d  showfilename                   *                                        char *
+     d  userp                          *                                        void *
+      *
+     d curl_sockaddr   ds                  based(######ptr######)
+     d                                     qualified
+     d  family                       10i 0
+     d  socktype                     10i 0
+     d  protocol                     10i 0
+     d  addrlen                      10u 0
+     d  addr                         16                                         struct sockaddr
+      *
+     d curl_khtype     s             10i 0 based(######ptr######)               enum
+     d CURLKHTYPE_UNKNOWN...
+     d                 c                   0
+     d CURLKHTYPE_RSA1...
+     d                 c                   1
+     d CURLKHTYPE_RSA...
+     d                 c                   2
+     d CURLKHTYPE_DSS...
+     d                 c                   3
+      *
+     d curl_khkey      ds                  based(######ptr######)
+     d                                     qualified
+     d  key                            *                                        const char *
+     d  len                          10u 0
+     d  keytype                            like(curl_khtype)
+      *
+     d curl_forms      ds                  based(######ptr######)
+     d                                     qualified
+     d  option                             like(CURLformoption)
+     d  value                          *                                        const char *
+     d   value_ptr                     *   overlay(value)
+     d   value_procptr...
+     d                                 *   overlay(value) procptr
+     d   value_num                         overlay(value: 8) like(curl_off_t)
+      *
+     d curl_slist      ds                  based(######ptr######)
+     d                                     qualified
+     d  data                           *                                        char *
+     d  next                           *                                        struct curl_slist *
+      *
+     d curl_version_info_data...
+     d                 ds                  based(######ptr######)
+     d                                     qualified
+     d  age                                like(CURLversion)
+     d  version                        *                                        const char *
+     d  version_num                  10u 0
+     d  host                           *                                        const char *
+     d  features                     10i 0
+     d  ssl_version                    *                                        const char *
+     d  ssl_version_num...
+     d                               10i 0                                      long
+     d  libz_version                   *                                        const char *
+     d  protocols                      *                                        const char * const *
+     d  ares                           *                                        const char *
+     d  ares_num                     10i 0
+     d  libidn                         *                                        const char *
+     d  iconv_ver_num...
+     d                               10i 0
+     d  libssh_version...
+     d                                 *                                        const char *
+     d  brotli_ver_num...
+     d                               10u 0
+     d  brotli_version...
+     d                                 *                                        const char *
+     d  nghttp2_ver_num...
+     d                               10u 0
+     d  nghttp2_version...
+     d                                 *                                        const char *
+     d  quic_version...
+     d                                 *                                        const char *
+     d  cainfo...
+     d                                 *                                        const char *
+     d  capath...
+     d                                 *                                        const char *
+     d  zstd_ver_num...
+     d                               10u 0
+     d  zstd_version...
+     d                                 *                                        const char *
+     d  hyper_version...
+     d                                 *                                        const char *
+     d  gsasl_version...
+     d                                 *                                        const char *
+      *
+     d curl_certinfo   ds                  based(######ptr######)
+     d                                     qualified
+     d  num_of_certs                 10i 0
+     d  certinfo                       *                                        struct curl_slist **
+      *
+     d curl_fistrgs    ds                  based(######ptr######)
+     d                                     qualified
+     d  time                           *                                        char *
+     d  perm                           *                                        char *
+     d  user                           *                                        char *
+     d  group                          *                                        char *
+     d  target                         *                                        char *
+      *
+     d curl_tlssessioninfo...
+     d                 ds                  based(######ptr######)
+     d                                     qualified
+     d  backend                            like(curl_sslbackend)
+     d  internals                      *                                        void *
+      *
+     d curl_fileinfo   ds                  based(######ptr######)
+     d                                     qualified
+     d  filename                       *                                        char *
+     d  filetype                           like(curlfiletype)
+     d  time                         10i 0                                      time_t
+     d  perm                         10u 0
+     d  uid                          10i 0
+     d  gid                          10i 0
+     d  size                               like(curl_off_t)
+     d  hardlinks                    10i 0
+     d  strings                            likeds(curl_fistrgs)
+     d  flags                        10u 0
+     d  b_data                         *                                        char *
+     d  b_size                       10u 0                                      size_t
+     d  b_used                       10u 0                                      size_t
+      *
+     d curl_easyoption...
+     d                 ds                  based(######ptr######)
+     d                                     qualified
+     d  name                           *                                        const char *
+     d  id                                 like(CURLoption)
+     d  type                               like(curl_easytype)
+     d  flags                        10u 0
+      *
+     d curl_hstsentry...
+     d                 ds                  based(######ptr######)
+     d                                     qualified
+     d  name                           *                                        char *
+     d  namelen                      10u 0                                      size_t
+     d  includeSubDomain...
+     d                               10u 0                                      Bit field: 1
+     d  expire                       10
+      *
+     d curl_index      ds                  based(######ptr######)
+     d                                     qualified
+     d  index                        10u 0                                      size_t
+     d  total                        10u 0                                      size_t
+      *
+     d curl_formget_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_malloc_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_free_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_realloc_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_strdup_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_calloc_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_lock_function...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_unlock_function...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_progress_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_xferinfo_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_read_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_trailer_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_write_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_seek_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_sockopt_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_ioctl_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_debug_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_conv_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_ssl_ctx_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_socket_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_multi_timer_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_push_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_opensocket_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_sshkeycallback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_chunk_bgn_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_chunk_end_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_fnmatch_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_closesocket_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_resolver_start_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_hstsread_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+     d curl_hstswrite_callback...
+     d                 s               *   based(######ptr######) procptr
+      *
+      **************************************************************************
+      *                              Prototypes
+      **************************************************************************
+      *
+     d curl_mime_init  pr              *   extproc('curl_mime_init')            curl_mime *
+     d  easy                           *   value                                CURL *
+      *
+     d curl_mime_free  pr                  extproc('curl_mime_free')
+     d  mime                           *   value                                curl_mime *
+      *
+     d curl_mime_addpart...
+     d                 pr              *   extproc('curl_mime_addpart')         curl_mimepart *
+     d  mime                           *   value                                curl_mime *
+      *
+     d curl_mime_name  pr                  extproc('curl_mime_name')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  name                           *   value options(*string)
+      *
+     d curl_mime_filename...
+     d                 pr                  extproc('curl_mime_filename')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  filename                       *   value options(*string)
+      *
+     d curl_mime_type  pr                  extproc('curl_mime_type')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  mimetype                       *   value options(*string)
+      *
+     d curl_mime_encoder...
+     d                 pr                  extproc('curl_mime_encoder')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  encoding                       *   value options(*string)
+      *
+     d curl_mime_data  pr                  extproc('curl_mime_data')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  data                           *   value options(*string)
+     d  datasize                     10u 0                                      size_t
+      *
+     d curl_mime_filedata...
+     d                 pr                  extproc('curl_mime_filedata')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  filename                       *   value options(*string)
+      *
+     d curl_mime_data_cb...
+     d                 pr                  extproc('curl_mime_data_cb')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  datasize                           value like(curl_off_t)
+     d  readfunc                           value like(curl_read_callback)
+     d  seekfunc                           value like(curl_seek_callback)
+     d  freefunc                           value like(curl_free_callback)
+     d  arg                            *   value                                void *
+      *
+     d curl_mime_subparts...
+     d                 pr                  extproc('curl_mime_subparts')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  subparts                       *   value                                curl_mime *
+      *
+     d curl_mime_headers...
+     d                 pr                  extproc('curl_mime_headers')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  headers                        *   value                                curl_slist *
+     d  take_ownership...
+     d                               10i 0 value
+      *
+      *  This procedure as a variable parameter list.
+      *  This prototype allows use of an option array, or a single "object"
+      *    option. Other argument lists may be implemented by alias procedure
+      *    prototype definitions.
+      *
+     d curl_formadd    pr                  extproc('curl_formadd')
+     d                                     like(CURLFORMcode)
+     d  httppost                       *                                        curl_httppost *
+     d  lastpost                       *                                        curl_httppost *
+     d  option1                            value like(CURLFORMoption)           CURLFORM_ARRAY
+     d                                     options(*nopass)
+     d  object1                        *   value options(*string: *nopass)
+     d  option2                            value like(CURLFORMoption)           CURLFORM_END
+     d                                     options(*nopass)
+      *
+      *
+     d curl_strequal   pr            10i 0 extproc('curl_strequal')
+     d  s1                             *   value options(*string)
+     d  s2                             *   value options(*string)
+      *
+     d curl_strnequal  pr            10i 0 extproc('curl_strnequal')
+     d  s1                             *   value options(*string)
+     d  s2                             *   value options(*string)
+     d  n                            10u 0 value
+      *
+     d curl_formget    pr            10i 0 extproc('curl_formget')
+     d  form                           *   value                                curl_httppost *
+     d  arg                            *   value
+     d  append                             value like(curl_formget_callback)
+      *
+     d curl_formfree   pr                  extproc('curl_formfree')
+     d  form                           *   value                                curl_httppost *
+      *
+     d curl_getenv     pr              *   extproc('curl_getenv')
+     d  variable                       *   value options(*string)
+      *
+     d curl_version    pr              *   extproc('curl_version')
+      *
+     d curl_easy_escape...
+     d                 pr              *   extproc('curl_easy_escape')          char *
+     d  handle                         *   value                                CURL *
+     d  string                         *   value options(*string)
+     d  length                       10i 0 value
+      *
+     d curl_escape     pr              *   extproc('curl_escape')               char *
+     d  string                         *   value options(*string)
+     d  length                       10i 0 value
+      *
+     d curl_easy_unescape...
+     d                 pr              *   extproc('curl_easy_unescape')        char *
+     d  handle                         *   value                                CURL *
+     d  string                         *   value options(*string)
+     d  length                       10i 0 value
+     d  outlength                    10i 0 options(*omit)
+      *
+     d curl_unescape   pr              *   extproc('curl_unescape')             char *
+     d  string                         *   value options(*string)
+     d  length                       10i 0 value
+      *
+     d curl_free       pr                  extproc('curl_free')
+     d  p                              *   value
+      *
+     d curl_global_init...
+     d                 pr                  extproc('curl_global_init')
+     d                                     like(CURLcode)
+     d  flags                        10i 0 value
+      *
+     d curl_global_init_mem...
+     d                 pr                  extproc('curl_global_init_mem')
+     d                                     like(CURLcode)
+     d  m                                  value like(curl_malloc_callback)
+     d  f                                  value like(curl_free_callback)
+     d  r                                  value like(curl_realloc_callback)
+     d  s                                  value like(curl_strdup_callback)
+     d  c                                  value like(curl_calloc_callback)
+      *
+     d curl_global_cleanup...
+     d                 pr                  extproc('curl_global_cleanup')
+      *
+     d curl_slist_append...
+     d                 pr              *   extproc('curl_slist_append')         struct curl_slist *
+     d  list                           *   value                                struct curl_slist *
+     d  data                           *   value options(*string)               const char *
+      *
+     d curl_slist_free_all...
+     d                 pr                  extproc('curl_slist_free_all')
+     d  list                           *   value                                struct curl_slist *
+      *
+     d curl_getdate    pr            10i 0 extproc('curl_getdate')              time_t
+     d  p                              *   value options(*string)               const char *
+     d  unused                       10i 0 const options(*omit)                 time_t
+      *
+     d curl_share_init...
+     d                 pr              *   extproc('curl_share_init')           CURLSH * (= void *)
+      *
+      *  Variable argument type procedure.
+      *  Multiply prototyped to support all possible types.
+      *
+     d curl_share_setopt_int...
+     d                 pr                  extproc('curl_share_setopt')
+     d                                     like(CURLSHcode)
+     d  share                          *   value                                CURLSH * (= void *)
+     d  option                             value like(CURLSHoption)
+     d  intarg                       10i 0 value options(*nopass)
+      *
+     d curl_share_setopt_ptr...
+     d                 pr                  extproc('curl_share_setopt')
+     d                                     like(CURLSHcode)
+     d  share                          *   value                                CURLSH * (= void *)
+     d  option                             value like(CURLSHoption)
+     d  ptrarg                         *   value options(*nopass)
+      *
+     d curl_share_setopt_proc...
+     d                 pr                  extproc('curl_share_setopt')
+     d                                     like(CURLSHcode)
+     d  share                          *   value                                CURLSH * (= void *)
+     d  option                             value like(CURLSHoption)
+     d  procarg                        *   value procptr options(*nopass)
+      *
+     d curl_share_cleanup...
+     d                 pr                  extproc('curl_share_cleanup')
+     d                                     like(CURLSHcode)
+     d  share                          *   value                                CURLSH * (= void *)
+      *
+     d curl_version_info...
+     d                 pr              *   extproc('curl_version_info')         c_i_version_data *
+     d  version                            value like(CURLversion)
+      *
+     d curl_easy_strerror...
+     d                 pr              *   extproc('curl_easy_strerror')        const char *
+     d  code                               value like(CURLcode)
+      *
+     d curl_share_strerror...
+     d                 pr              *   extproc('curl_share_strerror')       const char *
+     d  code                               value like(CURLSHcode)
+      *
+     d curl_easy_init  pr              *   extproc('curl_easy_init')            CURL *
+      *
+      *  Multiple prototypes for vararg procedure curl_easy_setopt.
+      *
+     d curl_easy_setopt_long...
+     d                 pr                  extproc('curl_easy_setopt')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  option                             value like(CURLoption)
+     d  longarg                      10i 0 value options(*nopass)
+      *
+     d curl_easy_setopt_object...
+     d                 pr                  extproc('curl_easy_setopt')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  option                             value like(CURLoption)
+     d  objectarg                      *   value options(*string: *nopass)
+      *
+     d curl_easy_setopt_function...
+     d                 pr                  extproc('curl_easy_setopt')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  option                             value like(CURLoption)
+     d  functionarg                    *   value procptr options(*nopass)
+      *
+     d curl_easy_setopt_offset...
+     d                 pr                  extproc('curl_easy_setopt')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  option                             value like(CURLoption)
+     d  offsetarg                          value like(curl_off_t)
+     d                                     options(*nopass)
+      *
+      *
+     d curl_easy_perform...
+     d                 pr                  extproc('curl_easy_perform')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+      *
+     d curl_easy_cleanup...
+     d                 pr                  extproc('curl_easy_cleanup')
+     d  curl                           *   value                                CURL *
+      *
+      *  Multiple prototypes for vararg procedure curl_easy_getinfo.
+      *
+     d curl_easy_getinfo_string...
+     d                 pr                  extproc('curl_easy_getinfo')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  stringarg                      *   options(*nopass)                     char *
+      *
+     d curl_easy_getinfo_long...
+     d                 pr                  extproc('curl_easy_getinfo')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  longarg                      10i 0 options(*nopass)
+      *
+     d curl_easy_getinfo_double...
+     d                 pr                  extproc('curl_easy_getinfo')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  doublearg                     8f   options(*nopass)
+      *
+     d curl_easy_getinfo_slist...
+     d                 pr                  extproc('curl_easy_getinfo')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  slistarg                       *   options(*nopass)                     struct curl_slist *
+      *
+     d curl_easy_getinfo_ptr...
+     d                 pr                  extproc('curl_easy_getinfo')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  ptrarg                         *   options(*nopass)                     void *
+      *
+     d curl_easy_getinfo_socket...
+     d                 pr                  extproc('curl_easy_getinfo')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  socketarg                          like(curl_socket_t) options(*nopass)
+      *
+     d curl_easy_getinfo_off_t...
+     d                 pr                  extproc('curl_easy_getinfo')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  offsetarg                          like(curl_off_t) options(*nopass)
+      *
+      *
+     d curl_easy_duphandle...
+     d                 pr              *   extproc('curl_easy_duphandle')       CURL *
+     d  curl                           *   value                                CURL *
+      *
+     d curl_easy_reset...
+     d                 pr                  extproc('curl_easy_reset')
+     d  curl                           *   value                                CURL *
+      *
+     d curl_easy_recv...
+     d                 pr                  extproc('curl_easy_recv')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  buffer                         *   value                                void *
+     d  buflen                       10u 0 value                                size_t
+     d  n                            10u 0                                      size_t *
+      *
+     d curl_easy_send...
+     d                 pr                  extproc('curl_easy_send')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  buffer                         *   value                                const void *
+     d  buflen                       10u 0 value                                size_t
+     d  n                            10u 0                                      size_t *
+      *
+     d curl_easy_pause...
+     d                 pr                  extproc('curl_easy_pause')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  bitmask                      10i 0 value
+      *
+     d curl_easy_upkeep...
+     d                 pr                  extproc('curl_easy_upkeep')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+      *
+     d curl_multi_init...
+     d                 pr              *   extproc('curl_multi_init')           CURLM *
+      *
+     d curl_multi_add_handle...
+     d                 pr                  extproc('curl_multi_add_handle')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  curl_handle                    *   value                                CURL *
+      *
+     d curl_multi_remove_handle...
+     d                 pr                  extproc('curl_multi_remove_handle')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  curl_handle                    *   value                                CURL *
+      *
+     d curl_multi_fdset...
+     d                 pr                  extproc('curl_multi_fdset')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  read_fd_set               65535    options(*varsize)                    fd_set
+     d  write_fd_set              65535    options(*varsize)                    fd_set
+     d  exc_fd_set                65535    options(*varsize)                    fd_set
+     d  max_fd                       10i 0
+      *
+     d curl_multi_wait...
+     d                 pr                  extproc('curl_multi_wait')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  extra_fds                      *   value                                curl_waitfd *
+     d  extra_nfds                   10u 0 value
+     d  timeout_ms                   10i 0 value
+     d  ret                          10i 0 options(*omit)
+      *
+     d curl_multi_perform...
+     d                 pr                  extproc('curl_multi_perform')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  running_handles...
+     d                               10i 0
+      *
+     d curl_multi_cleanup...
+     d                 pr                  extproc('curl_multi_cleanup')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+      *
+     d curl_multi_info_read...
+     d                 pr              *   extproc('curl_multi_info_read')      CURL_Msg *
+     d  multi_handle                   *   value                                CURLM *
+     d  msgs_in_queue                10i 0
+      *
+     d curl_multi_strerror...
+     d                 pr              *   extproc('curl_multi_strerror')       char *
+     d  code                               value like(CURLMcode)
+      *
+     d curl_pushheader_bynum...
+     d                 pr              *   extproc('curl_pushheader_bynum')     char *
+     d  h                              *   value                                curl_pushheaders *
+     d  num                          10u 0 value
+      *
+     d curl_pushheader_byname...
+     d                 pr              *   extproc('curl_pushheader_byname')    char *
+     d  h                              *   value                                curl_pushheaders *
+     d  header                         *   value options(*string)               const char *
+      *
+     d curl_multi_socket...
+     d                 pr                  extproc('curl_multi_socket')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  s                                  value like(curl_socket_t)
+     d  running_handles...
+     d                               10i 0
+      *
+     d curl_multi_socket_action...
+     d                 pr                  extproc('curl_multi_socket_action')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  s                                  value like(curl_socket_t)
+     d  ev_bitmask                   10i 0 value
+     d  running_handles...
+     d                               10i 0
+      *
+     d curl_multi_socket_all...
+     d                 pr                  extproc('curl_multi_socket_all')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  running_handles...
+     d                               10i 0
+      *
+     d curl_multi_timeout...
+     d                 pr                  extproc('curl_multi_timeout')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  milliseconds                 10i 0
+      *
+      *  Multiple prototypes for vararg procedure curl_multi_setopt.
+      *
+     d curl_multi_setopt_long...
+     d                 pr                  extproc('curl_multi_setopt')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  option                             value like(CURLMoption)
+     d  longarg                      10i 0 value options(*nopass)
+      *
+     d curl_multi_setopt_object...
+     d                 pr                  extproc('curl_multi_setopt')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  option                             value like(CURLMoption)
+     d  objectarg                      *   value options(*string: *nopass)
+      *
+     d curl_multi_setopt_function...
+     d                 pr                  extproc('curl_multi_setopt')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  option                             value like(CURLMoption)
+     d  functionarg                    *   value procptr options(*nopass)
+      *
+     d curl_multi_setopt_offset...
+     d                 pr                  extproc('curl_multi_setopt')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  option                             value like(CURLMoption)
+     d  offsetarg                          value like(curl_off_t)
+     d                                     options(*nopass)
+      *
+      *
+     d curl_multi_assign...
+     d                 pr                  extproc('curl_multi_assign')
+     d                                     like(CURLMcode)
+     d  multi_handle                   *   value                                CURLM *
+     d  sockfd                             value like(curl_socket_t)
+     d  sockp                          *   value                                void *
+      *
+     d curl_url        pr              *   extproc('curl_url')                  CURLU *
+      *
+     d curl_url_cleanup...
+     d                 pr                  extproc('curl_url_cleanup')
+     d  handle                         *   value                                CURLU *
+      *
+     d curl_url_dup    pr              *   extproc('curl_url_dup')              CURLU *
+     d  in                             *   value                                CURLU *
+      *
+     d curl_url_get    pr                  extproc('curl_url_get')
+     d                                     like(CURLUcode)
+     d  handle                         *   value                                CURLU *
+     d  what                               value like(CURLUPart)
+     d  part                           *                                        char **
+     d  flags                        10u 0 value
+      *
+     d curl_url_set    pr                  extproc('curl_url_set')
+     d                                     like(CURLUcode)
+     d  handle                         *   value                                CURLU *
+     d  what                               value like(CURLUPart)
+     d  part                           *   value options(*string)
+     d  flags                        10u 0 value
+      *
+     d curl_url_strerror...
+     d                 pr              *   extproc('curl_url_strerror')         const char *
+     d  code                               value like(CURLUcode)
+      *
+     d curl_easy_option_by_name...
+     d                 pr              *   extproc('curl_easy_option_by_name')  curl_easyoption *
+     d  name                           *   value options(*string)
+      *
+     d curl_easy_option_by_id...
+     d                 pr              *   extproc('curl_easy_option_by_id')    curl_easyoption *
+     d  id                                 value like(CURLoption)
+      *
+     d curl_easy_option_next...
+     d                 pr              *   extproc('curl_easy_next')            curl_easyoption *
+     d  prev                           *   value                                curl_easyoption *
+      *
+      **************************************************************************
+      *                CCSID wrapper procedure prototypes
+      **************************************************************************
+      *
+     d curl_version_ccsid...
+     d                 pr              *   extproc('curl_version_ccsid')
+     d  ccsid                        10u 0 value
+      *
+     d curl_easy_escape_ccsid...
+     d                 pr              *   extproc('curl_easy_escape_ccsid')    char *
+     d  handle                         *   value                                CURL *
+     d  string                         *   value options(*string)
+     d  length                       10i 0 value
+     d  ccsid                        10u 0 value
+      *
+     d curl_easy_unescape_ccsid...
+     d                 pr              *   extproc('curl_easy_unescape_ccsid')  char *
+     d  handle                         *   value                                CURL *
+     d  string                         *   value options(*string)
+     d  length                       10i 0 value
+     d  outlength                    10i 0 options(*omit)
+     d  ccsid                        10u 0 value
+      *
+     d curl_slist_append_ccsid...
+     d                 pr              *   extproc('curl_slist_append_ccsid')   struct curl_slist *
+     d  list                           *   value                                struct curl_slist *
+     d  data                           *   value options(*string)               const char *
+     d  ccsid                        10u 0 value
+      *
+     d curl_getdate_ccsid...
+     d                 pr            10i 0 extproc('curl_getdate_ccsid')        time_t
+     d  p                              *   value options(*string)               const char *
+     d  unused                       10i 0 const options(*omit)                 time_t
+     d  ccsid                        10u 0 value
+      *
+     d curl_version_info_ccsid...
+     d                 pr              *   extproc('curl_version_info_ccsid')   c_i_version_data *
+     d  version                            value like(CURLversion)
+     d  ccsid                        10u 0 value
+      *
+     d curl_easy_strerror_ccsid...
+     d                 pr              *   extproc('curl_easy_strerror_ccsid')  const char *
+     d  code                               value like(CURLcode)
+     d  ccsid                        10u 0 value
+      *
+     d curl_share_strerror_ccsid...
+     d                 pr              *   extproc('curl_share_strerror_ccsid') const char *
+     d  code                               value like(CURLSHcode)
+     d  ccsid                        10u 0 value
+      *
+     d curl_multi_strerror_ccsid...
+     d                 pr              *   extproc('curl_multi_strerror_ccsid') char *
+     d  code                               value like(CURLMcode)
+     d  ccsid                        10u 0 value
+      *
+      * May be used for strings and structures.
+     d curl_easy_getinfo_ccsid...
+     d                 pr                  extproc('curl_easy_getinfo_ccsid')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  info                               value like(CURLINFO)
+     d  ptrarg                         *   options(*nopass)                     char *
+     d  ccsid                        10u 0 value options(*nopass)
+      *
+     d curl_certinfo_free_all...
+     d                 pr                  extproc('curl_certinfo_free_all')
+     d  info                           *   value
+      *
+     d curl_formadd_ccsid...
+     d                 pr                  extproc('curl_formadd_ccsid')
+     d                                     like(CURLFORMcode)
+     d  httppost                       *                                        curl_httppost *
+     d  lastpost                       *                                        curl_httppost *
+     d  option1                            value like(CURLFORMoption)           CURLFORM_ARRAY
+     d                                     options(*nopass)
+     d  object1                        *   value options(*string: *nopass)
+     d  option2                            value like(CURLFORMoption)           CURLFORM_END
+     d                                     options(*nopass)
+      *
+     d curl_formget_ccsid...
+     d                 pr            10i 0 extproc('curl_formget_ccsid')
+     d  form                           *   value                                curl_httppost *
+     d  arg                            *   value
+     d  append                             value like(curl_formget_callback)
+     d  ccsid                        10u 0 value
+      *
+     d curl_form_long_value...
+     d                 pr              *   extproc('curl_form_long_value')
+     d  value                        10i 0 value                                curl_httppost *
+      *
+     d curl_easy_setopt_ccsid...
+     d                 pr                  extproc('curl_easy_setopt_ccsid')
+     d                                     like(CURLcode)
+     d  curl                           *   value                                CURL *
+     d  option                             value like(CURLoption)
+     d  objectarg                      *   value options(*string: *nopass)
+     d  ccsid                        10u 0 value options(*nopass)
+      *
+     d curl_pushheader_bynum_ccsid...
+     d                 pr              *   extproc(                             char *
+     d                                       'curl_pushheader_bynum_ccsid')
+     d  h                              *   value                                curl_pushheaders *
+     d  num                          10u 0 value
+     d  ccsid                        10u 0 value
+      *
+     d curl_pushheader_byname_ccsid...
+     d                 pr              *   extproc(                             char *
+     d                                       'curl_pushheader_byname_ccsid')
+     d  h                              *   value                                curl_pushheaders *
+     d  header                         *   value options(*string)               const char *
+     d  ccsidin                      10u 0 value
+     d  ccsidout                     10u 0 value
+      *
+     d curl_mime_name_ccsid...
+     d                 pr                  extproc('curl_mime_name_ccsid')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  name                           *   value options(*string)
+     d  ccsid                        10u 0 value
+      *
+     d curl_mime_filename_ccsid...
+     d                 pr                  extproc('curl_mime_filename_ccsid')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  filename                       *   value options(*string)
+     d  ccsid                        10u 0 value
+      *
+     d curl_mime_type_ccsid...
+     d                 pr                  extproc('curl_mime_type_ccsid')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  mimetype                       *   value options(*string)
+     d  ccsid                        10u 0 value
+      *
+     d curl_mime_encoder_ccsid...
+     d                 pr                  extproc('curl_mime_encoder_ccsid')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  encoding                       *   value options(*string)
+     d  ccsid                        10u 0 value
+      *
+     d curl_mime_data_ccsid...
+     d                 pr                  extproc('curl_mime_data_ccsid')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  data                           *   value options(*string)
+     d  datasize                     10u 0                                      size_t
+     d  ccsid                        10u 0 value
+      *
+     d curl_mime_filedata_ccsid...
+     d                 pr                  extproc('curl_mime_filedata_ccsid')
+     d                                     like(CURLcode)
+     d  part                           *   value                                curl_mimepart *
+     d  filename                       *   value options(*string)
+     d  ccsid                        10u 0 value
+      *
+     d curl_url_get_ccsid...
+     d                 pr                  extproc('curl_url_get_ccsid')
+     d                                     like(CURLUcode)
+     d  handle                         *   value                                CURLU *
+     d  what                               value like(CURLUPart)
+     d  part                           *                                        char **
+     d  flags                        10u 0 value
+     d  ccsid                        10u 0 value
+      *
+     d curl_url_set_ccsid...
+     d                 pr                  extproc('curl_url_set_ccsid')
+     d                                     like(CURLUcode)
+     d  handle                         *   value                                CURLU *
+     d  what                               value like(CURLUPart)
+     d  part                           *   value options(*string)
+     d  flags                        10u 0 value
+     d  ccsid                        10u 0 value
+      *
+     d curl_easy_option_by_name_ccsid...
+     d                 pr              *   extproc(                             curl_easyoption *
+     d                                      'curl_easy_option_by_name_ccsid')
+     d  name                           *   value options(*string)
+     d  ccsid                        10u 0 value
+      *
+     d curl_easy_option_get_name_ccsid...
+     d                 pr              *   extproc(                             const char *
+     d                                       'curl_easy_option_get_name_ccsid')
+     d  option                         *   value                                curl_easyoption *
+     d  ccsid                        10u 0 value
+      *
+      /endif
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/initscript.sh b/ap/lib/libcurl/curl-7.86.0/packages/OS400/initscript.sh
new file mode 100755
index 0000000..4facf17
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/initscript.sh
@@ -0,0 +1,288 @@
+#!/bin/sh
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2022, 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
+#
+###########################################################################
+
+system ()
+{
+    /usr/bin/system "$@" || exit 1
+}
+
+setenv()
+
+{
+        #       Define and export.
+
+        eval ${1}="${2}"
+        export ${1}
+}
+
+
+case "${SCRIPTDIR}" in
+/*)     ;;
+*)      SCRIPTDIR="`pwd`/${SCRIPTDIR}"
+esac
+
+while true
+do      case "${SCRIPTDIR}" in
+        */.)    SCRIPTDIR="${SCRIPTDIR%/.}";;
+        *)      break;;
+        esac
+done
+
+#  The script directory is supposed to be in $TOPDIR/packages/os400.
+
+TOPDIR=`dirname "${SCRIPTDIR}"`
+TOPDIR=`dirname "${TOPDIR}"`
+export SCRIPTDIR TOPDIR
+
+#  Extract the SONAME from the library makefile.
+
+SONAME=`sed -e '/^VERSIONINFO=/!d' -e 's/^.* \([0-9]*\):.*$/\1/' -e 'q' \
+                                                < "${TOPDIR}/lib/Makefile.am"`
+export SONAME
+
+
+################################################################################
+#
+#                       Tunable configuration parameters.
+#
+################################################################################
+
+setenv TARGETLIB        'CURL'                  # Target OS/400 program library.
+setenv STATBNDDIR       'CURL_A'                # Static binding directory.
+setenv DYNBNDDIR        'CURL'                  # Dynamic binding directory.
+setenv SRVPGM           "CURL.${SONAME}"        # Service program.
+setenv TGTCCSID         '500'                   # Target CCSID of objects.
+setenv DEBUG            '*ALL'                  # Debug level.
+setenv OPTIMIZE         '10'                    # Optimization level
+setenv OUTPUT           '*NONE'                 # Compilation output option.
+setenv TGTRLS           '*CURRENT'              # Target OS release.
+setenv IFSDIR           '/curl'                 # Installation IFS directory.
+
+#       Define ZLIB availability and locations.
+
+setenv WITH_ZLIB        0                       # Define to 1 to enable.
+setenv ZLIB_INCLUDE     '/zlib/include'         # ZLIB include IFS directory.
+setenv ZLIB_LIB         'ZLIB'                  # ZLIB library.
+setenv ZLIB_BNDDIR      'ZLIB_A'                # ZLIB binding directory.
+
+#       Define LIBSSH2 availability and locations.
+
+setenv WITH_LIBSSH2     0                       # Define to 1 to enable.
+setenv LIBSSH2_INCLUDE  '/libssh2/include'      # LIBSSH2 include IFS directory.
+setenv LIBSSH2_LIB      'LIBSSH2'               # LIBSSH2 library.
+setenv LIBSSH2_BNDDIR   'LIBSSH2_A'             # LIBSSH2 binding directory.
+
+
+################################################################################
+
+#       Need to get the version definitions.
+
+LIBCURL_VERSION=`grep '^#define  *LIBCURL_VERSION '                     \
+                        "${TOPDIR}/include/curl/curlver.h"              |
+                sed 's/.*"\(.*\)".*/\1/'`
+LIBCURL_VERSION_MAJOR=`grep '^#define  *LIBCURL_VERSION_MAJOR '         \
+                        "${TOPDIR}/include/curl/curlver.h"              |
+                sed 's/^#define  *LIBCURL_VERSION_MAJOR  *\([^ ]*\).*/\1/'`
+LIBCURL_VERSION_MINOR=`grep '^#define  *LIBCURL_VERSION_MINOR '         \
+                        "${TOPDIR}/include/curl/curlver.h"              |
+                sed 's/^#define  *LIBCURL_VERSION_MINOR  *\([^ ]*\).*/\1/'`
+LIBCURL_VERSION_PATCH=`grep '^#define  *LIBCURL_VERSION_PATCH '         \
+                        "${TOPDIR}/include/curl/curlver.h"              |
+                sed 's/^#define  *LIBCURL_VERSION_PATCH  *\([^ ]*\).*/\1/'`
+LIBCURL_VERSION_NUM=`grep '^#define  *LIBCURL_VERSION_NUM '             \
+                        "${TOPDIR}/include/curl/curlver.h"              |
+                sed 's/^#define  *LIBCURL_VERSION_NUM  *0x\([^ ]*\).*/\1/'`
+LIBCURL_TIMESTAMP=`grep '^#define  *LIBCURL_TIMESTAMP '                 \
+                        "${TOPDIR}/include/curl/curlver.h"              |
+                sed 's/.*"\(.*\)".*/\1/'`
+export LIBCURL_VERSION
+export LIBCURL_VERSION_MAJOR LIBCURL_VERSION_MINOR LIBCURL_VERSION_PATCH
+export LIBCURL_VERSION_NUM LIBCURL_TIMESTAMP
+
+################################################################################
+#
+#                       OS/400 specific definitions.
+#
+################################################################################
+
+LIBIFSNAME="/QSYS.LIB/${TARGETLIB}.LIB"
+
+
+################################################################################
+#
+#                               Procedures.
+#
+################################################################################
+
+#       action_needed dest [src]
+#
+#       dest is an object to build
+#       if specified, src is an object on which dest depends.
+#
+#       exit 0 (succeeds) if some action has to be taken, else 1.
+
+action_needed()
+
+{
+        [ ! -e "${1}" ] && return 0
+        [ "${2}" ] || return 1
+        [ "${1}" -ot "${2}" ] && return 0
+        return 1
+}
+
+
+#       canonicalize_path path
+#
+#       Return canonicalized path as:
+#       - Absolute
+#       - No . or .. component.
+
+canonicalize_path()
+
+{
+        if expr "${1}" : '^/' > /dev/null
+        then    P="${1}"
+        else    P="`pwd`/${1}"
+        fi
+
+        R=
+        IFSSAVE="${IFS}"
+        IFS="/"
+
+        for C in ${P}
+        do      IFS="${IFSSAVE}"
+                case "${C}" in
+                .)      ;;
+                ..)     R=`expr "${R}" : '^\(.*/\)..*'`
+                        ;;
+                ?*)     R="${R}${C}/"
+                        ;;
+                *)      ;;
+                esac
+        done
+
+        IFS="${IFSSAVE}"
+        echo "/`expr "${R}" : '^\(.*\)/'`"
+}
+
+
+#       make_module module_name source_name [additional_definitions]
+#
+#       Compile source name into ASCII module if needed.
+#       As side effect, append the module name to variable MODULES.
+#       Set LINK to "YES" if the module has been compiled.
+
+make_module()
+
+{
+        MODULES="${MODULES} ${1}"
+        MODIFSNAME="${LIBIFSNAME}/${1}.MODULE"
+        action_needed "${MODIFSNAME}" "${2}" || return 0;
+        SRCDIR=`dirname \`canonicalize_path "${2}"\``
+
+        #       #pragma convert has to be in the source file itself, i.e.
+        #               putting it in an include file makes it only active
+        #               for that include file.
+        #       Thus we build a temporary file with the pragma prepended to
+        #               the source file and we compile that themporary file.
+
+        echo "#line 1 \"${2}\"" > __tmpsrcf.c
+        echo "#pragma convert(819)" >> __tmpsrcf.c
+        echo "#line 1" >> __tmpsrcf.c
+        cat "${2}" >> __tmpsrcf.c
+        CMD="CRTCMOD MODULE(${TARGETLIB}/${1}) SRCSTMF('__tmpsrcf.c')"
+#       CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST *SHOWINC *SHOWSYS)"
+        CMD="${CMD} SYSIFCOPT(*IFS64IO) OPTION(*INCDIRFIRST)"
+        CMD="${CMD} LOCALETYPE(*LOCALE) FLAG(10)"
+        CMD="${CMD} INCDIR('/qibm/proddata/qadrt/include'"
+        CMD="${CMD} '${TOPDIR}/include/curl' '${TOPDIR}/include' '${SRCDIR}'"
+        CMD="${CMD} '${TOPDIR}/packages/OS400'"
+
+        if [ "${WITH_ZLIB}" != "0" ]
+        then    CMD="${CMD} '${ZLIB_INCLUDE}'"
+        fi
+
+        if [ "${WITH_LIBSSH2}" != "0" ]
+        then    CMD="${CMD} '${LIBSSH2_INCLUDE}'"
+        fi
+
+        CMD="${CMD} ${INCLUDES})"
+        CMD="${CMD} TGTCCSID(${TGTCCSID}) TGTRLS(${TGTRLS})"
+        CMD="${CMD} OUTPUT(${OUTPUT})"
+        CMD="${CMD} OPTIMIZE(${OPTIMIZE})"
+        CMD="${CMD} DBGVIEW(${DEBUG})"
+
+        DEFINES="${3} BUILDING_LIBCURL"
+
+        if [ "${WITH_ZLIB}" != "0" ]
+        then    DEFINES="${DEFINES} HAVE_LIBZ"
+        fi
+
+        if [ "${WITH_LIBSSH2}" != "0" ]
+        then    DEFINES="${DEFINES} USE_LIBSSH2"
+        fi
+
+        if [ "${DEFINES}" ]
+        then    CMD="${CMD} DEFINE(${DEFINES})"
+        fi
+
+        system "${CMD}"
+        rm -f __tmpsrcf.c
+        LINK=YES
+}
+
+
+#       Determine DB2 object name from IFS name.
+
+db2_name()
+
+{
+        if [ "${2}" = 'nomangle' ]
+        then    basename "${1}"                                         |
+                tr 'a-z-' 'A-Z_'                                        |
+                sed -e 's/\..*//'                                       \
+                    -e 's/^\(.\).*\(.........\)$/\1\2/'
+        else    basename "${1}"                                         |
+                tr 'a-z-' 'A-Z_'                                        |
+                sed -e 's/\..*//'                                       \
+                    -e 's/^CURL_*/C/'                                   \
+                    -e 's/^\(.\).*\(.........\)$/\1\2/'
+        fi
+}
+
+
+#       Copy IFS file replacing version info.
+
+versioned_copy()
+
+{
+        sed -e "s/@LIBCURL_VERSION@/${LIBCURL_VERSION}/g"               \
+            -e "s/@LIBCURL_VERSION_MAJOR@/${LIBCURL_VERSION_MAJOR}/g"   \
+            -e "s/@LIBCURL_VERSION_MINOR@/${LIBCURL_VERSION_MINOR}/g"   \
+            -e "s/@LIBCURL_VERSION_PATCH@/${LIBCURL_VERSION_PATCH}/g"   \
+            -e "s/@LIBCURL_VERSION_NUM@/${LIBCURL_VERSION_NUM}/g"       \
+            -e "s/@LIBCURL_TIMESTAMP@/${LIBCURL_TIMESTAMP}/g"           \
+                < "${1}" > "${2}"
+}
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-include.sh b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-include.sh
new file mode 100755
index 0000000..daf3262
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-include.sh
@@ -0,0 +1,106 @@
+#!/bin/sh
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2022, 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
+#
+###########################################################################
+#
+#       Installation of the header files in the OS/400 library.
+#
+
+SCRIPTDIR=`dirname "${0}"`
+. "${SCRIPTDIR}/initscript.sh"
+cd "${TOPDIR}/include"
+
+
+#       Create the OS/400 source program file for the header files.
+
+SRCPF="${LIBIFSNAME}/H.FILE"
+
+if action_needed "${SRCPF}"
+then    CMD="CRTSRCPF FILE(${TARGETLIB}/H) RCDLEN(112)"
+        CMD="${CMD} CCSID(${TGTCCSID}) TEXT('curl: Header files')"
+        system "${CMD}"
+fi
+
+
+#       Create the IFS directory for the header files.
+
+IFSINCLUDE="${IFSDIR}/include/curl"
+
+if action_needed "${IFSINCLUDE}"
+then    mkdir -p "${IFSINCLUDE}"
+fi
+
+
+#       Enumeration values are used as va_arg tagfields, so they MUST be
+#               integers.
+
+copy_hfile()
+
+{
+        destfile="${1}"
+        srcfile="${2}"
+        shift
+        shift
+        sed -e '1i\
+#pragma enum(int)\
+' "${@}" -e '$a\
+#pragma enum(pop)\
+' < "${srcfile}" > "${destfile}"
+}
+
+#       Copy the header files.
+
+for HFILE in curl/*.h ${SCRIPTDIR}/ccsidcurl.h
+do      case "`basename \"${HFILE}\" .h`" in
+        stdcheaders|typecheck-gcc)
+                continue;;
+        esac
+
+        DEST="${SRCPF}/`db2_name \"${HFILE}\" nomangle`.MBR"
+
+        if action_needed "${DEST}" "${HFILE}"
+        then    copy_hfile "${DEST}" "${HFILE}"
+                IFSDEST="${IFSINCLUDE}/`basename \"${HFILE}\"`"
+                rm -f "${IFSDEST}"
+                ln -s "${DEST}" "${IFSDEST}"
+        fi
+done
+
+
+#       Copy the ILE/RPG header file, setting-up version number.
+
+versioned_copy "${SCRIPTDIR}/curl.inc.in" "${SRCPF}/CURL.INC.MBR"
+rm -f "${IFSINCLUDE}/curl.inc.rpgle"
+ln -s "${SRCPF}/CURL.INC.MBR" "${IFSINCLUDE}/curl.inc.rpgle"
+
+
+#       Duplicate file H as CURL to support more include path forms.
+
+if action_needed "${LIBIFSNAME}/CURL.FILE"
+then    :
+else    system "DLTF FILE(${TARGETLIB}/CURL)"
+fi
+
+CMD="CRTDUPOBJ OBJ(H) FROMLIB(${TARGETLIB}) OBJTYPE(*FILE) TOLIB(*FROMLIB)"
+CMD="${CMD} NEWOBJ(CURL) DATA(*YES)"
+system "${CMD}"
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-lib.sh b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-lib.sh
new file mode 100755
index 0000000..7bbd9fa
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-lib.sh
@@ -0,0 +1,247 @@
+#!/bin/sh
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2022, 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
+#
+###########################################################################
+#
+#       libcurl compilation script for the OS/400.
+#
+
+SCRIPTDIR=`dirname "${0}"`
+. "${SCRIPTDIR}/initscript.sh"
+cd "${TOPDIR}/lib"
+
+#       Need to have IFS access to the mih/cipher header file.
+
+if action_needed cipher.mih '/QSYS.LIB/QSYSINC.LIB/MIH.FILE/CIPHER.MBR'
+then    rm -f cipher.mih
+        ln -s '/QSYS.LIB/QSYSINC.LIB/MIH.FILE/CIPHER.MBR' cipher.mih
+fi
+
+
+#      Create and compile the identification source file.
+
+echo '#pragma comment(user, "libcurl version '"${LIBCURL_VERSION}"'")' > os400.c
+echo '#pragma comment(user, __DATE__)' >> os400.c
+echo '#pragma comment(user, __TIME__)' >> os400.c
+echo '#pragma comment(copyright, "Copyright (C) 1998-2016 Daniel Stenberg et al. OS/400 version by P. Monnerat")' >> os400.c
+make_module     OS400           os400.c
+LINK=                           # No need to rebuild service program yet.
+MODULES=
+
+
+#       Get source list.
+
+sed -e ':begin'                                                         \
+    -e '/\\$/{'                                                         \
+    -e 's/\\$/ /'                                                       \
+    -e 'N'                                                              \
+    -e 'bbegin'                                                         \
+    -e '}'                                                              \
+    -e 's/\n//g'                                                        \
+    -e 's/[[:space:]]*$//'                                              \
+    -e 's/^\([A-Za-z][A-Za-z0-9_]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1="\2"/' \
+    -e 's/\$(\([A-Za-z][A-Za-z0-9_]*\))/${\1}/g'                        \
+        < Makefile.inc > tmpscript.sh
+. ./tmpscript.sh
+
+
+#       Compile the sources into modules.
+
+INCLUDES="'`pwd`'"
+
+# Create a small C program to check ccsidcurl.c is up to date
+if action_needed "${LIBIFSNAME}/CHKSTRINGS.PGM"
+then
+  CMD="CRTBNDC PGM(${TARGETLIB}/CHKSTRINGS) SRCSTMF('${SCRIPTDIR}/chkstrings.c')"
+  CMD="${CMD} INCDIR('${TOPDIR}/include/curl' '${TOPDIR}/include' '${SRCDIR}' ${INCLUDES})"
+  system -i "${CMD}"
+  if [ $? -ne 0 ]
+  then
+    echo "ERROR: Failed to build CHKSTRINGS *PGM object!"
+    exit 2
+  else
+    ${LIBIFSNAME}/CHKSTRINGS.PGM
+    if [ $? -ne 0 ]
+    then
+      echo "ERROR: CHKSTRINGS failed!"
+      exit 2
+    fi
+  fi
+fi
+
+make_module     OS400SYS        "${SCRIPTDIR}/os400sys.c"
+make_module     CCSIDCURL       "${SCRIPTDIR}/ccsidcurl.c"
+
+for SRC in ${CSOURCES}
+do      MODULE=`db2_name "${SRC}"`
+        make_module "${MODULE}" "${SRC}"
+done
+
+
+#       If needed, (re)create the static binding directory.
+
+if action_needed "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR"
+then    LINK=YES
+fi
+
+if [ "${LINK}" ]
+then    rm -rf "${LIBIFSNAME}/${STATBNDDIR}.BNDDIR"
+        CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${STATBNDDIR})"
+        CMD="${CMD} TEXT('LibCurl API static binding directory')"
+        system "${CMD}"
+
+        for MODULE in ${MODULES}
+        do      CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${STATBNDDIR})"
+                CMD="${CMD} OBJ((${TARGETLIB}/${MODULE} *MODULE))"
+                system "${CMD}"
+        done
+fi
+
+
+#       The exportation file for service program creation must be in a DB2
+#               source file, so make sure it exists.
+
+if action_needed "${LIBIFSNAME}/TOOLS.FILE"
+then    CMD="CRTSRCPF FILE(${TARGETLIB}/TOOLS) RCDLEN(112)"
+        CMD="${CMD} TEXT('curl: build tools')"
+        system "${CMD}"
+fi
+
+
+#       Gather the list of symbols to export.
+
+EXPORTS=`grep '^CURL_EXTERN[[:space:]]'                                 \
+              "${TOPDIR}"/include/curl/*.h                              \
+              "${SCRIPTDIR}/ccsidcurl.h"                                |
+         sed -e 's/^.*CURL_EXTERN[[:space:]]\(.*\)(.*$/\1/'             \
+             -e 's/[[:space:]]*$//'                                     \
+             -e 's/^.*[[:space:]][[:space:]]*//'                        \
+             -e 's/^\*//'                                               \
+             -e 's/(\(.*\))/\1/'`
+
+#       Create the service program exportation file in DB2 member if needed.
+
+BSF="${LIBIFSNAME}/TOOLS.FILE/BNDSRC.MBR"
+
+if action_needed "${BSF}" Makefile.am
+then    LINK=YES
+fi
+
+if [ "${LINK}" ]
+then    echo " STRPGMEXP PGMLVL(*CURRENT) SIGNATURE('LIBCURL_${SONAME}')" \
+            > "${BSF}"
+        for EXPORT in ${EXPORTS}
+        do      echo ' EXPORT    SYMBOL("'"${EXPORT}"'")' >> "${BSF}"
+        done
+
+        echo ' ENDPGMEXP' >> "${BSF}"
+fi
+
+
+#       Build the service program if needed.
+
+if action_needed "${LIBIFSNAME}/${SRVPGM}.SRVPGM"
+then    LINK=YES
+fi
+
+if [ "${LINK}" ]
+then    CMD="CRTSRVPGM SRVPGM(${TARGETLIB}/${SRVPGM})"
+        CMD="${CMD} SRCFILE(${TARGETLIB}/TOOLS) SRCMBR(BNDSRC)"
+        CMD="${CMD} MODULE(${TARGETLIB}/OS400)"
+        CMD="${CMD} BNDDIR(${TARGETLIB}/${STATBNDDIR}"
+        if [ "${WITH_ZLIB}" != 0 ]
+        then    CMD="${CMD} ${ZLIB_LIB}/${ZLIB_BNDDIR}"
+                liblist -a "${ZLIB_LIB}"
+        fi
+        if [ "${WITH_LIBSSH2}" != 0 ]
+        then    CMD="${CMD} ${LIBSSH2_LIB}/${LIBSSH2_BNDDIR}"
+                liblist -a "${LIBSSH2_LIB}"
+        fi
+        CMD="${CMD})"
+        CMD="${CMD} BNDSRVPGM(QADRTTS QGLDCLNT QGLDBRDR)"
+        CMD="${CMD} TEXT('curl API library')"
+        CMD="${CMD} TGTRLS(${TGTRLS})"
+        system "${CMD}"
+        LINK=YES
+fi
+
+
+#       If needed, (re)create the dynamic binding directory.
+
+if action_needed "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR"
+then    LINK=YES
+fi
+
+if [ "${LINK}" ]
+then    rm -rf "${LIBIFSNAME}/${DYNBNDDIR}.BNDDIR"
+        CMD="CRTBNDDIR BNDDIR(${TARGETLIB}/${DYNBNDDIR})"
+        CMD="${CMD} TEXT('LibCurl API dynamic binding directory')"
+        system "${CMD}"
+        CMD="ADDBNDDIRE BNDDIR(${TARGETLIB}/${DYNBNDDIR})"
+        CMD="${CMD} OBJ((*LIBL/${SRVPGM} *SRVPGM))"
+        system "${CMD}"
+fi
+
+
+#       Rebuild the formdata test if needed.
+
+if [ "${TEST_FORMDATA}" ]
+then    MODULES=
+        make_module TFORMDATA   formdata.c      "'_FORM_DEBUG' 'CURLDEBUG'"
+        make_module TSTREQUAL   strequal.c      "'_FORM_DEBUG' 'CURLDEBUG'"
+        make_module TMEMDEBUG   memdebug.c      "'_FORM_DEBUG' 'CURLDEBUG'"
+        make_module TMPRINTF    mprintf.c       "'_FORM_DEBUG' 'CURLDEBUG'"
+        make_module TSTRERROR   strerror.c      "'_FORM_DEBUG' 'CURLDEBUG'"
+        #       The following modules should not be needed (see comment in
+        #               formdata.c. However, there are some unsatisfied
+        #               external references leading in the following
+        #               modules to be (recursively) needed.
+        MODULES="${MODULES} EASY STRDUP SSLGEN GSKIT HOSTIP HOSTIP4 HOSTIP6"
+        MODULES="${MODULES} URL HASH TRANSFER GETINFO COOKIE SENDF SELECT"
+        MODULES="${MODULES} INET_NTOP SHARE HOSTTHRE MULTI LLIST FTP HTTP"
+        MODULES="${MODULES} HTTP_DIGES HTTP_CHUNK HTTP_NEGOT TIMEVAL HOSTSYN"
+        MODULES="${MODULES} CONNECT SOCKS PROGRESS ESCAPE INET_PTON GETENV"
+        MODULES="${MODULES} DICT LDAP TELNET FILE TFTP NETRC PARSEDATE"
+        MODULES="${MODULES} SPEEDCHECK SPLAY BASE64 SECURITY IF2IP MD5"
+        MODULES="${MODULES} KRB5 OS400SYS"
+
+        PGMIFSNAME="${LIBIFSNAME}/TFORMDATA.PGM"
+
+        if action_needed "${PGMIFSNAME}"
+        then    LINK=YES
+        fi
+
+        if [ "${LINK}" ]
+        then    CMD="CRTPGM PGM(${TARGETLIB}/TFORMDATA)"
+                CMD="${CMD} ENTMOD(QADRT/QADRTMAIN2)"
+                CMD="${CMD} MODULE("
+
+                for MODULE in ${MODULES}
+                do      CMD="${CMD} ${TARGETLIB}/${MODULE}"
+                done
+
+                CMD="${CMD} ) BNDSRVPGM(QADRTTS)"
+                CMD="${CMD} TGTRLS(${TGTRLS})"
+                system "${CMD}"
+        fi
+fi
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-src.sh b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-src.sh
new file mode 100755
index 0000000..327857d
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-src.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2022, 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
+#
+###########################################################################
+#
+#
+#       Not implemented yet on OS/400.
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-tests.sh b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-tests.sh
new file mode 100755
index 0000000..9ac9d46
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/make-tests.sh
@@ -0,0 +1,137 @@
+#!/bin/sh
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2022, 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
+#
+###########################################################################
+#
+#       tests compilation script for the OS/400.
+#
+
+
+SCRIPTDIR=`dirname "${0}"`
+. "${SCRIPTDIR}/initscript.sh"
+cd "${TOPDIR}/tests"
+
+
+#       tests directory not implemented yet.
+
+
+#       Process the libtest subdirectory.
+
+cd libtest
+
+#       Get definitions from the Makefile.inc file.
+#       The `sed' statement works as follows:
+#       _ Join \nl-separated lines.
+#       _ Retain only lines that begins with "identifier =".
+#       _ Turn these lines into shell variable assignments.
+
+eval "`sed -e ': begin'                                                 \
+        -e '/\\\\$/{'                                                   \
+        -e 'N'                                                          \
+        -e 's/\\\\\\n/ /'                                               \
+        -e 'b begin'                                                    \
+        -e '}'                                                          \
+        -e '/^[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[=]/b keep'             \
+        -e 'd'                                                          \
+        -e ': keep'                                                     \
+        -e 's/[[:space:]]*=[[:space:]]*/=/'                             \
+        -e 's/=\\(.*[^[:space:]]\\)[[:space:]]*$/=\\"\\1\\"/'           \
+        -e 's/\\$(\\([^)]*\\))/${\\1}/g'                                \
+        < Makefile.inc`"
+
+#       Special case: redefine chkhostname compilation parameters.
+
+chkhostname_SOURCES=chkhostname.c
+chkhostname_LDADD=curl_gethostname.o
+
+#       Compile all programs.
+#       The list is found in variable "noinst_PROGRAMS"
+
+INCLUDES="'${TOPDIR}/tests/libtest' '${TOPDIR}/lib'"
+
+for PGM in ${noinst_PROGRAMS}
+do      DB2PGM=`db2_name "${PGM}"`
+        PGMIFSNAME="${LIBIFSNAME}/${DB2PGM}.PGM"
+
+        #       Extract preprocessor symbol definitions from compilation
+        #               options for the program.
+
+        PGMCFLAGS="`eval echo \"\\${${PGM}_CFLAGS}\"`"
+        PGMDEFINES=
+
+        for FLAG in ${PGMCFLAGS}
+        do      case "${FLAG}" in
+                -D?*)   DEFINE="`echo \"${FLAG}\" | sed 's/^..//'`"
+                        PGMDEFINES="${PGMDEFINES} '${DEFINE}'"
+                        ;;
+                esac
+        done
+
+        #        Compile all C sources for the program into modules.
+
+        PGMSOURCES="`eval echo \"\\${${PGM}_SOURCES}\"`"
+        LINK=
+        MODULES=
+
+        for SOURCE in ${PGMSOURCES}
+        do      case "${SOURCE}" in
+                *.c)    #       Special processing for libxxx.c files: their
+                        #               module name is determined by the target
+                        #               PROGRAM name.
+
+                        case "${SOURCE}" in
+                        lib*.c) MODULE="${DB2PGM}"
+                                ;;
+                        *)      MODULE=`db2_name "${SOURCE}"`
+                                ;;
+                        esac
+
+                        make_module "${MODULE}" "${SOURCE}" "${PGMDEFINES}"
+                        if action_needed "${PGMIFSNAME}" "${MODIFSNAME}"
+                        then    LINK=yes
+                        fi
+                        ;;
+                esac
+        done
+
+        #       Link program if needed.
+
+        if [ "${LINK}" ]
+        then    PGMLDADD="`eval echo \"\\${${PGM}_LDADD}\"`"
+                for LDARG in ${PGMLDADD}
+                do      case "${LDARG}" in
+                        -*)     ;;              # Ignore non-module.
+                        *)      MODULES="${MODULES} "`db2_name "${LDARG}"`
+                                ;;
+                        esac
+                done
+                MODULES="`echo \"${MODULES}\" |
+                    sed \"s/[^ ][^ ]*/${TARGETLIB}\/&/g\"`"
+                CMD="CRTPGM PGM(${TARGETLIB}/${DB2PGM})"
+                CMD="${CMD} ENTMOD(QADRT/QADRTMAIN2)"
+                CMD="${CMD} MODULE(${MODULES})"
+                CMD="${CMD} BNDSRVPGM(${TARGETLIB}/${SRVPGM} QADRTTS)"
+                CMD="${CMD} TGTRLS(${TGTRLS})"
+                system "${CMD}"
+        fi
+done
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/makefile.sh b/ap/lib/libcurl/curl-7.86.0/packages/OS400/makefile.sh
new file mode 100755
index 0000000..b2c1b59
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/makefile.sh
@@ -0,0 +1,79 @@
+#!/bin/sh
+#***************************************************************************
+#                                  _   _ ____  _
+#  Project                     ___| | | |  _ \| |
+#                             / __| | | | |_) | |
+#                            | (__| |_| |  _ <| |___
+#                             \___|\___/|_| \_\_____|
+#
+# Copyright (C) 1998 - 2022, 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
+#
+###########################################################################
+#
+#       curl compilation script for the OS/400.
+#
+#
+#       This is a shell script since make is not a standard component of OS/400.
+
+SCRIPTDIR=`dirname "${0}"`
+. "${SCRIPTDIR}/initscript.sh"
+cd "${TOPDIR}"
+
+
+#       Create the OS/400 library if it does not exist.
+
+if action_needed "${LIBIFSNAME}"
+then    CMD="CRTLIB LIB(${TARGETLIB}) TEXT('curl: multiprotocol support API')"
+        system "${CMD}"
+fi
+
+
+#       Create the DOCS source file if it does not exist.
+
+if action_needed "${LIBIFSNAME}/DOCS.FILE"
+then    CMD="CRTSRCPF FILE(${TARGETLIB}/DOCS) RCDLEN(240)"
+        CMD="${CMD} CCSID(${TGTCCSID}) TEXT('Documentation texts')"
+        system "${CMD}"
+fi
+
+
+#       Copy some documentation files if needed.
+
+for TEXT in "${TOPDIR}/COPYING" "${SCRIPTDIR}/README.OS400"             \
+    "${TOPDIR}/CHANGES" "${TOPDIR}/docs/THANKS" "${TOPDIR}/docs/FAQ"    \
+    "${TOPDIR}/docs/FEATURES" "${TOPDIR}/docs/SSLCERTS.md"              \
+    "${TOPDIR}/docs/RESOURCES" "${TOPDIR}/docs/VERSIONS.md"             \
+    "${TOPDIR}/docs/HISTORY.md"
+do      MEMBER="`basename \"${TEXT}\" .OS400`"
+        MEMBER="`basename \"${MEMBER}\" .md`"
+        MEMBER="${LIBIFSNAME}/DOCS.FILE/`db2_name \"${MEMBER}\"`.MBR"
+
+        [ -e "${TEXT}" ] || continue
+
+        if action_needed "${MEMBER}" "${TEXT}"
+        then    CMD="CPY OBJ('${TEXT}') TOOBJ('${MEMBER}') TOCCSID(${TGTCCSID})"
+                CMD="${CMD} DTAFMT(*TEXT) REPLACE(*YES)"
+                system "${CMD}"
+        fi
+done
+
+
+#       Build in each directory.
+
+# for SUBDIR in include lib src tests
+for SUBDIR in include lib src
+do      "${SCRIPTDIR}/make-${SUBDIR}.sh"
+done
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/os400sys.c b/ap/lib/libcurl/curl-7.86.0/packages/OS400/os400sys.c
new file mode 100755
index 0000000..862c7fd
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/os400sys.c
@@ -0,0 +1,1410 @@
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2022, 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
+ *
+ *
+ ***************************************************************************/
+
+/* OS/400 additional support. */
+
+#include <curl/curl.h>
+#include "config-os400.h"  /* Not curl_setup.h: we only need some defines. */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#include <stdlib.h>
+#include <stddef.h>
+#include <string.h>
+#include <pthread.h>
+#include <netdb.h>
+#include <qadrt.h>
+#include <errno.h>
+
+#ifdef HAVE_LIBZ
+#include <zlib.h>
+#endif
+
+#ifdef USE_GSKIT
+#include <gskssl.h>
+#include <qsoasync.h>
+#endif
+
+#ifdef HAVE_GSSAPI
+#include <gssapi.h>
+#endif
+
+#ifndef CURL_DISABLE_LDAP
+#include <ldap.h>
+#endif
+
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+#include "os400sys.h"
+
+/**
+*** QADRT OS/400 ASCII runtime defines only the most used procedures, but a
+*** lot of them are not supported. This module implements ASCII wrappers for
+*** those that are used by libcurl, but not defined by QADRT.
+**/
+
+#pragma convert(0)                              /* Restore EBCDIC. */
+
+#define MIN_BYTE_GAIN   1024    /* Minimum gain when shortening a buffer. */
+
+struct buffer_t {
+  unsigned long size;            /* Buffer size. */
+  char *buf;                     /* Buffer address. */
+};
+
+
+static char *buffer_undef(localkey_t key, long size);
+static char *buffer_threaded(localkey_t key, long size);
+static char *buffer_unthreaded(localkey_t key, long size);
+
+static pthread_mutex_t  mutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_key_t    thdkey;
+static struct buffer_t *locbufs;
+
+char *(*Curl_thread_buffer)(localkey_t key, long size) = buffer_undef;
+
+static void thdbufdestroy(void *private)
+{
+  if(private) {
+    struct buffer_t *p = (struct buffer_t *) private;
+    localkey_t i;
+
+    for(i = (localkey_t) 0; i < LK_LAST; i++) {
+      free(p->buf);
+      p++;
+    }
+
+    free(private);
+  }
+}
+
+
+static void
+terminate(void)
+{
+  if(Curl_thread_buffer == buffer_threaded) {
+    locbufs = pthread_getspecific(thdkey);
+    pthread_setspecific(thdkey, (void *) NULL);
+    pthread_key_delete(thdkey);
+  }
+
+  if(Curl_thread_buffer != buffer_undef) {
+    thdbufdestroy((void *) locbufs);
+    locbufs = (struct buffer_t *) NULL;
+  }
+
+  Curl_thread_buffer = buffer_undef;
+}
+
+
+static char *
+get_buffer(struct buffer_t *buf, long size)
+{
+  char *cp;
+
+  /* If `size' >= 0, make sure buffer at `buf' is at least `size'-byte long.
+     Return the buffer address. */
+
+  if(size < 0)
+    return buf->buf;
+
+  if(!buf->buf) {
+    buf->buf = malloc(size);
+    if(buf->buf)
+      buf->size = size;
+
+    return buf->buf;
+  }
+
+  if((unsigned long) size <= buf->size) {
+    /* Shorten the buffer only if it frees a significant byte count. This
+       avoids some realloc() overhead. */
+
+    if(buf->size - size < MIN_BYTE_GAIN)
+      return buf->buf;
+  }
+
+  /* Resize the buffer. */
+
+  cp = realloc(buf->buf, size);
+  if(cp) {
+    buf->buf = cp;
+    buf->size = size;
+  }
+  else if(size <= buf->size)
+    cp = buf->buf;
+
+  return cp;
+}
+
+
+static char *
+buffer_unthreaded(localkey_t key, long size)
+{
+  return get_buffer(locbufs + key, size);
+}
+
+
+static char *
+buffer_threaded(localkey_t key, long size)
+{
+  struct buffer_t *bufs;
+
+  /* Get the buffer for the given local key in the current thread, and
+     make sure it is at least `size'-byte long. Set `size' to < 0 to get
+     its address only. */
+
+  bufs = (struct buffer_t *) pthread_getspecific(thdkey);
+
+  if(!bufs) {
+    if(size < 0)
+      return (char *) NULL;             /* No buffer yet. */
+
+    /* Allocate buffer descriptors for the current thread. */
+
+    bufs = calloc((size_t) LK_LAST, sizeof(*bufs));
+    if(!bufs)
+      return (char *) NULL;
+
+    if(pthread_setspecific(thdkey, (void *) bufs)) {
+      free(bufs);
+      return (char *) NULL;
+    }
+  }
+
+  return get_buffer(bufs + key, size);
+}
+
+
+static char *
+buffer_undef(localkey_t key, long size)
+{
+  /* Define the buffer system, get the buffer for the given local key in
+     the current thread, and make sure it is at least `size'-byte long.
+     Set `size' to < 0 to get its address only. */
+
+  pthread_mutex_lock(&mutex);
+
+  /* Determine if we can use pthread-specific data. */
+
+  if(Curl_thread_buffer == buffer_undef) {      /* If unchanged during lock. */
+    if(!pthread_key_create(&thdkey, thdbufdestroy))
+      Curl_thread_buffer = buffer_threaded;
+    else {
+      locbufs = calloc((size_t) LK_LAST, sizeof(*locbufs));
+      if(!locbufs) {
+        pthread_mutex_unlock(&mutex);
+        return (char *) NULL;
+      }
+      else
+        Curl_thread_buffer = buffer_unthreaded;
+    }
+
+    atexit(terminate);
+  }
+
+  pthread_mutex_unlock(&mutex);
+  return Curl_thread_buffer(key, size);
+}
+
+
+static char *
+set_thread_string(localkey_t key, const char *s)
+{
+  int i;
+  char *cp;
+
+  if(!s)
+    return (char *) NULL;
+
+  i = strlen(s) + 1;
+  cp = Curl_thread_buffer(key, MAX_CONV_EXPANSION * i + 1);
+
+  if(cp) {
+    i = QadrtConvertE2A(cp, s, MAX_CONV_EXPANSION * i, i);
+    cp[i] = '\0';
+  }
+
+  return cp;
+}
+
+
+int
+Curl_getnameinfo_a(const struct sockaddr *sa, curl_socklen_t salen,
+                   char *nodename, curl_socklen_t nodenamelen,
+                   char *servname, curl_socklen_t servnamelen,
+                   int flags)
+{
+  char *enodename = NULL;
+  char *eservname = NULL;
+  int status;
+
+  if(nodename && nodenamelen) {
+    enodename = malloc(nodenamelen);
+    if(!enodename)
+      return EAI_MEMORY;
+  }
+
+  if(servname && servnamelen) {
+    eservname = malloc(servnamelen);
+    if(!eservname) {
+      free(enodename);
+      return EAI_MEMORY;
+    }
+  }
+
+  status = getnameinfo(sa, salen, enodename, nodenamelen,
+                       eservname, servnamelen, flags);
+
+  if(!status) {
+    int i;
+    if(enodename) {
+      i = QadrtConvertE2A(nodename, enodename,
+                          nodenamelen - 1, strlen(enodename));
+      nodename[i] = '\0';
+    }
+
+    if(eservname) {
+      i = QadrtConvertE2A(servname, eservname,
+                          servnamelen - 1, strlen(eservname));
+      servname[i] = '\0';
+    }
+  }
+
+  free(enodename);
+  free(eservname);
+  return status;
+}
+
+int
+Curl_getaddrinfo_a(const char *nodename, const char *servname,
+                   const struct addrinfo *hints,
+                   struct addrinfo **res)
+{
+  char *enodename;
+  char *eservname;
+  int status;
+  int i;
+
+  enodename = (char *) NULL;
+  eservname = (char *) NULL;
+
+  if(nodename) {
+    i = strlen(nodename);
+
+    enodename = malloc(i + 1);
+    if(!enodename)
+      return EAI_MEMORY;
+
+    i = QadrtConvertA2E(enodename, nodename, i, i);
+    enodename[i] = '\0';
+  }
+
+  if(servname) {
+    i = strlen(servname);
+
+    eservname = malloc(i + 1);
+    if(!eservname) {
+      free(enodename);
+      return EAI_MEMORY;
+    }
+
+    QadrtConvertA2E(eservname, servname, i, i);
+    eservname[i] = '\0';
+  }
+
+  status = getaddrinfo(enodename, eservname, hints, res);
+  free(enodename);
+  free(eservname);
+  return status;
+}
+
+#ifdef USE_GSKIT
+
+/* ASCII wrappers for the GSKit procedures. */
+
+/*
+ * EBCDIC --> ASCII string mapping table.
+ * Some strings returned by GSKit are dynamically allocated and automatically
+ * released when closing the handle.
+ * To provide the same functionality, we use a "private" handle that
+ * holds the GSKit handle and a list of string mappings. This will allow
+ * avoid conversion of already converted strings and releasing them upon
+ * close time.
+ */
+
+struct gskstrlist {
+  struct gskstrlist *next;
+  const char *ebcdicstr;
+  const char *asciistr;
+};
+
+struct Curl_gsk_descriptor {
+  gsk_handle h;
+  struct gskstrlist *strlist;
+};
+
+int Curl_gsk_environment_open(gsk_handle *my_env_handle)
+{
+  struct Curl_gsk_descriptor *p;
+  int rc;
+
+  if(!my_env_handle)
+    return GSK_OS400_ERROR_INVALID_POINTER;
+  p = (struct Curl_gsk_descriptor *) malloc(sizeof(*p));
+  if(!p)
+    return GSK_INSUFFICIENT_STORAGE;
+  p->strlist = (struct gskstrlist *) NULL;
+  rc = gsk_environment_open(&p->h);
+  if(rc != GSK_OK)
+    free(p);
+  else
+    *my_env_handle = (gsk_handle) p;
+  return rc;
+}
+
+int Curl_gsk_secure_soc_open(gsk_handle my_env_handle,
+                             gsk_handle *my_session_handle)
+{
+  struct Curl_gsk_descriptor *p;
+  gsk_handle h;
+  int rc;
+
+  if(!my_env_handle)
+    return GSK_INVALID_HANDLE;
+  if(!my_session_handle)
+    return GSK_OS400_ERROR_INVALID_POINTER;
+  h = ((struct Curl_gsk_descriptor *) my_env_handle)->h;
+  p = (struct Curl_gsk_descriptor *) malloc(sizeof(*p));
+  if(!p)
+    return GSK_INSUFFICIENT_STORAGE;
+  p->strlist = (struct gskstrlist *) NULL;
+  rc = gsk_secure_soc_open(h, &p->h);
+  if(rc != GSK_OK)
+    free(p);
+  else
+    *my_session_handle = (gsk_handle) p;
+  return rc;
+}
+
+static void gsk_free_handle(struct Curl_gsk_descriptor *p)
+{
+  struct gskstrlist *q;
+
+  while((q = p->strlist)) {
+    p->strlist = q;
+    free((void *) q->asciistr);
+    free(q);
+  }
+  free(p);
+}
+
+int Curl_gsk_environment_close(gsk_handle *my_env_handle)
+{
+  struct Curl_gsk_descriptor *p;
+  int rc;
+
+  if(!my_env_handle)
+    return GSK_OS400_ERROR_INVALID_POINTER;
+  if(!*my_env_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) *my_env_handle;
+  rc = gsk_environment_close(&p->h);
+  if(rc == GSK_OK) {
+    gsk_free_handle(p);
+    *my_env_handle = (gsk_handle) NULL;
+  }
+  return rc;
+}
+
+
+int Curl_gsk_secure_soc_close(gsk_handle *my_session_handle)
+{
+  struct Curl_gsk_descriptor *p;
+  int rc;
+
+  if(!my_session_handle)
+    return GSK_OS400_ERROR_INVALID_POINTER;
+  if(!*my_session_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) *my_session_handle;
+  rc = gsk_secure_soc_close(&p->h);
+  if(rc == GSK_OK) {
+    gsk_free_handle(p);
+    *my_session_handle = (gsk_handle) NULL;
+  }
+  return rc;
+}
+
+int Curl_gsk_environment_init(gsk_handle my_env_handle)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_env_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_env_handle;
+  return gsk_environment_init(p->h);
+}
+
+
+int Curl_gsk_secure_soc_init(gsk_handle my_session_handle)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_session_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_session_handle;
+  return gsk_secure_soc_init(p->h);
+}
+
+
+int
+Curl_gsk_attribute_set_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
+                                const char *buffer, int bufSize)
+{
+  struct Curl_gsk_descriptor *p;
+  char *ebcdicbuf;
+  int rc;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  if(!buffer)
+    return GSK_OS400_ERROR_INVALID_POINTER;
+  if(bufSize < 0)
+    return GSK_ATTRIBUTE_INVALID_LENGTH;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  if(!bufSize)
+    bufSize = strlen(buffer);
+  ebcdicbuf = malloc(bufSize + 1);
+  if(!ebcdicbuf)
+    return GSK_INSUFFICIENT_STORAGE;
+  QadrtConvertA2E(ebcdicbuf, buffer, bufSize, bufSize);
+  ebcdicbuf[bufSize] = '\0';
+  rc = gsk_attribute_set_buffer(p->h, bufID, ebcdicbuf, bufSize);
+  free(ebcdicbuf);
+  return rc;
+}
+
+
+int
+Curl_gsk_attribute_set_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
+                            GSK_ENUM_VALUE enumValue)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  return gsk_attribute_set_enum(p->h, enumID, enumValue);
+}
+
+
+int
+Curl_gsk_attribute_set_numeric_value(gsk_handle my_gsk_handle,
+                                     GSK_NUM_ID numID, int numValue)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  return gsk_attribute_set_numeric_value(p->h, numID, numValue);
+}
+
+
+int
+Curl_gsk_attribute_set_callback(gsk_handle my_gsk_handle,
+                                GSK_CALLBACK_ID callBackID,
+                                void *callBackAreaPtr)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  return gsk_attribute_set_callback(p->h, callBackID, callBackAreaPtr);
+}
+
+
+static int
+cachestring(struct Curl_gsk_descriptor *p,
+            const char *ebcdicbuf, int bufsize, const char **buffer)
+{
+  int rc;
+  char *asciibuf;
+  struct gskstrlist *sp;
+
+  for(sp = p->strlist; sp; sp = sp->next)
+    if(sp->ebcdicstr == ebcdicbuf)
+      break;
+  if(!sp) {
+    sp = (struct gskstrlist *) malloc(sizeof(*sp));
+    if(!sp)
+      return GSK_INSUFFICIENT_STORAGE;
+    asciibuf = malloc(bufsize + 1);
+    if(!asciibuf) {
+      free(sp);
+      return GSK_INSUFFICIENT_STORAGE;
+    }
+    QadrtConvertE2A(asciibuf, ebcdicbuf, bufsize, bufsize);
+    asciibuf[bufsize] = '\0';
+    sp->ebcdicstr = ebcdicbuf;
+    sp->asciistr = asciibuf;
+    sp->next = p->strlist;
+    p->strlist = sp;
+  }
+  *buffer = sp->asciistr;
+  return GSK_OK;
+}
+
+
+int
+Curl_gsk_attribute_get_buffer_a(gsk_handle my_gsk_handle, GSK_BUF_ID bufID,
+                                const char **buffer, int *bufSize)
+{
+  struct Curl_gsk_descriptor *p;
+  int rc;
+  const char *mybuf;
+  int mylen;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  if(!buffer || !bufSize)
+    return GSK_OS400_ERROR_INVALID_POINTER;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  rc = gsk_attribute_get_buffer(p->h, bufID, &mybuf, &mylen);
+  if(rc != GSK_OK)
+    return rc;
+  rc = cachestring(p, mybuf, mylen, buffer);
+  if(rc == GSK_OK)
+    *bufSize = mylen;
+  return rc;
+}
+
+
+int
+Curl_gsk_attribute_get_enum(gsk_handle my_gsk_handle, GSK_ENUM_ID enumID,
+                            GSK_ENUM_VALUE *enumValue)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  return gsk_attribute_get_enum(p->h, enumID, enumValue);
+}
+
+
+int
+Curl_gsk_attribute_get_numeric_value(gsk_handle my_gsk_handle,
+                                     GSK_NUM_ID numID, int *numValue)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  return gsk_attribute_get_numeric_value(p->h, numID, numValue);
+}
+
+
+int
+Curl_gsk_attribute_get_cert_info(gsk_handle my_gsk_handle,
+                                 GSK_CERT_ID certID,
+                                 const gsk_cert_data_elem **certDataElem,
+                                 int *certDataElementCount)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_gsk_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_gsk_handle;
+  /* No need to convert code: text results are already in ASCII. */
+  return gsk_attribute_get_cert_info(p->h, certID,
+                                     certDataElem, certDataElementCount);
+}
+
+
+int
+Curl_gsk_secure_soc_misc(gsk_handle my_session_handle, GSK_MISC_ID miscID)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_session_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_session_handle;
+  return gsk_secure_soc_misc(p->h, miscID);
+}
+
+
+int
+Curl_gsk_secure_soc_read(gsk_handle my_session_handle, char *readBuffer,
+                         int readBufSize, int *amtRead)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_session_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_session_handle;
+  return gsk_secure_soc_read(p->h, readBuffer, readBufSize, amtRead);
+}
+
+
+int
+Curl_gsk_secure_soc_write(gsk_handle my_session_handle, char *writeBuffer,
+                          int writeBufSize, int *amtWritten)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_session_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_session_handle;
+  return gsk_secure_soc_write(p->h, writeBuffer, writeBufSize, amtWritten);
+}
+
+
+const char *
+Curl_gsk_strerror_a(int gsk_return_value)
+{
+  return set_thread_string(LK_GSK_ERROR, gsk_strerror(gsk_return_value));
+}
+
+int
+Curl_gsk_secure_soc_startInit(gsk_handle my_session_handle,
+                              int IOCompletionPort,
+                              Qso_OverlappedIO_t *communicationsArea)
+{
+  struct Curl_gsk_descriptor *p;
+
+  if(!my_session_handle)
+    return GSK_INVALID_HANDLE;
+  p = (struct Curl_gsk_descriptor *) my_session_handle;
+  return gsk_secure_soc_startInit(p->h, IOCompletionPort, communicationsArea);
+}
+
+#endif /* USE_GSKIT */
+
+#ifdef HAVE_GSSAPI
+
+/* ASCII wrappers for the GSSAPI procedures. */
+
+static int
+Curl_gss_convert_in_place(OM_uint32 *minor_status, gss_buffer_t buf)
+{
+  unsigned int i = buf->length;
+
+  /* Convert `buf' in place, from EBCDIC to ASCII.
+     If error, release the buffer and return -1. Else return 0. */
+
+  if(i) {
+    char *t = malloc(i);
+    if(!t) {
+      gss_release_buffer(minor_status, buf);
+
+      if(minor_status)
+        *minor_status = ENOMEM;
+
+      return -1;
+    }
+
+    QadrtConvertE2A(t, buf->value, i, i);
+    memcpy(buf->value, t, i);
+    free(t);
+  }
+
+  return 0;
+}
+
+
+OM_uint32
+Curl_gss_import_name_a(OM_uint32 *minor_status, gss_buffer_t in_name,
+                       gss_OID in_name_type, gss_name_t *out_name)
+{
+  int rc;
+  unsigned int i;
+  gss_buffer_desc in;
+
+  if(!in_name || !in_name->value || !in_name->length)
+    return gss_import_name(minor_status, in_name, in_name_type, out_name);
+
+  memcpy((char *) &in, (char *) in_name, sizeof(in));
+  i = in.length;
+
+  in.value = malloc(i + 1);
+  if(!in.value) {
+    if(minor_status)
+      *minor_status = ENOMEM;
+
+    return GSS_S_FAILURE;
+  }
+
+  QadrtConvertA2E(in.value, in_name->value, i, i);
+  ((char *) in.value)[i] = '\0';
+  rc = gss_import_name(minor_status, &in, in_name_type, out_name);
+  free(in.value);
+  return rc;
+}
+
+OM_uint32
+Curl_gss_display_status_a(OM_uint32 *minor_status, OM_uint32 status_value,
+                          int status_type, gss_OID mech_type,
+                          gss_msg_ctx_t *message_context,
+                          gss_buffer_t status_string)
+{
+  int rc;
+
+  rc = gss_display_status(minor_status, status_value, status_type,
+                          mech_type, message_context, status_string);
+
+  if(rc != GSS_S_COMPLETE || !status_string ||
+     !status_string->length || !status_string->value)
+    return rc;
+
+  /* No way to allocate a buffer here, because it will be released by
+     gss_release_buffer(). The solution is to overwrite the EBCDIC buffer
+     with ASCII to return it. */
+
+  if(Curl_gss_convert_in_place(minor_status, status_string))
+    return GSS_S_FAILURE;
+
+  return rc;
+}
+
+OM_uint32
+Curl_gss_init_sec_context_a(OM_uint32 *minor_status,
+                            gss_cred_id_t cred_handle,
+                            gss_ctx_id_t *context_handle,
+                            gss_name_t target_name, gss_OID mech_type,
+                            gss_flags_t req_flags, OM_uint32 time_req,
+                            gss_channel_bindings_t input_chan_bindings,
+                            gss_buffer_t input_token,
+                            gss_OID *actual_mech_type,
+                            gss_buffer_t output_token, gss_flags_t *ret_flags,
+                            OM_uint32 *time_rec)
+{
+  int rc;
+  gss_buffer_desc in;
+  gss_buffer_t inp;
+
+  in.value = NULL;
+  inp = input_token;
+
+  if(inp) {
+    if(inp->length && inp->value) {
+      unsigned int i = inp->length;
+
+      in.value = malloc(i + 1);
+      if(!in.value) {
+        if(minor_status)
+          *minor_status = ENOMEM;
+
+        return GSS_S_FAILURE;
+      }
+
+      QadrtConvertA2E(in.value, input_token->value, i, i);
+      ((char *) in.value)[i] = '\0';
+      in.length = i;
+      inp = &in;
+    }
+  }
+
+  rc = gss_init_sec_context(minor_status, cred_handle, context_handle,
+                            target_name, mech_type, req_flags, time_req,
+                            input_chan_bindings, inp, actual_mech_type,
+                            output_token, ret_flags, time_rec);
+  free(in.value);
+
+  if(rc != GSS_S_COMPLETE || !output_token ||
+     !output_token->length || !output_token->value)
+    return rc;
+
+  /* No way to allocate a buffer here, because it will be released by
+     gss_release_buffer(). The solution is to overwrite the EBCDIC buffer
+     with ASCII to return it. */
+
+  if(Curl_gss_convert_in_place(minor_status, output_token))
+    return GSS_S_FAILURE;
+
+  return rc;
+}
+
+
+OM_uint32
+Curl_gss_delete_sec_context_a(OM_uint32 *minor_status,
+                              gss_ctx_id_t *context_handle,
+                              gss_buffer_t output_token)
+{
+  int rc;
+
+  rc = gss_delete_sec_context(minor_status, context_handle, output_token);
+
+  if(rc != GSS_S_COMPLETE || !output_token ||
+     !output_token->length || !output_token->value)
+    return rc;
+
+  /* No way to allocate a buffer here, because it will be released by
+     gss_release_buffer(). The solution is to overwrite the EBCDIC buffer
+     with ASCII to return it. */
+
+  if(Curl_gss_convert_in_place(minor_status, output_token))
+    return GSS_S_FAILURE;
+
+  return rc;
+}
+
+#endif /* HAVE_GSSAPI */
+
+#ifndef CURL_DISABLE_LDAP
+
+/* ASCII wrappers for the LDAP procedures. */
+
+void *
+Curl_ldap_init_a(char *host, int port)
+{
+  unsigned int i;
+  char *ehost;
+  void *result;
+
+  if(!host)
+    return (void *) ldap_init(host, port);
+
+  i = strlen(host);
+
+  ehost = malloc(i + 1);
+  if(!ehost)
+    return (void *) NULL;
+
+  QadrtConvertA2E(ehost, host, i, i);
+  ehost[i] = '\0';
+  result = (void *) ldap_init(ehost, port);
+  free(ehost);
+  return result;
+}
+
+int
+Curl_ldap_simple_bind_s_a(void *ld, char *dn, char *passwd)
+{
+  int i;
+  char *edn;
+  char *epasswd;
+
+  edn = (char *) NULL;
+  epasswd = (char *) NULL;
+
+  if(dn) {
+    i = strlen(dn);
+
+    edn = malloc(i + 1);
+    if(!edn)
+      return LDAP_NO_MEMORY;
+
+    QadrtConvertA2E(edn, dn, i, i);
+    edn[i] = '\0';
+  }
+
+  if(passwd) {
+    i = strlen(passwd);
+
+    epasswd = malloc(i + 1);
+    if(!epasswd) {
+      free(edn);
+      return LDAP_NO_MEMORY;
+    }
+
+    QadrtConvertA2E(epasswd, passwd, i, i);
+    epasswd[i] = '\0';
+  }
+
+  i = ldap_simple_bind_s(ld, edn, epasswd);
+  free(epasswd);
+  free(edn);
+  return i;
+}
+
+int
+Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter,
+                     char **attrs, int attrsonly, LDAPMessage **res)
+{
+  int i;
+  int j;
+  char *ebase;
+  char *efilter;
+  char **eattrs;
+  int status;
+
+  ebase = (char *) NULL;
+  efilter = (char *) NULL;
+  eattrs = (char **) NULL;
+  status = LDAP_SUCCESS;
+
+  if(base) {
+    i = strlen(base);
+
+    ebase = malloc(i + 1);
+    if(!ebase)
+      status = LDAP_NO_MEMORY;
+    else {
+      QadrtConvertA2E(ebase, base, i, i);
+      ebase[i] = '\0';
+    }
+  }
+
+  if(filter && status == LDAP_SUCCESS) {
+    i = strlen(filter);
+
+    efilter = malloc(i + 1);
+    if(!efilter)
+      status = LDAP_NO_MEMORY;
+    else {
+      QadrtConvertA2E(efilter, filter, i, i);
+      efilter[i] = '\0';
+    }
+  }
+
+  if(attrs && status == LDAP_SUCCESS) {
+    for(i = 0; attrs[i++];)
+      ;
+
+    eattrs = calloc(i, sizeof(*eattrs));
+    if(!eattrs)
+      status = LDAP_NO_MEMORY;
+    else {
+      for(j = 0; attrs[j]; j++) {
+        i = strlen(attrs[j]);
+
+        eattrs[j] = malloc(i + 1);
+        if(!eattrs[j]) {
+          status = LDAP_NO_MEMORY;
+          break;
+        }
+
+        QadrtConvertA2E(eattrs[j], attrs[j], i, i);
+        eattrs[j][i] = '\0';
+      }
+    }
+  }
+
+  if(status == LDAP_SUCCESS)
+    status = ldap_search_s(ld, ebase? ebase: "", scope,
+                           efilter? efilter: "(objectclass=*)",
+                           eattrs, attrsonly, res);
+
+  if(eattrs) {
+    for(j = 0; eattrs[j]; j++)
+      free(eattrs[j]);
+
+    free(eattrs);
+  }
+
+  free(efilter);
+  free(ebase);
+  return status;
+}
+
+
+struct berval **
+Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, const char *attr)
+{
+  char *cp;
+  struct berval **result;
+
+  cp = (char *) NULL;
+
+  if(attr) {
+    int i = strlen(attr);
+
+    cp = malloc(i + 1);
+    if(!cp) {
+      ldap_set_lderrno(ld, LDAP_NO_MEMORY, NULL,
+                       ldap_err2string(LDAP_NO_MEMORY));
+      return (struct berval **) NULL;
+    }
+
+    QadrtConvertA2E(cp, attr, i, i);
+    cp[i] = '\0';
+  }
+
+  result = ldap_get_values_len(ld, entry, cp);
+  free(cp);
+
+  /* Result data are binary in nature, so they haven't been
+     converted to EBCDIC. Therefore do not convert. */
+
+  return result;
+}
+
+char *
+Curl_ldap_err2string_a(int error)
+{
+  return set_thread_string(LK_LDAP_ERROR, ldap_err2string(error));
+}
+
+char *
+Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry)
+{
+  int i;
+  char *cp;
+  char *cp2;
+
+  cp = ldap_get_dn(ld, entry);
+
+  if(!cp)
+    return cp;
+
+  i = strlen(cp);
+
+  cp2 = malloc(i + 1);
+  if(!cp2)
+    return cp2;
+
+  QadrtConvertE2A(cp2, cp, i, i);
+  cp2[i] = '\0';
+
+  /* No way to allocate a buffer here, because it will be released by
+     ldap_memfree() and ldap_memalloc() does not exist. The solution is to
+     overwrite the EBCDIC buffer with ASCII to return it. */
+
+  strcpy(cp, cp2);
+  free(cp2);
+  return cp;
+}
+
+char *
+Curl_ldap_first_attribute_a(void *ld,
+                            LDAPMessage *entry, BerElement **berptr)
+{
+  int i;
+  char *cp;
+  char *cp2;
+
+  cp = ldap_first_attribute(ld, entry, berptr);
+
+  if(!cp)
+    return cp;
+
+  i = strlen(cp);
+
+  cp2 = malloc(i + 1);
+  if(!cp2)
+    return cp2;
+
+  QadrtConvertE2A(cp2, cp, i, i);
+  cp2[i] = '\0';
+
+  /* No way to allocate a buffer here, because it will be released by
+     ldap_memfree() and ldap_memalloc() does not exist. The solution is to
+     overwrite the EBCDIC buffer with ASCII to return it. */
+
+  strcpy(cp, cp2);
+  free(cp2);
+  return cp;
+}
+
+char *
+Curl_ldap_next_attribute_a(void *ld,
+                           LDAPMessage *entry, BerElement *berptr)
+{
+  int i;
+  char *cp;
+  char *cp2;
+
+  cp = ldap_next_attribute(ld, entry, berptr);
+
+  if(!cp)
+    return cp;
+
+  i = strlen(cp);
+
+  cp2 = malloc(i + 1);
+  if(!cp2)
+    return cp2;
+
+  QadrtConvertE2A(cp2, cp, i, i);
+  cp2[i] = '\0';
+
+  /* No way to allocate a buffer here, because it will be released by
+     ldap_memfree() and ldap_memalloc() does not exist. The solution is to
+     overwrite the EBCDIC buffer with ASCII to return it. */
+
+  strcpy(cp, cp2);
+  free(cp2);
+  return cp;
+}
+
+#endif /* CURL_DISABLE_LDAP */
+
+static int
+sockaddr2ebcdic(struct sockaddr_storage *dstaddr,
+                const struct sockaddr *srcaddr, int srclen)
+{
+  const struct sockaddr_un *srcu;
+  struct sockaddr_un *dstu;
+  unsigned int i;
+  unsigned int dstsize;
+
+  /* Convert a socket address to job CCSID, if needed. */
+
+  if(!srcaddr || srclen < offsetof(struct sockaddr, sa_family) +
+     sizeof(srcaddr->sa_family) || srclen > sizeof(*dstaddr)) {
+    errno = EINVAL;
+    return -1;
+  }
+
+  memcpy((char *) dstaddr, (char *) srcaddr, srclen);
+
+  switch(srcaddr->sa_family) {
+
+  case AF_UNIX:
+    srcu = (const struct sockaddr_un *) srcaddr;
+    dstu = (struct sockaddr_un *) dstaddr;
+    dstsize = sizeof(*dstaddr) - offsetof(struct sockaddr_un, sun_path);
+    srclen -= offsetof(struct sockaddr_un, sun_path);
+    i = QadrtConvertA2E(dstu->sun_path, srcu->sun_path, dstsize - 1, srclen);
+    dstu->sun_path[i] = '\0';
+    srclen = i + offsetof(struct sockaddr_un, sun_path);
+  }
+
+  return srclen;
+}
+
+
+static int
+sockaddr2ascii(struct sockaddr *dstaddr, int dstlen,
+               const struct sockaddr_storage *srcaddr, int srclen)
+{
+  const struct sockaddr_un *srcu;
+  struct sockaddr_un *dstu;
+  unsigned int dstsize;
+
+  /* Convert a socket address to ASCII, if needed. */
+
+  if(!srclen)
+    return 0;
+  if(srclen > dstlen)
+    srclen = dstlen;
+  if(!srcaddr || srclen < 0) {
+    errno = EINVAL;
+    return -1;
+  }
+
+  memcpy((char *) dstaddr, (char *) srcaddr, srclen);
+
+  if(srclen >= offsetof(struct sockaddr_storage, ss_family) +
+     sizeof(srcaddr->ss_family)) {
+    switch(srcaddr->ss_family) {
+
+    case AF_UNIX:
+      srcu = (const struct sockaddr_un *) srcaddr;
+      dstu = (struct sockaddr_un *) dstaddr;
+      dstsize = dstlen - offsetof(struct sockaddr_un, sun_path);
+      srclen -= offsetof(struct sockaddr_un, sun_path);
+      if(dstsize > 0 && srclen > 0) {
+        srclen = QadrtConvertE2A(dstu->sun_path, srcu->sun_path,
+                                 dstsize - 1, srclen);
+        dstu->sun_path[srclen] = '\0';
+      }
+      srclen += offsetof(struct sockaddr_un, sun_path);
+    }
+  }
+
+  return srclen;
+}
+
+int
+Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen)
+{
+  int i;
+  struct sockaddr_storage laddr;
+
+  i = sockaddr2ebcdic(&laddr, destaddr, addrlen);
+
+  if(i < 0)
+    return -1;
+
+  return connect(sd, (struct sockaddr *) &laddr, i);
+}
+
+int
+Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen)
+{
+  int i;
+  struct sockaddr_storage laddr;
+
+  i = sockaddr2ebcdic(&laddr, localaddr, addrlen);
+
+  if(i < 0)
+    return -1;
+
+  return bind(sd, (struct sockaddr *) &laddr, i);
+}
+
+int
+Curl_os400_sendto(int sd, char *buffer, int buflen, int flags,
+                  struct sockaddr *dstaddr, int addrlen)
+{
+  int i;
+  struct sockaddr_storage laddr;
+
+  i = sockaddr2ebcdic(&laddr, dstaddr, addrlen);
+
+  if(i < 0)
+    return -1;
+
+  return sendto(sd, buffer, buflen, flags, (struct sockaddr *) &laddr, i);
+}
+
+int
+Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags,
+                    struct sockaddr *fromaddr, int *addrlen)
+{
+  int rcvlen;
+  struct sockaddr_storage laddr;
+  int laddrlen = sizeof(laddr);
+
+  if(!fromaddr || !addrlen || *addrlen <= 0)
+    return recvfrom(sd, buffer, buflen, flags, fromaddr, addrlen);
+
+  laddr.ss_family = AF_UNSPEC;          /* To detect if unused. */
+  rcvlen = recvfrom(sd, buffer, buflen, flags,
+                    (struct sockaddr *) &laddr, &laddrlen);
+
+  if(rcvlen < 0)
+    return rcvlen;
+
+  if(laddr.ss_family == AF_UNSPEC)
+    laddrlen = 0;
+  else {
+    laddrlen = sockaddr2ascii(fromaddr, *addrlen, &laddr, laddrlen);
+    if(laddrlen < 0)
+      return laddrlen;
+  }
+  *addrlen = laddrlen;
+  return rcvlen;
+}
+
+int
+Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen)
+{
+  struct sockaddr_storage laddr;
+  int laddrlen = sizeof(laddr);
+  int retcode = getpeername(sd, (struct sockaddr *) &laddr, &laddrlen);
+
+  if(!retcode) {
+    laddrlen = sockaddr2ascii(addr, *addrlen, &laddr, laddrlen);
+    if(laddrlen < 0)
+      return laddrlen;
+    *addrlen = laddrlen;
+  }
+
+  return retcode;
+}
+
+int
+Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen)
+{
+  struct sockaddr_storage laddr;
+  int laddrlen = sizeof(laddr);
+  int retcode = getsockname(sd, (struct sockaddr *) &laddr, &laddrlen);
+
+  if(!retcode) {
+    laddrlen = sockaddr2ascii(addr, *addrlen, &laddr, laddrlen);
+    if(laddrlen < 0)
+      return laddrlen;
+    *addrlen = laddrlen;
+  }
+
+  return retcode;
+}
+
+
+#ifdef HAVE_LIBZ
+const char *
+Curl_os400_zlibVersion(void)
+{
+  return set_thread_string(LK_ZLIB_VERSION, zlibVersion());
+}
+
+
+int
+Curl_os400_inflateInit_(z_streamp strm, const char *version, int stream_size)
+{
+  z_const char *msgb4 = strm->msg;
+  int ret;
+
+  ret = inflateInit(strm);
+
+  if(strm->msg != msgb4)
+    strm->msg = set_thread_string(LK_ZLIB_MSG, strm->msg);
+
+  return ret;
+}
+
+int
+Curl_os400_inflateInit2_(z_streamp strm, int windowBits,
+                         const char *version, int stream_size)
+{
+  z_const char *msgb4 = strm->msg;
+  int ret;
+
+  ret = inflateInit2(strm, windowBits);
+
+  if(strm->msg != msgb4)
+    strm->msg = set_thread_string(LK_ZLIB_MSG, strm->msg);
+
+  return ret;
+}
+
+int
+Curl_os400_inflate(z_streamp strm, int flush)
+{
+  z_const char *msgb4 = strm->msg;
+  int ret;
+
+  ret = inflate(strm, flush);
+
+  if(strm->msg != msgb4)
+    strm->msg = set_thread_string(LK_ZLIB_MSG, strm->msg);
+
+  return ret;
+}
+
+int
+Curl_os400_inflateEnd(z_streamp strm)
+{
+  z_const char *msgb4 = strm->msg;
+  int ret;
+
+  ret = inflateEnd(strm);
+
+  if(strm->msg != msgb4)
+    strm->msg = set_thread_string(LK_ZLIB_MSG, strm->msg);
+
+  return ret;
+}
+
+#endif
diff --git a/ap/lib/libcurl/curl-7.86.0/packages/OS400/os400sys.h b/ap/lib/libcurl/curl-7.86.0/packages/OS400/os400sys.h
new file mode 100755
index 0000000..f107238
--- /dev/null
+++ b/ap/lib/libcurl/curl-7.86.0/packages/OS400/os400sys.h
@@ -0,0 +1,57 @@
+/***************************************************************************
+ *                                  _   _ ____  _
+ *  Project                     ___| | | |  _ \| |
+ *                             / __| | | | |_) | |
+ *                            | (__| |_| |  _ <| |___
+ *                             \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 1998 - 2022, 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
+ *
+ *
+ ***************************************************************************/
+
+/* OS/400 additional definitions. */
+
+#ifndef __OS400_SYS_
+#define __OS400_SYS_
+
+
+/* Per-thread item identifiers. */
+
+typedef enum {
+        LK_SSL_ERROR,
+        LK_GSK_ERROR,
+        LK_LDAP_ERROR,
+        LK_CURL_VERSION,
+        LK_VERSION_INFO,
+        LK_VERSION_INFO_DATA,
+        LK_EASY_STRERROR,
+        LK_SHARE_STRERROR,
+        LK_MULTI_STRERROR,
+        LK_ZLIB_VERSION,
+        LK_ZLIB_MSG,
+        LK_LAST
+}               localkey_t;
+
+
+extern char *   (* Curl_thread_buffer)(localkey_t key, long size);
+
+
+/* Maximum string expansion factor due to character code conversion. */
+
+#define MAX_CONV_EXPANSION      4       /* Can deal with UTF-8. */
+
+#endif