summaryrefslogtreecommitdiff
path: root/docs/examples/fopen.c
Commit message (Collapse)AuthorAgeFilesLines
* all: Refactor malloc+memset to use callocDaniel Gustafsson2018-04-151-3/+1
| | | | | | | | | | When a zeroed out allocation is required, use calloc() rather than malloc() followed by an explicit memset(). The result will be the same, but using calloc() everywhere increases consistency in the codebase and avoids the risk of subtle bugs when code is injected between malloc and memset by accident. Closes https://github.com/curl/curl/pull/2497
* code style: use space after semicolonDaniel Stenberg2017-09-121-1/+1
|
* code style: use spaces around plusesDaniel Stenberg2017-09-111-2/+2
|
* code style: use spaces around equals signsDaniel Stenberg2017-09-111-39/+40
|
* examples: declare TU-local variables staticMarcel Raad2017-04-301-1/+1
| | | | | This fixes missing-variable-declarations warnings when building with clang.
* examples/fopen: checksrc complianceJay Satiro2017-03-281-2/+2
|
* spelling fixesklemens2017-03-261-5/+5
| | | | Closes #1356
* checksrc: code style: use 'char *name' styleDaniel Stenberg2016-11-241-1/+1
|
* examples: adhere to curl code styleDaniel Stenberg2016-02-111-25/+26
| | | | | | | | | | All plain C examples now (mostly) adhere to the curl code style. While they are only examples, they had diverted so much and contained all sorts of different mixed code styles by now. Having them use a unified style helps users and readability. Also, as they get copy-and-pasted widely by users, making sure they're clean and nice is a good idea. 573 checksrc warnings were addressed.
* examples: more descriptionsDaniel Stenberg2015-06-181-0/+4
|
* fopen.c: fix a few compiler warningsDaniel Stenberg2015-06-081-4/+4
|
* docs: Spelling fixesVille Skyttä2015-06-081-3/+3
|
* Bug #149: Deletion of unnecessary checks before calls of the function "free"Markus Elfring2015-03-161-9/+3
| | | | | | | | | | | The function "free" is documented in the way that no action shall occur for a passed null pointer. It is therefore not needed that a function caller repeats a corresponding check. http://stackoverflow.com/questions/18775608/free-a-null-pointer-anyway-or-check-first This issue was fixed by using the software Coccinelle 1.0.0-rc24. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
* examples: Wait recommended 100ms when no file descriptors are readyJay Satiro2014-11-191-8/+12
| | | | | | | | | Prior to this change when no file descriptors were ready on platforms other than Windows the multi examples would sleep whatever was in timeout, which may or may not have been less than the minimum recommended value [1] of 100ms. [1]: http://curl.haxx.se/libcurl/c/curl_multi_fdset.html
* examples: Don't call select() to sleep on windowsJay Satiro2014-11-151-7/+24
| | | | | | | | | | | | Windows does not support using select() for sleeping without a dummy socket. Instead use Windows' Sleep() and sleep for 100ms which is the minimum suggested value in the curl_multi_fdset() doc. Prior to this change the multi examples would exit prematurely since select() would error instead of sleeping when called without an fd. Reported-by: Johan Lantz Bug: http://curl.haxx.se/mail/lib-2014-11/0221.html
* example: fix compiler warnings in fopen.cDaniel Stenberg2010-12-171-10/+10
|
* fopen.c: re-indented, fixed previous mistakeDaniel Stenberg2010-11-041-393/+350
| | | | | | | I've made the code intended using curl-style now to look more like other examples. My previous "fix" was a bit too invasive but is now fixed again.
* multi use: call multi_perform even on select() timeoutsDaniel Stenberg2010-11-041-6/+3
|
* multi & hiper examples: updates and cleanupsDirk Manske2010-09-301-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | all multi and hiper examples: * don't loop curl_multi_perform calls, that was <7.20.0 style, currently the exported multi functions will not return CURLM_CALL_MULTI_PERFORM all hiper examples: * renamed check_run_count to check_multi_info * don't compare current running handle count with previous value, this was the wrong way to check for finished requests, simply call curl_multi_info_read * it's also safe to call curl_multi_remove_handle inside the curl_multi_info_read loop. ghiper.c: * replaced curl_multi_socket (that function is marked as obsolete) calls with curl_multi_socket_action calls (as in hiperfifo.c and evhiperfifo.c) ghiper.c and evhiperfifo.c: * be smart as hiperfifo.c, don't do uncessary curl_multi_* calls in new_conn and main
* examples: add curl_multi_timeoutConstantine Sapuntzakis2010-07-141-0/+11
| | | | | Make the multi-interface using examples use curl_multi_timeout to properly educate users how to do things.
* test536: do not fail with threaded DNS resolverKamil Dudka2010-04-241-3/+5
| | | | Also tweaked comments in certain examples using curl_multi_fdset().
* spellchecked by Stéphane FillodDaniel Stenberg2010-02-261-1/+1
|
* remove unnecessary typecasting of malloc()Yang Tse2008-09-061-1/+1
|
* MSVC adjustmentYang Tse2008-08-311-1/+3
|
* Fixed a surprising number of example programs that were passing int argumentsDan Fandrich2008-05-221-1/+1
| | | | to curl_easy_setopt instead of long.
* Give a hint as to why a url_fopen failed.Dan Fandrich2008-04-041-3/+3
|
* Fixed some compile warnings and errors and improved portability in theDan Fandrich2007-07-121-9/+9
| | | | | | examples. Removed ftp3rdparty.c since libcurl doesn't support 3rd party FTP transfers any longer.
* Added comments about checking return code and the maxfd counterDaniel Stenberg2006-10-131-0/+4
|
* remove curl_ prefix from functions not present in libcurlDaniel Stenberg2004-11-221-7/+7
|
* removed tabs and trailing whitespace from sourceDaniel Stenberg2004-10-061-198/+198
|
* removed old version checksDaniel Stenberg2003-12-081-5/+0
|
* use the newer option namesDaniel Stenberg2003-12-081-1/+1
|
* Vincent Sanders's massive update of this example code. One could argueDaniel Stenberg2003-08-111-166/+496
| | | | weather this is still an "example" or a whole new API layer! ;-)
* made it workDaniel Stenberg2003-01-271-41/+54
| | | | | made it cause less compiler warnings made it require 7.9.7 to build
* fopen.c added, a fopen() style emulation for URL readingDaniel Stenberg2002-05-131-0/+222