summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Kuethe <chris.kuethe@gmail.com>2008-08-03 16:42:57 +0000
committerChris Kuethe <chris.kuethe@gmail.com>2008-08-03 16:42:57 +0000
commitf5e46a580df6fbf49f804d9b32c61abdfe4cf898 (patch)
treefd30dcc21493a7ddb14b648303167381308f6cd7
parent3ca39fe6c88d372412a6f1812568c42f4abe3ff9 (diff)
downloadgpsd-f5e46a580df6fbf49f804d9b32c61abdfe4cf898.tar.gz
Unify the header protection macro style a bit.
Headers likely to be private to gpsd are prefixed with _GPSD_, reusable ones like crc24q.h don't get the _GPSD_ prefix. Protection macro goes right up near the top of the file, right after the SVN id, and it's closure is the last line of the file.
-rw-r--r--Tachometer.h8
-rw-r--r--TachometerP.h8
-rw-r--r--bits.h9
-rw-r--r--bsd-base64.h2
-rw-r--r--crc24q.c1
-rw-r--r--crc24q.h5
-rw-r--r--display.h4
-rw-r--r--gps.h9
-rw-r--r--gpsd.h-head8
-rw-r--r--gpsd.h-tail3
-rw-r--r--gpsd_dbus.h10
-rw-r--r--gpsflash.h8
-rw-r--r--italk.h3
-rw-r--r--libgpsmm.h8
-rw-r--r--rtcm2.h4
-rw-r--r--timebase.h5
-rw-r--r--ubx.h3
17 files changed, 61 insertions, 37 deletions
diff --git a/Tachometer.h b/Tachometer.h
index 0783c047..dc77dd83 100644
--- a/Tachometer.h
+++ b/Tachometer.h
@@ -1,8 +1,8 @@
/* $Id$ */
-/* Tachometer.h -- tachometer widget interface */
-#ifndef _Tachometer_h
-#define _Tachometer_h
+#ifndef _GPSD_TACHOMETER_H_
+#define _GPSD_TACHOMETER_H_
+/* Tachometer.h -- tachometer widget interface */
#include <X11/Xaw/Simple.h>
/* Resources:
@@ -46,4 +46,4 @@ extern WidgetClass tachometerWidgetClass;
typedef struct _TachometerClassRec *TachometerWidgetClass;
typedef struct _TachometerRec *TachometerWidget;
-#endif /* _Tachometer_h */
+#endif /* _GPSD_TACHOMETER_H_ */
diff --git a/TachometerP.h b/TachometerP.h
index 5ee209a8..6feb6b83 100644
--- a/TachometerP.h
+++ b/TachometerP.h
@@ -1,8 +1,8 @@
/* $Id$ */
-/* TachometerP.h -- Tachometer widget private data */
-#ifndef _TachometerP_h
-#define _TachometerP_h
+#ifndef _GPSD_TACHOMETERP_H_
+#define _GPSD_TACHOMETERP_H_
+/* TachometerP.h -- Tachometer widget private data */
#include <Tachometer.h>
#include <X11/Xaw/SimpleP.h>
@@ -38,4 +38,4 @@ typedef struct _TachometerRec {
TachometerPart tachometer;
} TachometerRec;
-#endif /* _TachometerP_h */
+#endif /* _GPSD_TACHOMETERP_H_ */
diff --git a/bits.h b/bits.h
index 07e2d0d3..7d4c4db1 100644
--- a/bits.h
+++ b/bits.h
@@ -1,4 +1,7 @@
/* $Id$ */
+#ifndef _GPSD_BITS_H_
+#define _GPSD_BITS_H_
+
/*
* bits.h - extract binary data from message buffer
*
@@ -16,10 +19,9 @@
* The use of fixed-length types in the casts enforces these.
* Both 32- and 64-bit systems with gcc are OK with this set.
*/
+
#include <stdint.h>
-#ifndef BITS_H
-#define BITS_H
union int_float {
int32_t i;
float f;
@@ -29,7 +31,6 @@ union long_double {
int64_t l;
double d;
};
-#endif /* BITS_H */
#ifndef GET_ORIGIN
#define GET_ORIGIN 0
@@ -85,3 +86,5 @@ union long_double {
/* bitfield extraction */
extern unsigned long long ubits(char buf[], unsigned int, unsigned int);
extern signed long long sbits(char buf[], unsigned int, unsigned int);
+
+#endif /* _GPSD_BITS_H_ */
diff --git a/bsd-base64.h b/bsd-base64.h
index a0d8db78..44fc92cc 100644
--- a/bsd-base64.h
+++ b/bsd-base64.h
@@ -12,4 +12,4 @@ int b64_pton(char const *src, u_char *target, size_t targsize);
# define __b64_pton b64_pton
#endif /* HAVE___B64_NTOP */
-#endif /* _BSD_BINRESVPORT_H */
+#endif /* _BSD_BASE64_H */
diff --git a/crc24q.c b/crc24q.c
index 005fd2b6..8b2e99e0 100644
--- a/crc24q.c
+++ b/crc24q.c
@@ -1,3 +1,4 @@
+/* $Id$ */
/*
* This is an implementation of the CRC-24Q cyclic redundancy checksum
* used by Qualcomm, RTCM104V3, and PGP 6.5.1. According to the RTCM104V3
diff --git a/crc24q.h b/crc24q.h
index 68db03ec..580221f3 100644
--- a/crc24q.h
+++ b/crc24q.h
@@ -1,3 +1,7 @@
+/* $Id$ */
+#ifndef _CRC24Q_H_
+#define _CRC24Q_H_
+
/* Interface for CRC-24Q cyclic redundancy chercksum code */
extern void crc24q_sign(unsigned char *data, int len);
@@ -5,3 +9,4 @@ extern void crc24q_sign(unsigned char *data, int len);
extern bool crc24q_check(unsigned char *data, int len);
extern unsigned crc24q_hash(unsigned char *data, int len);
+#endif /* _CRC24Q_H_ */
diff --git a/display.h b/display.h
index a679bb70..a427ff51 100644
--- a/display.h
+++ b/display.h
@@ -1,4 +1,6 @@
/* $gpsd: display.h 3486 2006-09-21 00:58:22Z ckuethe $ */
+#ifndef _GPSD_DISPLAY_H_
+#define _GPSD_DISPLAY_H_
void register_shell(Widget w);
void register_canvas(Widget w, GC gc);
@@ -6,3 +8,5 @@ void set_title(char *title);
void draw_graphics(struct gps_data_t *gpsdata);
void redraw(Widget w, XtPointer client_data, XtPointer call_data);
void resize(Widget w, XtPointer client_data, XtPointer call_data);
+
+#endif /* _GPSD_DISPLAY_H_ */
diff --git a/gps.h b/gps.h
index 082c1613..be589d3a 100644
--- a/gps.h
+++ b/gps.h
@@ -1,8 +1,8 @@
/* $Id$ */
-/* gps.h -- interface of the libgps library */
+#ifndef _GPSD_GPS_H_
+#define _GPSD_GPS_H_
-#ifndef gps_h
-#define gps_h 1
+/* gps.h -- interface of the libgps library */
#ifdef __cplusplus
extern "C" {
@@ -631,6 +631,5 @@ extern double wgs84_separation(double, double);
} /* End of the 'extern "C"' block */
#endif
-#endif /* gps_h */
/* gps.h ends here */
-
+#endif /* _GPSD_GPS_H_ */
diff --git a/gpsd.h-head b/gpsd.h-head
index dfb2175a..6a712eeb 100644
--- a/gpsd.h-head
+++ b/gpsd.h-head
@@ -1,9 +1,9 @@
+/* gpsd.h -- fundamental types and structures for the gpsd library */
/* This file is generated. Do not hand-hack it! */
-#ifndef _gpsd_h_
-#define _gpsd_h_
-
-/* gpsd.h -- fundamental types and structures for the gpsd library */
+/* $Id$ */
+#ifndef _GPSD_H_
+#define _GPSD_H_
#include <stdbool.h>
#include <stdio.h>
diff --git a/gpsd.h-tail b/gpsd.h-tail
index 7d5876f8..a9a61f4c 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -462,8 +462,7 @@ extern float roundf(float x);
void cfmakeraw(struct termios *);
#endif /* defined(__CYGWIN__) */
-#endif /* _gpsd_h_ */
-
+#endif /* _GPSD_H_ */
// Local variables:
// mode: c
// end:
diff --git a/gpsd_dbus.h b/gpsd_dbus.h
index 8399d2d4..92f64457 100644
--- a/gpsd_dbus.h
+++ b/gpsd_dbus.h
@@ -1,8 +1,8 @@
/* $Id$ */
-#ifdef DBUS_ENABLE
+#ifndef _GPSD_DBUS_H_
+#define _GPSD_DBUS_H_
-#ifndef _gpsd_dbus_h_
-#define _gpsd_dbus_h_
+#ifdef DBUS_ENABLE
#include <dbus/dbus.h>
@@ -11,6 +11,6 @@
int initialize_dbus_connection (void);
void send_dbus_fix (struct gps_device_t* channel);
-#endif /* _gpsd_dbus_h_ */
-
#endif
+
+#endif /* _GPSD_DBUS_H_ */
diff --git a/gpsflash.h b/gpsflash.h
index c8299ddc..b36943f0 100644
--- a/gpsflash.h
+++ b/gpsflash.h
@@ -1,4 +1,7 @@
/* $Id$ */
+#ifndef _GPSD_GPSFLASH_H_
+#define _GPSD_GPSFLASH_H_
+
/*
* Copyright (c) 2005 Chris Kuethe <chris.kuethe@gmail.com>
*
@@ -15,9 +18,6 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifndef _GPSFLASH_H_
-#define _GPSFLASH_H_
-
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
@@ -61,4 +61,4 @@ int srecord_send(int pfd, char *fw, size_t len);
int binary_send(int pfd, char *data, size_t ls);
bool expect(int pfd, const char *str, size_t len, time_t timeout);
-#endif /* _GPSFLASH_H_ */
+#endif /* _GPSD_GPSFLASH_H_ */
diff --git a/italk.h b/italk.h
index bf7e22ae..ec7ee111 100644
--- a/italk.h
+++ b/italk.h
@@ -1,4 +1,6 @@
/* $Id$ */
+#ifndef _GPSD_ITALK_H_
+#define _GPSD_ITALK_H_
/* 0 and 1 are responses to the <?> ping for iTalk and NMEA respectively */
#define PROTO_ITALK 0
@@ -493,3 +495,4 @@
#define SACQ_RESERVE 0x0f36
#define SACQ_SEARCH_CH_NUM_VALID 0x0f96
+#endif /* _GPSD_ITALK_H_ */
diff --git a/libgpsmm.h b/libgpsmm.h
index d6610d98..294e77c9 100644
--- a/libgpsmm.h
+++ b/libgpsmm.h
@@ -1,4 +1,7 @@
/* $Id$ */
+#ifndef _GPSD_GPSMM_H_
+#define _GPSD_GPSMM_H_
+
/*
* Copyright (C) 2005 Alfredo Pironti
*
@@ -6,9 +9,6 @@
* file "COPYING" for more information.
*
*/
-#ifndef _GPSMM_H_
-#define _GPSMM_H_
-
#include <sys/types.h>
#include "gps.h" //the C library we are going to wrap
@@ -31,4 +31,4 @@ class gpsmm {
struct gps_data_t* backup(void) { *to_user=*gps_data; return to_user;}; //return the backup copy
pthread_t *handler; //needed to handle the callback registration/deletion
};
-#endif // _GPSMM_H_
+#endif // _GPSD_GPSMM_H_
diff --git a/rtcm2.h b/rtcm2.h
index 032613de..fe2fdfe4 100644
--- a/rtcm2.h
+++ b/rtcm2.h
@@ -1,4 +1,7 @@
/* $Id$ */
+#ifndef _GPSD_RTCM2_H_
+#define _GPSD_RTCM2_H_
+
/*****************************************************************************
This is a decoder for RTCM-104 2.x, an obscure and complicated serial
@@ -491,3 +494,4 @@ struct rtcm2_msg_t {
#endif /* S_SPLINT_S */
#endif /* BIG ENDIAN */
+#endif /* _GPSD_RTCM2_H_ */
diff --git a/timebase.h b/timebase.h
index 849abd26..ebaa9b17 100644
--- a/timebase.h
+++ b/timebase.h
@@ -1,6 +1,8 @@
/* $Id$ */
-/* timebase.h -- constants that will require patching over time */
+#ifndef _GPSD_TIMEBASE_H_
+#define _GPSD_TIMEBASE_H_
+/* timebase.h -- constants that will require patching over time */
/*
* The current (fixed) leap-second correction, and the future Unix
* time after which to start hunting leap-second corrections from GPS
@@ -31,3 +33,4 @@
#define CENTURY_BASE 2000
/* timebase.h ends here */
+#endif /* _GPSD_TIMEBASE_H_ */
diff --git a/ubx.h b/ubx.h
index abfdd38d..e5102967 100644
--- a/ubx.h
+++ b/ubx.h
@@ -1,4 +1,6 @@
/* $Id$ */
+#ifndef _GPSD_UBX_H_
+#define _GPSD_UBX_H_
#define UBX_MESSAGE_BASE_SIZE 6
#define UBX_MESSAGE_DATA_OFFSET UBX_MESSAGE_BASE_SIZE
@@ -96,3 +98,4 @@ typedef enum {
#define UBX_SOL_VALID_WEEK 0x04
#define UBX_SOL_VALID_TIME 0x08
+#endif /* _GPSD_UBX_H_ */