mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-20 17:17:13 +02:00
Initial preparations for CURL and Discord integration.
This commit is contained in:
341
module/Vendor/CURL/packages/OS400/README.OS400
vendored
Normal file
341
module/Vendor/CURL/packages/OS400/README.OS400
vendored
Normal file
@ -0,0 +1,341 @@
|
||||
|
||||
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. String values passed to callback procedures 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_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_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 freed after
|
||||
use:
|
||||
CURLINFO_EFFECTIVE_URL
|
||||
CURLINFO_CONTENT_TYPE
|
||||
CURLINFO_FTP_ENTRY_PATH
|
||||
CURLINFO_REDIRECT_URL
|
||||
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 free'ed using 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 freed 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.
|
||||
|
||||
|
||||
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.
|
||||
_ 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 shell (QSH)
|
||||
_ 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, optimisation 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.
|
1438
module/Vendor/CURL/packages/OS400/ccsidcurl.c
vendored
Normal file
1438
module/Vendor/CURL/packages/OS400/ccsidcurl.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
93
module/Vendor/CURL/packages/OS400/ccsidcurl.h
vendored
Normal file
93
module/Vendor/CURL/packages/OS400/ccsidcurl.h
vendored
Normal file
@ -0,0 +1,93 @@
|
||||
#ifndef CURLINC_CCSIDCURL_H
|
||||
#define CURLINC_CCSIDCURL_H
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2020, 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.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
#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);
|
||||
|
||||
#endif
|
62
module/Vendor/CURL/packages/OS400/chkstrings.c
vendored
Normal file
62
module/Vendor/CURL/packages/OS400/chkstrings.c
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2020, 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.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
#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_COPYPOSTFIELDS + 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;
|
||||
}
|
2874
module/Vendor/CURL/packages/OS400/curl.inc.in
vendored
Normal file
2874
module/Vendor/CURL/packages/OS400/curl.inc.in
vendored
Normal file
File diff suppressed because it is too large
Load Diff
282
module/Vendor/CURL/packages/OS400/initscript.sh
vendored
Normal file
282
module/Vendor/CURL/packages/OS400/initscript.sh
vendored
Normal file
@ -0,0 +1,282 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2020, 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.
|
||||
#
|
||||
###########################################################################
|
||||
|
||||
|
||||
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' # Optimisation level
|
||||
setenv OUTPUT '*NONE' # Compilation output option.
|
||||
setenv TGTRLS 'V6R1M0' # 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 HAVE_ZLIB_H"
|
||||
fi
|
||||
|
||||
if [ "${WITH_LIBSSH2}" != "0" ]
|
||||
then DEFINES="${DEFINES} USE_LIBSSH2 HAVE_LIBSSH2_H"
|
||||
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}"
|
||||
}
|
104
module/Vendor/CURL/packages/OS400/make-include.sh
vendored
Normal file
104
module/Vendor/CURL/packages/OS400/make-include.sh
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2020, 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.
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# 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}"
|
245
module/Vendor/CURL/packages/OS400/make-lib.sh
vendored
Normal file
245
module/Vendor/CURL/packages/OS400/make-lib.sh
vendored
Normal file
@ -0,0 +1,245 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2020, 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.
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# 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
|
25
module/Vendor/CURL/packages/OS400/make-src.sh
vendored
Normal file
25
module/Vendor/CURL/packages/OS400/make-src.sh
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2020, 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.
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
#
|
||||
# Not implemented yet on OS/400.
|
135
module/Vendor/CURL/packages/OS400/make-tests.sh
vendored
Normal file
135
module/Vendor/CURL/packages/OS400/make-tests.sh
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2020, 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.
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# 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
|
75
module/Vendor/CURL/packages/OS400/makefile.sh
vendored
Normal file
75
module/Vendor/CURL/packages/OS400/makefile.sh
vendored
Normal file
@ -0,0 +1,75 @@
|
||||
#!/bin/sh
|
||||
#***************************************************************************
|
||||
# _ _ ____ _
|
||||
# Project ___| | | | _ \| |
|
||||
# / __| | | | |_) | |
|
||||
# | (__| |_| | _ <| |___
|
||||
# \___|\___/|_| \_\_____|
|
||||
#
|
||||
# Copyright (C) 1998 - 2020, 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.
|
||||
#
|
||||
###########################################################################
|
||||
#
|
||||
# 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"
|
||||
|
||||
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
|
1408
module/Vendor/CURL/packages/OS400/os400sys.c
vendored
Normal file
1408
module/Vendor/CURL/packages/OS400/os400sys.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
55
module/Vendor/CURL/packages/OS400/os400sys.h
vendored
Normal file
55
module/Vendor/CURL/packages/OS400/os400sys.h
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/***************************************************************************
|
||||
* _ _ ____ _
|
||||
* Project ___| | | | _ \| |
|
||||
* / __| | | | |_) | |
|
||||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2020, 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.
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/* 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
|
Reference in New Issue
Block a user