curl/docs/examples
Viktor Szakats 784a8ec2c1
tidy-up: delete, comment or scope C macros reported unused
To reduce the number `-Wunused-macro` compiler warnings:
- delete unused macros.
- comment out unused macro that are part of a set.
- move macros into the scope they are used.

This may be useful to enable by default, but there are tricky cases that
I didn't manage to fix and paused the effort. E.g. internal features
checks in `openssl.c`. There is more, once those are fixed.

Closes #16279
2025-02-14 10:37:14 +01:00
..
.checksrc docs/examples/checksrc: don't allow snprintf specifically 2025-01-06 13:49:21 +01:00
.gitignore gitignore: restore explicit lists and fix them 2025-01-28 14:44:35 +01:00
10-at-a-time.c
adddocsref.pl
address-scope.c Makefile.mk: drop in favour of autotools and cmake (MS-DOS, AmigaOS3) 2024-12-16 23:20:55 +01:00
altsvc.c
anyauthput.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
block_ip.c examples/block-ip: drop redundant memory.h include 2024-12-31 00:35:57 +01:00
cacertinmem.c build: fix compiling with GCC 4.x versions 2025-01-22 11:26:15 +01:00
certinfo.c
chkspeed.c
CMakeLists.txt msvc: tidy up _CRT_*_NO_DEPRECATE definitions 2025-01-12 00:34:21 +01:00
connect-to.c
cookie_interface.c
crawler.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
debug.c
default-scheme.c
ephiperfifo.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
evhiperfifo.c examples: use return according to code style 2025-01-13 09:10:58 +01:00
externalsocket.c tidy-up: delete, comment or scope C macros reported unused 2025-02-14 10:37:14 +01:00
fileupload.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
ftp-wildcard.c
ftpget.c
ftpgetinfo.c
ftpgetresp.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
ftpsget.c
ftpupload.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
ftpuploadfrommem.c
ftpuploadresume.c
getinfo.c
getinmemory.c
getredirect.c
getreferrer.c
ghiper.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
headerapi.c
hiperfifo.c examples: use return according to code style 2025-01-13 09:10:58 +01:00
href_extractor.c
hsts-preload.c
htmltidy.c
htmltitle.cpp examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
http2-download.c
http2-pushinmemory.c
http2-serverpush.c
http2-upload.c examples: make them compile with compatibility functions disabled (Windows) 2024-12-20 17:56:40 +01:00
http3-present.c
http3.c
http-options.c
http-post.c
httpcustomheader.c
httpput-postfields.c tidy-up: misc 2024-12-24 01:27:26 +01:00
httpput.c clang-tidy: add to CI, add cmake support, fix fallouts 2024-12-27 13:42:32 +01:00
https.c
imap-append.c
imap-authzid.c
imap-copy.c
imap-create.c
imap-delete.c
imap-examine.c
imap-fetch.c
imap-list.c
imap-lsub.c
imap-multi.c
imap-noop.c
imap-search.c
imap-ssl.c
imap-store.c
imap-tls.c
interface.c
ipv6.c
keepalive.c
localport.c
Makefile.am tidy-up: delete, comment or scope C macros reported unused 2025-02-14 10:37:14 +01:00
Makefile.example
Makefile.inc tidy-up: .gitignore lines mostly 2025-01-27 20:59:46 +01:00
maxconnects.c
multi-app.c docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
multi-debugcallback.c
multi-double.c
multi-event.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
multi-formadd.c
multi-legacy.c docs: use lowercase curl and libcurl 2025-01-02 17:15:54 +01:00
multi-post.c
multi-single.c
multi-uv.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
multithread.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
netrc.c
parseurl.c
persistent.c
pop3-authzid.c
pop3-dele.c
pop3-list.c
pop3-multi.c
pop3-noop.c
pop3-retr.c
pop3-ssl.c
pop3-stat.c
pop3-tls.c
pop3-top.c
pop3-uidl.c
post-callback.c
postinmemory.c
postit2-formadd.c
postit2.c
progressfunc.c
protofeats.c
range.c
README.md
resolve.c
rtsp-options.c
sendrecv.c build: fix compiling with GCC 4.x versions 2025-01-22 11:26:15 +01:00
sepheaders.c
sessioninfo.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
sftpget.c
sftpuploadresume.c
shared-connection-cache.c
simple.c
simplepost.c
simplessl.c docs: use valid example domain names 2025-02-09 00:17:05 +01:00
smooth-gtk-thread.c
smtp-authzid.c
smtp-expn.c
smtp-mail.c
smtp-mime.c
smtp-multi.c
smtp-ssl.c
smtp-tls.c
smtp-vrfy.c
sslbackend.c
synctime.c tidy-up: drop parenthesis around return expression 2025-01-14 12:11:42 +01:00
threaded-ssl.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +01:00
unixsocket.c
url2file.c
urlapi.c
usercertinmem.c build: fix compiling with GCC 4.x versions 2025-01-22 11:26:15 +01:00
version-check.pl
websocket-cb.c
websocket.c build: fix MSVC UWP builds 2024-11-28 14:24:03 +01:00
xmlstream.c examples/complicated: fix warnings, bump deprecated callback, tidy up 2024-12-20 17:56:35 +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.