From b5e358618ba1bc15377f103d6d87834ad50299e5 Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Sat, 19 Dec 2009 10:54:45 +0100 Subject: [PATCH] Move examples from example/simple to example/. --- buildconf | 2 +- configure.ac | 1 - example/.gitignore | 18 ++++++++++++++++++ example/Makefile.am | 16 +++++++++++++++- example/{simple => }/scp.c | 0 example/{simple => }/scp_nonblock.c | 0 example/{simple => }/scp_write.c | 0 example/{simple => }/scp_write_nonblock.c | 0 example/{simple => }/sftp.c | 0 example/{simple => }/sftp_RW_nonblock.c | 0 example/{simple => }/sftp_mkdir.c | 0 example/{simple => }/sftp_mkdir_nonblock.c | 0 example/{simple => }/sftp_nonblock.c | 0 example/{simple => }/sftp_write.c | 0 example/{simple => }/sftp_write_nonblock.c | 0 example/{simple => }/sftpdir.c | 0 example/{simple => }/sftpdir_nonblock.c | 0 example/simple/.gitignore | 18 ------------------ example/simple/Makefile.am | 16 ---------------- example/{simple => }/ssh2.c | 0 example/{simple => }/ssh2_exec.c | 0 example/{simple => }/x11.c | 0 nw/test/Makefile.netware | 2 +- win32/test/Makefile.win32 | 2 +- 24 files changed, 36 insertions(+), 39 deletions(-) rename example/{simple => }/scp.c (100%) rename example/{simple => }/scp_nonblock.c (100%) rename example/{simple => }/scp_write.c (100%) rename example/{simple => }/scp_write_nonblock.c (100%) rename example/{simple => }/sftp.c (100%) rename example/{simple => }/sftp_RW_nonblock.c (100%) rename example/{simple => }/sftp_mkdir.c (100%) rename example/{simple => }/sftp_mkdir_nonblock.c (100%) rename example/{simple => }/sftp_nonblock.c (100%) rename example/{simple => }/sftp_write.c (100%) rename example/{simple => }/sftp_write_nonblock.c (100%) rename example/{simple => }/sftpdir.c (100%) rename example/{simple => }/sftpdir_nonblock.c (100%) delete mode 100644 example/simple/.gitignore delete mode 100644 example/simple/Makefile.am rename example/{simple => }/ssh2.c (100%) rename example/{simple => }/ssh2_exec.c (100%) rename example/{simple => }/x11.c (100%) diff --git a/buildconf b/buildconf index 14a18816..ef1fe56e 100755 --- a/buildconf +++ b/buildconf @@ -22,6 +22,6 @@ ${AUTOHEADER:-autoheader} # copy the private libssh2_config.h.in to the examples dir so that # it can be included without pointing the include path to the private # source dir -cp src/libssh2_config.h.in example/simple/config.h.in +cp src/libssh2_config.h.in example/config.h.in ${AUTOCONF:-autoconf} ${AUTOMAKE:-automake} --add-missing --copy diff --git a/configure.ac b/configure.ac index a1dbaf6e..44fbe997 100644 --- a/configure.ac +++ b/configure.ac @@ -252,7 +252,6 @@ AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile example/Makefile - example/simple/Makefile docs/Makefile libssh2.pc]) AC_OUTPUT diff --git a/example/.gitignore b/example/.gitignore index 282522db..b5fdd712 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -1,2 +1,20 @@ Makefile Makefile.in +*.gcno +*.gcda +scp +scp_nonblock +scp_write +scp_write_nonblock +sftp +sftp_nonblock +sftpdir +sftpdir_nonblock +ssh2 +sftp_RW_nonblock +sftp_mkdir +sftp_mkdir_nonblock +sftp_write +sftp_write_nonblock +config.h.in +ssh2_exec diff --git a/example/Makefile.am b/example/Makefile.am index 3f2227ec..cfa16d92 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -1,2 +1,16 @@ AUTOMAKE_OPTIONS = foreign nostdinc -SUBDIRS = simple + +# samples +noinst_PROGRAMS = ssh2 \ + scp scp_nonblock \ + scp_write scp_write_nonblock \ + sftp sftp_nonblock \ + sftp_write sftp_write_nonblock \ + sftp_mkdir sftp_mkdir_nonblock \ + sftp_RW_nonblock \ + sftpdir sftpdir_nonblock ssh2_exec + +# the examples need the $(top_builddir)/src since when building outside of the +# source dir they still need to reach the libssh2_config.h header +AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/src +LDADD = $(top_builddir)/src/libssh2.la diff --git a/example/simple/scp.c b/example/scp.c similarity index 100% rename from example/simple/scp.c rename to example/scp.c diff --git a/example/simple/scp_nonblock.c b/example/scp_nonblock.c similarity index 100% rename from example/simple/scp_nonblock.c rename to example/scp_nonblock.c diff --git a/example/simple/scp_write.c b/example/scp_write.c similarity index 100% rename from example/simple/scp_write.c rename to example/scp_write.c diff --git a/example/simple/scp_write_nonblock.c b/example/scp_write_nonblock.c similarity index 100% rename from example/simple/scp_write_nonblock.c rename to example/scp_write_nonblock.c diff --git a/example/simple/sftp.c b/example/sftp.c similarity index 100% rename from example/simple/sftp.c rename to example/sftp.c diff --git a/example/simple/sftp_RW_nonblock.c b/example/sftp_RW_nonblock.c similarity index 100% rename from example/simple/sftp_RW_nonblock.c rename to example/sftp_RW_nonblock.c diff --git a/example/simple/sftp_mkdir.c b/example/sftp_mkdir.c similarity index 100% rename from example/simple/sftp_mkdir.c rename to example/sftp_mkdir.c diff --git a/example/simple/sftp_mkdir_nonblock.c b/example/sftp_mkdir_nonblock.c similarity index 100% rename from example/simple/sftp_mkdir_nonblock.c rename to example/sftp_mkdir_nonblock.c diff --git a/example/simple/sftp_nonblock.c b/example/sftp_nonblock.c similarity index 100% rename from example/simple/sftp_nonblock.c rename to example/sftp_nonblock.c diff --git a/example/simple/sftp_write.c b/example/sftp_write.c similarity index 100% rename from example/simple/sftp_write.c rename to example/sftp_write.c diff --git a/example/simple/sftp_write_nonblock.c b/example/sftp_write_nonblock.c similarity index 100% rename from example/simple/sftp_write_nonblock.c rename to example/sftp_write_nonblock.c diff --git a/example/simple/sftpdir.c b/example/sftpdir.c similarity index 100% rename from example/simple/sftpdir.c rename to example/sftpdir.c diff --git a/example/simple/sftpdir_nonblock.c b/example/sftpdir_nonblock.c similarity index 100% rename from example/simple/sftpdir_nonblock.c rename to example/sftpdir_nonblock.c diff --git a/example/simple/.gitignore b/example/simple/.gitignore deleted file mode 100644 index b7328883..00000000 --- a/example/simple/.gitignore +++ /dev/null @@ -1,18 +0,0 @@ -*.gcno -*.gcda -scp -scp_nonblock -scp_write -scp_write_nonblock -sftp -sftp_nonblock -sftpdir -sftpdir_nonblock -ssh2 -sftp_RW_nonblock -sftp_mkdir -sftp_mkdir_nonblock -sftp_write -sftp_write_nonblock -config.h.in -ssh2_exec diff --git a/example/simple/Makefile.am b/example/simple/Makefile.am deleted file mode 100644 index cfa16d92..00000000 --- a/example/simple/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -AUTOMAKE_OPTIONS = foreign nostdinc - -# samples -noinst_PROGRAMS = ssh2 \ - scp scp_nonblock \ - scp_write scp_write_nonblock \ - sftp sftp_nonblock \ - sftp_write sftp_write_nonblock \ - sftp_mkdir sftp_mkdir_nonblock \ - sftp_RW_nonblock \ - sftpdir sftpdir_nonblock ssh2_exec - -# the examples need the $(top_builddir)/src since when building outside of the -# source dir they still need to reach the libssh2_config.h header -AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/src -LDADD = $(top_builddir)/src/libssh2.la diff --git a/example/simple/ssh2.c b/example/ssh2.c similarity index 100% rename from example/simple/ssh2.c rename to example/ssh2.c diff --git a/example/simple/ssh2_exec.c b/example/ssh2_exec.c similarity index 100% rename from example/simple/ssh2_exec.c rename to example/ssh2_exec.c diff --git a/example/simple/x11.c b/example/x11.c similarity index 100% rename from example/simple/x11.c rename to example/x11.c diff --git a/nw/test/Makefile.netware b/nw/test/Makefile.netware index 60a34d67..bc022857 100644 --- a/nw/test/Makefile.netware +++ b/nw/test/Makefile.netware @@ -28,7 +28,7 @@ endif LINK_STATIC = 1 # Edit the vars below to change NLM target settings. -SAMPLES = ../../example/simple +SAMPLES = ../../example TARGETS := $(filter-out x11.nlm,$(patsubst $(SAMPLES)/%.c,%.nlm,$(strip $(wildcard $(SAMPLES)/*.c)))) VERSION = $(LIBSSH2_VERSION) COPYR = Copyright (c) 2004-2009, Sara Golemon diff --git a/win32/test/Makefile.win32 b/win32/test/Makefile.win32 index f9ac1b56..5724188b 100644 --- a/win32/test/Makefile.win32 +++ b/win32/test/Makefile.win32 @@ -125,7 +125,7 @@ else DS = \\ endif -vpath %.c ../../example/simple +vpath %.c ../../example .PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.rc $(OBJDIR)/%.res