diff options
author | Chris Kuethe <chris.kuethe@gmail.com> | 2008-08-03 16:42:57 +0000 |
---|---|---|
committer | Chris Kuethe <chris.kuethe@gmail.com> | 2008-08-03 16:42:57 +0000 |
commit | f5e46a580df6fbf49f804d9b32c61abdfe4cf898 (patch) | |
tree | fd30dcc21493a7ddb14b648303167381308f6cd7 | |
parent | 3ca39fe6c88d372412a6f1812568c42f4abe3ff9 (diff) | |
download | gpsd-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.h | 8 | ||||
-rw-r--r-- | TachometerP.h | 8 | ||||
-rw-r--r-- | bits.h | 9 | ||||
-rw-r--r-- | bsd-base64.h | 2 | ||||
-rw-r--r-- | crc24q.c | 1 | ||||
-rw-r--r-- | crc24q.h | 5 | ||||
-rw-r--r-- | display.h | 4 | ||||
-rw-r--r-- | gps.h | 9 | ||||
-rw-r--r-- | gpsd.h-head | 8 | ||||
-rw-r--r-- | gpsd.h-tail | 3 | ||||
-rw-r--r-- | gpsd_dbus.h | 10 | ||||
-rw-r--r-- | gpsflash.h | 8 | ||||
-rw-r--r-- | italk.h | 3 | ||||
-rw-r--r-- | libgpsmm.h | 8 | ||||
-rw-r--r-- | rtcm2.h | 4 | ||||
-rw-r--r-- | timebase.h | 5 | ||||
-rw-r--r-- | ubx.h | 3 |
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_ */ @@ -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 */ @@ -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 @@ -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_ */ @@ -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_ */ @@ -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_ */ @@ -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_ */ @@ -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_ */ @@ -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_ @@ -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_ */ @@ -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_ */ @@ -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_ */ |