diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 11:51:15 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-03-07 11:51:15 -0500 |
commit | df34a3add8df382eb852a67635c6859ee8cc657f (patch) | |
tree | c52183ba41403d093ad1ac971fa45c4ba1289f0c /doc | |
parent | 9c49083f2afe799343a610912b0ed404b2ffad05 (diff) | |
download | gpsd-df34a3add8df382eb852a67635c6859ee8cc657f.tar.gz |
gpsd-report() -> gpsd_log()
This change is done so we can add a "log" hook to the pps_thread_t
structure (this is not done yet) and harmonize with the name of the
outer logging function. If that name had been left as gpsd_report()
there would have been scope for bad confusion with the report_hook
member.
Also, remove two stray duplicative printf calls from the NMEA2000 driver
(drivers shouldn't have printfs!) and fix one typo.
This is a step towards factoring out ntplib. For that to happen, the
PPS thread code needs to be decoupled from the core session structure.
No logic changes. Object compatibility preserved. All regression tests pass.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/explan_gpsd.c.xml | 23 | ||||
-rw-r--r-- | doc/explan_gpsd_report.c.xml | 11 | ||||
-rw-r--r-- | doc/explan_libgpsd_core.c.xml | 25 | ||||
-rw-r--r-- | doc/internals.xml | 4 |
4 files changed, 32 insertions, 31 deletions
diff --git a/doc/explan_gpsd.c.xml b/doc/explan_gpsd.c.xml index 024b4f1f..05c08fc3 100644 --- a/doc/explan_gpsd.c.xml +++ b/doc/explan_gpsd.c.xml @@ -47,29 +47,6 @@ 0.</para></entry> </row> <row> - <entry><function>void gpsd_report(int errlevel, const char *fmt, ... )</function></entry> - <entry><para>This code is used for error reporting, but is dependant - on SQUELCH_DISABLE so that embedded systems (for example) are not - burdened with unnecessary noise. The first thing to check is if the - error level offered is high enough to be of interest (controlled by - the debug level we are running at).</para><para>If we are - interested, the first step is to protect the code with a mutex if we - are using the 1PPS input.</para><para>Now we build a message buffer - which has a fixed header (<quote>gpsd: </quote>) and the incoming - data. The output buffer is prepared (load the start with a NULL) and - then the input buffer is scanned, byte-by-byte, up to its - terminating NULL. The scanned data is transferred on the fly to the - output buffer subject to the following tests:-</para><para>If the - character is printable, it passes through unchanged.</para><para>If - it is a space and either of the next two bytes is NULL it will also - pass through unchanged.</para><para>In any other case, it is copied - across as a hexadecimal string like - <quote>x09</quote>.</para><para>The completed output buffer is then - either sent to the system logger if we are in background mode - (daemon) or to the stderr file if we are in foreground - mode.</para></entry> -</row> -<row> <entry><function>static void usage(void)</function></entry> <entry><para>Simply print a big list of the invocation parameters to the default <application>gpsd</application> port (2947, allocated by diff --git a/doc/explan_gpsd_report.c.xml b/doc/explan_gpsd_report.c.xml index c9047dc4..b8f94b12 100644 --- a/doc/explan_gpsd_report.c.xml +++ b/doc/explan_gpsd_report.c.xml @@ -1,4 +1,4 @@ -<sect1 id="gpsd_report.c"><title><filename>report.c</filename></title> +<sect1 id="gpsd_log.c"><title><filename>libgpsd_core.c</filename></title> <informaltable frame='all' pgwide='1'> <tgroup cols='2'> <colspec colname='c1'></colspec> @@ -13,15 +13,16 @@ <tfoot> <row> - <entry spanname='s1' align='left'>Notes based on code as of Mon Apr 5 21:38:06 2010 -0400</entry> + <entry spanname='s1' align='left'>Notes based on code as of Sat Mar 7 10:11:55 EST 2015</entry> </row> </tfoot> <tbody> <row> - <entry><function>void gpsd_report(int errlevel UNUSED, const char *fmt, ... )</function></entry> - <entry><para>Provides the outputting of strings to stderr for anyone - who needs it. Used extensively by many functions to report errors or + <entry><function>void gpsd_log(struct gpsd_errout_t, int errlevel, const char *fmt, ... )</function></entry> + <entry><para>Provides the outputting of strings to stderr or through a + specified hook function in the errout structure for anyone + who needs it. Used extensively by many functions to log errors or progress. Responds according to the <function>errlevel</function> argument, which is filled by the DEBUG command line argument, so that the verbosity of output is conditional on the user's wishes at diff --git a/doc/explan_libgpsd_core.c.xml b/doc/explan_libgpsd_core.c.xml index 2daa7f12..22ad92b3 100644 --- a/doc/explan_libgpsd_core.c.xml +++ b/doc/explan_libgpsd_core.c.xml @@ -15,12 +15,35 @@ <tfoot> <row> - <entry spanname='s1' align='left'>Notes based on code as of Mon Apr 5 21:38:06 2010 -0400.</entry> + <entry spanname='s1' align='left'>Notes based mostly on code as of Mon Apr 5 21:38:06 2010 -040.</entry> </row> </tfoot> <tbody> <row> + <entry><function>void gpsd_log(const struct errout_t, int errlevel, const char *fmt, ... )</function></entry> + <entry><para>This code is used for error reporting, but is dependant + on SQUELCH_DISABLE so that embedded systems (for example) are not + burdened with unnecessary noise. The first thing to check is if the + error level offered is high enough to be of interest (controlled by + the debug level we are running at).</para><para>If we are + interested, the first step is to protect the code with a mutex if we + are using the 1PPS input.</para><para>Now we build a message buffer + which has a fixed header (<quote>gpsd: </quote>) and the incoming + data. The output buffer is prepared (load the start with a NULL) and + then the input buffer is scanned, byte-by-byte, up to its + terminating NULL. The scanned data is transferred on the fly to the + output buffer subject to the following tests:-</para><para>If the + character is printable, it passes through unchanged.</para><para>If + it is a space and either of the next two bytes is NULL it will also + pass through unchanged.</para><para>In any other case, it is copied + across as a hexadecimal string like + <quote>x09</quote>.</para><para>The completed output buffer is then + either sent to the system logger if we are in background mode + (daemon) or to the stderr file if we are in foreground + mode.</para></entry> +</row> +<row> <entry><function>int gpsd_switch_driver(struct gps_device_t *session, char* typename)</function></entry> <entry><para>Test if the function is called with the same name as the active driver.</para><para>If it is, test if the driver has a diff --git a/doc/internals.xml b/doc/internals.xml index b209387c..dd5a5ff6 100644 --- a/doc/internals.xml +++ b/doc/internals.xml @@ -12,7 +12,7 @@ <!ENTITY gps.h SYSTEM "explan_gps.h.xml"> <!ENTITY gpsd.c SYSTEM "explan_gpsd.c.xml"> <!ENTITY gpsd.h SYSTEM "explan_gpsd.h.xml"> -<!ENTITY gpsd_report.c SYSTEM "explan_gpsd_report.c.xml"> +<!ENTITY gpsd_log.c SYSTEM "explan_gpsd_log.c.xml"> <!ENTITY gpsdclient.c SYSTEM "explan_gpsdclient.c.xml"> <!ENTITY gpsutils.c SYSTEM "explan_gpsutils.c.xml"> <!ENTITY isgps.c SYSTEM "explan_isgps.c.xml"> @@ -93,7 +93,7 @@ is not yet documented here.</para> &gps.h; &gpsd.c; &gpsd.h; -&gpsd_report.c; +&gpsd_log.c; &gpsdclient.c; &gpsutils.c; &isgps.c; |