To have a more similar layout across examples.
Closes #19580
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
#if !defined(_WIN32) && !defined(MSDOS) && !defined(__AMIGA__)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
#include <openssl/err.h>
#include <openssl/ssl.h>
-#include <curl/curl.h>
+
#include <stdio.h>
+#include <curl/curl.h>
+
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic ignored "-Woverlength-strings"
#endif
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
*
* SPDX-License-Identifier: curl
*
- * To compile:
- * gcc crawler.c $(pkg-config --cflags --libs libxml-2.0 libcurl)
- *
- */
+ ***************************************************************************/
/* <DESC>
* Web crawler based on curl and libxml2 to stress-test curl with
* hundreds of concurrent connections to various servers.
* </DESC>
*/
-
+/*
+ * To compile:
+ * gcc crawler.c $(pkg-config --cflags --libs libxml-2.0 libcurl)
+ */
#include <libxml/HTMLparser.h>
#include <libxml/xpath.h>
#include <libxml/uri.h>
-#include <curl/curl.h>
+
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <signal.h>
+#include <curl/curl.h>
+
/* Parameters */
static int max_con = 200;
static int max_total = 20000;
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
struct data {
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
*/
+#include <errno.h>
+#include <fcntl.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
+#include <sys/poll.h>
+#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
-#include <sys/poll.h>
-#include <curl/curl.h>
+
#include <ev.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
+
+#include <curl/curl.h>
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
+
#include <curl/curl.h>
#ifdef _WIN32
* SPDX-License-Identifier: curl
*
***************************************************************************/
-#include <stdio.h>
-
-#include <curl/curl.h>
-
/* <DESC>
* Delete a single file from an FTP server.
* </DESC>
*/
+#include <stdio.h>
+
+#include <curl/curl.h>
static size_t write_cb(void *buffer, size_t size, size_t nmemb, void *stream)
{
*/
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
static const char data[]=
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* chunk of memory instead of storing it in a file.
* </DESC>
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
callback.
*/
-
#include <glib.h>
-#include <sys/stat.h>
+
#include <unistd.h>
#include <fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
+#include <sys/stat.h>
+
#include <curl/curl.h>
#define MSG_OUT g_print /* Change to "g_error" to write to stderr */
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
static size_t write_cb(char *data, size_t n, size_t l, void *userp)
callback.
*/
-
+#include <errno.h>
+#include <fcntl.h>
#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
+#include <string.h>
+#include <sys/cdefs.h>
+#include <sys/poll.h>
+#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
-#include <sys/poll.h>
+
#include <curl/curl.h>
+
#include <event2/event.h>
#include <event2/event_struct.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <sys/cdefs.h>
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */
/*
* LibTidy => https://www.html-tidy.org/
*/
-
#include <stdio.h>
+
#include <tidy/tidy.h>
#include <tidy/tidybuffio.h>
+
#include <curl/curl.h>
/* curl write callback, to fill tidy's input buffer... */
#include <string.h>
#include <stdlib.h>
#include <string>
+
#include <curl/curl.h>
+
#include <libxml/HTMLparser.h>
//
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
#include <string.h>
#include <errno.h>
-/* curl stuff */
#include <curl/curl.h>
#ifndef CURLPIPE_MULTIPLEX
#include <stdlib.h>
#include <string.h>
-/* curl stuff */
#include <curl/curl.h>
struct Memory {
#include <stdlib.h>
#include <string.h>
-/* curl stuff */
#include <curl/curl.h>
#ifndef CURLPIPE_MULTIPLEX
#include <unistd.h>
#endif
-/* curl stuff */
#include <curl/curl.h>
#ifndef CURLPIPE_MULTIPLEX
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
*/
#include <stdio.h>
#include <fcntl.h>
+
#include <curl/curl.h>
static const char olivertwist[]=
#include <stdio.h>
#include <fcntl.h>
#include <sys/stat.h>
+
#include <curl/curl.h>
#ifdef _WIN32
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Send email with IMAP
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to send mail using libcurl's IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Retrieve emails from a shared IMAP mailbox
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to fetch mail using libcurl's IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Copy an email from one IMAP folder to another
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to copy a mail from one mailbox folder
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Create a new IMAP folder
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to create a new mailbox folder using
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Delete an IMAP folder
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to delete an existing mailbox folder
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Obtain information about an IMAP folder
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to obtain information about a mailbox
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Retrieve IMAP emails
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to fetch mail using libcurl's IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* List the folders within an IMAP mailbox
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to list the folders within an IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* List the subscribed IMAP folders
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to list the subscribed folders within
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Get IMAP email with the multi interface
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to fetch mail using libcurl's IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Perform an IMAP noop
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to perform a noop using libcurl's IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Search for new IMAP emails
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to search for new messages using
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* IMAP with implicit SSL
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to fetch mail using libcurl's IMAP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Modify the properties of an email over IMAP
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to modify an existing mail using
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* IMAP using TLS
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to fetch mail using libcurl's IMAP
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* transfers in parallel.
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
-/* curl stuff */
#include <curl/curl.h>
/*
* multi interface and debug callback
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
-/* curl stuff */
#include <curl/curl.h>
#define TRUE 1
#include <stdio.h>
#include <string.h>
-/* curl stuff */
#include <curl/curl.h>
/*
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* multi_socket API using libevent
* </DESC>
*/
-
#include <stdio.h>
#include <stdlib.h>
+
#include <event2/event.h>
+
#include <curl/curl.h>
static struct event_base *base;
* using the multi interface to do a multipart formpost without blocking
* </DESC>
*/
-
/*
- * Warning: this example uses the deprecated form api. See "multi-post.c"
- * for a similar example using the mime api.
+ * Warning: this example uses the deprecated form API. See "multi-post.c"
+ * for a similar example using the mime API.
*/
-
#include <stdio.h>
#include <string.h>
* transfers in parallel without curl_multi_wait/poll.
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#endif
-/* curl stuff */
#include <curl/curl.h>
/*
* using the multi interface to do a multipart formpost without blocking
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
#include <stdio.h>
#include <string.h>
-/* curl stuff */
#include <curl/curl.h>
/*
* multi_socket API using libuv
* </DESC>
*/
-
/* Use the socket_action interface to download multiple files in parallel,
powered by libuv.
#include <stdio.h>
#include <stdlib.h>
+
#include <uv.h>
+
#include <curl/curl.h>
/* object to pass to the callbacks */
/* Requires: HAVE_PTHREAD_H */
#include <stdio.h>
+
#include <pthread.h>
+
#include <curl/curl.h>
#define NUMT 4
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
#if !CURL_AT_LEAST_VERSION(7, 62, 0)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Retrieve emails from a shared POP3 mailbox
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to retrieve mail using libcurl's POP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Delete POP3 emails
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to delete an existing mail using
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* List the contents of a POP3 mailbox
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example using libcurl's POP3 capabilities to list the
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Get POP3 email using the multi interface
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to retrieve mail using libcurl's POP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Perform a POP3 noop
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to perform a noop using libcurl's POP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Retrieve POP3 email
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to retrieve mail using libcurl's POP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Get POP3 email using implicit SSL
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to retrieve mail using libcurl's POP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Obtain POP3 message statistics
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to obtain message statistics using
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* POP3 using TLS
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to retrieve mail using libcurl's POP3
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* POP3 example showing how to retrieve only the headers of an email
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to retrieve only the headers of a mail
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* List the contents of a POP3 mailbox by unique ID
* </DESC>
*/
-
#include <stdio.h>
+
#include <curl/curl.h>
/* This is a simple example using libcurl's POP3 capabilities to list the
*/
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* silly test data to POST */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+
#include <curl/curl.h>
struct MemoryStruct {
* HTTP Multipart formpost with file upload and two additional parts.
* </DESC>
*/
-
/*
* Example code that uploads a filename 'foo' to a remote script that accepts
* "HTML form based" (as described in RFC 1738) uploads using HTTP POST.
* <input type="submit" value="send" name="submit">
* </form>
*/
-
#include <stdio.h>
#include <string.h>
* </form>
*
*/
-
#include <stdio.h>
#include <string.h>
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
#define MINIMAL_PROGRESS_FUNCTIONALITY_INTERVAL 3000000
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
#if !CURL_AT_LEAST_VERSION(7,87,0)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
* Demonstrate curl_easy_send() and curl_easy_recv() usage.
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* Avoid warning in FD_SET() with pre-2020 Cygwin/MSYS releases:
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
static void my_lock(CURL *curl, curl_lock_data data,
* </DESC>
*/
#include <stdio.h>
+
#include <curl/curl.h>
int main(void)
*/
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
int main(void)
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Send email on behalf of another user with SMTP
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/*
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Expand an SMTP email mailing list
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to expand an email mailing list.
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Send email with SMTP
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/*
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Send SMTP mime emails
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to send mime mail using libcurl's SMTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Send SMTP email with the multi interface
* </DESC>
*/
-
#include <string.h>
+
#include <curl/curl.h>
/* This is an example showing how to send mail using libcurl's SMTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Send SMTP email using implicit SSL
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to send mail using libcurl's SMTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Send SMTP email using implicit TLS
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to send mail using libcurl's SMTP
* SPDX-License-Identifier: curl
*
***************************************************************************/
-
/* <DESC>
* Verify an SMTP email address
* </DESC>
*/
-
#include <stdio.h>
#include <string.h>
+
#include <curl/curl.h>
/* This is a simple example showing how to verify an email address from an
* gcc -Wall -I/usr/local/include xmlstream.c -lcurl -lexpat -o xmlstream
*
*/
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <expat.h>
+
#include <curl/curl.h>
struct MemoryStruct {