1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00

tidy-up: whitespace, sorting, comment and naming fixups

This commit is contained in:
Viktor Szakats
2023-03-31 18:14:38 +00:00
committed by Viktor Szakats
parent ccfeac87da
commit 9aa1964dfb
11 changed files with 29 additions and 30 deletions

View File

@@ -144,10 +144,10 @@ set(MAN_PAGES
libssh2_session_init_ex.3 libssh2_session_init_ex.3
libssh2_session_last_errno.3 libssh2_session_last_errno.3
libssh2_session_last_error.3 libssh2_session_last_error.3
libssh2_session_set_last_error.3
libssh2_session_method_pref.3 libssh2_session_method_pref.3
libssh2_session_methods.3 libssh2_session_methods.3
libssh2_session_set_blocking.3 libssh2_session_set_blocking.3
libssh2_session_set_last_error.3
libssh2_session_set_timeout.3 libssh2_session_set_timeout.3
libssh2_session_startup.3 libssh2_session_startup.3
libssh2_session_supported_algs.3 libssh2_session_supported_algs.3

View File

@@ -114,10 +114,10 @@ dist_man_MANS = \
libssh2_session_init_ex.3 \ libssh2_session_init_ex.3 \
libssh2_session_last_errno.3 \ libssh2_session_last_errno.3 \
libssh2_session_last_error.3 \ libssh2_session_last_error.3 \
libssh2_session_set_last_error.3 \
libssh2_session_method_pref.3 \ libssh2_session_method_pref.3 \
libssh2_session_methods.3 \ libssh2_session_methods.3 \
libssh2_session_set_blocking.3 \ libssh2_session_set_blocking.3 \
libssh2_session_set_last_error.3 \
libssh2_session_set_timeout.3 \ libssh2_session_set_timeout.3 \
libssh2_session_startup.3 \ libssh2_session_startup.3 \
libssh2_session_supported_algs.3 \ libssh2_session_supported_algs.3 \

View File

@@ -41,26 +41,26 @@ add_definitions(-DHAVE_CONFIG_H)
set(EXAMPLES set(EXAMPLES
direct_tcpip direct_tcpip
ssh2
scp scp
scp_nonblock scp_nonblock
scp_write scp_write
scp_write_nonblock scp_write_nonblock
sftp sftp
sftp_RW_nonblock
sftp_append
sftp_mkdir
sftp_mkdir_nonblock
sftp_nonblock sftp_nonblock
sftp_write sftp_write
sftp_write_nonblock sftp_write_nonblock
sftp_mkdir
sftp_mkdir_nonblock
sftp_RW_nonblock
sftp_write_sliding sftp_write_sliding
sftpdir sftpdir
sftpdir_nonblock sftpdir_nonblock
ssh2_exec ssh2
ssh2_agent ssh2_agent
ssh2_agent_forwarding ssh2_agent_forwarding
ssh2_echo ssh2_echo
sftp_append ssh2_exec
subsystem_netconf subsystem_netconf
tcpip-forward) tcpip-forward)
@@ -71,6 +71,7 @@ foreach(example ${EXAMPLES})
target_include_directories(example-${example} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src) target_include_directories(example-${example} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../src)
target_link_libraries(example-${example} ${LIB_STATIC} ${LIBRARIES}) target_link_libraries(example-${example} ${LIB_STATIC} ${LIBRARIES})
endforeach() endforeach()
add_target_to_copy_dependencies( add_target_to_copy_dependencies(
TARGET copy_example_dependencies TARGET copy_example_dependencies
DEPENDENCIES ${RUNTIME_DEPENDENCIES} DEPENDENCIES ${RUNTIME_DEPENDENCIES}

View File

@@ -1,5 +1,4 @@
/* /*
*
* Sample showing how to makes SSH2 with X11 Forwarding works. * Sample showing how to makes SSH2 with X11 Forwarding works.
* *
* Usage: * Usage:

View File

@@ -138,4 +138,3 @@ int _libssh2_channel_close(LIBSSH2_CHANNEL * channel);
int _libssh2_channel_forward_cancel(LIBSSH2_LISTENER *listener); int _libssh2_channel_forward_cancel(LIBSSH2_LISTENER *listener);
#endif /* __LIBSSH2_CHANNEL_H */ #endif /* __LIBSSH2_CHANNEL_H */

View File

@@ -61,8 +61,6 @@
/* Functions */ /* Functions */
#cmakedefine HAVE_GETTIMEOFDAY #cmakedefine HAVE_GETTIMEOFDAY
#cmakedefine HAVE_POLL
#cmakedefine HAVE_SELECT
#cmakedefine HAVE_STRTOLL #cmakedefine HAVE_STRTOLL
#cmakedefine HAVE_STRTOI64 #cmakedefine HAVE_STRTOI64
#cmakedefine HAVE_SNPRINTF #cmakedefine HAVE_SNPRINTF
@@ -70,6 +68,9 @@
#cmakedefine HAVE_EXPLICIT_MEMSET #cmakedefine HAVE_EXPLICIT_MEMSET
#cmakedefine HAVE_MEMSET_S #cmakedefine HAVE_MEMSET_S
#cmakedefine HAVE_POLL
#cmakedefine HAVE_SELECT
/* Socket non-blocking support */ /* Socket non-blocking support */
#cmakedefine HAVE_O_NONBLOCK #cmakedefine HAVE_O_NONBLOCK
#cmakedefine HAVE_FIONBIO #cmakedefine HAVE_FIONBIO

View File

@@ -76,7 +76,7 @@
# define LIBSSH2_WINDOWS_APP # define LIBSSH2_WINDOWS_APP
# endif # endif
# endif # endif
#endif #endif /* WIN32 */
#ifdef HAVE_WS2TCPIP_H #ifdef HAVE_WS2TCPIP_H
#include <ws2tcpip.h> #include <ws2tcpip.h>

View File

@@ -1406,4 +1406,3 @@ _libssh2_packet_requirev(LIBSSH2_SESSION *session,
state->start = 0; state->start = 0;
return LIBSSH2_ERROR_SOCKET_DISCONNECT; return LIBSSH2_ERROR_SOCKET_DISCONNECT;
} }

View File

@@ -1740,7 +1740,7 @@ libssh2_poll(LIBSSH2_POLLFD * fds, unsigned int nfds, long timeout)
*/ */
sysret = poll(sockets, nfds, (int)timeout_remaining); sysret = poll(sockets, nfds, (int)timeout_remaining);
timeout_remaining = 0; timeout_remaining = 0;
#endif /* HAVE_GETTIMEOFDAY */ #endif /* HAVE_LIBSSH2_GETTIMEOFDAY */
if(sysret > 0) { if(sysret > 0) {
for(i = 0; i < nfds; i++) { for(i = 0; i < nfds; i++) {

View File

@@ -68,9 +68,9 @@ endif
DB ?= NDEBUG DB ?= NDEBUG
CPPFLAGS += -D$(DB) CPPFLAGS += -D$(DB)
ifeq ($(DB),NDEBUG) ifeq ($(DB),NDEBUG)
OBJDIR := release OBJ_DIR := release
else else
OBJDIR := debug OBJ_DIR := debug
CFLAGS += -g CFLAGS += -g
CPPFLAGS += -DLIBSSH2DEBUG CPPFLAGS += -DLIBSSH2DEBUG
endif endif
@@ -143,7 +143,7 @@ AWK := awk
ZIP := zip -qzr9 ZIP := zip -qzr9
# Include the version info retrieved from libssh2.h # Include the version info retrieved from libssh2.h
-include $(OBJDIR)/version.inc -include $(OBJ_DIR)/version.inc
vpath %.c $(PROOT)/src vpath %.c $(PROOT)/src
@@ -151,7 +151,7 @@ vpath %.c $(PROOT)/src
include $(PROOT)/Makefile.inc include $(PROOT)/Makefile.inc
OBJECTS := $(patsubst %.c,%.o,$(CSOURCES)) OBJECTS := $(patsubst %.c,%.o,$(CSOURCES))
OBJS := $(addprefix $(OBJDIR)/,$(OBJECTS)) OBJS := $(addprefix $(OBJ_DIR)/,$(OBJECTS))
TARGET := libssh2 TARGET := libssh2
@@ -172,29 +172,29 @@ dll: prebuild $(libssh2_dll_LIBRARY)
lib: prebuild $(TARGET).a lib: prebuild $(TARGET).a
prebuild: $(OBJDIR) $(OBJDIR)/version.inc prebuild: $(OBJ_DIR) $(OBJ_DIR)/version.inc
test: $(TARGETS_EXAMPLES) test: $(TARGETS_EXAMPLES)
%.exe: %.c $(libssh2_DEPENDENCIES) %.exe: %.c $(libssh2_DEPENDENCIES)
$(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBSSH2_LDFLAGS_BIN) $< -o $@ $(LIBS) $(LIBS_BIN) $(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(LIBSSH2_LDFLAGS_BIN) $< -o $@ $(LIBS) $(LIBS_BIN)
$(OBJDIR)/%.o: %.c $(OBJ_DIR)/%.o: %.c
$(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) -c $< -o $@ $(CC) -W -Wall $(CFLAGS) $(CPPFLAGS) -c $< -o $@
$(libssh2_dll_LIBRARY) $(libssh2_dll_a_LIBRARY): $(OBJS) $(OBJDIR)/$(TARGET).res $(libssh2_dll_LIBRARY) $(libssh2_dll_a_LIBRARY): $(OBJS) $(OBJ_DIR)/$(TARGET).res
@$(call DEL, $@) @$(call DEL, $@)
$(CC) $(LDFLAGS) -shared $(LIBSSH2_LDFLAGS_LIB) $^ -o $@ $(LIBS) $(LIBS_LIB) \ $(CC) $(LDFLAGS) -shared $(LIBSSH2_LDFLAGS_LIB) $^ -o $@ $(LIBS) $(LIBS_LIB) \
-Wl,--output-def,$(libssh2_dll_LIBRARY:.dll=.def),--out-implib,$(libssh2_dll_a_LIBRARY) -Wl,--output-def,$(libssh2_dll_LIBRARY:.dll=.def),--out-implib,$(libssh2_dll_a_LIBRARY)
$(OBJDIR)/%.res: %.rc $(OBJ_DIR)/%.res: %.rc
$(RC) -O coff $(RCFLAGS) -i $< -o $@ $(RC) -O coff $(RCFLAGS) -i $< -o $@
$(TARGET).a: $(OBJS) $(TARGET).a: $(OBJS)
@$(call DEL, $@) @$(call DEL, $@)
$(AR) rcs $@ $^ $(AR) rcs $@ $^
$(OBJDIR)/version.inc: $(PROOT)/get_ver.awk $(PROOT)/include/libssh2.h $(OBJDIR) $(OBJ_DIR)/version.inc: $(PROOT)/get_ver.awk $(PROOT)/include/libssh2.h $(OBJ_DIR)
$(AWK) -f $^ > $@ $(AWK) -f $^ > $@
dist: all $(DISTDIR) $(DISTDIR)/readme.txt dist: all $(DISTDIR) $(DISTDIR)/readme.txt
@@ -216,16 +216,16 @@ distclean vclean: clean
$(call DEL, $(DISTARC)) $(call DEL, $(DISTARC))
objclean: all objclean: all
$(call RMDIR, $(OBJDIR)) $(call RMDIR, $(OBJ_DIR))
testclean: clean testclean: clean
$(call DEL, $(TARGETS_EXAMPLES)) $(call DEL, $(TARGETS_EXAMPLES))
clean: clean:
$(call DEL, $(libssh2_dll_LIBRARY) $(libssh2_dll_LIBRARY:.dll=.def) $(TARGET).a $(libssh2_dll_a_LIBRARY)) $(call DEL, $(libssh2_dll_LIBRARY) $(libssh2_dll_LIBRARY:.dll=.def) $(TARGET).a $(libssh2_dll_a_LIBRARY))
$(call RMDIR, $(OBJDIR)) $(call RMDIR, $(OBJ_DIR))
$(OBJDIR): $(OBJ_DIR):
@$(call MKDIR, $@) @$(call MKDIR, $@)
$(DISTDIR): $(DISTDIR):
@@ -239,7 +239,7 @@ $(DISTDIR)/readme.txt: GNUmakefile
@echo $(DL)any further documentation:$(DL) >> $@ @echo $(DL)any further documentation:$(DL) >> $@
@echo $(DL)$(HOMEPAGE)$(DL) >> $@ @echo $(DL)$(HOMEPAGE)$(DL) >> $@
help: $(OBJDIR)/version.inc help: $(OBJ_DIR)/version.inc
@echo $(DL)===========================================================$(DL) @echo $(DL)===========================================================$(DL)
@echo $(DL)OpenSSL path = $(OPENSSL_PATH)$(DL) @echo $(DL)OpenSSL path = $(OPENSSL_PATH)$(DL)
@echo $(DL)wolfSSL path = $(WOLFSSL_PATH)$(DL) @echo $(DL)wolfSSL path = $(WOLFSSL_PATH)$(DL)