Skip to content

src: drop redundant LIBSSH2_API attribute from definitions - #1969

Closed
vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:src-drop-pubfunc-attrs
Closed

vszakats wants to merge 1 commit into
libssh2:masterfrom
vszakats:src-drop-pubfunc-attrs

Conversation

@vszakats

@vszakats vszakats commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_API lines immediately preceding public API function definitions across multiple src/*.c files.
  • 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.

@vszakats vszakats closed this in f5f434c Jun 4, 2026
@vszakats
vszakats deleted the src-drop-pubfunc-attrs branch June 4, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants