summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-12-14 08:09:49 -0500
committerEric S. Raymond <esr@thyrsus.com>2010-12-14 08:09:49 -0500
commit1e0126fcbf956b5893dabcac2c7c3f5002ce910c (patch)
treebfbf7b365af98444431d391a464a5ecb5bf5e87f
parenteead1c2ac4df683dd43c8b6e0a1c766a00f7c702 (diff)
downloadgpsd-1e0126fcbf956b5893dabcac2c7c3f5002ce910c.tar.gz
More header simplification. All regression tests pass.
-rw-r--r--cgps.c1
-rw-r--r--gpsd.c19
-rw-r--r--gpspipe.c13
-rw-r--r--libgps_core.c6
-rw-r--r--libgpsd_core.c17
-rw-r--r--net_gnss_dispatch.c5
-rw-r--r--sockaddr.h20
7 files changed, 40 insertions, 41 deletions
diff --git a/cgps.c b/cgps.c
index db294d6f..b097fcc8 100644
--- a/cgps.c
+++ b/cgps.c
@@ -82,7 +82,6 @@
#include <sys/stat.h>
#include <sys/time.h> /* for select() */
#ifndef S_SPLINT_S
-#include <sys/socket.h>
#include <unistd.h>
#endif /* S_SPLINT_S */
#include <stdlib.h>
diff --git a/gpsd.c b/gpsd.c
index 2bf7fa0b..b7c0447b 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -25,25 +25,6 @@
#endif /* S_SPLINT_S */
#include "gpsd_config.h"
-#ifndef S_SPLINT_S
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#else
-#define AF_UNSPEC 0
-#endif /* HAVE_SYS_SOCKET_H */
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif /* HAVE_SYS_UN_H */
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif /* HAVE_NETINET_IN_H */
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif /* HAVE_ARPA_INET_H */
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif /* HAVE_NETDB_H */
-#endif /* S_SPLINT_S */
#if defined (HAVE_PATH_H)
#include <paths.h>
diff --git a/gpspipe.c b/gpspipe.c
index fdf7ee7b..8df4a85d 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -26,20 +26,15 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
-#include "gpsd_config.h"
-#ifndef S_SPLINT_S
-#if HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif /* HAVE_SYS_SOCKET_H */
-#include <unistd.h>
-#endif /* S_SPLINT_S */
#include <errno.h>
#include <string.h>
#include <fcntl.h>
-#if HAVE_TERMIOS
#include <termios.h>
-#endif /* HAVE_TERMIOS */
#include <assert.h>
+#ifndef S_SPLINT_S
+#include <unistd.h>
+#endif /* S_SPLINT_S */
+
#include "gpsd.h"
#include "gpsdclient.h"
#include "revision.h"
diff --git a/libgps_core.c b/libgps_core.c
index 306cfbdc..9d96ec14 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -3,9 +3,6 @@
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
-#ifndef S_SPLINT_S
-#include <unistd.h>
-#endif /* S_SPLINT_S */
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
@@ -15,6 +12,9 @@
#include <locale.h>
#include <assert.h>
#include <sys/time.h> /* expected to have a select(2) prototype a la SuS */
+#ifndef S_SPLINT_S
+#include <unistd.h>
+#endif /* S_SPLINT_S */
#include "gpsd.h"
#include "gps_json.h"
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 9997de09..f3240760 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -3,9 +3,18 @@
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
*/
+#include <sys/time.h>
#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#include <errno.h>
+#include <fcntl.h>
+#ifndef S_SPLINT_S
+#include <unistd.h>
+#endif /* S_SPLINT_S */
+
#include "gpsd_config.h"
-#include <sys/time.h>
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif /* HAVE_SYS_IOCTL_H */
@@ -15,18 +24,12 @@
#else
#define AF_UNSPEC 0
#endif /* HAVE_SYS_SOCKET_H */
-#include <unistd.h>
#endif /* S_SPLINT_S */
-#include <stdio.h>
-#include <math.h>
#ifndef S_SPLINT_S
#ifdef HAVE_NETDB_H
#include <netdb.h>
#endif /* HAVE_NETDB_H */
#endif /* S_SPLINT_S */
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
#include "gpsd.h"
diff --git a/net_gnss_dispatch.c b/net_gnss_dispatch.c
index 96009aeb..1d3f2dab 100644
--- a/net_gnss_dispatch.c
+++ b/net_gnss_dispatch.c
@@ -5,6 +5,9 @@
*/
#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
#include "gpsd_config.h"
#ifndef S_SPLINT_S
#ifdef HAVE_SYS_SOCKET_H
@@ -12,8 +15,6 @@
#endif
#include <unistd.h>
#endif /* S_SPLINT_S */
-#include <string.h>
-#include <errno.h>
#include "gpsd.h"
diff --git a/sockaddr.h b/sockaddr.h
index 61866d09..118fb372 100644
--- a/sockaddr.h
+++ b/sockaddr.h
@@ -1,5 +1,25 @@
/* klugey def'n of a socket address struct helps hide IPV4 vs. IPV6 ugliness */
+#ifndef S_SPLINT_S
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#else
+#define AF_UNSPEC 0
+#endif /* HAVE_SYS_SOCKET_H */
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif /* HAVE_SYS_UN_H */
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif /* HAVE_NETINET_IN_H */
+#ifdef HAVE_ARPA_INET_H
+#include <arpa/inet.h>
+#endif /* HAVE_ARPA_INET_H */
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif /* HAVE_NETDB_H */
+#endif /* S_SPLINT_S */
+
typedef union sockaddr_u {
struct sockaddr sa;
struct sockaddr_in sa_in;