OS400: add new definitions to the ILE/RPG binding.

Also update supported protocols list in README.OS400.

Fixes #20672
Closes #21066
This commit is contained in:
Patrick Monnerat 2026-02-22 11:37:16 +01:00 committed by Daniel Stenberg
parent 949b1ff34e
commit 54f4937729
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
3 changed files with 309 additions and 236 deletions

View File

@ -30,256 +30,270 @@
#pragma enum(int)
/* Define cpu-machine-OS */
#ifndef CURL_OS
#define CURL_OS "OS/400"
#endif
/* OS400 supports a 3-argument ASCII version of gethostbyaddr_r(), but its
* prototype is incompatible with the "standard" one (1st argument is not
* const). getaddrinfo() is supported (ASCII version defined as
* a local wrapper in setup-os400.h) in a thread-safe way: we can then
* configure getaddrinfo() as such and get rid of gethostbyname_r() without
* loss of thread-safeness. */
#undef HAVE_GETHOSTBYNAME_R
#undef HAVE_GETHOSTBYNAME_R_3
#undef HAVE_GETHOSTBYNAME_R_5
#undef HAVE_GETHOSTBYNAME_R_6
#define HAVE_GETADDRINFO
#define HAVE_GETADDRINFO_THREADSAFE
/* ---------------------------------------------------------------- */
/* Global configuration parameters: normally generated by autoconf. */
/* ---------------------------------------------------------------- */
/* Define if you need the _REENTRANT define for some functions */
#undef NEED_REENTRANT
/* Location of default ca bundle */
/* Use the system keyring as the default CA bundle. */
#define CURL_CA_BUNDLE "/QIBM/UserData/ICSS/Cert/Server/DEFAULT.KDB"
/* Define if you want to enable IPv6 support */
#define USE_IPV6
/* Define if struct sockaddr_in6 has the sin6_scope_id member */
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* Define this to 'int' if ssize_t is not an available typedefed type */
#undef ssize_t
/* Define to 1 if you have the alarm function. */
#define HAVE_ALARM 1
/* Define if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H
/* Define if you have the `closesocket' function. */
#undef HAVE_CLOSESOCKET
/* Define if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H
/* Define if you have the `geteuid' function. */
#define HAVE_GETEUID
/* Define if you have the `gethostname' function. */
#define HAVE_GETHOSTNAME
/* Define if you have the `getpass_r' function. */
#undef HAVE_GETPASS_R
/* Define to 1 if you have the getpeername function. */
#define HAVE_GETPEERNAME 1
/* Define if you have the `getpwuid' function. */
#define HAVE_GETPWUID
/* Define to 1 if you have the getsockname function. */
#define HAVE_GETSOCKNAME 1
/* Define if you have the `gettimeofday' function. */
#define HAVE_GETTIMEOFDAY
/* Define if you have the `timeval' struct. */
#define HAVE_STRUCT_TIMEVAL
/* Define if you have the <io.h> header file. */
#undef HAVE_IO_H
/* Define if you have GSS API. */
#define HAVE_GSSAPI
/* Define if you have the <gssapi.h> header file. */
#define HAVE_GSSAPI_H
/* Define if you have the GNU gssapi libraries */
#undef HAVE_GSSGNU
/* Define if you have the `localtime_r' function. */
#define HAVE_LOCALTIME_R
/* Define if you have the <netdb.h> header file. */
#define HAVE_NETDB_H
/* Define if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H
/* Define if you have the <net/if.h> header file. */
#define HAVE_NET_IF_H
/* Define if you have the <pwd.h> header file. */
#define HAVE_PWD_H
/* Define if you have the `select' function. */
#define HAVE_SELECT
/* Define if you have the `sigaction' function. */
#define HAVE_SIGACTION
/* Define if you have the `signal' function. */
#undef HAVE_SIGNAL
/* Define if you have the `socket' function. */
#define HAVE_SOCKET
/* The following define is needed on OS400 to enable strcmpi(), stricmp() and
strdup(). */
#define __cplusplus__strings__
/* Define if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define if you have the `strcmpi' function. */
#define HAVE_STRCMPI
/* Define if you have the `stricmp' function. */
#define HAVE_STRICMP
/* Define if you have the <strings.h> header file. */
#define HAVE_STRINGS_H
/* Define if you have the <stropts.h> header file. */
#undef HAVE_STROPTS_H
/* Define if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H
/* Define if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
/* Define if you have the <sys/sockio.h> header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H
/* Define if you have the <sys/un.h> header file. */
#define HAVE_SYS_UN_H
/* Define if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H
/* Define if you have the <termios.h> header file. */
#undef HAVE_TERMIOS_H
/* Define if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
/* Define if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H
/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4
/* The size of `size_t', as computed by sizeof. */
#define SIZEOF_SIZE_T 4
/* The size of `curl_off_t', as computed by sizeof. */
#define SIZEOF_CURL_OFF_T 8
/* Define this if you have struct sockaddr_storage */
#define HAVE_STRUCT_SOCKADDR_STORAGE
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
/* Define for large files, on AIX-style hosts. */
#define _LARGE_FILES
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define if you have a working ioctl FIONBIO function. */
#define HAVE_IOCTL_FIONBIO
/* Define if you have a working ioctl SIOCGIFADDR function. */
#define HAVE_IOCTL_SIOCGIFADDR
/* To disable LDAP */
#undef CURL_DISABLE_LDAP
/* Definition to make a library symbol externally visible. */
#define CURL_EXTERN_SYMBOL
/* Define if you have the ldap_url_parse procedure. */
/* #define HAVE_LDAP_URL_PARSE */ /* Disabled because of an IBM bug. */
/* cpu-machine-OS */
#ifndef CURL_OS
#define CURL_OS "OS/400"
#endif
/* Define if you have the recv function. */
#define HAVE_RECV
/* Define to 1 if you have the alarm function. */
#define HAVE_ALARM 1
/* Define to the type of arg 1 for recv. */
#define RECV_TYPE_ARG1 int
/* Define if you have the <arpa/inet.h> header file. */
#define HAVE_ARPA_INET_H 1
/* Define to the type of arg 2 for recv. */
#define RECV_TYPE_ARG2 char *
/* if you have <dirent.h> */
#define HAVE_DIRENT_H
/* Define to the type of arg 3 for recv. */
#define RECV_TYPE_ARG3 int
/* Define to 1 if you have the fcntl function. */
#define HAVE_FCNTL 1
/* Define to the type of arg 4 for recv. */
#define RECV_TYPE_ARG4 int
/* Define to 1 if you have the <fcntl.h> header file. */
#define HAVE_FCNTL_H 1
/* Define to the function return type for recv. */
#define RECV_TYPE_RETV int
/* Define to 1 if you have a working fcntl O_NONBLOCK function. */
#define HAVE_FCNTL_O_NONBLOCK 1
/* Define if you have the send function. */
#define HAVE_SEND
/* Define to 1 if you have the freeaddrinfo function. */
#define HAVE_FREEADDRINFO 1
/* Define to the type of arg 1 for send. */
#define SEND_TYPE_ARG1 int
/* Define to 1 if you have the ftruncate function. */
#define HAVE_FTRUNCATE 1
/* Define if the type qualifier of arg 2 for send is not const. */
/* Define to 1 if you have a working getaddrinfo function. */
#define HAVE_GETADDRINFO 1
/* Define to 1 if the getaddrinfo function is thread-safe. */
#define HAVE_GETADDRINFO_THREADSAFE 1
/* Define to 1 if you have the 'geteuid' function. */
#define HAVE_GETEUID 1
/* Define to 1 if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1
/* Define to 1 if you have the getpeername function. */
#define HAVE_GETPEERNAME 1
/* Define to 1 if you have the 'getppid' function. */
#define HAVE_GETPPID 1
/* Define to 1 if you have the 'getpwuid' function. */
#define HAVE_GETPWUID 1
/* Define to 1 if you have the getsockname function. */
#define HAVE_GETSOCKNAME 1
/* Define to 1 if you have the 'gettimeofday' function. */
#define HAVE_GETTIMEOFDAY 1
/* if you have GSS-API libraries */
#define HAVE_GSSAPI
/* Define to 1 if you have a working ioctl FIONBIO function. */
#define HAVE_IOCTL_FIONBIO 1
/* Define to 1 if you have a working ioctl SIOCGIFADDR function. */
#define HAVE_IOCTL_SIOCGIFADDR 1
/* Define to 1 if you have the lber.h header file. */
#define HAVE_LBER_H 1
/* Define to 1 if you have the ldap.h header file. */
#define HAVE_LDAP_H 1
/* Define to 1 if you have a working localtime_r function. */
#define HAVE_LOCALTIME_R 1
/* Define to 1 if you have the <netdb.h> header file. */
#define HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in.h> header file. */
#define HAVE_NETINET_IN_H 1
/* Define to 1 if you have the <netinet/tcp.h> header file. */
#define HAVE_NETINET_TCP_H 1
/* Define to 1 if you have the <netinet/udp.h> header file. */
#define HAVE_NETINET_UDP_H 1
/* Define to 1 if you have the <net/if.h> header file. */
#define HAVE_NET_IF_H 1
/* if you have opendir */
#define HAVE_OPENDIR
/* Define to 1 if you have the 'pipe' function. */
#define HAVE_PIPE 1
/* if you have <pthread.h> */
#define HAVE_PTHREAD_H 1
/* Define to 1 if you have the <pwd.h> header file. */
#define HAVE_PWD_H 1
/* Define to 1 if you have the recv function. */
#define HAVE_RECV 1
/* Define to 1 if symbol `sa_family_t' exists */
#define HAVE_SA_FAMILY_T 1
/* Define to 1 if you have the select function. */
#define HAVE_SELECT 1
/* Define to 1 if you have the send function. */
#define HAVE_SEND 1
/* Define to 1 if you have the 'sendmsg' function. */
#define HAVE_SENDMSG 1
/* Define to 1 if you have the sigaction function. */
#define HAVE_SIGACTION 1
/* Define to 1 if struct sockaddr_in6 has the sin6_scope_id member */
#define HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID 1
/* Define to 1 if you have the socketpair function. */
#define HAVE_SOCKET 1
/* Define to 1 if you have the <stdbool.h> header file. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdio.h> header file. */
#define HAVE_STDIO_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the stricmp function. */
#define HAVE_STRICMP 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* if struct sockaddr_storage is defined */
#define HAVE_STRUCT_SOCKADDR_STORAGE
/* Define to 1 if you have the timeval struct. */
#define HAVE_STRUCT_TIMEVAL 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
#define HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/un.h> header file. */
#define HAVE_SYS_UN_H 1
/* Define to 1 if you have the <unicode/uidna.h> header file. */
#define HAVE_UNICODE_UIDNA_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the 'utime' function. */
#define HAVE_UTIME 1
/* Define to 1 if you have the <utime.h> header file. */
#define HAVE_UTIME_H 1
/* Size of curl_off_t in number of bytes */
#define SIZEOF_CURL_OFF_T 8
/* Size of curl_socket_t in number of bytes */
#define SIZEOF_CURL_SOCKET_T 4
/* Size of int in number of bytes */
#define SIZEOF_INT 4
/* Size of long in number of bytes */
#define SIZEOF_LONG 4
/* Size of off_t in number of bytes */
#define SIZEOF_OFF_T 8 /* _LARGE_FILES (*IFS64IO) version. */
/* Size of size_t in number of bytes */
#define SIZEOF_SIZE_T 4
/* Size of time_t in number of bytes */
#define SIZEOF_TIME_T 4
/* Define to 1 if all of the C89 standard headers exist (not just the ones
required in a freestanding environment). This macro is provided for
backward compatibility; new code need not use it. */
#define STDC_HEADERS 1
/* Define if you want to enable IPv6 support */
#define USE_IPV6
/* Use Unix domain sockets */
#define USE_UNIX_SOCKETS
/* Define to 1 if OS is AIX. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
#endif
/* ---------------------------------------------------------------- */
/* recv/send parameter types (see lib/functypes.h) */
/* ---------------------------------------------------------------- */
/* int recv(int, char *, int, int); */
#define RECV_TYPE_ARG1 int
#define RECV_TYPE_ARG2 char *
#define RECV_TYPE_ARG3 int
#define RECV_TYPE_ARG4 int
#define RECV_TYPE_RETV int
/* int send(int, char *, int, int); */
#define SEND_TYPE_ARG1 int
#define SEND_NONCONST_ARG2
#define SEND_TYPE_ARG2 char *
#define SEND_TYPE_ARG3 int
#define SEND_TYPE_ARG4 int
#define SEND_TYPE_RETV int
/* Define to the type of arg 2 for send. */
#define SEND_TYPE_ARG2 char *
/* ---------------------------------------------------------------- */
/* Additional definitions specific to OS/400 */
/* ---------------------------------------------------------------- */
/* Define to the type of arg 3 for send. */
#define SEND_TYPE_ARG3 int
/* Define to the type of arg 4 for send. */
#define SEND_TYPE_ARG4 int
/* Define to the function return type for send. */
#define SEND_TYPE_RETV int
/* The <gssapi.h> header file is in the main system include directory. */
#define HAVE_GSSAPI_H
/* Define to use the OS/400 crypto library. */
#define USE_OS400CRYPTO
/* Define to use Unix sockets. */
#define USE_UNIX_SOCKETS
/* Use the system keyring as the default CA bundle. */
#define CURL_CA_BUNDLE "/QIBM/UserData/ICSS/Cert/Server/DEFAULT.KDB"
/* ---------------------------------------------------------------- */
/* ADDITIONAL DEFINITIONS */
/* ---------------------------------------------------------------- */
/* The following definition is required on OS/400 to enable strcmpi(),
stricmp() and strdup(). */
#define __cplusplus__strings__
/* The following must be defined BEFORE system header files inclusion. */

