Permalink
Browse files

more header include cleanups

  • Loading branch information...
1 parent 2142af5 commit 00748f36c57324ccc2cb21ac9af45d15821cf675 @sahlberg committed Apr 14, 2013
Showing with 98 additions and 25 deletions.
  1. +3 −0 aros/aros_compat.h
  2. +8 −0 configure.ac
  3. +13 −3 examples/nfsclient-async.c
  4. +20 −4 examples/nfsclient-bcast.c
  5. +7 −2 examples/nfsclient-raw.c
  6. +8 −2 examples/nfsclient-sync.c
  7. +7 −1 lib/init.c
  8. +10 −4 lib/libnfs-sync.c
  9. +8 −1 lib/libnfs.c
  10. +14 −8 lib/socket.c
View
@@ -1,6 +1,9 @@
#ifndef AROS_COMPAT_H
#define AROS_COMPAT_H
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/ioctl.h>
#include <netinet/in.h>
#include <sys/mount.h>
#include <proto/socket.h>
View
@@ -85,6 +85,14 @@ esac
dnl Check for poll.h
AC_CHECK_HEADERS([poll.h])
+# check for unistd.h
+dnl Check for unistd.h
+AC_CHECK_HEADERS([unistd.h])
+
+# check for sys/ioctl.h
+dnl Check for sys/ioctl.h
+AC_CHECK_HEADERS([sys/ioctl.h])
+
# check for SA_LEN
dnl Check if sockaddr data structure includes a "sa_len"
AC_CHECK_MEMBER([struct sockaddr.sa_len],
View
@@ -17,14 +17,24 @@
/* Example program using the highlevel async interface.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#else
#include <sys/stat.h>
-#include <fcntl.h>
-#include <poll.h>
#endif
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#define SERVER "10.1.1.27"
#define EXPORT "/VIRTUAL"
#define NFSFILE "/BOOKS/Classics/Dracula.djvu"
@@ -34,7 +44,7 @@
#include <stdlib.h>
#include <stdint.h>
#include <sys/types.h>
-#include <unistd.h>
+#include <fcntl.h>
#include "libnfs-zdr.h"
#include "libnfs.h"
#include "libnfs-raw.h"
View
@@ -17,19 +17,35 @@
/* Example program using the lowlevel raw broadcast interface.
*/
-
+#ifdef HAVE_CONFIG_H
#include "config.h"
-#include <stdio.h>
+#endif
+
+#ifdef WIN32
+#include "win32_compat.h"
+#endif
+
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
+
+#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <poll.h>
#include <errno.h>
#include <sys/socket.h>
-#include <sys/ioctl.h>
#include <sys/time.h>
#include <net/if.h>
#include <netdb.h>
+
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+
#include "libnfs-zdr.h"
#include "libnfs.h"
#include "libnfs-raw.h"
View
@@ -18,15 +18,20 @@
/* Example program using the lowlevel raw interface.
* This allow accurate control of the exact commands that are being used.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#ifdef WIN32
#include "win32_compat.h"
-#else
-#include <poll.h>
#endif
#define SERVER "10.1.1.27"
#define EXPORT "/shared"
+#ifdef HAVE_POLL_H
+#include <poll.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
View
@@ -20,20 +20,26 @@
/* Example program using the highlevel sync interface
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#pragma comment(lib, "ws2_32.lib")
WSADATA wsaData;
#else
#include <string.h>
-#include <fcntl.h>
#include <sys/stat.h>
-#include <unistd.h>
#ifndef AROS
#include <sys/statvfs.h>
#endif
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#ifdef AROS
#include "aros_compat.h"
#endif
View
@@ -11,15 +11,21 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#ifdef WIN32
#include "win32_compat.h"
#else
-#include <unistd.h>
#include <strings.h>
#endif/*WIN32*/
#define _GNU_SOURCE
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
View
@@ -17,12 +17,14 @@
/*
* High level api to nfs filesystems
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#else
#include <strings.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
#include <netdb.h>
#include <sys/socket.h>
#include <net/if.h>
@@ -40,14 +42,18 @@
#endif /*AROS*/
#endif /*WIN32*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
#endif
#ifdef HAVE_POLL_H
#include <poll.h>
#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
View
@@ -17,13 +17,20 @@
/*
* High level api to nfs filesystems
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#else
#include <strings.h>
#include <utime.h>
-#include <unistd.h>
#ifdef AROS
#include "aros_compat.h"
View
@@ -14,26 +14,32 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef AROS
+#include "aros_compat.h"
+#endif
+
#ifdef WIN32
#include "win32_compat.h"
#else
-#include <unistd.h>
#include <arpa/inet.h>
-#include <sys/ioctl.h>
#include <sys/socket.h>
#include <netdb.h>
#endif/*WIN32*/
-#ifdef HAVE_CONFIG_H
-#include "config.h"
+#ifdef HAVE_POLL_H
+#include <poll.h>
#endif
-#ifdef AROS
-#include "aros_compat.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
#endif
-#ifdef HAVE_POLL_H
-#include <poll.h>
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
#endif
#include <stdio.h>

0 comments on commit 00748f3

Please sign in to comment.