curl-curl/docs/examples
Viktor Szakats 0b09ad8ecb
examples/multi-uv: simplify passing uv struct
Reported-by: st751228051 on github
Follow-up to c722346518 #19538 #19462
Closes #19707
2025-11-26 13:19:36 +01:00
..
.checksrc checksrc: disallow atoi and atol globally 2025-11-13 14:28:25 +01:00
.gitignore examples: add an example for logging failed transfers 2025-10-09 14:40:09 -04:00
10-at-a-time.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
adddocsref.pl scripts: enable strict warnings in Perl where missing, fix fallouts 2025-07-27 22:35:18 +02:00
address-scope.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
altsvc.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
anyauthput.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
block_ip.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
cacertinmem.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
certinfo.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
chkspeed.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
CMakeLists.txt build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
connect-to.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
cookie_interface.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
crawler.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
debug.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
default-scheme.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ephiperfifo.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
evhiperfifo.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
externalsocket.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
fileupload.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftp-delete.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ftp-wildcard.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftpget.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftpgetinfo.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftpgetresp.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftpsget.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftpupload.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
ftpuploadfrommem.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ftpuploadresume.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
getinfo.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
getinmemory.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
getredirect.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
getreferrer.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ghiper.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
headerapi.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
hiperfifo.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
hsts-preload.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
htmltidy.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
htmltitle.cpp examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http2-download.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http2-pushinmemory.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http2-serverpush.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http2-upload.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http3-present.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http3.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http-options.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
http-post.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
httpcustomheader.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
httpput-postfields.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
httpput.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
https.c examples: fix minor typo 2025-11-25 08:58:03 +01:00
imap-append.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-authzid.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-copy.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-create.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-delete.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-examine.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-fetch.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-list.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-lsub.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-multi.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-noop.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-search.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-ssl.c examples: fix minor typo 2025-11-25 08:58:03 +01:00
imap-store.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
imap-tls.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
interface.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
ipv6.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
keepalive.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
localport.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
log_failed_transfers.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
Makefile.am cmake: support building some complicated examples, build them in CI 2025-10-07 19:09:02 +02:00
Makefile.example Makefile.example: make default options more likely to work 2025-10-20 13:52:58 +02:00
Makefile.inc examples: add an example for logging failed transfers 2025-10-09 14:40:09 -04:00
maxconnects.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-app.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-debugcallback.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-double.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-event.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-formadd.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-legacy.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-post.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-single.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
multi-uv.c examples/multi-uv: simplify passing uv struct 2025-11-26 13:19:36 +01:00
multithread.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
netrc.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
parseurl.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
persistent.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
pop3-authzid.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-dele.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-list.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-multi.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-noop.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-retr.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-ssl.c examples: fix minor typo 2025-11-25 08:58:03 +01:00
pop3-stat.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-tls.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-top.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
pop3-uidl.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
post-callback.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
postinmemory.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
postit2-formadd.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
postit2.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
progressfunc.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
protofeats.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
range.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
README.md GHA: silence proselint warnings and an error 2024-10-15 16:44:17 +02:00
resolve.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
rtsp-options.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
sendrecv.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
sepheaders.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
sessioninfo.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
sftpget.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
sftpuploadresume.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
shared-connection-cache.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
simple.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
simplepost.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
simplessl.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
smooth-gtk-thread.c examples: make functions/data static where missing 2025-11-18 01:05:14 +01:00
smtp-authzid.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
smtp-expn.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
smtp-mail.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
smtp-mime.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
smtp-multi.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
smtp-ssl.c examples: fix minor typo 2025-11-25 08:58:03 +01:00
smtp-tls.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
smtp-vrfy.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00
sslbackend.c docs: use CURLSSLBACKEND_NONE 2023-09-21 14:15:03 +02:00
synctime.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
threaded-ssl.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
unixsocket.c examples: improve global init, error checks and returning errors 2025-10-13 23:02:05 +02:00
url2file.c build: tidy-up MSVC CRT warning suppression macros 2025-11-18 00:49:26 +01:00
urlapi.c badwords: check indented lines in source code, fix fallouts 2025-11-15 13:25:02 +01:00
usercertinmem.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
version-check.pl scripts: enable strict warnings in Perl where missing, fix fallouts 2025-07-27 22:35:18 +02:00
websocket-cb.c examples: consistent variable naming across examples 2025-10-31 16:44:57 +01:00
websocket-updown.c tidy-up: result code variable names in tests and examples 2025-11-14 01:47:12 +01:00
websocket.c examples/websocket: fix use of uninitialized rlen 2025-10-17 10:15:07 +02:00
xmlstream.c examples: tidy-up headers and includes 2025-11-18 02:05:07 +01:00

libcurl examples

This directory is for libcurl programming examples. They are meant to show some simple steps on how you can build your own application to take full advantage of libcurl.

If you end up with other small but still useful example sources, please mail them for submission in future packages and on the website.

Building

The Makefile.example is an example Makefile that could be used to build these examples. Just edit the file according to your system and requirements first.

Most examples should build fine using a command line like this:

`curl-config --cc --cflags --libs` -o example-my example.c

Some compilers do not like having the arguments in this order but instead want you do reorganize them like:

`curl-config --cc` -o example-my example.c `curl-config --cflags --libs`

Please do not use the curl.se site as a test target for your libcurl applications/experiments. Even if some of the examples use that site as a URL at some places, it does not mean that the URLs work or that we expect you to actually torture our website with your tests. Thanks.

Examples

Each example source code file is designed to be and work stand-alone and rather self-explanatory. The examples may at times lack the level of error checks you need in a real world, but that is then only for the sake of readability: to make the code smaller and easier to follow.