more header include cleanups
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 14 Apr 2013 17:11:48 +0000 (10:11 -0700)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Sun, 14 Apr 2013 17:11:48 +0000 (10:11 -0700)
aros/aros_compat.h
configure.ac
examples/nfsclient-async.c
examples/nfsclient-bcast.c
examples/nfsclient-raw.c
examples/nfsclient-sync.c
lib/init.c
lib/libnfs-sync.c
lib/libnfs.c
lib/socket.c

index 528fdf78dcaf5ccb6dddf3a086a7a47126637319..e882967a6ee2e2ad14ab4ef867aab44e2d56a268 100644 (file)
@@ -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>
index 7578ef5d412ccd4653dac3d0408ea3bb4a3bf1d5..70e451b0c8fc4f63c5578b036a73623d05a20622 100644 (file)
@@ -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],
index d3869593762f5dae89c136e74386d9d05b839368..d2b92e3297e6221f0d485b4a8e7ea60a6c371f2b 100644 (file)
 
 /* 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"
index e73cfaff98d92fdb2d257f8e2ed4aa904385e886..9f7076b0b3d34517990bbea6ba42305b1bb81b9b 100644 (file)
 
 /* 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"
index 2e55d5382ffb35335a4db95a3e4e19d27b3ca895..2d5104f26c028f236f04fc417229de865b0b4ae5 100644 (file)
 /* 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>
index 4bd2c0b942714b26d4c72ee8305842ecdec1b5f2..70bd77a1757c18dca5cd536871afc7a8380f1bf5 100644 (file)
 
 /* 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
index e1d4980913f62a0dcc2129f1b792266a98fb27fb..6085b6892bb9cc068f8611aa90113a5ec1b5f910 100644 (file)
    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>
index fe711ac5f58ccce6656c93356242a869f5adeb9a..f2c9ebf481387dd8cdd2c39dde00347f58dae8c2 100644 (file)
 /*
  * 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>
 #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>
index d7b5075f0a71fc1710168a37f6a79657f776fe5d..c3df1df813dd8fa13e42c41cec90b2c14d8e3535 100644 (file)
 /*
  * 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"
index 384ba132b53d2465d147c249e4467dc904e6ba36..b14231e84129f2d67980a93177e4a415a2023b03 100644 (file)
    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>