}
}
-
# return the exit code from diff
exit system("diff -u /tmp/autotools /tmp/cmake") >> 8;
'26' => 1,
);
-
sub runone {
my $a;
my $nargs = getnum(60) + 1;
"\\.(bat|sln)\$",
);
+my @double_empty_lines = (
+ "^lib/.+\\.(c|h)\$",
+ "^packages/",
+ "^tests/data/test",
+ "\\.(m4|py)\$",
+);
+
my @non_ascii_allowed = (
'\xC3\xB6', # UTF-8 for https://codepoints.net/U+00F6 LATIN SMALL LETTER O WITH DIAERESIS
);
my @err = ();
if(!fn_match($filename, @tabs) &&
- $content =~ /\t/) {
+ $content =~ /\t/) {
push @err, "content: has tab";
}
}
if($eol ne "crlf" &&
- fn_match($filename, @need_crlf)) {
+ fn_match($filename, @need_crlf)) {
push @err, "content: must use CRLF EOL for this file type";
}
if($eol ne "lf" && $content ne "" &&
- !fn_match($filename, @need_crlf)) {
+ !fn_match($filename, @need_crlf)) {
push @err, "content: must use LF EOL for this file type";
}
}
if($content ne "" &&
- $content !~ /\n\z/) {
+ $content !~ /\n\z/) {
push @err, "content: has no EOL at EOF";
}
if($content =~ /\n\n\z/ ||
- $content =~ /\r\n\r\n\z/) {
+ $content =~ /\r\n\r\n\z/) {
push @err, "content: has multiple EOL at EOF";
}
if($content =~ /\n\n\n\n/ ||
- $content =~ /\r\n\r\n\r\n\r\n/) {
+ $content =~ /\r\n\r\n\r\n\r\n/) {
push @err, "content: has 3 or more consecutive empty lines";
}
+ if(!fn_match($filename, @double_empty_lines)) {
+ if($content =~ /\n\n\n/ ||
+ $content =~ /\r\n\r\n\r\n/) {
+ push @err, "content: has 2 consecutive empty lines";
+ }
+ }
+
if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) {
push @err, "content: has binary contents";
}
return $rc;
}
-
sub extract {
my($f) = @_;
my $syn = 0;
- name: 'configure / ${{ matrix.build }}'
run: |
- if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ] ; then
+ if [ "${MATRIX_COMPILER}" = 'gcc-13' ] && [ "${MATRIX_IMAGE}" = 'macos-15' ]; then
# Ref: https://github.com/Homebrew/homebrew-core/issues/194778#issuecomment-2793243409
/opt/homebrew/opt/gcc@13/libexec/gcc/aarch64-apple-darwin24/13/install-tools/mkheaders
fi
#include <fcntl.h>
/* */
#if defined(sun) || defined(__sun__) || \
- defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+ defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if defined(__SVR4) || defined(__srv4__)
# define PLATFORM_SOLARIS
# else
#include <stdarg.h>
#include <string.h>
#include <float.h>
-int main(void) { return 0; }
+int main(void)
+{
+ return 0;
+}
#endif
#ifdef HAVE_FILE_OFFSET_BITS
We cannot simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
LARGE_OFF_T % 2147483647 == 1)
? 1 : -1];
#include <string.h>
#include <errno.h>
-static void check(char c) { (void)c; }
+static void check(char c)
+{
+ (void)c;
+}
int main(void)
{
#include <errno.h>
/* Float, because a pointer cannot be implicitly cast to float */
-static void check(float f) { (void)f; }
+static void check(float f)
+{
+ (void)f;
+}
int main(void)
{
endif()
endif()
-
# Ugly (but functional) way to include "Makefile.inc" by transforming it
# (= regenerate it).
function(curl_transform_makefile_inc _input_file _output_file)
#include <time.h>
]],[[
struct timeval ts;
- ts.tv_sec = 0;
+ ts.tv_sec = 0;
ts.tv_usec = 0;
(void)ts;
]])
fi
AC_SUBST([LIBCURL_PC_CFLAGS])
-
dnl **********************************************************************
dnl platform/compiler/architecture specific checks/flags
dnl **********************************************************************
fi
AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"])
-
dnl **********************************************************************
dnl Check for libgsasl
dnl **********************************************************************
AS_HELP_STRING([--with-libssh2], [enable libssh2]),
OPT_LIBSSH2=$withval, OPT_LIBSSH2=no)
-
OPT_LIBSSH=off
AC_ARG_WITH(libssh,dnl
AS_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the libssh installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
dnl a pkgconfig file
AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
fi
-
;;
off)
dnl no --with-librtmp option given, just check default places
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
-
else
dnl no nghttp3 pkg-config found, deal with it
if test "$want_nghttp3" != "default"; then
CPPFLAGS=$CLEANCPPFLAGS
LIBS=$CLEANLIBS
)
-
else
dnl no libuv pkg-config found, deal with it
if test "$want_libuv" != "default"; then
]
)
-
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_DEFINE(CURL_DISABLE_HSTS, 1, [disable alt-svc])
fi
-
dnl *************************************************************
dnl check whether ECH support, if desired, is actually available
dnl
fi
fi
-
dnl *************************************************************
dnl check whether OpenSSL (lookalikes) have SSL_set0_wbio
dnl
Details are also in [the SSL certificates
document](https://curl.se/docs/sslcerts.html).
-
## Why is curl -R on Windows one hour off?
Since curl 7.53.0 this issue should be fixed as long as curl was built with
timeout is set.
See option `TcpMaxConnectRetransmissions` on [this
-page](https://support.microsoft.com/bg-bg/topic/hotfix-enables-the-configuration-of-the-tcp-maximum-syn-retransmission-amount-in-windows-7-or-windows-server-2008-r2-1b6f8352-2c5f-58bb-ead7-2cf021407c8e).
+page](https://support.microsoft.com/topic/hotfix-enables-the-configuration-of-the-tcp-maximum-syn-retransmission-amount-in-windows-7-or-windows-server-2008-r2-1b6f8352-2c5f-58bb-ead7-2cf021407c8e).
Also, even on non-Windows systems there may run a firewall or anti-virus
software or similar that accepts the connection but does not actually do
curl --trace my-trace.txt www.haxx.se
-
## Detailed Information
Different protocols provide different ways of getting detailed information
curl --ca-native --cacert mycerts.pem https://example.com
-
#### Other Combinations
How well the use of native CA stores work in all other combinations depends
Please see the following thread for more information:
https://curl.se/mail/lib-2012-05/0178.html
-
# POP3
## Enhanced capability support
curl --data name=curl https://url1.example.com https://url2.example.com
-
## Multiple HTTP methods in a single command line
Sometimes you need to operate on several URLs in a single command line and do
of URL's and creates some new easy handles to fetch each URL via the
curl_multi "hiper" API.
-
Thus, you can try a single URL:
% echo http://www.yahoo.com > hiper.fifo
of URL's and creates some new easy handles to fetch each URL via the
curl_multi "hiper" API.
-
Thus, you can try a single URL:
% echo http://www.yahoo.com > hiper.fifo
of URL's and creates some new easy handles to fetch each URL via the
curl_multi "hiper" API.
-
Thus, you can try a single URL:
% echo http://www.yahoo.com > hiper.fifo
of URL's and creates some new easy handles to fetch each URL via the
curl_multi "hiper" API.
-
Thus, you can try a single URL:
% echo http://www.yahoo.com > hiper.fifo
//
#ifdef _WIN32
-#define COMPARE(a, b) (!_stricmp((a), (b)))
+#define COMPARE(a, b) (!_stricmp(a, b))
#else
-#define COMPARE(a, b) (!strcasecmp((a), (b)))
+#define COMPARE(a, b) (!strcasecmp(a, b))
#endif
//
#endif
#ifdef _MSC_VER
-#define gettimeofday(a, b) my_gettimeofday((a), (b))
+#define gettimeofday(a, b) my_gettimeofday(a, b)
static int my_gettimeofday(struct timeval *tp, void *tzp)
{
(void)tzp;
CURLFORM_COPYCONTENTS, "postit2-formadd.c",
CURLFORM_END);
-
/* Fill in the submit field too, even if this is rarely needed */
curl_formadd(&formpost,
&lastptr,
|--|--|--|--|--|--|--|--TOTAL
|--|--|--|--|--|--|--|--REDIRECT
-
CURLINFO_QUEUE_TIME_T(3), CURLINFO_NAMELOOKUP_TIME_T(3),
CURLINFO_CONNECT_TIME_T(3), CURLINFO_APPCONNECT_TIME_T(3),
CURLINFO_PRETRANSFER_TIME_T(3), CURLINFO_POSTTRANSFER_TIME_T(3),
set. Added in 7.46.0 */
};
-
/* This is a return code for the progress callback that, when returned, will
signal libcurl to continue executing the default progress function */
#define CURL_PROGRESSFUNC_CONTINUE 0x10000001
#define CURLAUTH_AWS_SIGV4 (((unsigned long)1)<<7)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
-#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
+#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC | CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0L /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0L /* none allowed, silly but complete */
/* return CURLE_OK to accept */
/* or something else to refuse */
-
/* parameter for the CURLOPT_USE_SSL option */
#define CURLUSESSL_NONE 0L /* do not attempt to use SSL */
#define CURLUSESSL_TRY 1L /* try using SSL, proceed anyway otherwise */
/* *STRINGPOINT is an alias for OBJECTPOINT to allow tools to extract the
string options from the header file */
-
#define CURLOPT(na,t,nu) na = t + nu
#define CURLOPTDEPRECATED(na,t,nu,v,m) na CURL_DEPRECATED(v,m) = t + nu
libcurl will ask for the compressed methods it knows of, and if that
is not any, it will not ask for transfer-encoding at all even if this
- option is set to 1.
-
- */
+ option is set to 1. */
CURLOPT(CURLOPT_TRANSFER_ENCODING, CURLOPTTYPE_LONG, 207),
/* Callback function for closing socket (instead of close(2)). The callback
#undef CURLOPT_DNS_USE_GLOBAL_CACHE /* soon obsolete */
#endif
-
- /* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
- name resolves addresses using more than one IP protocol version, this
- option might be handy to force libcurl to use a specific IP version. */
+/* Below here follows defines for the CURLOPT_IPRESOLVE option. If a host
+ name resolves addresses using more than one IP protocol version, this
+ option might be handy to force libcurl to use a specific IP version. */
#define CURL_IPRESOLVE_WHATEVER 0L /* default, uses addresses to all IP
versions that your system allows */
#define CURL_IPRESOLVE_V4 1L /* uses only IPv4 addresses/connections */
#define CURL_SSLVERSION_MAX_TLSv1_2 (CURL_SSLVERSION_TLSv1_2 << 16)
#define CURL_SSLVERSION_MAX_TLSv1_3 (CURL_SSLVERSION_TLSv1_3 << 16)
- /* never use, keep last */
+/* never use, keep last */
#define CURL_SSLVERSION_MAX_LAST (CURL_SSLVERSION_LAST << 16)
#define CURL_TLSAUTH_NONE 0L
#define CURL_REDIR_POST_302 2L
#define CURL_REDIR_POST_303 4L
#define CURL_REDIR_POST_ALL \
- (CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
+ (CURL_REDIR_POST_301 | CURL_REDIR_POST_302 | CURL_REDIR_POST_303)
#define CURL_TIMECOND_NONE 0L
#define CURL_TIMECOND_IFMODSINCE 1L
} curl_TimeCond;
/* Special size_t value signaling a null-terminated string. */
-#define CURL_ZERO_TERMINATED ((size_t) -1)
+#define CURL_ZERO_TERMINATED ((size_t)-1)
/* curl_strequal() and curl_strnequal() are subject for removal in a future
release */
CURL_EXTERN char *curl_escape(const char *string,
int length);
-
/*
* NAME curl_easy_unescape()
*
*
* curl_global_init() should be invoked exactly once for each application that
* uses libcurl and before any call of other libcurl functions.
-
+ *
* This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
* curl_version_info_data.features flag (fetch by curl_version_info()).
-
*/
CURL_EXTERN CURLcode curl_global_init(long flags);
*
* curl_global_trace() can be invoked at application start to
* configure which components in curl should participate in tracing.
-
+ *
* This function is thread-safe if CURL_VERSION_THREADSAFE is set in the
* curl_version_info_data.features flag (fetch by curl_version_info()).
-
*/
CURL_EXTERN CURLcode curl_global_trace(const char *config);
#define CURL_GLOBAL_SSL (1<<0) /* no purpose since 7.57.0 */
#define CURL_GLOBAL_WIN32 (1<<1)
-#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL|CURL_GLOBAL_WIN32)
+#define CURL_GLOBAL_ALL (CURL_GLOBAL_SSL | CURL_GLOBAL_WIN32)
#define CURL_GLOBAL_NOTHING 0
#define CURL_GLOBAL_DEFAULT CURL_GLOBAL_ALL
#define CURL_GLOBAL_ACK_EINTR (1<<2)
-
/*****************************************************************************
* Setup defines, protos etc for the sharing stuff.
*/
curl_lock_data data,
void *userptr);
-
typedef enum {
CURLSHE_OK, /* all is fine */
CURLSHE_BAD_OPTION, /* 1 */
#define CURLPAUSE_SEND (1<<2)
#define CURLPAUSE_SEND_CONT (0)
-#define CURLPAUSE_ALL (CURLPAUSE_RECV|CURLPAUSE_SEND)
-#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT|CURLPAUSE_SEND_CONT)
+#define CURLPAUSE_ALL (CURLPAUSE_RECV | CURLPAUSE_SEND)
+#define CURLPAUSE_CONT (CURLPAUSE_RECV_CONT | CURLPAUSE_SEND_CONT)
/*
* NAME curl_easy_ssls_import()
curl_ssls_export_cb *export_fn,
void *userptr);
-
#ifdef __cplusplus
} /* end of extern "C" */
#endif
*/
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
-
/*
* NAME curl_easy_duphandle()
*
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
size_t buflen, size_t *n);
-
/*
* NAME curl_easy_upkeep()
*
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
CURL *curl_handle);
- /*
- * Name: curl_multi_remove_handle()
- *
- * Desc: removes a curl handle from the multi stack again
- *
- * Returns: CURLMcode type, general multi error code.
- */
+/*
+ * Name: curl_multi_remove_handle()
+ *
+ * Desc: removes a curl handle from the multi stack again
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
CURL *curl_handle);
- /*
- * Name: curl_multi_fdset()
- *
- * Desc: Ask curl for its fd_set sets. The app can use these to select() or
- * poll() on. We want curl_multi_perform() called as soon as one of
- * them are ready.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+/*
+ * Name: curl_multi_fdset()
+ *
+ * Desc: Ask curl for its fd_set sets. The app can use these to select() or
+ * poll() on. We want curl_multi_perform() called as soon as one of
+ * them are ready.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
fd_set *read_fd_set,
fd_set *write_fd_set,
*/
CURL_EXTERN CURLMcode curl_multi_wakeup(CURLM *multi_handle);
- /*
- * Name: curl_multi_perform()
- *
- * Desc: When the app thinks there is data available for curl it calls this
- * function to read/write whatever there is right now. This returns
- * as soon as the reads and writes are done. This function does not
- * require that there actually is data available for reading or that
- * data can be written, it can be called just in case. It returns
- * the number of handles that still transfer data in the second
- * argument's integer-pointer.
- *
- * Returns: CURLMcode type, general multi error code. *NOTE* that this only
- * returns errors etc regarding the whole multi stack. There might
- * still have occurred problems on individual transfers even when
- * this returns OK.
- */
+/*
+ * Name: curl_multi_perform()
+ *
+ * Desc: When the app thinks there is data available for curl it calls this
+ * function to read/write whatever there is right now. This returns
+ * as soon as the reads and writes are done. This function does not
+ * require that there actually is data available for reading or that
+ * data can be written, it can be called just in case. It returns
+ * the number of handles that still transfer data in the second
+ * argument's integer-pointer.
+ *
+ * Returns: CURLMcode type, general multi error code. *NOTE* that this only
+ * returns errors etc regarding the whole multi stack. There might
+ * still have occurred problems on individual transfers even when
+ * this returns OK.
+ */
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
int *running_handles);
- /*
- * Name: curl_multi_cleanup()
- *
- * Desc: Cleans up and removes a whole multi stack. It does not free or
- * touch any individual easy handles in any way. We need to define
- * in what state those handles will be if this function is called
- * in the middle of a transfer.
- *
- * Returns: CURLMcode type, general multi error code.
- */
+/*
+ * Name: curl_multi_cleanup()
+ *
+ * Desc: Cleans up and removes a whole multi stack. It does not free or
+ * touch any individual easy handles in any way. We need to define
+ * in what state those handles will be if this function is called
+ * in the middle of a transfer.
+ *
+ * Returns: CURLMcode type, general multi error code.
+ */
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
/*
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
/* This macro below was added in 7.16.3 to push users who recompile to use
- the new curl_multi_socket_action() instead of the old curl_multi_socket()
-*/
+ * the new curl_multi_socket_action() instead of the old curl_multi_socket()
+ */
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
#endif
/* This is the argument passed to the socket callback */
CURLOPT(CURLMOPT_SOCKETDATA, CURLOPTTYPE_OBJECTPOINT, 2),
- /* set to 1 to enable pipelining for this multi handle */
+ /* set to 1 to enable pipelining for this multi handle */
CURLOPT(CURLMOPT_PIPELINING, CURLOPTTYPE_LONG, 3),
- /* This is the timer callback function pointer */
+ /* This is the timer callback function pointer */
CURLOPT(CURLMOPT_TIMERFUNCTION, CURLOPTTYPE_FUNCTIONPOINT, 4),
/* This is the argument passed to the timer callback */
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURLMoption option, ...);
-
/*
* Name: curl_multi_assign()
*
*/
CURL_EXTERN CURL **curl_multi_get_handles(CURLM *multi_handle);
-
typedef enum {
CURLMINFO_NONE, /* first, never use this */
/* The number of easy handles currently managed by the multi handle,
*/
#define curl_share_setopt(share,opt,param) curl_share_setopt(share,opt,param)
-
/* the actual warnings, triggered by calling the Wcurl_easy_setopt_err*
* functions */
#define curlcheck_off_t_info(info) \
(CURLINFO_OFF_T < (info))
-
-/* typecheck helpers -- check whether given expression has requested type */
+/*
+ * typecheck helpers -- check whether given expression has requested type
+ */
/* For pointers, you can use the curlcheck_ptr/curlcheck_arr macros,
* otherwise define a new macro. Search for __builtin_types_compatible_p
(curlcheck_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), CURL *))
-
/* evaluates to true if expr is a long (no matter the signedness)
* XXX: for now, int is also accepted (and therefore short and char, which
* are promoted to int when passed to a variadic function) */
struct connectdata *conn,
int sockindex);
-
#endif /* !CURL_DISABLE_HTTP */
#endif /* HEADER_CURL_CF_HTTP_H */
struct connectdata *conn,
int sockindex);
-
CURLcode Curl_conn_cf_connect(struct Curl_cfilter *cf,
struct Curl_easy *data,
bool *done);
/* 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__
unsigned int resultlen; /* Result length (bytes). */
};
-
/* HMAC computation context. */
struct HMAC_context {
const struct HMAC_params *hash; /* Hash function definition. */
#else /* HAVE_MEMRCHR */
void *Curl_memrchr(const void *s, int c, size_t n);
-#define memrchr(x, y, z) Curl_memrchr((x), (y), (z))
+#define memrchr(x, y, z) Curl_memrchr(x, y, z)
#endif /* HAVE_MEMRCHR */
#endif
#endif /* HAVE_RECV */
-
#ifdef __minix
/* Minix does not support send on TCP sockets */
#define swrite(x, y, z) (ssize_t)write((SEND_TYPE_ARG1)(x), \
#define CURL_LOG_LVL_NONE 0
#define CURL_LOG_LVL_INFO 1
-
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define CURL_HAVE_C99
#endif
CURLcode Curl_cw_pause_flush(struct Curl_easy *data);
-
#endif /* HEADER_CURL_CW_PAUSE_H */
const char *name, size_t namelen);
size_t Curl_dynhds_cremove(struct dynhds *dynhds, const char *name);
-
/**
* Set the give header name and value, replacing any entries with
* the same name. The header is added at the end of all (remaining)
#define SEND_TYPE_RETV int
#endif
-
#ifndef RECV_TYPE_ARG1
#define RECV_TYPE_ARG1 int
#endif
#define Curl_ipv6works(x) FALSE
#endif
-
/* unlink a dns entry, potentially shared with a cache */
void Curl_resolv_unlink(struct Curl_easy *data,
struct Curl_dns_entry **pdns);
/* Decode HTTP status code string. */
CURLcode Curl_http_decode_status(int *pstatus, const char *s, size_t len);
-
/**
* All about a core HTTP request, excluding body and trailers
*/
#define curl_ldap_num_t ULONG
#else
#define FREE_ON_WINLDAP(x)
-#define curl_ldap_num_t int
+#define curl_ldap_num_t int
#endif
#ifndef HAVE_LDAP_URL_PARSE
}
}
-
my $fl;
while(<STDIN>) {
my $l = $_;
}
}
-
for my $name (sort @names) {
my $oname = $name;
my $a = $alias{$name};
gss_name_t * out_name);
#define gss_import_name Curl_gss_import_name_a
-
extern OM_uint32 Curl_gss_display_status_a(OM_uint32 * minor_status,
OM_uint32 status_value,
int status_type, gss_OID mech_type,
gss_buffer_t status_string);
#define gss_display_status Curl_gss_display_status_a
-
extern OM_uint32 Curl_gss_init_sec_context_a(OM_uint32 * minor_status,
gss_cred_id_t cred_handle,
gss_ctx_id_t * context_handle,
OM_uint32 * time_rec);
#define gss_init_sec_context Curl_gss_init_sec_context_a
-
extern OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 *minor_status,
gss_ctx_id_t *context_handle,
gss_buffer_t output_token);
#define gss_delete_sec_context Curl_gss_delete_sec_context_a
-
/* LDAP wrappers. */
#define BerValue struct berval
input easier and better. */
#define CURL_MAX_INPUT_LENGTH 8000000
-
#include "cookie.h"
#include "psl.h"
#include "formdata.h"
size_t scidlen,
int *qlogfdp);
-
CURLcode Curl_cf_quic_create(struct Curl_cfilter **pcf,
struct Curl_easy *data,
struct connectdata *conn,
return GNUTLS_X509_FMT_PEM; /* default to PEM */
}
-#define GNUTLS_CIPHERS "NORMAL:%PROFILE_MEDIUM:-ARCFOUR-128:"\
+#define GNUTLS_CIPHERS "NORMAL:%PROFILE_MEDIUM:-ARCFOUR-128:" \
"-CTYPE-ALL:+CTYPE-X509"
/* If GnuTLS was compiled without support for SRP it will error out if SRP is
requested in the priority string, so treat it specially
*/
/* Largest supported ASN.1 structure. */
-#define CURL_ASN1_MAX ((size_t) 0x40000) /* 256K */
+#define CURL_ASN1_MAX ((size_t)0x40000) /* 256K */
/* ASN.1 classes. */
/* #define CURL_ASN1_UNIVERSAL 0 */
#include <openssl/opensslv.h>
]],[[
#if defined(AMISSL_CURRENT_VERSION) && defined(AMISSL_V3xx) && \
- (OPENSSL_VERSION_NUMBER >= 0x30000000L) && \
- defined(PROTO_AMISSL_H)
+ (OPENSSL_VERSION_NUMBER >= 0x30000000L) && defined(PROTO_AMISSL_H)
return 0;
#else
#error not AmiSSL v5 / OpenSSL 3
AC_LANG_PROGRAM([[
$curl_includes_unistd
]],[[
- if(0 != alarm(0))
+ if(alarm(0) != 0)
return 1;
]])
],[
$curl_includes_libgen
$curl_includes_unistd
]],[[
- if(0 != basename(0))
+ if(basename(0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
- if(0 != closesocket(0))
+ if(closesocket(0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
- if(0 != closesocket(0))
+ if(closesocket(0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != CloseSocket(0))
+ if(CloseSocket(0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != CloseSocket(0))
+ if(CloseSocket(0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_fcntl
]],[[
- if(0 != fcntl(0, 0, 0))
+ if(fcntl(0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_fcntl
]],[[
int flags = 0;
- if(0 != fcntl(0, F_SETFL, flags | O_NONBLOCK))
+ if(fcntl(0, F_SETFL, flags | O_NONBLOCK) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_sys_xattr
]],[[
- if(0 != fsetxattr(0, "", 0, 0, 0))
+ if(fsetxattr(0, "", 0, 0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_sys_xattr
]],[[
- if(0 != fsetxattr(0, 0, 0, 0, 0, 0))
+ if(fsetxattr(0, 0, 0, 0, 0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_unistd
]],[[
- if(0 != ftruncate(0, 0))
+ if(ftruncate(0, 0) != 0)
return 1;
]])
],[
$curl_includes_netdb
]],[[
struct addrinfo *ai = 0;
- if(0 != getaddrinfo(0, 0, 0, &ai))
+ if(getaddrinfo(0, 0, 0, &ai) != 0)
return 1;
]])
],[
$curl_includes_netdb
]],[[
struct addrinfo *ai = 0;
- if(0 != getaddrinfo(0, 0, 0, &ai))
+ if(getaddrinfo(0, 0, 0, &ai) != 0)
return 1;
]])
],[
$curl_includes_netdb
$curl_includes_bsdsocket
]],[[
- if(0 != gethostbyname_r(0, 0, 0))
+ if(gethostbyname_r(0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_netdb
$curl_includes_bsdsocket
]],[[
- if(0 != gethostbyname_r(0, 0, 0, 0, 0))
+ if(gethostbyname_r(0, 0, 0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_netdb
$curl_includes_bsdsocket
]],[[
- if(0 != gethostbyname_r(0, 0, 0, 0, 0, 0))
+ if(gethostbyname_r(0, 0, 0, 0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
]],[[
char s[1];
- if(0 != gethostname((void *)s, 0))
+ if(gethostname((void *)s, 0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
]],[[
char s[1];
- if(0 != gethostname((void *)s, 0))
+ if(gethostname((void *)s, 0) != 0)
return 1;
]])
],[
int FUNCALLCONV gethostname($tst_arg1, $tst_arg2);
]],[[
char s[1];
- if(0 != gethostname(($tst_arg1)s, 0))
+ if(gethostname(($tst_arg1)s, 0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != getpeername(0, (void *)0, (void *)0))
+ if(getpeername(0, (void *)0, (void *)0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != getpeername(0, (void *)0, (void *)0))
+ if(getpeername(0, (void *)0, (void *)0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != getsockname(0, (void *)0, (void *)0))
+ if(getsockname(0, (void *)0, (void *)0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != getsockname(0, (void *)0, (void *)0))
+ if(getsockname(0, (void *)0, (void *)0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_ifaddrs
]],[[
- if(0 != getifaddrs(0))
+ if(getifaddrs(0) != 0)
return 1;
]])
],[
]],[[
time_t tm = 1170352587;
struct tm result;
- if(0 != gmtime_r(&tm, &result))
+ if(gmtime_r(&tm, &result) != 0)
return 1;
(void)result;
]])
]],[[
char ipv4res[sizeof("255.255.255.255")];
unsigned char ipv4a[5] = "";
- if(0 != inet_ntop(0, ipv4a, ipv4res, 0))
+ if(inet_ntop(0, ipv4a, ipv4res, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_arpa_inet
]],[[
- unsigned char ipv4a[4+1] = "";
+ unsigned char ipv4a[4 + 1] = "";
const char *ipv4src = "192.168.100.1";
- if(0 != inet_pton(0, ipv4src, ipv4a))
+ if(inet_pton(0, ipv4src, ipv4a) != 0)
return 1;
]])
],[
$curl_includes_arpa_inet
$curl_includes_string
]],[[
- unsigned char ipv6a[16+1];
- unsigned char ipv4a[4+1];
+ unsigned char ipv6a[16 + 1];
+ unsigned char ipv4a[4 + 1];
const char *ipv6src = "fe80::214:4fff:fe0b:76c8";
const char *ipv4src = "192.168.100.1";
/* - */
memset(ipv4a, 1, sizeof(ipv4a));
- if(1 != inet_pton(AF_INET, ipv4src, ipv4a))
+ if(inet_pton(AF_INET, ipv4src, ipv4a) != 1)
return 1; /* fail */
/* - */
- if( (ipv4a[0] != 0xc0) ||
- (ipv4a[1] != 0xa8) ||
- (ipv4a[2] != 0x64) ||
- (ipv4a[3] != 0x01) ||
- (ipv4a[4] != 0x01) )
+ if((ipv4a[0] != 0xc0) ||
+ (ipv4a[1] != 0xa8) ||
+ (ipv4a[2] != 0x64) ||
+ (ipv4a[3] != 0x01) ||
+ (ipv4a[4] != 0x01))
return 1; /* fail */
/* - */
memset(ipv6a, 1, sizeof(ipv6a));
- if(1 != inet_pton(AF_INET6, ipv6src, ipv6a))
+ if(inet_pton(AF_INET6, ipv6src, ipv6a) != 1)
return 1; /* fail */
/* - */
- if( (ipv6a[0] != 0xfe) ||
- (ipv6a[1] != 0x80) ||
- (ipv6a[8] != 0x02) ||
- (ipv6a[9] != 0x14) ||
- (ipv6a[10] != 0x4f) ||
- (ipv6a[11] != 0xff) ||
- (ipv6a[12] != 0xfe) ||
- (ipv6a[13] != 0x0b) ||
- (ipv6a[14] != 0x76) ||
- (ipv6a[15] != 0xc8) ||
- (ipv6a[16] != 0x01) )
+ if((ipv6a[0] != 0xfe) ||
+ (ipv6a[1] != 0x80) ||
+ (ipv6a[8] != 0x02) ||
+ (ipv6a[9] != 0x14) ||
+ (ipv6a[10] != 0x4f) ||
+ (ipv6a[11] != 0xff) ||
+ (ipv6a[12] != 0xfe) ||
+ (ipv6a[13] != 0x0b) ||
+ (ipv6a[14] != 0x76) ||
+ (ipv6a[15] != 0xc8) ||
+ (ipv6a[16] != 0x01))
return 1; /* fail */
/* - */
- if( (ipv6a[2] != 0x0) ||
- (ipv6a[3] != 0x0) ||
- (ipv6a[4] != 0x0) ||
- (ipv6a[5] != 0x0) ||
- (ipv6a[6] != 0x0) ||
- (ipv6a[7] != 0x0) )
+ if((ipv6a[2] != 0x0) ||
+ (ipv6a[3] != 0x0) ||
+ (ipv6a[4] != 0x0) ||
+ (ipv6a[5] != 0x0) ||
+ (ipv6a[6] != 0x0) ||
+ (ipv6a[7] != 0x0))
return 1; /* fail */
/* - */
return 0;
AC_LANG_PROGRAM([[
$curl_includes_stropts
]],[[
- if(0 != ioctl(0, 0, 0))
+ if(ioctl(0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_stropts
]],[[
int flags = 0;
- if(0 != ioctl(0, FIONBIO, &flags))
+ if(ioctl(0, FIONBIO, &flags) != 0)
return 1;
]])
],[
#include <net/if.h>
]],[[
struct ifreq ifr;
- if(0 != ioctl(0, SIOCGIFADDR, &ifr))
+ if(ioctl(0, SIOCGIFADDR, &ifr) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
- if(0 != ioctlsocket(0, 0, 0))
+ if(ioctlsocket(0, 0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_winsock2
]],[[
- if(0 != ioctlsocket(0, 0, 0))
+ if(ioctlsocket(0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_winsock2
]],[[
unsigned long flags = 0;
- if(0 != ioctlsocket(0, FIONBIO, &flags))
+ if(ioctlsocket(0, FIONBIO, &flags) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_bsdsocket
]],[[
- if(0 != IoctlSocket(0, 0, 0))
+ if(IoctlSocket(0, 0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_bsdsocket
]],[[
- if(0 != IoctlSocket(0, 0, 0))
+ if(IoctlSocket(0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
]],[[
long flags = 0;
- if(0 != IoctlSocket(0, FIONBIO, &flags))
+ if(IoctlSocket(0, FIONBIO, &flags) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
- if(0 != memrchr("", 0, 0))
+ if(memrchr("", 0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
- if(0 != memrchr("", 0, 0))
+ if(memrchr("", 0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_signal
]],[[
- if(0 != sigaction(0, 0, 0))
+ if(sigaction(0, 0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_signal
]],[[
- if(0 != siginterrupt(0, 0))
+ if(siginterrupt(0, 0) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_signal
]],[[
- if(0 != signal(0, 0))
+ if(signal(0, 0) != 0)
return 1;
]])
],[
$curl_includes_setjmp
]],[[
sigjmp_buf env;
- if(0 != sigsetjmp(env, 0))
+ if(sigsetjmp(env, 0) != 0)
return 1;
]])
],[
$curl_includes_setjmp
]],[[
sigjmp_buf env;
- if(0 != sigsetjmp(env, 0))
+ if(sigsetjmp(env, 0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != socket(0, 0, 0))
+ if(socket(0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_bsdsocket
$curl_includes_sys_socket
]],[[
- if(0 != socket(0, 0, 0))
+ if(socket(0, 0, 0) != 0)
return 1;
]])
],[
$curl_includes_sys_socket
]],[[
int sv[2];
- if(0 != socketpair(0, 0, 0, sv))
+ if(socketpair(0, 0, 0, sv) != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
- if(0 != strcasecmp("", ""))
+ if(strcasecmp("", "") != 0)
return 1;
]])
],[
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
- if(0 != strcmpi(0, 0))
+ if(strcmpi(0, 0) != 0)
return 1;
]])
],[
$curl_includes_string
]],[[
char s[1];
- if(0 != strerror_r(0, s, 0))
+ if(strerror_r(0, s, 0) != 0)
return 1;
]])
],[
char *strerror_r(int errnum, char *workbuf, $arg3 bufsize);
]],[[
char s[1];
- if(0 != strerror_r(0, s, 0))
+ if(strerror_r(0, s, 0) != 0)
return 1;
(void)s;
]])
int strerror_r(int errnum, char *resultbuf, $arg3 bufsize);
]],[[
char s[1];
- if(0 != strerror_r(0, s, 0))
+ if(strerror_r(0, s, 0) != 0)
return 1;
(void)s;
]])
AC_LANG_PROGRAM([[
$curl_includes_string
]],[[
- if(0 != stricmp(0, 0))
+ if(stricmp(0, 0) != 0)
return 1;
]])
],[
$2
]],[
switch(0) {
- case 0:
- case (sizeof($1) == $typesize):;
+ case 0:
+ case (sizeof($1) == $typesize):;
}
])
],[
#include "os400sys.h"
#ifndef SIZE_MAX
-#define SIZE_MAX ((size_t) ~0) /* Is unsigned on OS/400. */
+#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 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(). */
-#define ALLOC_GRANULE 8 /* Alloc. granule for curl_formadd_ccsid(). */
-
-
-static void
-makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid)
+static void makeOS400IconvCode(char buf[ICONV_ID_SIZE], unsigned int ccsid)
{
/**
*** Convert a CCSID to the corresponding IBM iconv_open() character
curl_msprintf(buf, "IBMCCSID%05u0000000", ccsid);
}
-
-static iconv_t
-iconv_open_CCSID(unsigned int ccsidout, unsigned int ccsidin,
- unsigned int cstr)
+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];
makeOS400IconvCode(fromcode, ccsidin);
makeOS400IconvCode(tocode, ccsidout);
- memset(tocode + 13, 0, sizeof(tocode) - 13); /* Dest. code id format. */
+ memset(tocode + 13, 0, sizeof(tocode) - 13); /* Dest. code id format. */
if(cstr)
- fromcode[18] = '1'; /* Set null-terminator flag. */
+ 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)
+static int convert(char *d, size_t dlen, int dccsid, const char *s, int slen,
+ int sccsid)
{
int i;
iconv_t cd;
cd = iconv_open_CCSID(dccsid, sccsid, 1);
}
else {
- lslen = (size_t) slen;
+ lslen = (size_t)slen;
cd = iconv_open_CCSID(dccsid, sccsid, 0);
}
i = dlen;
- if((int) iconv(cd, (char * *) &s, &lslen, &d, &dlen) < 0)
+ if((int)iconv(cd, (char **)&s, &lslen, &d, &dlen) < 0)
i = -1;
else
i -= dlen;
return i;
}
-
static char *dynconvert(int dccsid, const char *s, int slen, int sccsid,
int *olen)
{
/* 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. */
+ dlen = (size_t)(slen < 0 ? strlen(s) : slen) + 1;
+ dlen *= MAX_CONV_EXPANSION; /* Allow some expansion. */
d = malloc(dlen);
if(!d)
- return (char *) NULL;
+ return (char *)NULL;
l = convert(d, dlen, dccsid, s, slen, sccsid);
if(l < 0) {
free(d);
- return (char *) NULL;
+ return (char *)NULL;
}
if(slen < 0) {
if(l2 < 0) {
free(d);
- return (char *) NULL;
+ return (char *)NULL;
}
l += l2;
}
- if((size_t) l < dlen) {
- cp = realloc(d, l); /* Shorten to minimum needed. */
+ 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)
+static struct curl_slist *slist_convert(int dccsid, struct curl_slist *from,
+ int sccsid)
{
- struct curl_slist *to = (struct curl_slist *) NULL;
+ struct curl_slist *to = (struct curl_slist *)NULL;
for(; from; from = from->next) {
struct curl_slist *nl;
if(!cp) {
curl_slist_free_all(to);
- return (struct curl_slist *) NULL;
+ return (struct curl_slist *)NULL;
}
nl = Curl_slist_append_nodup(to, cp);
if(!nl) {
return to;
}
-
-static char *
-keyed_string(localkey_t key, const char *ascii, unsigned int ccsid)
+static char *keyed_string(localkey_t key, const char *ascii,
+ unsigned int ccsid)
{
int i;
char *ebcdic;
if(!ascii)
- return (char *) NULL;
+ return (char *)NULL;
i = MAX_CONV_EXPANSION * (strlen(ascii) + 1);
return ebcdic;
if(convert(ebcdic, i, ccsid, ascii, -1, ASCII_CCSID) < 0)
- return (char *) NULL;
+ return (char *)NULL;
return ebcdic;
}
-
-const char *
-curl_to_ccsid(const char *s, unsigned int ccsid)
+const char *curl_to_ccsid(const char *s, unsigned int ccsid)
{
if(s)
s = dynconvert(ccsid, s, -1, ASCII_CCSID, NULL);
return s;
}
-
-const char *
-curl_from_ccsid(const char *s, unsigned int ccsid)
+const char *curl_from_ccsid(const char *s, unsigned int ccsid)
{
if(s)
s = dynconvert(ASCII_CCSID, s, -1, ccsid, NULL);
return s;
}
-
-char *
-curl_version_ccsid(unsigned int ccsid)
+char *curl_version_ccsid(unsigned int ccsid)
{
return keyed_string(LK_CURL_VERSION, curl_version(), ccsid);
}
-
-char *
-curl_easy_escape_ccsid(CURL *handle, const char *string, int length,
- unsigned int sccsid, unsigned int dccsid)
+char *curl_easy_escape_ccsid(CURL *handle, const char *string, int length,
+ unsigned int sccsid, unsigned int dccsid)
{
char *s;
char *d;
if(!string) {
/* !checksrc! disable ERRNOVAR 1 */
errno = EINVAL;
- return (char *) NULL;
+ return (char *)NULL;
}
s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL);
if(!s)
- return (char *) NULL;
+ return (char *)NULL;
d = curl_easy_escape(handle, s, 0);
free(s);
if(!d)
- return (char *) NULL;
+ return (char *)NULL;
s = dynconvert(dccsid, d, -1, ASCII_CCSID, NULL);
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 *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) {
/* !checksrc! disable ERRNOVAR 1 */
errno = EINVAL;
- return (char *) NULL;
+ return (char *)NULL;
}
s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL);
if(!s)
- return (char *) NULL;
+ return (char *)NULL;
d = curl_easy_unescape(handle, s, 0, outlength);
free(s);
if(!d)
- return (char *) NULL;
+ return (char *)NULL;
s = dynconvert(dccsid, d, -1, ASCII_CCSID, NULL);
free(d);
return s;
}
-
-struct curl_slist *
-curl_slist_append_ccsid(struct curl_slist *list,
- const char *data, unsigned int ccsid)
+struct curl_slist *curl_slist_append_ccsid(struct curl_slist *list,
+ const char *data,
+ unsigned int ccsid)
{
char *s;
- s = (char *) NULL;
+ s = (char *)NULL;
if(!data)
return curl_slist_append(list, data);
s = dynconvert(ASCII_CCSID, data, -1, ccsid, NULL);
if(!s)
- return (struct curl_slist *) NULL;
+ 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)
+time_t curl_getdate_ccsid(const char *p, const time_t *unused,
+ unsigned int ccsid)
{
char *s;
time_t t;
s = dynconvert(ASCII_CCSID, p, -1, ccsid, NULL);
if(!s)
- return (time_t) -1;
+ 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)
+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'.
return 0;
}
-
-curl_version_info_data *
-curl_version_info_ccsid(CURLversion stamp, unsigned int ccsid)
+curl_version_info_data *curl_version_info_ccsid(CURLversion stamp,
+ unsigned int ccsid)
{
curl_version_info_data *p;
char *cp;
/* If caller has been compiled with a newer version, error. */
if(stamp > CURLVERSION_NOW)
- return (curl_version_info_data *) NULL;
+ return (curl_version_info_data *)NULL;
p = curl_version_info(stamp);
}
for(i = 0; i < sizeof(charfields) / sizeof(charfields[0]); i++) {
- cpp = (const char **) ((char *) p + charfields[i]);
+ cpp = (const char **)((char *)p + charfields[i]);
if(*cpp)
n += strlen(*cpp) + 1;
}
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));
+ id = (curl_version_info_data *)Curl_thread_buffer(LK_VERSION_INFO,
+ sizeof(*id));
if(!id || !cp)
- return (curl_version_info_data *) NULL;
+ return (curl_version_info_data *)NULL;
/* Copy data and convert strings. */
- memcpy((char *) id, (char *) p, sizeof(*p));
+ memcpy((char *)id, (char *)p, sizeof(*p));
if(id->protocols) {
i = nproto * sizeof(id->protocols[0]);
- id->protocols = (const char * const *) cp;
- memcpy(cp, (char *) p->protocols, i);
+ 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;
+ 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]);
+ cpp = (const char **)((char *)p + charfields[i]);
if(*cpp && convert_version_info_string(cpp, &cp, &n, ccsid))
- return (curl_version_info_data *) NULL;
+ return (curl_version_info_data *)NULL;
}
return id;
}
-
-const char *
-curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid)
+const char *curl_easy_strerror_ccsid(CURLcode error, unsigned int ccsid)
{
return keyed_string(LK_EASY_STRERROR, curl_easy_strerror(error), ccsid);
}
-
-const char *
-curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid)
+const char *curl_share_strerror_ccsid(CURLSHcode error, unsigned int ccsid)
{
return keyed_string(LK_SHARE_STRERROR, curl_share_strerror(error), ccsid);
}
-
-const char *
-curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid)
+const char *curl_multi_strerror_ccsid(CURLMcode error, unsigned int ccsid)
{
return keyed_string(LK_MULTI_STRERROR, curl_multi_strerror(error), ccsid);
}
-
-const char *
-curl_url_strerror_ccsid(CURLUcode error, unsigned int ccsid)
+const char *curl_url_strerror_ccsid(CURLUcode error, unsigned int ccsid)
{
return keyed_string(LK_URL_STRERROR, curl_url_strerror(error), ccsid);
}
-
-void
-curl_certinfo_free_all(struct curl_certinfo *info)
+void curl_certinfo_free_all(struct curl_certinfo *info)
{
/* Free all memory used by certificate info. */
if(info) {
for(i = 0; i < info->num_of_certs; i++)
curl_slist_free_all(info->certinfo[i]);
- free((char *) info->certinfo);
+ free((char *)info->certinfo);
}
- free((char *) info);
+ free((char *)info);
}
}
-
-CURLcode
-curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...)
+CURLcode curl_easy_getinfo_ccsid(CURL *curl, CURLINFO info, ...)
{
va_list arg;
void *paramp;
/* WARNING: unlike curl_easy_getinfo(), the strings returned by this
procedure have to be free'ed. */
- data = (struct Curl_easy *) curl;
+ data = (struct Curl_easy *)curl;
va_start(arg, info);
paramp = va_arg(arg, void *);
ret = Curl_getinfo(data, info, paramp);
struct curl_certinfo *cipf;
struct curl_certinfo *cipt;
- switch((int) info & CURLINFO_TYPEMASK) {
+ switch((int)info & CURLINFO_TYPEMASK) {
case CURLINFO_STRING:
ccsid = va_arg(arg, unsigned int);
- cpp = (char * *) paramp;
+ cpp = (char **)paramp;
if(*cpp) {
*cpp = dynconvert(ccsid, *cpp, -1, ASCII_CCSID, NULL);
ccsid = va_arg(arg, unsigned int);
switch(info) {
case CURLINFO_CERTINFO:
- cipf = *(struct curl_certinfo * *) paramp;
+ cipf = *(struct curl_certinfo **)paramp;
if(cipf) {
- cipt = (struct curl_certinfo *) malloc(sizeof(*cipt));
+ 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 *));
+ cipt->certinfo =
+ (struct curl_slist **)calloc(cipf->num_of_certs + 1,
+ sizeof(struct curl_slist *));
if(!cipt->certinfo)
ret = CURLE_OUT_OF_MEMORY;
else {
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))) {
+ 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;
+ cipt = (struct curl_certinfo *)NULL;
}
- *(struct curl_certinfo * *) paramp = cipt;
+ *(struct curl_certinfo **)paramp = cipt;
}
break;
break;
default:
- slp = (struct curl_slist **) paramp;
+ slp = (struct curl_slist **)paramp;
if(*slp) {
*slp = slist_convert(ccsid, *slp, ASCII_CCSID);
if(!*slp)
return ret;
}
-
-static int
-Curl_is_formadd_string(CURLformoption option)
+static int Curl_is_formadd_string(CURLformoption option)
{
switch(option) {
return 0;
}
-
-static void
-Curl_formadd_release_local(struct curl_forms *forms, int nargs, int skip)
+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[nargs].value);
- free((char *) forms);
+ free((char *)forms);
}
-
-static int
-Curl_formadd_convert(struct curl_forms *forms,
- int formx, int lengthx, unsigned int ccsid)
+static int Curl_formadd_convert(struct curl_forms *forms, int formx,
+ int lengthx, unsigned int ccsid)
{
int l;
char *cp;
return 0;
if(lengthx >= 0)
- l = (int) forms[lengthx].value;
+ l = (int)forms[lengthx].value;
else
l = strlen(forms[formx].value) + 1;
if(!cp)
return -1;
- l = convert(cp, MAX_CONV_EXPANSION * l, ASCII_CCSID,
- forms[formx].value, l, ccsid);
+ 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. */
+ 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. */
+ forms[lengthx].value = (char *)l; /* Update length after conversion. */
return l;
}
-
-CURLFORMcode
-curl_formadd_ccsid(struct curl_httppost **httppost,
- struct curl_httppost **last_post, ...)
+CURLFORMcode curl_formadd_ccsid(struct curl_httppost **httppost,
+ struct curl_httppost **last_post, ...)
{
va_list arg;
CURLformoption option;
lengthx = -1;
namex = -1;
namelengthx = -1;
- forms = (struct curl_forms *) NULL;
+ forms = (struct curl_forms *)NULL;
va_start(arg, last_post);
for(;;) {
if(option == CURLFORM_END)
break;
- }
+ }
/* Dispatch by option. */
switch(option) {
case CURLFORM_END:
- forms = (struct curl_forms *) NULL; /* Leave array mode. */
+ forms = (struct curl_forms *)NULL; /* Leave array mode. */
continue;
case CURLFORM_ARRAY:
break;
case CURLFORM_COPYNAME:
- option = CURLFORM_PTRNAME; /* Static for now. */
+ option = CURLFORM_PTRNAME; /* Static for now. */
case CURLFORM_PTRNAME:
if(namex >= 0)
if(!forms) {
value = va_arg(arg, char *);
- nameccsid = (unsigned int) va_arg(arg, long);
+ nameccsid = (unsigned int)va_arg(arg, long);
}
else {
- nameccsid = (unsigned int) forms->value;
+ nameccsid = (unsigned int)forms->value;
forms++;
}
if(!forms) {
value = va_arg(arg, char *);
- contentccsid = (unsigned int) va_arg(arg, long);
+ contentccsid = (unsigned int)va_arg(arg, long);
}
else {
- contentccsid = (unsigned int) forms->value;
+ contentccsid = (unsigned int)forms->value;
forms++;
}
case CURLFORM_PTRCONTENTS:
case CURLFORM_BUFFERPTR:
if(!forms)
- value = va_arg(arg, char *); /* No conversion. */
+ value = va_arg(arg, char *); /* No conversion. */
break;
lengthx = nargs;
if(!forms)
- value = (char *) va_arg(arg, long);
+ value = (char *)va_arg(arg, long);
break;
lengthx = nargs;
if(!forms)
- value = (char *) va_arg(arg, curl_off_t);
+ value = (char *)va_arg(arg, curl_off_t);
break;
namelengthx = nargs;
if(!forms)
- value = (char *) va_arg(arg, long);
+ value = (char *)va_arg(arg, long);
break;
case CURLFORM_BUFFERLENGTH:
if(!forms)
- value = (char *) va_arg(arg, long);
+ value = (char *)va_arg(arg, long);
break;
case CURLFORM_CONTENTHEADER:
if(!forms)
- value = (char *) va_arg(arg, struct curl_slist *);
+ value = (char *)va_arg(arg, struct curl_slist *);
break;
case CURLFORM_STREAM:
if(!forms)
- value = (char *) va_arg(arg, void *);
+ value = (char *)va_arg(arg, void *);
break;
if(!forms) {
value = va_arg(arg, char *);
- ccsid = (unsigned int) va_arg(arg, long);
+ ccsid = (unsigned int)va_arg(arg, long);
}
else {
- ccsid = (unsigned int) forms->value;
+ ccsid = (unsigned int)forms->value;
forms++;
}
if(Curl_formadd_convert(lforms, namex, namelengthx, nameccsid) < 0)
result = CURL_FORMADD_MEMORY;
else
- lforms[namex].option = CURLFORM_COPYNAME; /* Force copy. */
- }
+ 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. */
lforms[nargs].option = CURLFORM_END;
result = curl_formadd(httppost, last_post,
CURLFORM_ARRAY, lforms, CURLFORM_END);
- }
+ }
/* Terminate. */
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)
+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;
+ p = (struct cfcdata *)arg;
- if((long) len <= 0)
+ if((long)len <= 0)
return (*p->append)(p->arg, buf, len);
b = malloc(MAX_CONV_EXPANSION * len);
if(!b)
- return (size_t) -1;
+ 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;
+ return (size_t)-1;
}
ret = (*p->append)(p->arg, b, l);
return ret == l ? len : -1;
}
-
-int
-curl_formget_ccsid(struct curl_httppost *form, void *arg,
- curl_formget_callback append, unsigned int ccsid)
+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);
+ return curl_formget(form, (void *)&lcfc, Curl_formget_callback_ccsid);
}
-
-CURLcode
-curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
+CURLcode curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
{
CURLcode result;
va_list arg;
break;
}
- data->set.postfieldsize = pfsize; /* Replace data size. */
+ data->set.postfieldsize = pfsize; /* Replace data size. */
s = cp;
cp = NULL;
}
result = curl_easy_setopt(easy, CURLOPT_POSTFIELDS, s);
- data->set.str[STRING_COPYPOSTFIELDS] = s; /* Give to library. */
+ data->set.str[STRING_COPYPOSTFIELDS] = s; /* Give to library. */
break;
default:
if(bp && bp->data && bp->len &&
ccsid != NOCONV_CCSID && ccsid != ASCII_CCSID) {
- pfsize = (curl_off_t) bp->len * MAX_CONV_EXPANSION;
+ pfsize = (curl_off_t)bp->len * MAX_CONV_EXPANSION;
if(pfsize > SIZE_MAX)
pfsize = SIZE_MAX;
break;
}
FALLTHROUGH();
- case CURLOPT_ERRORBUFFER: /* This is an output buffer. */
+ case CURLOPT_ERRORBUFFER: /* This is an output buffer. */
result = Curl_vsetopt(easy, tag, arg);
break;
}
return result;
}
-
/* ILE/RPG helper functions. */
-char *
-curl_form_long_value(long value)
+char *curl_form_long_value(long value)
{
/* ILE/RPG cannot cast an integer to a pointer. This procedure does it. */
- return (char *) value;
+ return (char *)value;
}
-
-CURLcode
-curl_easy_setopt_RPGnum_(CURL *easy, CURLoption tag, curl_off_t arg)
+CURLcode curl_easy_setopt_RPGnum_(CURL *easy, CURLoption tag, curl_off_t arg)
{
/* ILE/RPG procedure overloading cannot discriminate between different
size and/or signedness of format arguments. This provides a generic
wrapper that adapts size to the given tag expectation.
This procedure is not intended to be explicitly called from user code. */
if(tag / 10000 != CURLOPTTYPE_OFF_T)
- return curl_easy_setopt(easy, tag, (long) arg);
+ return curl_easy_setopt(easy, tag, (long)arg);
return curl_easy_setopt(easy, tag, arg);
}
-
-CURLcode
-curl_multi_setopt_RPGnum_(CURLM *multi, CURLMoption tag, curl_off_t arg)
+CURLcode curl_multi_setopt_RPGnum_(CURLM *multi, CURLMoption tag,
+ curl_off_t arg)
{
/* Likewise, for multi handle. */
if(tag / 10000 != CURLOPTTYPE_OFF_T)
- return curl_multi_setopt(multi, tag, (long) arg);
+ return curl_multi_setopt(multi, tag, (long)arg);
return curl_multi_setopt(multi, tag, arg);
}
-
-char *
-curl_pushheader_bynum_cssid(struct curl_pushheaders *h,
- size_t num, unsigned int ccsid)
+char *curl_pushheader_bynum_cssid(struct curl_pushheaders *h, size_t num,
+ unsigned int ccsid)
{
- char *d = (char *) NULL;
+ char *d = (char *)NULL;
char *s = curl_pushheader_bynum(h, num);
if(s)
return d;
}
-
-char *
-curl_pushheader_byname_ccsid(struct curl_pushheaders *h, const char *header,
- unsigned int ccsidin, unsigned int ccsidout)
+char *curl_pushheader_byname_ccsid(struct curl_pushheaders *h,
+ const char *header, unsigned int ccsidin,
+ unsigned int ccsidout)
{
- char *d = (char *) NULL;
+ char *d = (char *)NULL;
if(header) {
header = dynconvert(ASCII_CCSID, header, -1, ccsidin, NULL);
if(header) {
char *s = curl_pushheader_byname(h, header);
- free((char *) header);
+ free((char *)header);
if(s)
d = dynconvert(ccsidout, s, -1, ASCII_CCSID, NULL);
mime_string_call(curl_mimepart *part, const char *string, unsigned int ccsid,
CURLcode (*mimefunc)(curl_mimepart *part, const char *string))
{
- char *s = (char *) NULL;
+ char *s = (char *)NULL;
CURLcode result;
if(!string)
return result;
}
-CURLcode
-curl_mime_name_ccsid(curl_mimepart *part, const char *name, unsigned int ccsid)
+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)
+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)
+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)
+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)
+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)
+CURLcode curl_mime_data_ccsid(curl_mimepart *part, const char *data,
+ size_t datasize, unsigned int ccsid)
{
- char *s = (char *) NULL;
+ char *s = (char *)NULL;
CURLcode result;
int osize;
return result;
}
-CURLUcode
-curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part,
- unsigned int flags, unsigned int ccsid)
+CURLUcode curl_url_get_ccsid(CURLU *handle, CURLUPart what, char **part,
+ unsigned int flags, unsigned int ccsid)
{
char *s = (char *)NULL;
CURLUcode result;
return result;
}
-CURLUcode
-curl_url_set_ccsid(CURLU *handle, CURLUPart what, const char *part,
- unsigned int flags, unsigned int ccsid)
+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(option && option->name)
name = dynconvert(ccsid, option->name, -1, ASCII_CCSID, NULL);
- return (const char *) name;
+ return (const char *)name;
}
/* Header API CCSID support. */
-CURLHcode
-curl_easy_header_ccsid(CURL *easy, const char *name, size_t index,
- unsigned int origin, int request,
- struct curl_header **hout, unsigned int ccsid)
+CURLHcode curl_easy_header_ccsid(CURL *easy, const char *name, size_t index,
+ unsigned int origin, int request,
+ struct curl_header **hout, unsigned int ccsid)
{
CURLHcode result = CURLHE_BAD_ARGUMENT;
#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,
struct vary2 *cmdargs; /* Command line arguments. */
};
-static int
-is_ifs(char c)
+static int is_ifs(char c)
{
return c == ' ' || c == '\t' || c == '\r' || c == '\n';
}
-static int
-parse_command_line(const char *cmdargs, size_t len,
- size_t *argc, char **argv,
- size_t *argsize, char *argbuf)
+static int parse_command_line(const char *cmdargs, size_t len, size_t *argc,
+ char **argv, size_t *argsize, char *argbuf)
{
const char *endline = cmdargs + len;
char quote = '\0';
return 0;
}
-
-int
-main(int argsc, struct arguments *args)
+int main(int argsc, struct arguments *args)
{
size_t argc;
char **argv;
if(!exitcode) {
/* Allocate space for parsed arguments. */
- argv = (char **) malloc((argc + 1) * sizeof(*argv) + argsize);
+ argv = (char **)malloc((argc + 1) * sizeof(*argv) + argsize);
if(!argv) {
fputs("Memory allocation error\n", stderr);
exitcode = -2;
}
else {
- _SYSPTR pgmptr = rslvsp(WLI_PGM, (char *) CURLPGM, library, _AUTH_NONE);
- _LU_Work_Area_T *luwrka = (_LU_Work_Area_T *) _LUWRKA();
+ _SYSPTR pgmptr = rslvsp(WLI_PGM, (char *)CURLPGM, library, _AUTH_NONE);
+ _LU_Work_Area_T *luwrka = (_LU_Work_Area_T *)_LUWRKA();
- parse_command_line(args->cmdargs->string, args->cmdargs->len,
- &argc, argv, &argsize, (char *) (argv + argc + 1));
+ parse_command_line(args->cmdargs->string, args->cmdargs->len, &argc,
+ argv, &argsize, (char *)(argv + argc + 1));
/* Call program. */
- _CALLPGMV((void *) &pgmptr, argv, argc);
+ _CALLPGMV((void *)&pgmptr, argv, argc);
exitcode = luwrka->LU_RC;
free(argv);
extern int QadrtFreeEnviron(void);
extern char * setlocale_a(int, const char *);
-
/* The ASCII main program. */
-extern int main_a(int argc, char * * argv);
+extern int main_a(int argc, char **argv);
/* Global values of original EBCDIC arguments. */
int ebcdic_argc;
char ** ebcdic_argv;
-
int main(int argc, char **argv)
{
int i;
char dummybuf[128];
/* To/From codes are 32 byte long strings with
reserved fields initialized to ZEROs */
- const char tocode[32] = {"IBMCCSID01208"}; /* Use UTF-8. */
- const char fromcode[32] = {"IBMCCSID000000000010"};
+ const char tocode[32] = { "IBMCCSID01208" }; /* Use UTF-8. */
+ const char fromcode[32] = { "IBMCCSID000000000010" };
ebcdic_argc = argc;
ebcdic_argv = argv;
}
/* Allocate memory for the ASCII arguments and vector. */
- argv = (char **) malloc((argc + 1) * sizeof(*argv) + bytecount);
+ argv = (char **)malloc((argc + 1) * sizeof(*argv) + bytecount);
/* Build the vector and convert argument encoding. */
- outbuf = (char *) (argv + argc + 1);
+ outbuf = (char *)(argv + argc + 1);
outbytesleft = bytecount;
for(i = 0; i < argc; i++) {
i = main_a(argc, argv);
/* Clean-up allocated items. */
- free((char *) argv);
+ free((char *)argv);
QadrtFreeConversionTable();
QadrtFreeEnviron();
#pragma convert(0) /* Restore EBCDIC. */
-#define MIN_BYTE_GAIN 1024 /* Minimum gain when shortening a buffer. */
+#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 void thdbufdestroy(void *private)
{
if(private) {
- struct buffer_t *p = (struct buffer_t *) private;
+ struct buffer_t *p = (struct buffer_t *)private;
localkey_t i;
- for(i = (localkey_t) 0; i < LK_LAST; i++) {
+ for(i = (localkey_t)0; i < LK_LAST; i++) {
free(p->buf);
p++;
}
}
}
-
-static void
-terminate(void)
+static void terminate(void)
{
if(Curl_thread_buffer == buffer_threaded) {
locbufs = pthread_getspecific(thdkey);
- pthread_setspecific(thdkey, (void *) NULL);
+ pthread_setspecific(thdkey, (void *)NULL);
pthread_key_delete(thdkey);
}
if(Curl_thread_buffer != buffer_undef) {
- thdbufdestroy((void *) locbufs);
- locbufs = (struct buffer_t *) NULL;
+ thdbufdestroy((void *)locbufs);
+ locbufs = (struct buffer_t *)NULL;
}
Curl_thread_buffer = buffer_undef;
}
-
-static char *
-get_buffer(struct buffer_t *buf, long size)
+static char *get_buffer(struct buffer_t *buf, long size)
{
char *cp;
return buf->buf;
}
- if((unsigned long) size <= buf->size) {
+ if((unsigned long)size <= buf->size) {
/* Shorten the buffer only if it frees a significant byte count. This
avoids some realloc() overhead. */
return cp;
}
-
/*
* Get buffer address for the given local key.
* This is always called though `Curl_thread_buffer' and when threads are
* NOT made available by the os, so no mutex lock/unlock occurs.
*/
-static char *
-buffer_unthreaded(localkey_t key, long size)
+static char *buffer_unthreaded(localkey_t key, long size)
{
return get_buffer(locbufs + key, size);
}
-
/*
* Get buffer address for the given local key, taking care of
* concurrent threads.
* This is always called though `Curl_thread_buffer' and when threads are
* made available by the os.
*/
-static char *
-buffer_threaded(localkey_t key, long size)
+static char *buffer_threaded(localkey_t key, long size)
{
struct buffer_t *bufs;
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);
+ bufs = (struct buffer_t *)pthread_getspecific(thdkey);
if(!bufs) {
if(size < 0)
- return (char *) NULL; /* No buffer yet. */
+ return (char *)NULL; /* No buffer yet. */
/* Allocate buffer descriptors for the current thread. */
- bufs = calloc((size_t) LK_LAST, sizeof(*bufs));
+ bufs = calloc((size_t)LK_LAST, sizeof(*bufs));
if(!bufs)
- return (char *) NULL;
+ return (char *)NULL;
- if(pthread_setspecific(thdkey, (void *) bufs)) {
+ if(pthread_setspecific(thdkey, (void *)bufs)) {
free(bufs);
- return (char *) NULL;
+ return (char *)NULL;
}
}
return get_buffer(bufs + key, size);
}
-
-static char *
-buffer_undef(localkey_t key, long 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.
/* Determine if we can use pthread-specific data. */
- if(Curl_thread_buffer == buffer_undef) { /* If unchanged during lock. */
+ if(Curl_thread_buffer == buffer_undef) { /* If unchanged during lock. */
/* OS400 interactive jobs do not support threads: check here. */
if(!pthread_key_create(&thdkey, thdbufdestroy)) {
/* Threads are supported: use the thread-aware buffer procedure. */
else {
/* No multi-threading available: allocate storage for single-thread
* buffer headers. */
- locbufs = calloc((size_t) LK_LAST, sizeof(*locbufs));
+ locbufs = calloc((size_t)LK_LAST, sizeof(*locbufs));
if(!locbufs) {
- pthread_mutex_unlock(&mutex); /* For symetry: will probably fail. */
- return (char *) NULL;
+ pthread_mutex_unlock(&mutex); /* For symetry: will probably fail. */
+ return (char *)NULL;
}
else
Curl_thread_buffer = buffer_unthreaded; /* Use unthreaded version. */
return Curl_thread_buffer(key, size);
}
-
-static char *
-set_thread_string(localkey_t key, const char *s)
+static char *set_thread_string(localkey_t key, const char *s)
{
int i;
char *cp;
if(!s)
- return (char *) NULL;
+ return (char *)NULL;
i = strlen(s) + 1;
cp = Curl_thread_buffer(key, MAX_CONV_EXPANSION * i + 1);
return cp;
}
-
-int
-Curl_getnameinfo_a(const struct sockaddr *sa, socklen_t salen,
- char *nodename, socklen_t nodenamelen,
- char *servname, socklen_t servnamelen,
- int flags)
+int Curl_getnameinfo_a(const struct sockaddr *sa, socklen_t salen,
+ char *nodename, socklen_t nodenamelen,
+ char *servname, socklen_t servnamelen,
+ int flags)
{
char *enodename = NULL;
char *eservname = NULL;
}
}
- status = getnameinfo(sa, salen, enodename, nodenamelen,
- eservname, servnamelen, flags);
+ status = getnameinfo(sa, salen, enodename, nodenamelen, eservname,
+ servnamelen, flags);
if(!status) {
int i;
if(enodename) {
- i = QadrtConvertE2A(nodename, enodename,
- nodenamelen - 1, strlen(enodename));
+ i = QadrtConvertE2A(nodename, enodename, nodenamelen - 1,
+ strlen(enodename));
nodename[i] = '\0';
}
if(eservname) {
- i = QadrtConvertE2A(servname, eservname,
- servnamelen - 1, strlen(eservname));
+ i = QadrtConvertE2A(servname, eservname, servnamelen - 1,
+ strlen(eservname));
servname[i] = '\0';
}
}
return status;
}
-int
-Curl_getaddrinfo_a(const char *nodename, const char *servname,
- const struct addrinfo *hints,
- struct addrinfo **res)
+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;
+ enodename = (char *)NULL;
+ eservname = (char *)NULL;
if(nodename) {
i = strlen(nodename);
/* ASCII wrappers for the GSSAPI procedures. */
-static int
-Curl_gss_convert_in_place(OM_uint32 *minor_status, gss_buffer_t buf)
+static int Curl_gss_convert_in_place(OM_uint32 *minor_status, gss_buffer_t buf)
{
unsigned int i = buf->length;
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)
+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)
{
OM_uint32 rc;
unsigned int i;
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));
+ memcpy((char *)&in, (char *)in_name, sizeof(in));
i = in.length;
in.value = malloc(i + 1);
}
QadrtConvertA2E(in.value, in_name->value, i, i);
- ((char *) in.value)[i] = '\0';
+ ((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)
+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;
}
QadrtConvertA2E(in.value, input_token->value, i, i);
- ((char *) in.value)[i] = '\0';
+ ((char *)in.value)[i] = '\0';
in.length = i;
inp = ∈
}
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)
+OM_uint32 Curl_gss_delete_sec_context_a(OM_uint32 *minor_status,
+ gss_ctx_id_t *context_handle,
+ gss_buffer_t output_token)
{
OM_uint32 rc;
/* ASCII wrappers for the LDAP procedures. */
-void *
-Curl_ldap_init_a(char *host, int port)
+void *Curl_ldap_init_a(char *host, int port)
{
size_t i;
char *ehost;
void *result;
if(!host)
- return (void *) ldap_init(host, port);
+ return (void *)ldap_init(host, port);
i = strlen(host);
ehost = malloc(i + 1);
if(!ehost)
- return (void *) NULL;
+ return (void *)NULL;
QadrtConvertA2E(ehost, host, i, i);
ehost[i] = '\0';
- result = (void *) ldap_init(ehost, port);
+ result = (void *)ldap_init(ehost, port);
free(ehost);
return result;
}
-int
-Curl_ldap_simple_bind_s_a(void *ld, char *dn, char *passwd)
+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;
+ edn = (char *)NULL;
+ epasswd = (char *)NULL;
if(dn) {
i = strlen(dn);
return i;
}
-int
-Curl_ldap_search_s_a(void *ld, char *base, int scope, char *filter,
- char **attrs, int attrsonly, LDAPMessage **res)
+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 **eattrs;
int status;
- ebase = (char *) NULL;
- efilter = (char *) NULL;
- eattrs = (char **) NULL;
+ ebase = (char *)NULL;
+ efilter = (char *)NULL;
+ eattrs = (char **)NULL;
status = LDAP_SUCCESS;
if(base) {
return status;
}
-
-struct berval **
-Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry, const char *attr)
+struct berval **Curl_ldap_get_values_len_a(void *ld, LDAPMessage *entry,
+ const char *attr)
{
char *cp;
struct berval **result;
- cp = (char *) NULL;
+ cp = (char *)NULL;
if(attr) {
int i = strlen(attr);
if(!cp) {
ldap_set_lderrno(ld, LDAP_NO_MEMORY, NULL,
ldap_err2string(LDAP_NO_MEMORY));
- return (struct berval **) NULL;
+ return (struct berval **)NULL;
}
QadrtConvertA2E(cp, attr, i, i);
return result;
}
-char *
-Curl_ldap_err2string_a(int error)
+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)
+char *Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry)
{
int i;
char *cp;
return cp;
}
-char *
-Curl_ldap_first_attribute_a(void *ld,
- LDAPMessage *entry, BerElement **berptr)
+char *Curl_ldap_first_attribute_a(void *ld, LDAPMessage *entry,
+ BerElement **berptr)
{
int i;
char *cp;
return cp;
}
-char *
-Curl_ldap_next_attribute_a(void *ld,
- LDAPMessage *entry, BerElement *berptr)
+char *Curl_ldap_next_attribute_a(void *ld, LDAPMessage *entry,
+ BerElement *berptr)
{
int i;
char *cp;
#endif /* CURL_DISABLE_LDAP */
-static int
-sockaddr2ebcdic(struct sockaddr_storage *dstaddr,
- const struct sockaddr *srcaddr, int srclen)
+static int sockaddr2ebcdic(struct sockaddr_storage *dstaddr,
+ const struct sockaddr *srcaddr, int srclen)
{
const struct sockaddr_un *srcu;
struct sockaddr_un *dstu;
return -1;
}
- memcpy((char *) dstaddr, (char *) srcaddr, srclen);
+ memcpy((char *)dstaddr, (char *)srcaddr, srclen);
switch(srcaddr->sa_family) {
case AF_UNIX:
- srcu = (const struct sockaddr_un *) srcaddr;
- dstu = (struct sockaddr_un *) dstaddr;
+ 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);
return srclen;
}
-
-static int
-sockaddr2ascii(struct sockaddr *dstaddr, int dstlen,
- const struct sockaddr_storage *srcaddr, int 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;
return -1;
}
- memcpy((char *) dstaddr, (char *) srcaddr, srclen);
+ 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;
+ 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) {
return srclen;
}
-int
-Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen)
+int Curl_os400_connect(int sd, struct sockaddr *destaddr, int addrlen)
{
int i;
struct sockaddr_storage laddr;
if(i < 0)
return -1;
- return connect(sd, (struct sockaddr *) &laddr, i);
+ return connect(sd, (struct sockaddr *)&laddr, i);
}
-int
-Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen)
+int Curl_os400_bind(int sd, struct sockaddr *localaddr, int addrlen)
{
int i;
struct sockaddr_storage laddr;
if(i < 0)
return -1;
- return bind(sd, (struct sockaddr *) &laddr, i);
+ return bind(sd, (struct sockaddr *)&laddr, i);
}
-int
-Curl_os400_sendto(int sd, char *buffer, int buflen, int flags,
- const struct sockaddr *dstaddr, int addrlen)
+int Curl_os400_sendto(int sd, char *buffer, int buflen, int flags,
+ const struct sockaddr *dstaddr, int addrlen)
{
int i;
struct sockaddr_storage laddr;
if(i < 0)
return -1;
- return sendto(sd, buffer, buflen, flags, (struct sockaddr *) &laddr, i);
+ 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 Curl_os400_recvfrom(int sd, char *buffer, int buflen, int flags,
+ struct sockaddr *fromaddr, int *addrlen)
{
int rcvlen;
struct sockaddr_storage laddr;
laddr.ss_family = AF_UNSPEC; /* To detect if unused. */
rcvlen = recvfrom(sd, buffer, buflen, flags,
- (struct sockaddr *) &laddr, &laddrlen);
+ (struct sockaddr *)&laddr, &laddrlen);
if(rcvlen < 0)
return rcvlen;
return rcvlen;
}
-int
-Curl_os400_getpeername(int sd, struct sockaddr *addr, int *addrlen)
+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);
+ int retcode = getpeername(sd, (struct sockaddr *)&laddr, &laddrlen);
if(!retcode) {
laddrlen = sockaddr2ascii(addr, *addrlen, &laddr, laddrlen);
return retcode;
}
-int
-Curl_os400_getsockname(int sd, struct sockaddr *addr, int *addrlen)
+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);
+ int retcode = getsockname(sd, (struct sockaddr *)&laddr, &laddrlen);
if(!retcode) {
laddrlen = sockaddr2ascii(addr, *addrlen, &laddr, laddrlen);
return retcode;
}
-
#ifdef HAVE_LIBZ
-const char *
-Curl_os400_zlibVersion(void)
+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)
+int Curl_os400_inflateInit_(z_streamp strm, const char *version,
+ int stream_size)
{
z_const char *msgb4 = strm->msg;
int ret;
return ret;
}
-int
-Curl_os400_inflateInit2_(z_streamp strm, int windowBits,
- const char *version, int stream_size)
+int Curl_os400_inflateInit2_(z_streamp strm, int windowBits,
+ const char *version, int stream_size)
{
z_const char *msgb4 = strm->msg;
int ret;
return ret;
}
-int
-Curl_os400_inflate(z_streamp strm, int flush)
+int Curl_os400_inflate(z_streamp strm, int flush)
{
z_const char *msgb4 = strm->msg;
int ret;
return ret;
}
-int
-Curl_os400_inflateEnd(z_streamp strm)
+int Curl_os400_inflateEnd(z_streamp strm)
{
z_const char *msgb4 = strm->msg;
int ret;
#ifndef __OS400_SYS_
#define __OS400_SYS_
-
/* Per-thread item identifiers. */
typedef enum {
- 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_URL_STRERROR,
- LK_ZLIB_VERSION,
- LK_ZLIB_MSG,
- LK_LAST
-} localkey_t;
-
-
-extern char * (* Curl_thread_buffer)(localkey_t key, long size);
-
+ 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_URL_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. */
+#define MAX_CONV_EXPANSION 4 /* Can deal with UTF-8. */
#endif
#pragma member_alignment restore
#ifdef __VAX
-#define ENABLE "ENABLE"
+#define ENABLE "ENABLE"
#define DISABLE "DISABLE"
#else
-#define ENABLE TRUE
+#define ENABLE TRUE
#define DISABLE 0
-int decc$feature_get_index (const char *name);
-int decc$feature_set_value (int index, int mode, int value);
+int decc$feature_get_index(const char *name);
+int decc$feature_set_value(int index, int mode, int value);
#endif
-int SYS$TRNLNM(
- const unsigned long *attr,
- const struct dsc$descriptor_s *table_dsc,
- struct dsc$descriptor_s *name_dsc,
- const unsigned char *acmode,
- const struct itmlst_3 *item_list);
-int SYS$CRELNM(
- const unsigned long *attr,
- const struct dsc$descriptor_s *table_dsc,
- const struct dsc$descriptor_s *name_dsc,
- const unsigned char *acmode,
- const struct itmlst_3 *item_list);
-
+int SYS$TRNLNM(const unsigned long *attr,
+ const struct dsc$descriptor_s *table_dsc,
+ struct dsc$descriptor_s *name_dsc,
+ const unsigned char *acmode,
+ const struct itmlst_3 *item_list);
+int SYS$CRELNM(const unsigned long *attr,
+ const struct dsc$descriptor_s *table_dsc,
+ const struct dsc$descriptor_s *name_dsc,
+ const unsigned char *acmode,
+ const struct itmlst_3 *item_list);
/* Take all the fun out of simply looking up a logical name */
-static int sys_trnlnm(const char *logname,
- char *value,
- int value_len)
+static int sys_trnlnm(const char *logname, char *value, int value_len)
{
const $DESCRIPTOR(table_dsc, "LNM$FILE_DEV");
const unsigned long attr = LNM$M_CASE_BLIND;
}
/* How to simply create a logical name */
-static int sys_crelnm(const char *logname,
- const char *value)
+static int sys_crelnm(const char *logname, const char *value)
{
int ret_val;
const char *proc_table = "LNM$PROCESS_TABLE";
struct dsc$descriptor_s logname_dsc;
struct itmlst_3 item_list[2];
- proc_table_dsc.dsc$a_pointer = (char *) proc_table;
+ proc_table_dsc.dsc$a_pointer = (char *)proc_table;
proc_table_dsc.dsc$w_length = strlen(proc_table);
proc_table_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
proc_table_dsc.dsc$b_class = DSC$K_CLASS_S;
- logname_dsc.dsc$a_pointer = (char *) logname;
+ logname_dsc.dsc$a_pointer = (char *)logname;
logname_dsc.dsc$w_length = strlen(logname);
logname_dsc.dsc$b_dtype = DSC$K_DTYPE_T;
logname_dsc.dsc$b_class = DSC$K_CLASS_S;
return ret_val;
}
-
/* Start of DECC RTL Feature handling */
/*
index = decc$feature_get_index(name);
if(index > 0)
- decc$feature_set_value (index, 0, value);
+ decc$feature_set_value(index, 0, value);
}
#endif
int use_unix_settings = 1;
status = sys_trnlnm("GNV$UNIX_SHELL",
- unix_shell_name, sizeof(unix_shell_name) -1);
+ unix_shell_name, sizeof(unix_shell_name) - 1);
if(!$VMS_STATUS_SUCCESS(status)) {
use_unix_settings = 0;
}
set_feature_default("DECC$FILE_OWNER_UNIX", ENABLE);
set_feature_default("DECC$POSIX_SEEK_STREAM_FILE", ENABLE);
-
}
else {
set_feature_default("DECC$FILENAME_UNIX_REPORT", ENABLE);
/* Commented here to prevent future bugs: A program or user should */
/* never ever enable DECC$POSIX_STYLE_UID. */
/* It will probably break all code that accesses UIDs */
- /* do_not_set_default ("DECC$POSIX_STYLE_UID", TRUE); */
+ /* do_not_set_default("DECC$POSIX_STYLE_UID", TRUE); */
}
-
/* Some boilerplate to force this to be a proper LIB$INITIALIZE section */
#pragma nostandard
# endif
#endif
/* Set our contribution to the LIB$INITIALIZE array */
-void (* const iniarray[])(void) = {set_features };
+void (* const iniarray[])(void) = { set_features };
#ifndef __VAX
# if __INITIAL_POINTER_SIZE
# pragma __pointer_size __restore
# endif
#endif
-
/*
** Force a reference to LIB$INITIALIZE to ensure it
** exists in the image.
#ifdef __DECC
#pragma extern_model strict_refdef
#endif
- int lib_init_ref = (int) LIB$INITIALIZE;
+int lib_init_ref = (int)LIB$INITIALIZE;
#ifdef __DECC
#pragma extern_model restore
#pragma standard
/* IF YOU UPDATE THIS FILE, UPDATE CURLMSG_VMS.H SO THAT THEY ARE IN SYNC */
/* */
-#define CURL_FACILITY 3841
-#define CURL_OK 251756553
-#define CURL_UNSUPPORTED_PROTOCOL 251756562
-#define CURL_FAILED_INIT 251756570
-#define CURL_URL_MALFORMAT 251756578
-#define CURL_OBSOLETE4 251756586
-#define CURL_COULDNT_RESOLVE_PROXY 251756594
-#define CURL_COULDNT_RESOLVE_HOST 251756602
-#define CURL_COULDNT_CONNECT 251756610
-#define CURL_WEIRD_SERVER_REPLY 251756618
+#define CURL_FACILITY 3841
+#define CURL_OK 251756553
+#define CURL_UNSUPPORTED_PROTOCOL 251756562
+#define CURL_FAILED_INIT 251756570
+#define CURL_URL_MALFORMAT 251756578
+#define CURL_OBSOLETE4 251756586
+#define CURL_COULDNT_RESOLVE_PROXY 251756594
+#define CURL_COULDNT_RESOLVE_HOST 251756602
+#define CURL_COULDNT_CONNECT 251756610
+#define CURL_WEIRD_SERVER_REPLY 251756618
#define CURL_FTP_WEIRD_SERVER_REPLY CURL_WEIRD_SERVER_REPLY
-#define CURL_FTP_ACCESS_DENIED 251756626
-#define CURL_OBSOLETE10 251756634
-#define CURL_FTP_WEIRD_PASS_REPLY 251756642
-#define CURL_OBSOLETE12 251756650
-#define CURL_FTP_WEIRD_PASV_REPLY 251756658
-#define CURL_FTP_WEIRD_227_FORMAT 251756666
-#define CURL_FTP_CANT_GET_HOST 251756674
-#define CURL_OBSOLETE16 251756682
-#define CURL_FTP_COULDNT_SET_TYPE 251756690
-#define CURL_PARTIAL_FILE 251756698
-#define CURL_FTP_COULDNT_RETR_FILE 251756706
-#define CURL_OBSOLETE20 251756714
-#define CURL_QUOTE_ERROR 251756722
-#define CURL_HTTP_RETURNED_ERROR 251756730
-#define CURL_WRITE_ERROR 251756738
-#define CURL_OBSOLETE24 251756746
-#define CURL_UPLOAD_FAILED 251756754
-#define CURL_READ_ERROR 251756762
-#define CURL_OUT_OF_MEMORY 251756770
-#define CURL_OPERATION_TIMEOUTED 251756778
-#define CURL_OBSOLETE29 251756786
-#define CURL_FTP_PORT_FAILED 251756794
-#define CURL_FTP_COULDNT_USE_REST 251756802
-#define CURL_OBSOLETE32 251756810
-#define CURL_RANGE_ERROR 251756818
-#define CURL_HTTP_POST_ERROR 251756826
-#define CURL_SSL_CONNECT_ERROR 251756834
-#define CURL_BAD_DOWNLOAD_RESUME 251756842
+#define CURL_FTP_ACCESS_DENIED 251756626
+#define CURL_OBSOLETE10 251756634
+#define CURL_FTP_WEIRD_PASS_REPLY 251756642
+#define CURL_OBSOLETE12 251756650
+#define CURL_FTP_WEIRD_PASV_REPLY 251756658
+#define CURL_FTP_WEIRD_227_FORMAT 251756666
+#define CURL_FTP_CANT_GET_HOST 251756674
+#define CURL_OBSOLETE16 251756682
+#define CURL_FTP_COULDNT_SET_TYPE 251756690
+#define CURL_PARTIAL_FILE 251756698
+#define CURL_FTP_COULDNT_RETR_FILE 251756706
+#define CURL_OBSOLETE20 251756714
+#define CURL_QUOTE_ERROR 251756722
+#define CURL_HTTP_RETURNED_ERROR 251756730
+#define CURL_WRITE_ERROR 251756738
+#define CURL_OBSOLETE24 251756746
+#define CURL_UPLOAD_FAILED 251756754
+#define CURL_READ_ERROR 251756762
+#define CURL_OUT_OF_MEMORY 251756770
+#define CURL_OPERATION_TIMEOUTED 251756778
+#define CURL_OBSOLETE29 251756786
+#define CURL_FTP_PORT_FAILED 251756794
+#define CURL_FTP_COULDNT_USE_REST 251756802
+#define CURL_OBSOLETE32 251756810
+#define CURL_RANGE_ERROR 251756818
+#define CURL_HTTP_POST_ERROR 251756826
+#define CURL_SSL_CONNECT_ERROR 251756834
+#define CURL_BAD_DOWNLOAD_RESUME 251756842
#define CURL_FILE_COULDNT_READ_FILE 251756850
-#define CURL_LDAP_CANNOT_BIND 251756858
-#define CURL_LDAP_SEARCH_FAILED 251756866
-#define CURL_OBSOLETE40 251756874
-#define CURL_FUNCTION_NOT_FOUND 251756882
-#define CURL_ABORTED_BY_CALLBACK 251756890
-#define CURL_BAD_FUNCTION_ARGUMENT 251756898
-#define CURL_OBSOLETE44 251756906
-#define CURL_INTERFACE_FAILED 251756914
-#define CURL_OBSOLETE46 251756922
-#define CURL_TOO_MANY_REDIRECTS 251756930
-#define CURL_UNKNOWN_TELNET_OPTION 251756938
-#define CURL_TELNET_OPTION_SYNTAX 251756946
-#define CURL_OBSOLETE50 251756954
-#define CURL_PEER_FAILED_VERIF 251756962
-#define CURL_GOT_NOTHING 251756970
-#define CURL_SSL_ENGINE_NOTFOUND 251756978
-#define CURL_SSL_ENGINE_SETFAILED 251756986
-#define CURL_SEND_ERROR 251756994
-#define CURL_RECV_ERROR 251757002
-#define CURL_OBSOLETE57 251757010
-#define CURL_SSL_CERTPROBLEM 251757018
-#define CURL_SSL_CIPHER 251757026
-#define CURL_SSL_CACERT 251757034
-#define CURL_BAD_CONTENT_ENCODING 251757042
-#define CURL_LDAP_INVALID_URL 251757050
-#define CURL_FILESIZE_EXCEEDED 251757058
-#define CURL_USE_SSL_FAILED 251757066
-#define CURL_SEND_FAIL_REWIND 251757074
-#define CURL_SSL_ENGINE_INITFAILED 251757082
-#define CURL_LOGIN_DENIED 251757090
-#define CURL_TFTP_NOTFOUND 251757098
-#define CURL_TFTP_PERM 251757106
-#define CURL_REMOTE_DISK_FULL 251757114
-#define CURL_TFTP_ILLEGAL 251757122
-#define CURL_TFTP_UNKNOWNID 251757130
-#define CURL_REMOTE_FILE_EXISTS 251757138
-#define CURL_TFTP_NOSUCHUSER 251757146
-#define CURL_CONV_FAILED 251757154
-#define CURL_CONV_REQD 251757162
-#define CURL_SSL_CACERT_BADFILE 251757170
-#define CURL_REMOTE_FILE_NOT_FOUND 251757178
-#define CURL_SSH 251757186
-#define CURL_SSL_SHUTDOWN_FAILED 251757194
-#define CURL_AGAIN 251757202
-#define CURL_SSL_CRL_BADFILE 251757210
-#define CURL_SSL_ISSUER_ERROR 251757218
-#define CURL_CURL_LAST 251757226
+#define CURL_LDAP_CANNOT_BIND 251756858
+#define CURL_LDAP_SEARCH_FAILED 251756866
+#define CURL_OBSOLETE40 251756874
+#define CURL_FUNCTION_NOT_FOUND 251756882
+#define CURL_ABORTED_BY_CALLBACK 251756890
+#define CURL_BAD_FUNCTION_ARGUMENT 251756898
+#define CURL_OBSOLETE44 251756906
+#define CURL_INTERFACE_FAILED 251756914
+#define CURL_OBSOLETE46 251756922
+#define CURL_TOO_MANY_REDIRECTS 251756930
+#define CURL_UNKNOWN_TELNET_OPTION 251756938
+#define CURL_TELNET_OPTION_SYNTAX 251756946
+#define CURL_OBSOLETE50 251756954
+#define CURL_PEER_FAILED_VERIF 251756962
+#define CURL_GOT_NOTHING 251756970
+#define CURL_SSL_ENGINE_NOTFOUND 251756978
+#define CURL_SSL_ENGINE_SETFAILED 251756986
+#define CURL_SEND_ERROR 251756994
+#define CURL_RECV_ERROR 251757002
+#define CURL_OBSOLETE57 251757010
+#define CURL_SSL_CERTPROBLEM 251757018
+#define CURL_SSL_CIPHER 251757026
+#define CURL_SSL_CACERT 251757034
+#define CURL_BAD_CONTENT_ENCODING 251757042
+#define CURL_LDAP_INVALID_URL 251757050
+#define CURL_FILESIZE_EXCEEDED 251757058
+#define CURL_USE_SSL_FAILED 251757066
+#define CURL_SEND_FAIL_REWIND 251757074
+#define CURL_SSL_ENGINE_INITFAILED 251757082
+#define CURL_LOGIN_DENIED 251757090
+#define CURL_TFTP_NOTFOUND 251757098
+#define CURL_TFTP_PERM 251757106
+#define CURL_REMOTE_DISK_FULL 251757114
+#define CURL_TFTP_ILLEGAL 251757122
+#define CURL_TFTP_UNKNOWNID 251757130
+#define CURL_REMOTE_FILE_EXISTS 251757138
+#define CURL_TFTP_NOSUCHUSER 251757146
+#define CURL_CONV_FAILED 251757154
+#define CURL_CONV_REQD 251757162
+#define CURL_SSL_CACERT_BADFILE 251757170
+#define CURL_REMOTE_FILE_NOT_FOUND 251757178
+#define CURL_SSH 251757186
+#define CURL_SSL_SHUTDOWN_FAILED 251757194
+#define CURL_AGAIN 251757202
+#define CURL_SSL_CRL_BADFILE 251757210
+#define CURL_SSL_ISSUER_ERROR 251757218
+#define CURL_CURL_LAST 251757226
#pragma __member_alignment __restore
#include <stsdef.h>
#include <errno.h>
-unsigned long LIB$SET_SYMBOL(
- const struct dsc$descriptor_s * symbol,
- const struct dsc$descriptor_s * value,
- const unsigned long *table_type);
+unsigned long LIB$SET_SYMBOL(const struct dsc$descriptor_s *symbol,
+ const struct dsc$descriptor_s *value,
+ const unsigned long *table_type);
int main(int argc, char **argv)
{
void *libptr;
- const char * (*ssl_version)(int t);
+ const char *(*ssl_version)(int t);
const char *version;
if(argc < 1) {
libptr = dlopen(argv[1], 0);
- ssl_version = (const char * (*)(int))dlsym(libptr, "SSLeay_version");
+ ssl_version = (const char *(*)(int))dlsym(libptr, "SSLeay_version");
if(!ssl_version) {
- ssl_version = (const char * (*)(int))dlsym(libptr, "ssleay_version");
+ ssl_version = (const char *(*)(int))dlsym(libptr, "ssleay_version");
if(!ssl_version) {
- ssl_version = (const char * (*)(int))dlsym(libptr, "SSLEAY_VERSION");
+ ssl_version = (const char *(*)(int))dlsym(libptr, "SSLEAY_VERSION");
}
}
}
}
-
use POSIX qw(strftime);
my @ts;
if(defined($ENV{SOURCE_DATE_EPOCH})) {
}
-
if($errors || $warnings || $verbose) {
printf "checksrc: %d errors and %d warnings\n", $errors, $warnings;
if($suppressed) {
);
-
sub configureopts {
my ($opts)=@_;
my %thisin;
}
}
-
print "ENABLED configure options that are not available\n";
for my $w (sort keys %with) {
if(!$avail{$w}) {
my $creates=`git diff-tree --diff-filter=D -r --summary origin/$branch $start 2>/dev/null | wc -l`;
# Time since that tag
-my $tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut "-d|" -f2`; # Unix timestamp
+my $tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut '-d|' -f2`; # Unix timestamp
my $taggednice=`git for-each-ref --format="%(refname:short) | %(creatordate)" refs/tags/* | grep ^$start | cut '-d|' -f2`; # human readable time
chomp $taggednice;
my $now=POSIX::strftime("%s", localtime());
##
EOF
-
certutil -L -h 'Builtin Object Token' -d "$db" | \
grep ' *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$' | \
sed -e 's/ *[CcGTPpu]*,[CcGTPpu]*,[CcGTPpu]* *$//' -e 's/\(.*\)/"\1"/' | \
return "--$k$trail";
}
-
my $colwidth=79; # max number of columns
sub prefixline {
# convert single backslash to double-backslash
$d =~ s/\\/\\\\/g if($manpage);
-
if($manpage) {
if(!$quote && $d =~ /--/) {
$d =~ s/--([a-z0-9.-]+)/manpageify($1, 1)/ge;
printdesc($manpage, 0, @d);
}
-
sub sourcecategories {
my ($dir) = @_;
my %cats;
return $result;
}
-
sub oldhash {
my $hash = "";
open(C, "<$_[0]") || return 0;
};
static const struct detail scheme[] = {
- {"dict", "#ifndef CURL_DISABLE_DICT" },
- {"file", "#ifndef CURL_DISABLE_FILE" },
- {"ftp", "#ifndef CURL_DISABLE_FTP" },
- {"ftps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_FTP)" },
- {"gopher", "#ifndef CURL_DISABLE_GOPHER" },
- {"gophers", "#if defined(USE_SSL) && !defined(CURL_DISABLE_GOPHER)" },
- {"http", "#ifndef CURL_DISABLE_HTTP" },
- {"https", "#if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)" },
- {"imap", "#ifndef CURL_DISABLE_IMAP" },
- {"imaps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP)" },
- {"ldap", "#ifndef CURL_DISABLE_LDAP" },
- {"ldaps", "#if !defined(CURL_DISABLE_LDAP) && \\\n"
- " !defined(CURL_DISABLE_LDAPS) && \\\n"
- " ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \\\n"
- " (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)))" },
- {"mqtt", "#ifndef CURL_DISABLE_MQTT" },
- {"pop3", "#ifndef CURL_DISABLE_POP3" },
- {"pop3s", "#if defined(USE_SSL) && !defined(CURL_DISABLE_POP3)" },
- {"rtmp", "#ifdef USE_LIBRTMP" },
- {"rtmpt", "#ifdef USE_LIBRTMP" },
- {"rtmpe", "#ifdef USE_LIBRTMP" },
- {"rtmpte", "#ifdef USE_LIBRTMP" },
- {"rtmps", "#ifdef USE_LIBRTMP" },
- {"rtmpts", "#ifdef USE_LIBRTMP" },
- {"rtsp", "#ifndef CURL_DISABLE_RTSP" },
- {"scp", "#ifdef USE_SSH" },
- {"sftp", "#ifdef USE_SSH" },
- {"smb", "#if !defined(CURL_DISABLE_SMB) && \\\n"
- " defined(USE_CURL_NTLM_CORE) && (SIZEOF_CURL_OFF_T > 4)" },
- {"smbs", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMB) && \\\n"
- " defined(USE_CURL_NTLM_CORE) && (SIZEOF_CURL_OFF_T > 4)" },
- {"smtp", "#ifndef CURL_DISABLE_SMTP" },
- {"smtps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMTP)" },
- {"telnet", "#ifndef CURL_DISABLE_TELNET" },
- {"tftp", "#ifndef CURL_DISABLE_TFTP" },
- {"ws",
- "#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)" },
- {"wss", "#if !defined(CURL_DISABLE_WEBSOCKETS) && \\\n"
- " defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)" },
+ { "dict", "#ifndef CURL_DISABLE_DICT" },
+ { "file", "#ifndef CURL_DISABLE_FILE" },
+ { "ftp", "#ifndef CURL_DISABLE_FTP" },
+ { "ftps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_FTP)" },
+ { "gopher", "#ifndef CURL_DISABLE_GOPHER" },
+ { "gophers", "#if defined(USE_SSL) && !defined(CURL_DISABLE_GOPHER)" },
+ { "http", "#ifndef CURL_DISABLE_HTTP" },
+ { "https", "#if defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)" },
+ { "imap", "#ifndef CURL_DISABLE_IMAP" },
+ { "imaps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_IMAP)" },
+ { "ldap", "#ifndef CURL_DISABLE_LDAP" },
+ { "ldaps", "#if !defined(CURL_DISABLE_LDAP) && \\\n"
+ " !defined(CURL_DISABLE_LDAPS) && \\\n"
+ " ((defined(USE_OPENLDAP) && defined(USE_SSL)) || \\\n"
+ " (!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)))" },
+ { "mqtt", "#ifndef CURL_DISABLE_MQTT" },
+ { "pop3", "#ifndef CURL_DISABLE_POP3" },
+ { "pop3s", "#if defined(USE_SSL) && !defined(CURL_DISABLE_POP3)" },
+ { "rtmp", "#ifdef USE_LIBRTMP" },
+ { "rtmpt", "#ifdef USE_LIBRTMP" },
+ { "rtmpe", "#ifdef USE_LIBRTMP" },
+ { "rtmpte", "#ifdef USE_LIBRTMP" },
+ { "rtmps", "#ifdef USE_LIBRTMP" },
+ { "rtmpts", "#ifdef USE_LIBRTMP" },
+ { "rtsp", "#ifndef CURL_DISABLE_RTSP" },
+ { "scp", "#ifdef USE_SSH" },
+ { "sftp", "#ifdef USE_SSH" },
+ { "smb", "#if !defined(CURL_DISABLE_SMB) && \\\n"
+ " defined(USE_CURL_NTLM_CORE) && (SIZEOF_CURL_OFF_T > 4)" },
+ { "smbs", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMB) && \\\n"
+ " defined(USE_CURL_NTLM_CORE) && (SIZEOF_CURL_OFF_T > 4)" },
+ { "smtp", "#ifndef CURL_DISABLE_SMTP" },
+ { "smtps", "#if defined(USE_SSL) && !defined(CURL_DISABLE_SMTP)" },
+ { "telnet", "#ifndef CURL_DISABLE_TELNET" },
+ { "tftp", "#ifndef CURL_DISABLE_TFTP" },
+ { "ws",
+ "#if !defined(CURL_DISABLE_WEBSOCKETS) && !defined(CURL_DISABLE_HTTP)" },
+ { "wss", "#if !defined(CURL_DISABLE_WEBSOCKETS) && \\\n"
+ " defined(USE_SSL) && !defined(CURL_DISABLE_HTTP)" },
{ NULL, NULL }
};
" s++;\n"
" l--;\n"
" }\n"
- "*/\n", init, shift);
+ "*/\n",
+ init, shift);
printf(" static const struct Curl_handler * const protocols[%d] = {", try);
for(j = 0; j < i; j++) {
if(num[j] == v) {
- /*
+#if 0
printf("NOPE: %u is a dupe (%s and %s)\n",
v, scheme[i], scheme[j]);
- */
+#endif
badcombo = 1;
break;
}
return err;
}
-
static bool get_line(FILE *input, struct dynbuf *buf, bool *error)
{
CURLcode result;
);
}
-
my %APPVEYOR_TEST_NAMES; # JSON and shell-quoted test names by test number
sub appveyor_check_environment {
<HTML><BODY>
<CENTER><H1>This is <a href="http://www.gnu.org/software/gnutls">GnuTLS</a></H1></CENTER>
-
<p>Session ID: <i>003030000100000001000000000000000030330001000000B062410001000000</i></p>
<h5>If your browser supports session resuming, then you should see the same session ID, when you press the <b>reload</b> button.</h5>
<p>Connected as user 'jsmith'.</p>
</command>
</client>
-
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
</command>
</client>
-
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
</command>
</client>
-
# Verify data after the test has been "shot"
<verify>
<protocol crlf="headers">
hello
</datacheck>
-
-
</reply>
# Client-side
-foo-
</data2>
-
-
</reply>
#
</keywords>
</info>
-
#
# Client-side
<client>
</keywords>
</info>
-
#
# Client-side
<client>
</data>
</reply>
-
#
# Client-side
<client>
</command>
</client>
-
# Verify data after the test has been "shot"
<verify>
# This does not send QUIT because of known bug:
-->
-
<!-- First request has NTLM auth, wrong password -->
<data100 crlf="headers">
HTTP/1.1 401 Need Digest or NTLM auth
</keywords>
</info>
-
#
# Server-side
<reply>
auth_required
</servercmd>
-
# this is returned first since we get no proxy-auth
<connect crlf="headers">
HTTP/1.1 407 Authorization Required to proxy me my dear
server CONNACK 2 20020005
</protocol>
-
# 8 is CURLE_WEIRD_SERVER_REPLY
<errorcode>
8
</command>
</client>
-
# Verify data after the test has been "shot"
<verify>
<protocol crlf="yes">
</keywords>
</info>
-
#
# Client-side
<client>
</keywords>
</info>
-
#
# Client-side
<client>
</command>
</client>
-
# Verify data after the test has been "shot"
<verify>
<protocol crlf="yes">
);
use getpart;
-
#######################################################################
# logmsg is our general message logging subroutine.
# This function is currently required to be here by servers.pm
push @protocols, 'none';
}
-
#######################################################################
# Initialize @protocols from the curl binary under test
#
}
}
-
#######################################################################
# Initialize the test harness to run tests
#
);
}
-
my %file_chmod1 = (
'name' => 'chmod1',
'content' => "This file should have permissions 444\n",
if(!$inside && ($_ =~ /^ *\<$section/)) {
$inside++;
}
- if((1 ==$inside) && ( ($_ =~ /^ *\<$part ([^>]*)/) ||
- !(defined($part)) )
+ if((1 == $inside) && (($_ =~ /^ *\<$part ([^>]*)/) ||
+ !(defined($part)))
) {
$inside++;
my $attr=$1;
last;
}
# detect end of section when part was not found
- elsif((1 ==$inside) && ($_ =~ /^ *\<\/$section\>/)) {
+ elsif((1 == $inside) && ($_ =~ /^ *\<\/$section\>/)) {
last;
}
- elsif((2 ==$inside) && ($_ =~ /^ *\<\/$part/)) {
+ elsif((2 == $inside) && ($_ =~ /^ *\<\/$part/)) {
$inside--;
}
}
return 0;
}
-
# Return entire document as list of lines
sub fulltest {
return @xml;
# Strip off all lines that match the specified pattern and return
# the new array.
#
-
sub striparray {
my ($pattern, $arrayref) = @_;
return @array;
}
-
1;
use Cwd qw(getcwd);
use File::Spec;
-
#######################################################################
# global configuration variables
#
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
#include "first.h"
#include "testtrace.h"
-
#ifndef CURL_DISABLE_FTP
struct test_cli_ftp_upload_data {
curl_off_t uploadsize = -1;
(void)URL;
- while((ch = cgetopt(test_argc, test_argv, "r:"))
- != -1) {
+ while((ch = cgetopt(test_argc, test_argv, "r:")) != -1) {
switch(ch) {
case 'r':
resolve = coptarg;
if(formrc)
curl_mprintf("curl_formadd(1) = %d\n", formrc);
-
curl = curl_easy_init();
if(!curl) {
curl_mfprintf(stderr, "curl_easy_init() failed\n");
'CURLOPT_SOCKS5_AUTH',
);
-
#
# Generate a set of string checks
#
}
}
-
print $fh <<FOOTER
/* NOLINTNEXTLINE(clang-analyzer-optin.core.EnumCastOutOfRange) */
goto unit_test_abort; \
} while(0)
+/* begin/end macros */
#define UNITTEST_BEGIN_SIMPLE \
(void)arg; \
HOST = "localhost"
IDENT = "NTEL"
-
# The strings that indicate the test framework is checking our aliveness
VERIFIED_REQ = "verifiedserver"
VERIFIED_RSP = "WE ROOLZ: {pid}"
-
def telnetserver(options):
"""Start up a TCP server with a telnet handler and serve DICT requests forever."""
if options.pidfile:
# leaving `with` calls server.close() automatically
return ScriptRC.SUCCESS
-
class NegotiatingTelnetHandler(socketserver.BaseRequestHandler):
"""Handler class for Telnet connections."""
except IOError:
log.exception("IOError hit during request")
-
class Negotiator(object):
NO_NEG = 0
START_NEG = 1
log.debug("Sending WONT %s", option_str)
self.send_iac([NegTokens.WONT, NegOptions.to_val(option_str)])
-
class NegBase(object):
@classmethod
def to_val(cls, name):
return "<unknown>"
-
class NegTokens(NegBase):
# The start of a negotiation sequence
IAC = 255
# The end of sub-negotiation options.
SE = 240
-
class NegOptions(NegBase):
# Binary Transmission
BINARY = 0
# Charset option
CHARSET = 42
-
def get_options():
parser = argparse.ArgumentParser()
return parser.parse_args()
-
def setup_logging(options):
"""Set up logging from the command line options."""
root_logger = logging.getLogger()
stdout_handler.setLevel(logging.DEBUG)
root_logger.addHandler(stdout_handler)
-
class ScriptRC(object):
"""Enum for script return codes."""
FAILURE = 1
EXCEPTION = 2
-
if __name__ == '__main__':
# Get the options from the user.
options = get_options()
);
}
-
#######################################################################
# Block for cached static variables
#
}
}
-
sub set_advisor_read_lock {
my ($filename) = @_;
printf "Error creating lock file $filename error: $!\n";
}
-
sub clear_advisor_read_lock {
my ($filename) = @_;
}
}
-
1;
use valgrind;
use memanalyzer;
-
#######################################################################
# Global variables set elsewhere but used only by this package
# These may only be set *before* runner_init is called
return @out;
}
-
#######################################################################
# Load test keywords into %keywords hash
#
}
}
-
#######################################################################
# Return a list of log locks that still exist
#
return 0;
}
-
#######################################################################
# restore environment variables that were modified in test
sub restore_test_env {
}
}
-
#######################################################################
# Start the servers needed to run this test case
sub singletest_startservers {
return ($why, $error);
}
-
#######################################################################
# Generate preprocessed test file
sub singletest_preprocess {
loadtest("$LOGDIR/test${testnum}");
}
-
#######################################################################
# Set up the test environment to run this test case
sub singletest_setenv {
}
}
-
#######################################################################
# Check that test environment is fine to run this test case
sub singletest_precheck {
return $why;
}
-
#######################################################################
# Prepare the test environment to run this test case
sub singletest_prepare {
return 0;
}
-
#######################################################################
# Run the test command
sub singletest_run {
return (0, $cmdres, $dumped_core, $CURLOUT, $tool, use_valgrind() && !$disablevalgrind);
}
-
#######################################################################
# Clean up after test command
sub singletest_clean {
return 0;
}
-
###################################################################
# Get ready to run a single test case
sub runner_test_preprocess {
return ($why, $error, clearlogs(), \%testtimings);
}
-
###################################################################
# Run a single test case with an environment that already been prepared
# Returns 0=success, -1=skippable failure, -2=permanent error,
return (undef, undef);
}
-
###################################################################
# Cleanly abort and exit the runner
# This uses print since there is no longer any controller to write logs.
undef $runnerw;
}
-
1;
$singletest_bufferedrunner = $runnerid;
}
}
+
#######################################################################
# Store a log message in a buffer for this test
# The messages can then be displayed all at once at the end of the test
chomp $nghttpx_h3;
}
-
#######################################################################
# Get the list of tests that the tests/data/Makefile.am knows about!
#
close($dh);
}
-
#######################################################################
# Remove all files in the specified directory
#
return $done;
}
-
#######################################################################
# Given two array references, this function will store them in two temporary
# files, run 'diff' on them, store the result and return the diff output!
return @out;
}
-
#######################################################################
# compare test results with the expected output, we might filter off
# some pattern that is allowed to differ, output test results
}
}
-
# Setup CI Test Run
sub citest_starttestrun {
if(azure_check_environment()) {
# Appveyor does not require anything here
}
-
# Register the test case with the CI runner
sub citest_starttest {
my $testnum = $_[0];
}
}
-
# Submit the test case result with the CI runner
sub citest_finishtest {
my ($testnum, $error) = @_;
# Appveyor does not require anything here
}
-
# add one set of test timings from the runner to global set
sub updatetesttimings {
my ($testnum, %testtimings)=@_;
}
}
-
#######################################################################
# Return the log directory for the given test runner
sub getrunnernumlogdir {
die "Internal error: runner ID $runnerid not found";
}
-
#######################################################################
# Verify that this test case should be run
sub singletest_shouldrun {
return ($why, $errorreturncode);
}
-
#######################################################################
# Print the test name and count tests
sub singletest_count {
return 0;
}
-
#######################################################################
# Report a successful test
sub singletest_success {
return ($cmdres, 0);
}
-
#######################################################################
# Report a successful test
singletest_success($testnum, $count, $total, ignoreresultcode($testnum));
#######################################################################
# Fetch all disabled tests, if there are any
#
-
sub disabledtests {
my ($file) = @_;
my @input;
$total++; # number of tests we have run
$executed++;
- if($error>0) {
- if($error==2) {
+ if($error > 0) {
+ if($error == 2) {
# ignored test failures
$failedign .= "$testnum ";
}
# display all files in $LOGDIR/ in a nice way
displaylogs($ridready, $testnum);
}
- if($error==2) {
+ if($error == 2) {
$ign++; # ignored test result counter
}
elsif(!$anyway) {
my $r = $_;
my $skip_count = $skipped{$r};
my $log_line = sprintf("TESTINFO: \"%s\" %d time%s (", $r, $skip_count,
- ($skip_count == 1) ? "" : "s");
+ ($skip_count == 1) ? "" : "s");
# now gather all test case numbers that had this reason for being
# skipped
}
}
-
#***************************************************************************
# Return server characterization factors given a server id string.
#
return($proto, $ipvnum, $idnum);
}
-
#***************************************************************************
# Return server name string formatted for presentation purposes
#
return "${proto}${idnum}${ipver}";
}
-
#***************************************************************************
# Return server name string formatted for identification purposes
#
return lc(servername_str($proto, $ipver, $idnum));
}
-
#***************************************************************************
# Return server name string formatted for filename purposes
#
return $string;
}
-
#***************************************************************************
# Return filename for server pid file.
#
return "${piddir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for server log file.
#
return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for server commands file.
#
return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for server input file.
#
return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for server output file.
#
return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for a server executable
#
return exerunner() . $SRVDIR . "servers" . exe_ext($ext) . " $name";
}
-
#***************************************************************************
# Return filename for a server executable as an argument list
#
return @cmd;
}
-
#***************************************************************************
# Return filename for main or primary sockfilter pid file.
#
return "${piddir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for main or primary sockfilter log file.
#
return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for data or secondary sockfilter pid file.
#
return "${piddir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# Return filename for data or secondary sockfilter log file.
#
return "${logdir}/". servername_canon($proto, $ipver, $idnum) ."$trailer";
}
-
#***************************************************************************
# End of library
1;
exerunner
);
-
my %serverpidfile; # all server pid filenames, identified by server id
my %serverportfile;# all server port filenames, identified by server id
my $sshdvernum; # for socks server, ssh daemon version number
our $debugprotocol; # nonzero for verbose server logs
our $stunnel; # path to stunnel command
-
#######################################################################
# Check for a command in the PATH of the test server.
#
}
}
-
#######################################################################
# Check if a given child process has just died. Reaps it if so.
#
return ($rc == $pid)?1:0;
}
-
##############################################################################
# This function makes sure the right set of server is running for the
# specified test case. This is a useful design when we run single tests as not
return &startservers(@what);
}
-
#######################################################################
# Start a new thread/process and run the given command line in there.
# Return the pids (yes plural) of the new child process to the parent.
return ($child, $pid2);
}
-
#######################################################################
# Return the port to use for the given protocol.
#
return $PORT{$proto} || "[not running]";
}
-
#######################################################################
# Stop a test server along with pids which are not in the %run hash yet.
# This also stops all servers which are relative to the given one.
return $result;
}
-
#######################################################################
# Return flags to let curl use an external HTTP proxy
#
return 0;
}
-
#######################################################################
# start the http server
#
return (0, $httppid, $pid2, $port);
}
-
#######################################################################
# start the http2 server
#
return (0, $rtsppid, $pid2, $port);
}
-
#######################################################################
# Start the ssh (scp/sftp) server
#
return (0+!$ntelpid, $ntelpid, $pid2, $port);
}
-
#######################################################################
# Single shot http and gopher server responsiveness test. This should only
# be used to verify that a server present in %run hash is still functional
return $result;
}
-
#######################################################################
# substitute the variable stuff into either a joined up file or
# a command, in either case passed by reference
VERIFIED_REQ = "verifiedserver"
VERIFIED_RSP = "WE ROOLZ: {pid}\n"
-
class ShutdownHandler(threading.Thread):
"""
Cleanly shut down the SMB server.
our $cliprvkeyf = 'curl_client_key'; # client private key file
our $clipubkeyf = 'curl_client_key.pub'; # client public key file
-
#***************************************************************************
# Absolute paths where to look for sftp-server plugin, when not in PATH
#
/opt/ssh/libexec
);
-
#***************************************************************************
# Absolute paths where to look for httptlssrv (gnutls-serv), when not in PATH
#
/opt/gnutls/libexec
);
-
#***************************************************************************
# Create or overwrite the given file with lines from an array of strings
#
return $error;
}
-
#***************************************************************************
# Display contents of the given file
#
print "=== End of file $filename\n";
}
-
#***************************************************************************
# Display first line of the given file
#
print "=== End of file $filename\n";
}
-
#***************************************************************************
# Display contents of the ssh daemon config file
#
display_file($sshdconfig);
}
-
#***************************************************************************
# Display contents of the ssh client config file
#
display_file($sshconfig);
}
-
#***************************************************************************
# Display contents of the sftp client config file
#
display_file($sftpconfig);
}
-
#***************************************************************************
# Display contents of the ssh daemon log file
#
display_file($sshdlog);
}
-
#***************************************************************************
# Display contents of the ssh client log file
#
display_file($sshlog);
}
-
#***************************************************************************
# Display contents of the sftp client log file
#
display_file($sftplog);
}
-
#***************************************************************************
# Find a file somewhere in the given path
#
return "";
}
-
#***************************************************************************
# Find an executable file somewhere in the given path
#
return "";
}
-
#***************************************************************************
# Find a file in environment path or in our sftppath
#
return find_file($filename, @spath);
}
-
#***************************************************************************
# Find an executable file in environment path or in our httptlssrvpath
#
return find_exe_file($filename, @hpath);
}
-
#***************************************************************************
# Find ssh daemon and return canonical filename
#
return find_file_spath($sshdexe);
}
-
#***************************************************************************
# Find ssh client and return canonical filename
#
return find_file_spath($sshexe);
}
-
#***************************************************************************
# Find sftp-server plugin and return canonical filename
#
return find_file_spath($sftpsrvexe);
}
-
#***************************************************************************
# Find sftp client and return canonical filename
#
return find_file_spath($sftpexe);
}
-
#***************************************************************************
# Find ssh-keygen and return canonical filename
#
return find_file_spath($sshkeygenexe);
}
-
#***************************************************************************
# Find httptlssrv (gnutls-serv) and return canonical filename
#
return "";
}
-
#***************************************************************************
# Return version info for the given ssh client or server binaries
#
return ($sshid, $versnum, $versstr, $error);
}
-
#***************************************************************************
# End of library
1;
#
my $loglevel = $debugprotocol?'DEBUG3':'DEBUG2';
-
#***************************************************************************
# Validate username
#
exit 1;
}
-
#***************************************************************************
# Find out ssh daemon canonical filename
#
exit 1;
}
-
#***************************************************************************
# Find out ssh daemon version info
#
}
logmsg "ssh server found $sshd is $sshdverstr\n" if($verbose);
-
#***************************************************************************
# ssh daemon command line options we might use and version support
#
# -t: test config file : SunSSH 1.0.0 and later
# -?: sshd version info : SunSSH 1.0.0 and later
-
#***************************************************************************
# Verify minimum ssh daemon version
#
exit 1;
}
-
#***************************************************************************
# Find out sftp server plugin canonical filename
#
}
logmsg "sftp server plugin found $sftpsrv\n" if($verbose);
-
#***************************************************************************
# Find out sftp client canonical filename
#
}
logmsg "sftp client found $sftp\n" if($verbose);
-
#***************************************************************************
# Find out ssh keygen canonical filename
#
}
logmsg "ssh keygen found $sshkeygen\n" if($verbose);
-
#***************************************************************************
# Find out ssh client canonical filename
#
exit 1;
}
-
#***************************************************************************
# Find out ssh client version info
#
}
logmsg "ssh client found $ssh is $sshverstr\n" if($verbose);
-
#***************************************************************************
# ssh client command line options we might use and version support
#
# -vv: increase verbosity : SunSSH 1.0.0 and later
# -V: ssh version info : SunSSH 1.0.0 and later
-
#***************************************************************************
# Verify minimum ssh client version
#
exit 1;
}
-
#***************************************************************************
# ssh keygen command line options we actually use and version support
#
}
}
-
#***************************************************************************
# Convert paths for curl's tests running on Windows with Cygwin/MSYS OpenSSH
#
# [2] Option specific for portable versions
# [3] Option not used in our ssh server config file
-
#***************************************************************************
# Initialize sshd config with options actually supported in OpenSSH 2.9.9
#
push @cfgarr, 'X11Forwarding no';
push @cfgarr, '#';
-
#***************************************************************************
# Write out initial sshd configuration file for curl's tests
#
exit 1;
}
-
#***************************************************************************
# Verifies at run time if sshd supports a given configuration file option
#
return 0;
}
-
#***************************************************************************
# Kerberos Authentication support may have not been built into sshd
#
push @cfgarr, 'KerberosTicketCleanup yes';
}
-
#***************************************************************************
# Andrew File System support may have not been built into sshd
#
push @cfgarr, 'AFSTokenPassing no';
}
-
#***************************************************************************
# S/Key authentication support may have not been built into sshd
#
push @cfgarr, 'SkeyAuthentication no';
}
-
#***************************************************************************
# GSSAPI Authentication support may have not been built into sshd
#
}
push @cfgarr, '#';
-
#***************************************************************************
# Options that might be supported or not in sshd OpenSSH 2.9.9 and later
#
}
push @cfgarr, '#';
-
#***************************************************************************
# Write out resulting sshd configuration file for curl's tests
#
exit 1;
}
-
#***************************************************************************
# Verify that sshd actually supports our generated configuration file
#
exit 1;
}
-
#***************************************************************************
# Generate ssh client host key database file for curl's tests
#
}
}
-
#***************************************************************************
# Convert paths for curl's tests running on Windows using Cygwin OpenSSH
#
$knownhosts_config = abs_path(pp($knownhosts));
}
-
#***************************************************************************
# ssh client configuration file options we might use and version support
#
# [2] Option specific for portable versions
# [3] Option not used in our ssh client config file
-
#***************************************************************************
# Initialize ssh config with options actually supported in OpenSSH 2.9.9
#
push @cfgarr, 'UsePrivilegedPort no';
push @cfgarr, '#';
-
#***************************************************************************
# Options supported in ssh client newer than OpenSSH 2.9.9
#
push @cfgarr, '#';
-
#***************************************************************************
# Write out resulting ssh client configuration file for curl's tests
#
exit 1;
}
-
#***************************************************************************
# Initialize client sftp config with options actually supported.
#
}
}
-
#***************************************************************************
# Write out resulting sftp client configuration file for curl's tests
#
}
@cfgarr = ();
-
#***************************************************************************
# Generate client sftp commands batch file for sftp server verification
#
logmsg sprintf("\"$sshd\" exited with %d\n", $rc >> 8);
}
-
#***************************************************************************
# Clean up once the server has stopped
#
}
}
-
scanallheaders();
scanman_md_dir("$root/docs/libcurl");
scanman_md_dir("$root/docs/libcurl/opts");
'--wdebug' => 6,
);
-
#########################################################################
# parse the curl code that parses the command line arguments!
open($r, "<", "$root/src/tool_getparam.c") ||
}
close($r);
-
#########################################################################
# parse the curl code that outputs the curl -h list
open($r, "<", "$root/src/tool_listhelp.c") ||
exit;
}
-
shift @ARGV;
my @f = @ARGV;
-
my %manp;
-
my $errors = 0;
sub manpresent {
scan_sources();
scan_docs();
-
my $error = 0;
# Check the configure symbols for use in code
for my $s (sort keys %disable) {
close H;
}
-
opendir(my $dh, $incdir) || die "Cannot opendir $incdir: $!";
my @hfiles = grep { /\.h$/ } readdir($dh);
closedir $dh;
close($f);
}
-
my %ref = (
'curl.1' => 1
);
$errors++;
}
-
if($optpage && $SH && ($SH !~ /^(SYNOPSIS|EXAMPLE|NAME|SEE ALSO)/i) &&
($_ =~ /(.*)(CURL(OPT_|MOPT_|INFO_|SHOPT_)[A-Z0-9_]*)/)) {
# an option with its own man page, check that it is tagged
my %funcman; # Function man pages deprecations.
my %optman; # Option man pages deprecations.
-
# Scan header file for public function and enum values. Flag them with
# the version they are deprecated in, if some.
sub scan_header {
}
}
-
# Read symbols-in-versions.
open(my $fh, "<", "$root/docs/libcurl/symbols-in-versions") ||
- die "$root/docs/libcurl/symbols-in-versions";
+ die "$root/docs/libcurl/symbols-in-versions";
while(<$fh>) {
if($_ =~ /^((?:CURL|LIBCURL)\S+)\s+\S+\s*(\S*)\s*(\S*)$/) {
if($3 eq "") {
close($fh);
}
-
for my $f (@m) {
checkfile($f);
}
close(H);
}
-
opendir(my $dh, $curlh) || die "Cannot opendir $curlh: $!";
my @hfiles = grep { /\.h$/ } readdir($dh);
closedir $dh;
}
}
-
if($fixed < 4) {
$fixed=4;
open(my $f, ">", "$setupfile") or die;
my $logfunc; # optional reference to function for logging
my @logmessages; # array holding logged messages
-
#######################################################################
# Log an informational message
# If a log callback function was set in setlogfunc, it is called. If not,
return $loglines;
}
-
#######################################################################
sub includefile {
};
static const struct testcase tests[] = {
- {".hello.com", "*.hello.com", FALSE },
- {"a.hello.com", "*.hello.com", TRUE },
+ { ".hello.com", "*.hello.com", FALSE },
+ { "a.hello.com", "*.hello.com", TRUE },
{ "", "", FALSE },
{ "a", "", FALSE },
{ "", "b", FALSE },
log = logging.getLogger(__name__)
-
REPLY_DATA = re.compile("<reply>[ \t\n\r]*<data[^<]*>(.*?)</data>", re.MULTILINE | re.DOTALL)
-
class ClosingFileHandler(logging.StreamHandler):
def __init__(self, filename):
super(ClosingFileHandler, self).__init__()
# Left-strip the data so we do not get a newline before our data.
return m.group(1).lstrip()
-
if __name__ == '__main__':
td = TestData("./data")
data = td.get_test_data(1451)
);
}
-
use File::Basename;
sub valgrindparse {