Repository navigation
Conversation
The attributes have an effect on the prototype only, it's not necessary to set in on definitions. It may have had a double duty of indicating public functions in the source, but those are easy to spot by their `libssh2_` prefixes after libssh2#1961.
There was a problem hiding this comment.
Pull request overview
This PR streamlines libssh2’s C sources by removing redundant LIBSSH2_API annotations from function definitions, relying on the existing LIBSSH2_API markings on the public prototypes in the installed headers (e.g., include/libssh2.h, include/libssh2_sftp.h, etc.). This keeps symbol-export intent in the API surface while reducing duplication in implementation files.
Changes:
- Removed standalone
LIBSSH2_APIlines immediately preceding public API function definitions across multiplesrc/*.cfiles. - Did the same for the OS/400 CCSID wrapper implementations (
os400/ccsid.c). - No functional logic changes; this is a mechanical cleanup of declaration attributes on definitions.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/version.c |
Drops redundant LIBSSH2_API on API function definitions. |
src/userauth.c |
Drops redundant LIBSSH2_API on userauth API function definitions. |
src/sftp.c |
Drops redundant LIBSSH2_API on SFTP API function definitions. |
src/session.c |
Drops redundant LIBSSH2_API on session API function definitions. |
src/scp.c |
Drops redundant LIBSSH2_API on SCP API function definitions. |
src/publickey.c |
Drops redundant LIBSSH2_API on publickey API function definitions. |
src/misc.c |
Drops redundant LIBSSH2_API on misc API function definitions (incl. trace/free/base64). |
src/knownhost.c |
Drops redundant LIBSSH2_API on knownhost API function definitions. |
src/kex.c |
Drops redundant LIBSSH2_API on KEX/session method preference-related API definitions. |
src/keepalive.c |
Drops redundant LIBSSH2_API on keepalive API function definitions. |
src/hostkey.c |
Drops redundant LIBSSH2_API on hostkey API function definitions. |
src/global.c |
Drops redundant LIBSSH2_API on global init/exit API function definitions. |
src/channel.c |
Drops redundant LIBSSH2_API on channel API function definitions. |
src/agent.c |
Drops redundant LIBSSH2_API on agent API function definitions. |
os400/ccsid.c |
Drops redundant LIBSSH2_API on OS/400 CCSID wrapper API function definitions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The attributes have an effect on the prototype only, it's not necessary
to set it on function definitions. It may have had a role of which
functions are public, but this is easy to spot by their
libssh2_prefixes, esp. after #1961.