summaryrefslogtreecommitdiff
path: root/bits.h
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-11-30 07:29:25 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-11-30 07:29:25 +0000
commit2f6775a8769ed7a2250bb90a68c5fa2617123604 (patch)
treeb0a90a20de3049daf781390419172d628bb83fc0 /bits.h
parent1c2b3463912566fa8a5841385a56ed1d966138db (diff)
downloadgpsd-2f6775a8769ed7a2250bb90a68c5fa2617123604.tar.gz
Split the packet-sniffer internals out of the session structure.
This is a big, super-intrusive patch but changes no logic at all -- it's all about ripping out some of the gps_device_t structure members into a new gps_packet_t structure. Even the driver API doesn't change at all, this is all libgpsd(3) internals being rearranged. The motivation here is that we want to kill off the ad-hoc Python implementation of a packet-sniffer in gpsfake. To do that we need to be able to write a "pure" packet sniffer that uses the same C code as the daemon's but without being welded to the rest of the libgpsd(3) code. This is the first step towards that.
Diffstat (limited to 'bits.h')
-rw-r--r--bits.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/bits.h b/bits.h
index 9e642b2a..8bdae448 100644
--- a/bits.h
+++ b/bits.h
@@ -75,11 +75,11 @@ union long_double {
/* Zodiac protocol description uses 1-origin indexing by little-endian word */
-#define getword(n) ( (session->outbuffer[2*(n)-2]) \
- | (session->outbuffer[2*(n)-1] << 8))
-#define getlong(n) ( (session->outbuffer[2*(n)-2]) \
- | (session->outbuffer[2*(n)-1] << 8) \
- | (session->outbuffer[2*(n)+0] << 16) \
- | (session->outbuffer[2*(n)+1] << 24))
+#define getword(n) ( (session->packet.outbuffer[2*(n)-2]) \
+ | (session->packet.outbuffer[2*(n)-1] << 8))
+#define getlong(n) ( (session->packet.outbuffer[2*(n)-2]) \
+ | (session->packet.outbuffer[2*(n)-1] << 8) \
+ | (session->packet.outbuffer[2*(n)+0] << 16) \
+ | (session->packet.outbuffer[2*(n)+1] << 24))
#define getstring(t, s, e) \
- (void)memcpy(t, session->outbuffer+2*(s)-2, 2*((e)-(s)+1))
+ (void)memcpy(t, session->packet.outbuffer+2*(s)-2, 2*((e)-(s)+1))