changed to configure defines to control inclusion of headers from libssh2_config.h.

This commit is contained in:
Guenter Knauf 2007-04-26 22:59:29 +00:00
parent 34bcc69a1a
commit 40970adb53
14 changed files with 175 additions and 91 deletions

View File

@ -227,6 +227,7 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]),
# AC_HEADER_STDC # AC_HEADER_STDC
AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h]) AC_CHECK_HEADERS([errno.h fcntl.h stdio.h stdlib.h unistd.h sys/uio.h])
AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h]) AC_CHECK_HEADERS([sys/select.h sys/socket.h sys/ioctl.h sys/time.h])
AC_CHECK_HEADERS([arpa/inet.h netinet/in.h])
AC_CHECK_FUNCS(poll gettimeofday select) AC_CHECK_FUNCS(poll gettimeofday select)
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.

View File

@ -1,18 +1,26 @@
/* /*
* $Id: scp.c,v 1.4 2007/02/02 23:23:36 bagder Exp $ * $Id: scp.c,v 1.5 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do a simple SCP transfer. * Sample showing how to do a simple SCP transfer.
*/ */
#include <libssh2.h> #include <libssh2.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,18 +1,26 @@
/* /*
* $Id: scp_nonblock.c,v 1.1 2007/02/02 16:21:20 bagder Exp $ * $Id: scp_nonblock.c,v 1.2 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SCP transfers in a non-blocking manner. * Sample showing how to do SCP transfers in a non-blocking manner.
*/ */
#include <libssh2.h> #include <libssh2.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftp.c,v 1.5 2007/04/22 13:10:48 jehousley Exp $ * $Id: sftp.c,v 1.6 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SFTP transfers. * Sample showing how to do SFTP transfers.
* *
@ -12,16 +12,24 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftp_RW_nonblock.c,v 1.1 2007/04/22 14:15:47 jehousley Exp $ * $Id: sftp_RW_nonblock.c,v 1.2 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SFTP transfers in a non-blocking manner. * Sample showing how to do SFTP transfers in a non-blocking manner.
* *
@ -12,13 +12,24 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftp_mkdir.c,v 1.1 2007/04/22 19:52:51 jehousley Exp $ * $Id: sftp_mkdir.c,v 1.2 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SFTP mkdir * Sample showing how to do SFTP mkdir
* *
@ -12,16 +12,21 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftp_mkdir_nonblock.c,v 1.1 2007/04/22 19:52:51 jehousley Exp $ * $Id: sftp_mkdir_nonblock.c,v 1.2 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SFTP non-blocking mkdir. * Sample showing how to do SFTP non-blocking mkdir.
* *
@ -12,16 +12,21 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftp_nonblock.c,v 1.5 2007/04/22 15:05:06 jehousley Exp $ * $Id: sftp_nonblock.c,v 1.6 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SFTP non-blocking transfers. * Sample showing how to do SFTP non-blocking transfers.
* *
@ -12,16 +12,24 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftp_write.c,v 1.1 2007/04/22 15:57:52 jehousley Exp $ * $Id: sftp_write.c,v 1.2 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SFTP write transfers. * Sample showing how to do SFTP write transfers.
* *
@ -12,16 +12,21 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftp_write_nonblock.c,v 1.1 2007/04/22 15:57:52 jehousley Exp $ * $Id: sftp_write_nonblock.c,v 1.2 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample showing how to do SFTP non-blocking write transfers. * Sample showing how to do SFTP non-blocking write transfers.
* *
@ -12,16 +12,21 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftpdir.c,v 1.2 2007/04/22 11:01:54 jehousley Exp $ * $Id: sftpdir.c,v 1.3 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample doing an SFTP directory listing. * Sample doing an SFTP directory listing.
* *
@ -12,14 +12,21 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,5 +1,5 @@
/* /*
* $Id: sftpdir_nonblock.c,v 1.2 2007/04/22 11:00:02 jehousley Exp $ * $Id: sftpdir_nonblock.c,v 1.3 2007/04/26 22:59:29 gknauf Exp $
* *
* Sample doing an SFTP directory listing. * Sample doing an SFTP directory listing.
* *
@ -12,14 +12,21 @@
#include <libssh2.h> #include <libssh2.h>
#include <libssh2_sftp.h> #include <libssh2_sftp.h>
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
# include <arpa/inet.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -1,12 +1,17 @@
#include "libssh2.h" #include "libssh2.h"
#ifndef WIN32 #ifdef HAVE_WINSOCK2_H
# include <netinet/in.h>
# include <sys/socket.h>
# include <unistd.h>
#else
# include <winsock2.h> # include <winsock2.h>
#endif #endif
#ifdef HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
# ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>

View File

@ -15,6 +15,7 @@
#define HAVE_SYS_TIME_H #define HAVE_SYS_TIME_H
#endif #endif
#define HAVE_WINSOCK2_H
#define HAVE_IOCTLSOCKET #define HAVE_IOCTLSOCKET
/* same as WSABUF */ /* same as WSABUF */