Commit Graph

29 Commits

Author SHA1 Message Date
Viktor Szakats
53b4dfe405
examples: delete unused includes
Delete a bunch of unnecessary-looking headers from some examples. This
is known to be tricky on AIX (perhaps also in other less-tested envs).

Let me know if any of this looks incorrect or outright fails on some
systems.

Follow-up to d4b8589055 #13771
Closes #13785
2024-05-28 00:27:04 +02:00
Viktor Szakats
d4b8589055
examples: fix compiling with MSVC
- `websocket.c`: use `Sleep()` on Windows.
  `sleep()` and `unistd.h` are not available in MSVC.

- `http2-upload.c`: use local `gettimeofday()` implementation when
  compiled with MSVC.
  (Alternate solution is to disable the trace function for MSVC.)
  Public domain code copied and adapted from libssh2:
  e973493f99/src/misc.c (L719-L743)

- silence compiler warning for deprecated `inet_addr()`.
  Also drop duplicate winsock2 include.
  ```
  curl\docs\examples\externalsocket.c(125,32): error C2220: the following warning is treated as an error [curl\bld\docs\examples\curl-example-externalsocket.vcxproj]
  curl\docs\examples\externalsocket.c(125,32): warning C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [curl\bld\docs\examples\curl-example-e
  ```
  Ref: https://github.com/curl/curl/actions/runs/9227337318/job/25389073450#step:4:95

- silence an MSVC compiler warning. This is in conflict with `checksrc`
  rules, so silence the rule in favour of the warning-free C syntax.
  ```
  curl\docs\examples\multi-legacy.c(152,1): error C2220: the following warning is treated as an error [curl\bld\docs\examples\curl-example-multi-legacy.vcxproj]
  curl\docs\examples\multi-legacy.c(152,1): warning C4706: assignment within conditional expression [curl\bld\docs\examples\curl-example-multi-legacy.vcxproj]
  ```
  Ref: https://github.com/curl/curl/actions/runs/9227337318/job/25389073450#step:4:226

- do not use `sys/time.h` and `unistd.h` in Windows builds.
  Some of these includes look unnecessary. Subject to another PR.

Cherry-picked from #13766
Closes #13771
2024-05-26 22:43:04 +02:00
Daniel Stenberg
2bc1d775f5
copyright: update all copyright lines and remove year ranges
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205
2023-01-03 09:19:21 +01:00
max.mehl
ad9bc5976d
copyright: make repository REUSE compliant
Add licensing and copyright information for all files in this repository. This
either happens in the file itself as a comment header or in the file
`.reuse/dep5`.

This commit also adds a Github workflow to check pull requests and adapts
copyright.pl to the changes.

Closes #8869
2022-06-13 09:13:00 +02:00
Daniel Stenberg
ac0a88fd25
copyright: fix year ranges
Follow-up from 4d2f800677
2020-11-05 08:22:10 +01:00
Daniel Stenberg
4d2f800677
curl.se: new home
Closes #6172
2020-11-04 23:59:47 +01:00
Viktor Szakats
efc696a2e0 docs/examples: URL updates
- also update two URLs outside of docs/examples
- fix spelling of filename persistant.c
- fix three long lines that started failing checksrc.pl

Closes https://github.com/curl/curl/pull/3036
2018-09-23 09:23:29 +00:00
Daniel Stenberg
d202fbcc00 examples: fix some compiler warnings 2016-02-11 10:21:09 +01:00
Daniel Stenberg
4af40b3646 URLs: change all http:// URLs to https:// 2016-02-03 00:19:02 +01:00
Daniel Stenberg
2e503441ed examples: added descriptions 2016-01-04 15:34:05 +01:00
Steve Holme
4c8a053855 sepheaders.c: Applied curl oding standards 2014-12-31 11:20:41 +00:00
Julien Nabet
8a3c0fbed1 sepheaders.c: Fixed resource leak on failure 2014-12-31 11:14:22 +00:00
Dan Fandrich
3ae2b6cd7f Update instances of some obsolete CURLOPTs to their new names 2014-07-05 22:47:13 +02:00
Guenter Knauf
da0db499fd Use opened body.out file and write content to it. 2013-06-20 22:53:37 +02:00
Daniel Stenberg
ac28971aa6 examples: cleanup curl includes
Only <curl/curl.h> is needed typically and curl/types.h has been removed
2011-06-28 19:08:51 +02:00
Daniel Stenberg
1aeb635cdd sources: update source headers
All C and H files now (should) feature the proper project curl source
code header, which includes basic info, a copyright statement and some
basic disclaimers.
2011-03-10 12:04:33 +01:00
Daniel Stenberg
9583b4af90 examples: fix compiler warnings 2010-12-17 23:34:26 +01:00
Daniel Stenberg
18e7b52e8e examples: use example.com in example URLs 2010-10-05 15:00:19 +02:00
Daniel Stenberg
2309b4e330 remove the CVSish $Id$ lines 2010-03-24 11:02:54 +01:00
Dan Fandrich
e664cd5826 Fixed a surprising number of example programs that were passing int arguments
to curl_easy_setopt instead of long.
2008-05-22 21:20:07 +00:00
Dan Fandrich
4706a93341 Fixed some more simple compile warnings in the examples. 2007-07-16 21:22:12 +00:00
Dan Fandrich
49ce3e5160 Fixed some compile warnings and errors and improved portability in the
examples.
Removed ftp3rdparty.c since libcurl doesn't support 3rd party FTP transfers
any longer.
2007-07-12 21:11:10 +00:00
Daniel Stenberg
a03c76b228 ok stop using old and deprecated options 2006-11-08 08:49:27 +00:00
Daniel Stenberg
cc48658564 cut off old crappy win32 comments and use the proper global_init instead
also removed very old "require libcurl older than blablabla"
2003-11-19 08:21:34 +00:00
Daniel Stenberg
5334a58f9b Andy Cedilnik's corrections 2003-03-17 12:38:08 +00:00
Daniel Stenberg
c74cb59e08 added comment about CURLOPT_WRITEDATA for directing contents somewhere 2002-08-12 11:36:48 +00:00
Daniel Stenberg
e1132ecbe6 corrected 2001-05-15 12:55:35 +00:00
Daniel Stenberg
ada9bc2b24 win32sockets.c is now added with winsock init/cleanup example functions 2001-02-20 13:56:38 +00:00
Daniel Stenberg
35aa363587 new libcurl example code stuff 2000-09-20 22:32:08 +00:00