1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Commit Graph

19 Commits

Author SHA1 Message Date
Viktor Szakats
dc656fd807 include: restore parentheses for macro arguments, for compatibility
To avoid the chance of breaking compatibility. Make an exception for
values also passed to `strlen()` because these were already not
supporting callers passing `x, y`-style macro expressions to these
macros, as arguments.

Also note that SFTP handle args already did not support this due to the
lack of parentheses in `libssh2_sftp_close()`, `libssh2_sftp_closedir()`
macros.

Follow-up to b6f307dca9 #1898

Closes #2577
2026-09-03 16:42:51 +02:00
Viktor Szakats
bcef4a03ee tidy-up: fixup and reflow copyright headers
Also:
- sync with canonical `BSD-3-Clause.txt`:
  - number the clauses.
  - wording in the 3rd clause.
- add 'All rights reserved.' where missing.
- agent: sync with rest of files.
- agent: merge two, identical, embedded headers.
- fix comments nits found nearby.

Closes #2247
2026-07-08 04:22:55 +02:00
Viktor Szakats
04ecdb22fe build: update picky warning options, fix fallouts
- sync picky compiler warning options with curl:
  - update version mappings for latest Apple clang.
  - replace `-pedantic` with `-Wpedantic` on newer toolchains.
  - adjust warning cutoff versions.
  - enable new picky warnings.
  - unlock picky warnings for most recent MSVC.
- GHA: bump some MSVC jobs to to VS2026.

Fix fallouts:
- configure: replace `-I` with `-isystem` for dependency headers.
  Notably it silences picky warnings otherwise found in 3rd-party
  headers, e.g. `-Wreserved-identifier` in `gpg-error.h`,
  `openssl/lhash.h`, `wolfssl/wolfcrypt/hmac.h`, or
  `-Wcast-function-type-strict` in `openssl/rsa.h`.
  It also aligns autotools builds with CMake (and curl builds).
  Logic copied from curl.
- example/x11: fix to not use reserved symbols.
- include, src/libssh2_priv.h: silence `-Wreserved-identifier` locally.
  May be fixed for real in a future patch.
- avoid using reserved C++ keyword `public`.
- openssl: silence `-Wcast-function-type-strict` locally for
  non-OpenSSL3 builds.
- mbedtls, openssl: fix potentially uninitialized variable warnings.
  (extend to all compilers from MSVC in openssl)
- fix `LIBSSH2_SOCKET_MASK` signedness on Windows.
- wincng: apply casts from `int` to `enum` to silence
  `-Wimplicit-int-enum-cast`.
- configure: disable `-Wleading-whitespace=spaces` to due
  incompatibility with `AC_FUNC_ALLOCA`.
- packet: fix to pass `int` as mask length.
- fix `-Wformat-signedness`.
- src/libssh2_priv.h: silence `-Wreserved-macro-identifier` locally for
  mingw-w64 builds.
- GHA: add workaround for missing NSIS on windows-2025 runner images.

Closes #1972
2026-06-07 15:19:19 +02:00
Viktor Szakats
f0279a69b5 include: move return type inline with the declarations, where missing
Move `LIBSSH2_API` inline, too.

Also:
- fix missing argument names from a function typedef.
- fix pointer argument formatting.

Follow-up to e85ce25b4c #1960
Follow-up to 6ffb96321c #1935

Closes #1964
2026-06-03 10:50:15 +02:00
Viktor Szakats
a73aa23c9f checksrc: stop disabling TYPEDEFSTRUCT globally
Silence locally in public headers. They are part of the documented
public interface, removing them would be a breaking change.

Follow-up to 35aa0b2cd7 #1910
Follow-up to 7dd7e62629 #1909
Follow-up to c07e953a2f #1908
Follow-up to 967647c4da #1907

Closes #1912
2026-05-01 14:19:03 +02:00
Viktor Szakats
b6f307dca9 tidy-up: add missing, and drop redundant parentheses
Also:
- apply minor whitespace fixes.
- VMS/man2help.c: clarify `if` expression, drop redundant `else`
  expression.

Follow-up to 6e47049cff #1844

Closes #1898
2026-04-29 19:52:56 +02:00
Daniel Stenberg
f6aa31f48f provide SPDX identifiers
- All files have prominent copyright and SPDX identifier
- If not embedded in the file, in the .reuse/dep5 file
- All used licenses are in LICENSES/ (not shipped in tarballs)
- A new REUSE CI job verify that all files are OK

Assisted-by: Viktor Szakats

Closes #1084
2023-06-07 08:18:55 +02:00
Viktor Szakats
187d89bb07 copyright: remove years from copyright headers
Also:
- uppercase `(C)`.
- add missing 'All rights reserved.' lines.
- drop duplicate 'Author' lines.
- add copyright headers where missing.
- enable copyright header check in checksrc.

Reasons for deleting years (copied as-is from curl):
- 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

Closes #1082
2023-06-04 19:19:16 +00:00
Viktor Szakats
504026262d include: indentation fixes 2023-04-11 02:33:45 +02:00
Daniel Stenberg
452517d96c style: make includes and examples code style strict
make travis and the makefile rule verify them too

Closes #334
2019-03-21 13:04:07 +01:00
Patrick Monnerat
0fbf8f3c7e Fold long lines in include files 2016-01-18 13:35:28 +01:00
Daniel Stenberg
35a9d4bc62 From: Alexander Lamaison <swish@lammy.co.uk>
Make the public headers includable on their own
2009-07-17 23:40:32 +02:00
Daniel Stenberg
97fbb77da5 made the three public headers use (mostly) lines shorter than 80 columns as
HACKING says - it makes them much more readable to my old tired eyes...
2009-01-01 22:27:08 +00:00
James Housley
dde2b09496 libssh2_channel_free() actually can return PACKET_EAGAIN. Update all
calling functions to support that with the following API notes:

* libssh2_publickey_shutdown(), libssh2_session_free() changed
  to return an "int" to allow signaling of LIBSSH2_ERROR_EAGAIN.

* libssh2_scp_recv(), libssh2_scp_send_ex() and libssh2_sftp_init()
  will loop in on libssh2_channel_free() when there is an error.
  It is not possible to return LIBSSH2_ERROR_EAGAIN in this condition
  in these 3 functions and not lose the original error code.
2007-06-12 18:27:37 +00:00
James Housley
412b25d971 Initially the libssh2 code was indented with tabs of 4 spaces. Some of
the recent commits converted the tabs to 4 spaces, which matched the
initial indent size.  Other commits converted the tabs to 8 spaces, this
didn't match.

All the code has been converted to 4 space indents.  No changes to line
lengths or actual code was performed.  This is in preperation to my up
coming non-blocking work so my commits should only be code changes and
line lengths in the code I am working on.
2007-05-28 17:56:08 +00:00
Dan Fandrich
09deb228f1 Added some consts to struct members 2007-04-19 19:40:45 +00:00
Dan Fandrich
9b81a01376 Made some function parameters in the API const. This is an API change,
but correctly-written applications should see no source or binary
compatibility issues.  Also fixed a few compiler warnings.
2007-04-18 18:51:03 +00:00
Sara Golemon
c45992da55 Bump copyright year 2006-03-02 01:10:52 +00:00
Sara Golemon
e15f5d97a0 Add publickey subsystem support 2005-07-21 20:28:07 +00:00