diff --git a/configure.in b/configure.in index 80a6217..2833779 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 784c67b..08cc950 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 d4a20b8..f319f4a 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 ab10d51..9ce21c6 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 77512c6..82d4ef2 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 bb962be..4c14bed 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 58102b7..ee2d3fe 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 b8bf781..e40b675 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 e8c16b8..a9e20b1 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 6a10600..3368c18 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 bcfe6b7..b1dd949 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 334a084..761f862 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 4a3fab3..0b26215 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 512644c..0fb867b 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 */