diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-03-18 13:22:31 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-03-18 13:22:31 -0400 |
commit | cd86d4410bcff417de15a0fc5eb905ef56c26596 (patch) | |
tree | 54b97075dc41737757b0c5d918c8fc5a0d694614 /libgps.xml | |
parent | c00be23fbd4cf2aa23d85abc5ec68d31342c010d (diff) | |
download | gpsd-cd86d4410bcff417de15a0fc5eb905ef56c26596.tar.gz |
In the client API, take the data buffer out of the gpsdata_t structure.
tz has shown me that we had a point of brittleness where the size
of the client's data buffer was exposed in gps_data_t. Solution:
move it (and the data-waiting count) to the client's private-data
member. Requires a new but trivial client-library entry point to get
the buffer pointer when a client needs it.
Had to be done before API Version 5 froze, or we'd have been stuck breaking
a shipped API again.
No implications for the daemon or other tools, as this buffer is never
used there. (Except it gets rid of several K of never-used static
buffer space in the daemon, which is a good thing.)
All regression tests pass. Code splints clean. cgps (the only place
the API fix matters in our code) live-tests correctly.
Diffstat (limited to 'libgps.xml')
-rw-r--r-- | libgps.xml | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -47,6 +47,10 @@ C: <paramdef>int <parameter>timeout</parameter></paramdef> </funcprototype> <funcprototype> +<funcdef>void <function>gps_data</function></funcdef> + <paramdef>struct gps_data_t *<parameter>gpsdata</parameter></paramdef> +</funcprototype> +<funcprototype> <funcdef>void <function>gps_close</function></funcdef> <paramdef>struct gps_data_t *<parameter>gpsdata</parameter></paramdef> </funcprototype> @@ -140,6 +144,10 @@ will not supply input often enough to prevent a spurious error indication. For the typical 1-second cycle time of GPSes this implies a minimum 2-second timeout.</para> +<para><function>gps_data()</function> returns the contents of the +client data buffer. Use with care; this may fail to be a NUL-terminated +string if WATCH_RAW is enabled.</para> + <para><function>gps_stream()</function> asks <application>gpsd</application> to stream the reports it has at you, to be made available when you poll. It is preferable to the |