Coverage Report

Created: 2026-12-01 06:12

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gpsd/gpsd-3.28.1~dev/libgps/gps_maskdump.c
Line
Count
Source
1
2
// This code is generated by maskaudit.py.  Do not hand-hack it!
3
4
/*
5
 * Also, beware that it is something of a CPU hog when called on every packet.
6
 * Try to write guards so it is only called at higher log levels.
7
 */
8
9
#include "../include/gpsd_config.h"  // must be before all includes
10
11
#include <stdio.h>
12
#include <string.h>
13
14
#include "../include/gpsd.h"
15
16
/* Convert gps_mask_t set to a string representation
17
 *
18
 * Return pointer to static buffer containing the string.
19
 */
20
const char *gps_maskdump(gps_mask_t set)
21
0
{
22
0
    static char buf[383];
23
0
    size_t index;
24
0
    const struct {
25
0
        gps_mask_t mask;
26
0
        const char *name;
27
0
    } names[] = {
28
0
        {AIS_SET, "AIS"},
29
0
        {ALTITUDE_SET, "ALTITUDE"},
30
0
        {ATTITUDE_SET, "ATTITUDE"},
31
0
        {CLEAR_IS, "CLEAR"},
32
0
        {CLIMBERR_SET, "CLIMBERR"},
33
0
        {CLIMB_SET, "CLIMB"},
34
0
        {DEVICEID_SET, "DEVICEID"},
35
0
        {DEVICELIST_SET, "DEVICELIST"},
36
0
        {DEVICE_SET, "DEVICE"},
37
0
        {DOP_SET, "DOP"},
38
0
        {DRIVER_IS, "DRIVER"},
39
0
        {ECEF_SET, "ECEF"},
40
0
        {EOF_IS, "EOF"},
41
0
        {EOF_SET, "EOF"},
42
0
        {ERROR_SET, "ERROR"},
43
0
        {GOODTIME_IS, "GOODTIME"},
44
0
        {GST_SET, "GST"},
45
0
        {HERR_SET, "HERR"},
46
0
        {IMU_SET, "IMU"},
47
0
        {LATLON_SET, "LATLON"},
48
0
        {LOGMESSAGE_SET, "LOGMESSAGE"},
49
0
        {LOG_SET, "LOG"},
50
0
        {MAGNETIC_TRACK_SET, "MAGNETIC_TRACK"},
51
0
        {MODE_SET, "MODE"},
52
0
        {NAVDATA_SET, "NAVDATA"},
53
0
        {NED_SET, "NED"},
54
0
        {NODATA_IS, "NODATA"},
55
0
        {NTPTIME_IS, "NTPTIME"},
56
0
        {ONLINE_SET, "ONLINE"},
57
0
        {OSCILLATOR_SET, "OSCILLATOR"},
58
0
        {PACKET_SET, "PACKET"},
59
0
        {PASSTHROUGH_IS, "PASSTHROUGH"},
60
0
        {PERR_IS, "PERR"},
61
0
        {POLICY_SET, "POLICY"},
62
0
        {PPS_SET, "PPS"},
63
0
        {RAW_IS, "RAW"},
64
0
        {RAW_SET, "RAW"},
65
0
        {REPORT_IS, "REPORT"},
66
0
        {RTCM2_SET, "RTCM2"},
67
0
        {RTCM3_SET, "RTCM3"},
68
0
        {SATELLITE_SET, "SATELLITE"},
69
0
        {SPARTN_SET, "SPARTN"},
70
0
        {SPEEDERR_SET, "SPEEDERR"},
71
0
        {SPEED_SET, "SPEED"},
72
0
        {STATUS_SET, "STATUS"},
73
0
        {SUBFRAME_SET, "SUBFRAME"},
74
0
        {TIMERR_SET, "TIMERR"},
75
0
        {TIME_SET, "TIME"},
76
0
        {TOFF_SET, "TOFF"},
77
0
        {TRACKERR_SET, "TRACKERR"},
78
0
        {TRACK_SET, "TRACK"},
79
0
        {USED_IS, "USED"},
80
0
        {VECEF_SET, "VECEF"},
81
0
        {VERR_SET, "VERR"},
82
0
        {VERSION_SET, "VERSION"},
83
0
        {VNED_SET, "VNED"},
84
0
    };
85
86
0
    buf[0] = '{';
87
0
    buf[1] = '\0';
88
0
    for (index = 0; index < ROWS(names); index++) {
89
0
        if ((gps_mask_t)0 != (set & names[index].mask)) {
90
0
            if ('\0' != buf[1]) {
91
0
                (void)strlcat(buf, "|", sizeof(buf));
92
0
            }
93
0
            (void)strlcat(buf, names[index].name, sizeof(buf));
94
0
        }
95
0
    }
96
0
    (void)strlcat(buf, "}", sizeof(buf));
97
0
    return buf;
98
0
}
99