diff --git a/configure.in b/configure.in index 80a62170..2833779a 100644 --- a/configure.in +++ b/configure.in @@ -227,6 +227,7 @@ AC_HELP_STRING([--disable-debug],[Disable debug options]), # AC_HEADER_STDC 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([arpa/inet.h netinet/in.h]) AC_CHECK_FUNCS(poll gettimeofday select) # Checks for typedefs, structures, and compiler characteristics. diff --git a/example/simple/scp.c b/example/simple/scp.c index 784c67ba..08cc9508 100644 --- a/example/simple/scp.c +++ b/example/simple/scp.c @@ -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. */ #include -#ifndef WIN32 -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +# include +#endif #include #include diff --git a/example/simple/scp_nonblock.c b/example/simple/scp_nonblock.c index d4a20b86..f319f4ae 100644 --- a/example/simple/scp_nonblock.c +++ b/example/simple/scp_nonblock.c @@ -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. */ #include -#ifndef WIN32 -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_SYS_TIME_H +# include +#endif #include #include diff --git a/example/simple/sftp.c b/example/simple/sftp.c index ab10d518..9ce21c62 100644 --- a/example/simple/sftp.c +++ b/example/simple/sftp.c @@ -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. * @@ -12,16 +12,24 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif - - +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_SYS_TIME_H +# include +#endif #include #include diff --git a/example/simple/sftp_RW_nonblock.c b/example/simple/sftp_RW_nonblock.c index 77512c62..82d4ef2f 100644 --- a/example/simple/sftp_RW_nonblock.c +++ b/example/simple/sftp_RW_nonblock.c @@ -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. * @@ -12,13 +12,24 @@ #include #include -#ifndef WIN32 -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_SYS_TIME_H +# include +#endif #include #include diff --git a/example/simple/sftp_mkdir.c b/example/simple/sftp_mkdir.c index bb962be0..4c14bed0 100644 --- a/example/simple/sftp_mkdir.c +++ b/example/simple/sftp_mkdir.c @@ -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 * @@ -12,16 +12,21 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif - - +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif #include #include diff --git a/example/simple/sftp_mkdir_nonblock.c b/example/simple/sftp_mkdir_nonblock.c index 58102b7e..ee2d3fed 100644 --- a/example/simple/sftp_mkdir_nonblock.c +++ b/example/simple/sftp_mkdir_nonblock.c @@ -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. * @@ -12,16 +12,21 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif - - +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif #include #include diff --git a/example/simple/sftp_nonblock.c b/example/simple/sftp_nonblock.c index b8bf7819..e40b675c 100644 --- a/example/simple/sftp_nonblock.c +++ b/example/simple/sftp_nonblock.c @@ -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. * @@ -12,16 +12,24 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif - - +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif +#ifdef HAVE_SYS_TIME_H +# include +#endif #include #include diff --git a/example/simple/sftp_write.c b/example/simple/sftp_write.c index e8c16b89..a9e20b18 100644 --- a/example/simple/sftp_write.c +++ b/example/simple/sftp_write.c @@ -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. * @@ -12,16 +12,21 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif - - +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif #include #include diff --git a/example/simple/sftp_write_nonblock.c b/example/simple/sftp_write_nonblock.c index 6a10600e..3368c18f 100644 --- a/example/simple/sftp_write_nonblock.c +++ b/example/simple/sftp_write_nonblock.c @@ -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. * @@ -12,16 +12,21 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif - - +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif #include #include diff --git a/example/simple/sftpdir.c b/example/simple/sftpdir.c index bcfe6b79..b1dd9490 100644 --- a/example/simple/sftpdir.c +++ b/example/simple/sftpdir.c @@ -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. * @@ -12,14 +12,21 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif #include #include diff --git a/example/simple/sftpdir_nonblock.c b/example/simple/sftpdir_nonblock.c index 334a0843..761f8625 100644 --- a/example/simple/sftpdir_nonblock.c +++ b/example/simple/sftpdir_nonblock.c @@ -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. * @@ -12,14 +12,21 @@ #include #include -#ifndef WIN32 -# include -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +# include +#endif #include #include diff --git a/example/simple/ssh2.c b/example/simple/ssh2.c index 4a3fab3e..0b262157 100644 --- a/example/simple/ssh2.c +++ b/example/simple/ssh2.c @@ -1,12 +1,17 @@ #include "libssh2.h" -#ifndef WIN32 -# include -# include -# include -#else +#ifdef HAVE_WINSOCK2_H # include #endif +#ifdef HAVE_NETINET_IN_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +# ifdef HAVE_UNISTD_H +#include +#endif #include #include diff --git a/win32/libssh2_config.h b/win32/libssh2_config.h index 512644c7..0fb867b8 100644 --- a/win32/libssh2_config.h +++ b/win32/libssh2_config.h @@ -15,6 +15,7 @@ #define HAVE_SYS_TIME_H #endif +#define HAVE_WINSOCK2_H #define HAVE_IOCTLSOCKET /* same as WSABUF */