View File

@ -234,26 +234,20 @@ Protocols currently implemented on OS/400:
_ DICT
_ FILE
_ FTP
_ FTPS
_ FTP with secure transmission
_ GOPHER
_ HTTP
_ HTTPS
_ IMAP
_ IMAPS
_ IMAP with secure transmission
_ LDAP
_ MQTT
_ POP3
_ POP3S
_ POP3 with secure transmission
_ RTSP
_ SCP if libssh2 is enabled
_ SFTP if libssh2 is enabled
_ SMB
_ SMTP
_ SMTPS
_ SMTP with secure transmission
_ TELNET
_ TFTP
_ WS
Compiling on OS/400:

View File

@ -366,6 +366,13 @@
*
d CURL_PUSH_OK c 0
d CURL_PUSH_DENY c 1
d CURL_PUSH_ERROROUT...
d c 2
*
d CURLMNOTIFY_INFO_READ...
d c 0
d CURLMNOTIFY_EASY_DONE...
d c 1
*
d CURLPAUSE_RECV c X'00000001'
d CURLPAUSE_RECV_CONT...
@ -1085,6 +1092,9 @@
d c X'10000000'
d CURLPROTO_GOPHERS...
d c X'20000000'
d CURLPROTO_MQTTS...
d c X'40000000'
d CURLPROTO_ALL c X'FFFFFFFF'
*
d CURLoption s 10i 0 based(######ptr######) Enum
d CURLOPT_WRITEDATA...
@ -2201,6 +2211,33 @@
d c 10015
d CURLMOPT_MAX_CONCURRENT_STREAMS...
d c 10016
d CURLMOPT_NETWORK_CHANGED...
d c 10017
d CURLMOPT_NOTIFYFUNCTION...
d c 20018
d CURLMOPT_NOTIFYDATA...
d c 10019
*
d CURLMinfo_offt s 10i 0 based(######ptr######) Enum
d CURLMINFO_NONE...
d c 0
d CURLMINFO_XFERS_CURRENT...
d c 1
d CURLMINFO_XFERS_RUNNING...
d c 2
d CURLMINFO_XFERS_PENDING...
d c 3
d CURLMINFO_XFERS_DONE...
d c 4
d CURLMINFO_XFERS_ADDED...
d c 5
*
* Definition of bits for the CURLMOPT_NETWORK_CHANGED argument.
*
d CURLMNWC_CLEAR_CONNS...
d c x'00000001'
d CURLMNWC_CLEAR_DNS...
d c x'00000002'
*
* Bitmask bits for CURLMOPT_PIPELINING.
*
@ -2635,6 +2672,9 @@
d s * based(######ptr######) procptr
*
d curl_ws_write_callback...
d s * based(######ptr######) procptr
*
d curl_notify_callback...
d s * based(######ptr######) procptr
*
**************************************************************************
@ -3128,6 +3168,25 @@
d pr * extproc('curl_multi_get_handles') CURL **
d multi_handle * value CURLM *
*
d curl_multi_get_offt...
d pr extproc('curl_multi_get_offt')
d like(CURLMcode)
d multi_handle * value CURLM *
d info value like(CURLMinfo_offt)
d pvalue like(curl_off_t)
*
d curl_multi_notify_disable...
d pr extproc('curl_multi_notify_disable')
d like(CURLMcode)
d multi_handle * value CURLM *
d notification 10i 0 value
*
d curl_multi_notify_enable...
d pr extproc('curl_multi_notify_enable')
d like(CURLMcode)
d multi_handle * value CURLM *
d notification 10i 0 value
*
d curl_url pr * extproc('curl_url') CURLU *
*
d curl_url_cleanup...
@ -3187,6 +3246,12 @@
d curl_ws_meta pr * extproc('curl_ws_meta') curl_ws_frame *
d curl * value CURL *
*
d curl_ws_start pr extproc('curl_ws_start')
d like(CURLcode)
d curl * value CURL *
d flags 10u 0 value
d frame_len value like(curl_off_t)
*
d curl_easy_header...
d pr extproc('curl_easy_header') curl_header *
d like(CURLHcode)