LLVMFuzzerTestOneInput:
   27|  2.83k|{//gpsd/tests//test_json.c
   28|       |
   29|  2.83k|    if (Size < kMinInputLength || Size > kMaxInputLength){
  ------------------
  |  |   21|  5.67k|#define kMinInputLength 10
  ------------------
                  if (Size < kMinInputLength || Size > kMaxInputLength){
  ------------------
  |  |   22|  2.83k|#define kMaxInputLength 5120
  ------------------
  |  Branch (29:9): [True: 6, False: 2.83k]
  |  Branch (29:35): [True: 19, False: 2.81k]
  ------------------
   30|     25|        return 0;
   31|     25|    }
   32|       |
   33|  2.81k|    uint8_t *DataFx;
   34|  2.81k|    size_t SizeFx = Size+1;
   35|  2.81k|    DataFx = (uint8_t *)calloc(SizeFx,sizeof(uint8_t));
   36|       |
   37|  2.81k|    memcpy((void *)DataFx,(void *)Data,Size);
   38|       |
   39|  2.81k|    char AddCB[] ={0x7b}; //{
   40|  2.81k|    memcpy((void *)DataFx,(void *)AddCB,sizeof(AddCB));
   41|       |//calloc already added 0x00 at the end of DataFx.
   42|       |
   43|  2.81k|    int status;
   44|  2.81k|    {
   45|  2.81k|        memset((void *)&gpsdata, 0, sizeof(gpsdata));
   46|  2.81k|        status = libgps_json_unpack((char *)DataFx, &gpsdata, NULL);
   47|  2.81k|    }
   48|  2.81k|    {
   49|  2.81k|        memset((void *)&gpsdata, 0, sizeof(gpsdata));
   50|  2.81k|        status = json_toff_read((char *)DataFx, &gpsdata, NULL);
   51|  2.81k|    }
   52|       |
   53|  2.81k|    free(DataFx);
   54|       |
   55|  2.81k|    return status;
   56|  2.83k|}

libgps_json.c:str_starts_with:
   18|  18.8k|{
   19|  18.8k|    return 0 == strncmp(str, prefix, strlen(prefix));
   20|  18.8k|}

json_ais_read:
   42|    329|{
   43|       |    // collected but not actually used yet
   44|    329|    bool scaled;
   45|       |
   46|    329|#define AIS_HEADER \
   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
   49|    329|        {"device",         t_string,   .addr.string = path, \
   50|    329|                                          .len = pathlen}, \
   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
   53|    329|                                          .dflt.boolean = false}, \
   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
   55|       |
   56|    329|#define AIS_TYPE6 \
   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
   58|    329|                                       .dflt.uinteger = 0},\
   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
   60|    329|                                       .dflt.uinteger = 0},\
   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
   62|    329|                                       .dflt.boolean = false},\
   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
   64|    329|                                       .dflt.uinteger = 0},\
   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
   66|    329|                                       .dflt.uinteger = 0},
   67|    329|#define AIS_TYPE8 \
   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
   69|    329|                                       .dflt.uinteger = 0},\
   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
   71|    329|                                       .dflt.uinteger = 0},
   72|       |
   73|    329|    int status;
   74|       |
   75|    329|#include "ais_json.i"           // JSON parser template structures
  ------------------
  |  |    1|       |/*
  |  |    2|       | * This is code generated by jsongen.py. Do not hand-hack it!
  |  |    3|       | */
  |  |    4|    329| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |    5|       |
  |  |    6|       |
  |  |    7|    329|    const struct json_attr_t json_ais1[] = {
  |  |    8|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |    9|    329|	{"status",        t_uinteger,  .addr.uinteger = &ais->type1.status,
  |  |   10|    329|                                       .dflt.uinteger = 0},
  |  |   11|    329|	{"status_text",   t_ignore},
  |  |   12|    329|	{"turn",          t_integer,   .addr.integer = &ais->type1.turn,
  |  |   13|    329|                                       .dflt.integer = AIS_TURN_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1540|    329|#define AIS_TURN_NOT_AVAILABLE  128
  |  |  ------------------
  |  |   14|    329|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type1.speed,
  |  |   15|    329|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1542|    329|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |   16|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type1.accuracy,
  |  |   17|    329|                                       .dflt.boolean = false},
  |  |   18|    329|	{"lon",           t_integer,   .addr.integer = &ais->type1.lon,
  |  |   19|    329|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1547|    329|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |   20|    329|	{"lat",           t_integer,   .addr.integer = &ais->type1.lat,
  |  |   21|    329|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1549|    329|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |   22|    329|	{"course",        t_uinteger,  .addr.uinteger = &ais->type1.course,
  |  |   23|    329|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1551|    329|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |   24|    329|	{"heading",       t_uinteger,  .addr.uinteger = &ais->type1.heading,
  |  |   25|    329|                                       .dflt.uinteger = AIS_HEADING_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1553|    329|#define AIS_HEADING_NOT_AVAILABLE       511
  |  |  ------------------
  |  |   26|    329|	{"second",        t_uinteger,  .addr.uinteger = &ais->type1.second,
  |  |   27|    329|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1558|    329|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |   28|    329|	{"maneuver",      t_uinteger,  .addr.uinteger = &ais->type1.maneuver,
  |  |   29|    329|                                       .dflt.uinteger = AIS_SEC_INOPERATIVE},
  |  |  ------------------
  |  |  |  | 1561|    329|#define AIS_SEC_INOPERATIVE     63
  |  |  ------------------
  |  |   30|    329|	{"raim",          t_boolean,   .addr.boolean = &ais->type1.raim,
  |  |   31|    329|                                       .dflt.boolean = false},
  |  |   32|    329|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type1.radio,
  |  |   33|    329|                                       .dflt.uinteger = 0},
  |  |   34|    329|        {NULL}
  |  |   35|    329|    };
  |  |   36|       |
  |  |   37|    329|    char timestamp[JSON_VAL_MAX+1];
  |  |   38|    329|    const struct json_attr_t json_ais4[] = {
  |  |   39|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |   40|    329|	{"timestamp",     t_string,    .addr.string = timestamp,
  |  |   41|    329|                                       .len = sizeof(timestamp)},
  |  |   42|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type4.accuracy,
  |  |   43|    329|                                       .dflt.boolean = true},
  |  |   44|    329|	{"lon",           t_integer,   .addr.integer = &ais->type4.lon,
  |  |   45|    329|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1547|    329|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |   46|    329|	{"lat",           t_integer,   .addr.integer = &ais->type4.lat,
  |  |   47|    329|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1549|    329|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |   48|    329|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type4.epfd,
  |  |   49|    329|                                       .dflt.uinteger = 0},
  |  |   50|    329|	{"epfd_text",   t_ignore},
  |  |   51|    329|	{"raim",          t_boolean,   .addr.boolean = &ais->type4.raim,
  |  |   52|    329|                                       .dflt.boolean = false},
  |  |   53|    329|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type4.radio,
  |  |   54|    329|                                       .dflt.uinteger = 0},
  |  |   55|    329|        {NULL}
  |  |   56|    329|    };
  |  |   57|       |
  |  |   58|    329|    char eta[JSON_VAL_MAX+1];
  |  |   59|    329|    const struct json_attr_t json_ais5[] = {
  |  |   60|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |   61|    329|	{"imo",           t_uinteger,  .addr.uinteger = &ais->type5.imo,
  |  |   62|    329|                                       .dflt.uinteger = 0},
  |  |   63|    329|	{"ais_version",   t_uinteger,  .addr.uinteger = &ais->type5.ais_version,
  |  |   64|    329|                                       .dflt.uinteger = 0},
  |  |   65|    329|	{"callsign",      t_string,    .addr.string = ais->type5.callsign,
  |  |   66|    329|                                       .len = sizeof(ais->type5.callsign)},
  |  |   67|    329|	{"shipname",      t_string,    .addr.string = ais->type5.shipname,
  |  |   68|    329|                                       .len = sizeof(ais->type5.shipname)},
  |  |   69|    329|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type5.shiptype,
  |  |   70|    329|                                       .dflt.uinteger = 0},
  |  |   71|    329|	{"shiptype_text",   t_ignore},
  |  |   72|    329|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type5.to_bow,
  |  |   73|    329|                                       .dflt.uinteger = 0},
  |  |   74|    329|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type5.to_stern,
  |  |   75|    329|                                       .dflt.uinteger = 0},
  |  |   76|    329|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type5.to_port,
  |  |   77|    329|                                       .dflt.uinteger = 0},
  |  |   78|    329|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type5.to_starboard,
  |  |   79|    329|                                       .dflt.uinteger = 0},
  |  |   80|    329|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type5.epfd,
  |  |   81|    329|                                       .dflt.uinteger = 0},
  |  |   82|    329|	{"epfd_text",   t_ignore},
  |  |   83|    329|	{"eta",           t_string,    .addr.string = eta,
  |  |   84|    329|                                       .len = sizeof(eta)},
  |  |   85|    329|	{"draught",       t_uinteger,  .addr.uinteger = &ais->type5.draught,
  |  |   86|    329|                                       .dflt.uinteger = 0},
  |  |   87|    329|	{"destination",   t_string,    .addr.string = ais->type5.destination,
  |  |   88|    329|                                       .len = sizeof(ais->type5.destination)},
  |  |   89|    329|	{"dte",           t_uinteger,  .addr.uinteger = &ais->type5.dte,
  |  |   90|    329|                                       .dflt.uinteger = 1},
  |  |   91|    329|        {NULL}
  |  |   92|    329|    };
  |  |   93|       |
  |  |   94|    329|    char data[JSON_VAL_MAX+1];
  |  |   95|    329|    const struct json_attr_t json_ais6[] = {
  |  |   96|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |   97|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |   98|    329|	{"data",          t_string,    .addr.string = data,
  |  |   99|    329|                                       .len = sizeof(data)},
  |  |  100|    329|        {NULL}
  |  |  101|    329|    };
  |  |  102|       |
  |  |  103|    329|    const struct json_attr_t json_ais6_fid10[] = {
  |  |  104|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  105|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  106|    329|	{"ana_int",       t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.ana_int,
  |  |  107|    329|                                       .dflt.uinteger = 0},
  |  |  108|    329|	{"ana_ext1",      t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.ana_ext1,
  |  |  109|    329|                                       .dflt.uinteger = 0},
  |  |  110|    329|	{"ana_ext2",      t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.ana_ext2,
  |  |  111|    329|                                       .dflt.uinteger = 0},
  |  |  112|    329|	{"racon",         t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.racon,
  |  |  113|    329|                                       .dflt.uinteger = 0},
  |  |  114|    329|	{"racon_text",   t_ignore},
  |  |  115|    329|	{"light",         t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.light,
  |  |  116|    329|                                       .dflt.uinteger = 0},
  |  |  117|    329|	{"light_text",   t_ignore},
  |  |  118|    329|	{"alarm",         t_boolean,   .addr.boolean = &ais->type6.dac235fid10.alarm,
  |  |  119|    329|                                       .dflt.boolean = false},
  |  |  120|    329|	{"stat_ext",      t_uinteger,  .addr.uinteger = &ais->type6.dac235fid10.stat_ext,
  |  |  121|    329|                                       .dflt.uinteger = 0},
  |  |  122|    329|	{"off_pos",       t_boolean,   .addr.boolean = &ais->type6.dac235fid10.off_pos,
  |  |  123|    329|                                       .dflt.boolean = false},
  |  |  124|    329|        {NULL}
  |  |  125|    329|    };
  |  |  126|       |
  |  |  127|    329|    char departure[JSON_VAL_MAX+1];
  |  |  128|    329|    const struct json_attr_t json_ais6_fid12[] = {
  |  |  129|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  130|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  131|    329|	{"lastport",      t_string,    .addr.string = ais->type6.dac1fid12.lastport,
  |  |  132|    329|                                       .len = sizeof(ais->type6.dac1fid12.lastport)},
  |  |  133|    329|	{"departure",     t_string,    .addr.string = departure,
  |  |  134|    329|                                       .len = sizeof(departure)},
  |  |  135|    329|	{"nextport",      t_string,    .addr.string = ais->type6.dac1fid12.nextport,
  |  |  136|    329|                                       .len = sizeof(ais->type6.dac1fid12.nextport)},
  |  |  137|    329|	{"eta",           t_string,    .addr.string = eta,
  |  |  138|    329|                                       .len = sizeof(eta)},
  |  |  139|    329|	{"dangerous",     t_string,    .addr.string = ais->type6.dac1fid12.dangerous,
  |  |  140|    329|                                       .len = sizeof(ais->type6.dac1fid12.dangerous)},
  |  |  141|    329|	{"imdcat",        t_string,    .addr.string = ais->type6.dac1fid12.imdcat,
  |  |  142|    329|                                       .len = sizeof(ais->type6.dac1fid12.imdcat)},
  |  |  143|    329|	{"unid",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid12.unid,
  |  |  144|    329|                                       .dflt.uinteger = 0},
  |  |  145|    329|	{"amount",        t_uinteger,  .addr.uinteger = &ais->type6.dac1fid12.amount,
  |  |  146|    329|                                       .dflt.uinteger = 0},
  |  |  147|    329|	{"unit",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid12.unit,
  |  |  148|    329|                                       .dflt.uinteger = 0},
  |  |  149|    329|        {NULL}
  |  |  150|    329|    };
  |  |  151|       |
  |  |  152|    329|    const struct json_attr_t json_ais6_fid15[] = {
  |  |  153|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  154|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  155|    329|	{"airdraught",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid15.airdraught,
  |  |  156|    329|                                       .dflt.uinteger = 0},
  |  |  157|    329|        {NULL}
  |  |  158|    329|    };
  |  |  159|       |
  |  |  160|    329|    const struct json_attr_t json_ais6_fid16[] = {
  |  |  161|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  162|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  163|    329|	{"persons",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid16.persons,
  |  |  164|    329|                                       .dflt.uinteger = 0},
  |  |  165|    329|        {NULL}
  |  |  166|    329|    };
  |  |  167|       |
  |  |  168|    329|    char arrival[JSON_VAL_MAX+1];
  |  |  169|    329|    const struct json_attr_t json_ais6_fid18[] = {
  |  |  170|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  171|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  172|    329|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid18.linkage,
  |  |  173|    329|                                       .dflt.uinteger = 0},
  |  |  174|    329|	{"arrival",       t_string,    .addr.string = arrival,
  |  |  175|    329|                                       .len = sizeof(arrival)},
  |  |  176|    329|	{"portname",      t_string,    .addr.string = ais->type6.dac1fid18.portname,
  |  |  177|    329|                                       .len = sizeof(ais->type6.dac1fid18.portname)},
  |  |  178|    329|	{"destination",   t_string,    .addr.string = ais->type6.dac1fid18.destination,
  |  |  179|    329|                                       .len = sizeof(ais->type6.dac1fid18.destination)},
  |  |  180|    329|	{"lon",           t_integer,   .addr.integer = &ais->type6.dac1fid18.lon,
  |  |  181|    329|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1503|    329|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  182|    329|	{"lat",           t_integer,   .addr.integer = &ais->type6.dac1fid18.lat,
  |  |  183|    329|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1504|    329|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  184|    329|        {NULL}
  |  |  185|    329|    };
  |  |  186|       |
  |  |  187|    329|    char berth_name[JSON_VAL_MAX+1];
  |  |  188|    329|    const struct json_attr_t json_ais6_fid20[] = {
  |  |  189|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  190|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  191|    329|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.linkage,
  |  |  192|    329|                                       .dflt.uinteger = 0},
  |  |  193|    329|	{"berth_length",  t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.berth_length,
  |  |  194|    329|                                       .dflt.uinteger = 0},
  |  |  195|    329|	{"berth_depth",   t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.berth_depth,
  |  |  196|    329|                                       .dflt.uinteger = 0},
  |  |  197|    329|	{"position",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.position,
  |  |  198|    329|                                       .dflt.uinteger = 0},
  |  |  199|    329|	{"position_text",   t_ignore},
  |  |  200|    329|	{"arrival",       t_string,    .addr.string = arrival,
  |  |  201|    329|                                       .len = sizeof(arrival)},
  |  |  202|    329|	{"availability",  t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.availability,
  |  |  203|    329|                                       .dflt.uinteger = 0},
  |  |  204|    329|	{"agent",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.agent,
  |  |  205|    329|                                       .dflt.uinteger = 0},
  |  |  206|    329|	{"fuel",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.fuel,
  |  |  207|    329|                                       .dflt.uinteger = 0},
  |  |  208|    329|	{"chandler",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.chandler,
  |  |  209|    329|                                       .dflt.uinteger = 0},
  |  |  210|    329|	{"stevedore",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.stevedore,
  |  |  211|    329|                                       .dflt.uinteger = 0},
  |  |  212|    329|	{"electrical",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.electrical,
  |  |  213|    329|                                       .dflt.uinteger = 0},
  |  |  214|    329|	{"water",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.water,
  |  |  215|    329|                                       .dflt.uinteger = 0},
  |  |  216|    329|	{"customs",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.customs,
  |  |  217|    329|                                       .dflt.uinteger = 0},
  |  |  218|    329|	{"cartage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.cartage,
  |  |  219|    329|                                       .dflt.uinteger = 0},
  |  |  220|    329|	{"crane",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.crane,
  |  |  221|    329|                                       .dflt.uinteger = 0},
  |  |  222|    329|	{"lift",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.lift,
  |  |  223|    329|                                       .dflt.uinteger = 0},
  |  |  224|    329|	{"medical",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.medical,
  |  |  225|    329|                                       .dflt.uinteger = 0},
  |  |  226|    329|	{"navrepair",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.navrepair,
  |  |  227|    329|                                       .dflt.uinteger = 0},
  |  |  228|    329|	{"provisions",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.provisions,
  |  |  229|    329|                                       .dflt.uinteger = 0},
  |  |  230|    329|	{"shiprepair",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.shiprepair,
  |  |  231|    329|                                       .dflt.uinteger = 0},
  |  |  232|    329|	{"surveyor",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.surveyor,
  |  |  233|    329|                                       .dflt.uinteger = 0},
  |  |  234|    329|	{"steam",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.steam,
  |  |  235|    329|                                       .dflt.uinteger = 0},
  |  |  236|    329|	{"tugs",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.tugs,
  |  |  237|    329|                                       .dflt.uinteger = 0},
  |  |  238|    329|	{"solidwaste",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.solidwaste,
  |  |  239|    329|                                       .dflt.uinteger = 0},
  |  |  240|    329|	{"liquidwaste",   t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.liquidwaste,
  |  |  241|    329|                                       .dflt.uinteger = 0},
  |  |  242|    329|	{"hazardouswaste",t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.hazardouswaste,
  |  |  243|    329|                                       .dflt.uinteger = 0},
  |  |  244|    329|	{"ballast",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.ballast,
  |  |  245|    329|                                       .dflt.uinteger = 0},
  |  |  246|    329|	{"additional",    t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.additional,
  |  |  247|    329|                                       .dflt.uinteger = 0},
  |  |  248|    329|	{"regional1",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.regional1,
  |  |  249|    329|                                       .dflt.uinteger = 0},
  |  |  250|    329|	{"regional2",     t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.regional2,
  |  |  251|    329|                                       .dflt.uinteger = 0},
  |  |  252|    329|	{"future1",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.future1,
  |  |  253|    329|                                       .dflt.uinteger = 0},
  |  |  254|    329|	{"future2",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid20.future2,
  |  |  255|    329|                                       .dflt.uinteger = 0},
  |  |  256|    329|	{"berth_name",    t_string,    .addr.string = berth_name,
  |  |  257|    329|                                       .len = sizeof(berth_name)},
  |  |  258|    329|	{"berth_lon",     t_integer,   .addr.integer = &ais->type6.dac1fid20.berth_lon,
  |  |  259|    329|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1503|    329|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  260|    329|	{"berth_lat",     t_integer,   .addr.integer = &ais->type6.dac1fid20.berth_lat,
  |  |  261|    329|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1504|    329|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  262|    329|        {NULL}
  |  |  263|    329|    };
  |  |  264|       |
  |  |  265|    329|    const struct json_attr_t json_ais6_fid21[] = {
  |  |  266|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  267|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  268|    329|	{"country",       t_string,    .addr.string = ais->type6.dac200fid21.country,
  |  |  269|    329|                                       .len = sizeof(ais->type6.dac200fid21.country)},
  |  |  270|    329|	{"locode",        t_string,    .addr.string = ais->type6.dac200fid21.locode,
  |  |  271|    329|                                       .len = sizeof(ais->type6.dac200fid21.locode)},
  |  |  272|    329|	{"section",       t_string,    .addr.string = ais->type6.dac200fid21.section,
  |  |  273|    329|                                       .len = sizeof(ais->type6.dac200fid21.section)},
  |  |  274|    329|	{"terminal",      t_string,    .addr.string = ais->type6.dac200fid21.terminal,
  |  |  275|    329|                                       .len = sizeof(ais->type6.dac200fid21.terminal)},
  |  |  276|    329|	{"hectometre",    t_string,    .addr.string = ais->type6.dac200fid21.hectometre,
  |  |  277|    329|                                       .len = sizeof(ais->type6.dac200fid21.hectometre)},
  |  |  278|    329|	{"eta",           t_string,    .addr.string = eta,
  |  |  279|    329|                                       .len = sizeof(eta)},
  |  |  280|    329|	{"tugs",          t_uinteger,  .addr.uinteger = &ais->type6.dac200fid21.tugs,
  |  |  281|    329|                                       .dflt.uinteger = 0},
  |  |  282|    329|	{"airdraught",    t_uinteger,  .addr.uinteger = &ais->type6.dac200fid21.airdraught,
  |  |  283|    329|                                       .dflt.uinteger = 0},
  |  |  284|    329|        {NULL}
  |  |  285|    329|    };
  |  |  286|       |
  |  |  287|    329|    char rta[JSON_VAL_MAX+1];
  |  |  288|    329|    const struct json_attr_t json_ais6_fid22[] = {
  |  |  289|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  290|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  291|    329|	{"country",       t_string,    .addr.string = ais->type6.dac200fid22.country,
  |  |  292|    329|                                       .len = sizeof(ais->type6.dac200fid22.country)},
  |  |  293|    329|	{"locode",        t_string,    .addr.string = ais->type6.dac200fid22.locode,
  |  |  294|    329|                                       .len = sizeof(ais->type6.dac200fid22.locode)},
  |  |  295|    329|	{"section",       t_string,    .addr.string = ais->type6.dac200fid22.section,
  |  |  296|    329|                                       .len = sizeof(ais->type6.dac200fid22.section)},
  |  |  297|    329|	{"terminal",      t_string,    .addr.string = ais->type6.dac200fid22.terminal,
  |  |  298|    329|                                       .len = sizeof(ais->type6.dac200fid22.terminal)},
  |  |  299|    329|	{"hectometre",    t_string,    .addr.string = ais->type6.dac200fid22.hectometre,
  |  |  300|    329|                                       .len = sizeof(ais->type6.dac200fid22.hectometre)},
  |  |  301|    329|	{"rta",           t_string,    .addr.string = rta,
  |  |  302|    329|                                       .len = sizeof(rta)},
  |  |  303|    329|	{"status",        t_uinteger,  .addr.uinteger = &ais->type6.dac200fid22.status,
  |  |  304|    329|                                       .dflt.uinteger = DAC200FID22_STATUS_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1656|    329|#define DAC200FID22_STATUS_NOT_AVAILABLE        0
  |  |  ------------------
  |  |  305|    329|        {NULL}
  |  |  306|    329|    };
  |  |  307|       |
  |  |  308|    329|    const struct json_attr_t json_ais6_fid25_cargos_subtype[] = {
  |  |  309|    329|	{"code",          t_uinteger,STRUCTOBJECT(struct cargo_t, code),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  310|    329|                                       .dflt.uinteger = 0},
  |  |  311|    329|	{"subtype",       t_uinteger,STRUCTOBJECT(struct cargo_t, subtype),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  312|    329|                                       .dflt.uinteger = 0},
  |  |  313|    329|        {NULL}
  |  |  314|    329|    };
  |  |  315|    329|    const struct json_attr_t json_ais6_fid25[] = {
  |  |  316|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  317|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  318|    329|	{"unit",          t_uinteger,  .addr.uinteger = &ais->type6.dac1fid25.unit,
  |  |  319|    329|                                       .dflt.uinteger = 0},
  |  |  320|    329|	{"amount",        t_uinteger,  .addr.uinteger = &ais->type6.dac1fid25.amount,
  |  |  321|    329|                                       .dflt.uinteger = 0},
  |  |  322|    329|	{"cargos",        t_array,     STRUCTARRAY(ais->type6.dac1fid25.cargos, json_ais6_fid25_cargos_subtype, &ais->type6.dac1fid25.ncargos)},
  |  |  ------------------
  |  |  |  |  190|    329|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    329|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    329|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    329|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    329|        .addr.array.count = n, \
  |  |  |  |  195|    329|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    329| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  323|    329|        {NULL}
  |  |  324|    329|    };
  |  |  325|       |
  |  |  326|    329|    char start[JSON_VAL_MAX+1];
  |  |  327|    329|    const struct json_attr_t json_ais6_fid28_waypoints_subtype[] = {
  |  |  328|    329|	{"lon",           t_integer, STRUCTOBJECT(struct waypoint_t, lon),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  329|    329|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    329|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  330|    329|	{"lat",           t_integer, STRUCTOBJECT(struct waypoint_t, lat),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  331|    329|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1509|    329|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  332|    329|        {NULL}
  |  |  333|    329|    };
  |  |  334|    329|    const struct json_attr_t json_ais6_fid28[] = {
  |  |  335|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  336|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  337|    329|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.linkage,
  |  |  338|    329|                                       .dflt.uinteger = 0},
  |  |  339|    329|	{"sender",        t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.sender,
  |  |  340|    329|                                       .dflt.uinteger = 0},
  |  |  341|    329|	{"rtype",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.rtype,
  |  |  342|    329|                                       .dflt.uinteger = 0},
  |  |  343|    329|	{"rtype_text",   t_ignore},
  |  |  344|    329|	{"start",         t_string,    .addr.string = start,
  |  |  345|    329|                                       .len = sizeof(start)},
  |  |  346|    329|	{"duration",      t_uinteger,  .addr.uinteger = &ais->type6.dac1fid28.duration,
  |  |  347|    329|                                       .dflt.uinteger = 0},
  |  |  348|    329|	{"waypoints",     t_array,     STRUCTARRAY(ais->type6.dac1fid28.waypoints, json_ais6_fid28_waypoints_subtype, &ais->type6.dac1fid28.waycount)},
  |  |  ------------------
  |  |  |  |  190|    329|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    329|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    329|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    329|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    329|        .addr.array.count = n, \
  |  |  |  |  195|    329|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    329| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  349|    329|        {NULL}
  |  |  350|    329|    };
  |  |  351|       |
  |  |  352|    329|    const struct json_attr_t json_ais6_fid30[] = {
  |  |  353|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  354|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  355|    329|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type6.dac1fid30.linkage,
  |  |  356|    329|                                       .dflt.uinteger = 0},
  |  |  357|    329|	{"text",          t_string,    .addr.string = ais->type6.dac1fid30.text,
  |  |  358|    329|                                       .len = sizeof(ais->type6.dac1fid30.text)},
  |  |  359|    329|        {NULL}
  |  |  360|    329|    };
  |  |  361|       |
  |  |  362|    329|    const struct json_attr_t json_ais6_fid32_tidals_subtype[] = {
  |  |  363|    329|	{"lon",           t_integer, STRUCTOBJECT(struct tidal_t, lon),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  364|    329|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1503|    329|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  365|    329|	{"lat",           t_integer, STRUCTOBJECT(struct tidal_t, lat),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  366|    329|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1504|    329|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  367|    329|	{"from_hour",     t_uinteger,STRUCTOBJECT(struct tidal_t, from_hour),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  368|    329|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1572|    329|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  369|    329|	{"from_min",      t_uinteger,STRUCTOBJECT(struct tidal_t, from_min),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  370|    329|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1578|    329|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  371|    329|	{"to_hour",       t_uinteger,STRUCTOBJECT(struct tidal_t, to_hour),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  372|    329|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1576|    329|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  373|    329|	{"to_min",        t_uinteger,STRUCTOBJECT(struct tidal_t, to_min),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  374|    329|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1578|    329|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  375|    329|	{"cdir",          t_uinteger,STRUCTOBJECT(struct tidal_t, cdir),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  376|    329|                                       .dflt.uinteger = DAC1FID32_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1872|    329|#define DAC1FID32_CDIR_NOT_AVAILABLE     360
  |  |  ------------------
  |  |  377|    329|	{"cspeed",        t_uinteger,STRUCTOBJECT(struct tidal_t, cspeed),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  378|    329|                                       .dflt.uinteger = DAC1FID32_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1874|    329|#define DAC1FID32_CSPEED_NOT_AVAILABLE   127
  |  |  ------------------
  |  |  379|    329|        {NULL}
  |  |  380|    329|    };
  |  |  381|    329|    const struct json_attr_t json_ais6_fid32[] = {
  |  |  382|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  383|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  384|    329|	{"month",         t_uinteger,  .addr.uinteger = &ais->type6.dac1fid32.month,
  |  |  385|    329|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1572|    329|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  386|    329|	{"day",           t_uinteger,  .addr.uinteger = &ais->type6.dac1fid32.day,
  |  |  387|    329|                                       .dflt.uinteger = AIS_DAY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1574|    329|#define AIS_DAY_NOT_AVAILABLE   0
  |  |  ------------------
  |  |  388|    329|	{"tidals",        t_array,     STRUCTARRAY(ais->type6.dac1fid32.tidals, json_ais6_fid32_tidals_subtype, &ais->type6.dac1fid32.ntidals)},
  |  |  ------------------
  |  |  |  |  190|    329|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    329|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    329|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    329|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    329|        .addr.array.count = n, \
  |  |  |  |  195|    329|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    329| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  389|    329|        {NULL}
  |  |  390|    329|    };
  |  |  391|       |
  |  |  392|    329|    const struct json_attr_t json_ais6_fid55[] = {
  |  |  393|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  394|    329|	AIS_TYPE6
  |  |  ------------------
  |  |  |  |   57|    329|        {"seqno",         t_uinteger,  .addr.uinteger = &ais->type6.seqno,\
  |  |  |  |   58|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   59|    329|        {"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type6.dest_mmsi,\
  |  |  |  |   60|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   61|    329|        {"retransmit",    t_boolean,   .addr.boolean = &ais->type6.retransmit,\
  |  |  |  |   62|    329|                                       .dflt.boolean = false},\
  |  |  |  |   63|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type6.dac,\
  |  |  |  |   64|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   65|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type6.fid,\
  |  |  |  |   66|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  395|    329|	{"crew",          t_uinteger,  .addr.uinteger = &ais->type6.dac200fid55.crew,
  |  |  396|    329|                                       .dflt.uinteger = DAC200FID55_COUNT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1663|    329|#define DAC200FID55_COUNT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  397|    329|	{"passengers",    t_uinteger,  .addr.uinteger = &ais->type6.dac200fid55.passengers,
  |  |  398|    329|                                       .dflt.uinteger = DAC200FID55_COUNT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1663|    329|#define DAC200FID55_COUNT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  399|    329|	{"personnel",     t_uinteger,  .addr.uinteger = &ais->type6.dac200fid55.personnel,
  |  |  400|    329|                                       .dflt.uinteger = DAC200FID55_COUNT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1663|    329|#define DAC200FID55_COUNT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  401|    329|        {NULL}
  |  |  402|    329|    };
  |  |  403|       |
  |  |  404|    329|    const struct json_attr_t json_ais7[] = {
  |  |  405|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  406|    329|	{"mmsi1",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi1,
  |  |  407|    329|                                       .dflt.uinteger = 0},
  |  |  408|    329|	{"mmsi2",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi2,
  |  |  409|    329|                                       .dflt.uinteger = 0},
  |  |  410|    329|	{"mmsi3",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi3,
  |  |  411|    329|                                       .dflt.uinteger = 0},
  |  |  412|    329|	{"mmsi4",         t_uinteger,  .addr.uinteger = &ais->type7.mmsi4,
  |  |  413|    329|                                       .dflt.uinteger = 0},
  |  |  414|    329|	{"seqno1",        t_uinteger,  .addr.uinteger = &ais->type7.seqno1,
  |  |  415|    329|                                       .dflt.uinteger = 0},
  |  |  416|    329|	{"seqno2",        t_uinteger,  .addr.uinteger = &ais->type7.seqno2,
  |  |  417|    329|                                       .dflt.uinteger = 0},
  |  |  418|    329|	{"seqno3",        t_uinteger,  .addr.uinteger = &ais->type7.seqno3,
  |  |  419|    329|                                       .dflt.uinteger = 0},
  |  |  420|    329|	{"seqno4",        t_uinteger,  .addr.uinteger = &ais->type7.seqno4,
  |  |  421|    329|                                       .dflt.uinteger = 0},
  |  |  422|    329|        {NULL}
  |  |  423|    329|    };
  |  |  424|       |
  |  |  425|    329|    const struct json_attr_t json_ais8[] = {
  |  |  426|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  427|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  428|    329|	{"data",          t_string,    .addr.string = data,
  |  |  429|    329|                                       .len = sizeof(data)},
  |  |  430|    329|        {NULL}
  |  |  431|    329|    };
  |  |  432|       |
  |  |  433|    329|    const struct json_attr_t json_ais8_fid10[] = {
  |  |  434|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  435|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  436|    329|	{"vin",           t_string,    .addr.string = ais->type8.dac200fid10.vin,
  |  |  437|    329|                                       .len = sizeof(ais->type8.dac200fid10.vin)},
  |  |  438|    329|	{"length",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.length,
  |  |  439|    329|                                       .dflt.uinteger = 0},
  |  |  440|    329|	{"beam",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.beam,
  |  |  441|    329|                                       .dflt.uinteger = 0},
  |  |  442|    329|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.shiptype,
  |  |  443|    329|                                       .dflt.uinteger = 0},
  |  |  444|    329|	{"shiptype_text",   t_ignore},
  |  |  445|    329|	{"hazard",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.hazard,
  |  |  446|    329|                                       .dflt.uinteger = 0},
  |  |  447|    329|	{"hazard_text",   t_ignore},
  |  |  448|    329|	{"draught",       t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.draught,
  |  |  449|    329|                                       .dflt.uinteger = 0},
  |  |  450|    329|	{"loaded",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid10.loaded,
  |  |  451|    329|                                       .dflt.uinteger = 0},
  |  |  452|    329|	{"loaded_text",   t_ignore},
  |  |  453|    329|	{"speed_q",       t_boolean,   .addr.boolean = &ais->type8.dac200fid10.speed_q,
  |  |  454|    329|                                       .dflt.boolean = false},
  |  |  455|    329|	{"course_q",      t_boolean,   .addr.boolean = &ais->type8.dac200fid10.course_q,
  |  |  456|    329|                                       .dflt.boolean = false},
  |  |  457|    329|	{"heading_q",     t_boolean,   .addr.boolean = &ais->type8.dac200fid10.heading_q,
  |  |  458|    329|                                       .dflt.boolean = false},
  |  |  459|    329|        {NULL}
  |  |  460|    329|    };
  |  |  461|       |
  |  |  462|    329|    const struct json_attr_t json_ais8_fid11[] = {
  |  |  463|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  464|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  465|    329|	{"lat",           t_integer,   .addr.integer = &ais->type8.dac1fid11.lat,
  |  |  466|    329|                                       .dflt.integer = DAC1FID11_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1974|    329|#define DAC1FID11_LAT_NOT_AVAILABLE     0x7FFFFF
  |  |  ------------------
  |  |  467|    329|	{"lon",           t_integer,   .addr.integer = &ais->type8.dac1fid11.lon,
  |  |  468|    329|                                       .dflt.integer = DAC1FID11_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1972|    329|#define DAC1FID11_LON_NOT_AVAILABLE     0xFFFFFF
  |  |  ------------------
  |  |  469|    329|	{"timestamp",     t_string,    .addr.string = timestamp,
  |  |  470|    329|                                       .len = sizeof(timestamp)},
  |  |  471|    329|	{"wspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wspeed,
  |  |  472|    329|                                       .dflt.uinteger = DAC1FID11_WSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1980|    329|#define DAC1FID11_WSPEED_NOT_AVAILABLE  127
  |  |  ------------------
  |  |  473|    329|	{"wgust",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wgust,
  |  |  474|    329|                                       .dflt.uinteger = DAC1FID11_WSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1980|    329|#define DAC1FID11_WSPEED_NOT_AVAILABLE  127
  |  |  ------------------
  |  |  475|    329|	{"wdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wdir,
  |  |  476|    329|                                       .dflt.uinteger = DAC1FID11_WDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1983|    329|#define DAC1FID11_WDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  477|    329|	{"wgustdir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wgustdir,
  |  |  478|    329|                                       .dflt.uinteger = DAC1FID11_WDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1983|    329|#define DAC1FID11_WDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  479|    329|	{"airtemp",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.airtemp,
  |  |  480|    329|                                       .dflt.uinteger = DAC1FID11_AIRTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1985|    329|#define DAC1FID11_AIRTEMP_NOT_AVAILABLE 2047
  |  |  ------------------
  |  |  481|    329|	{"humidity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.humidity,
  |  |  482|    329|                                       .dflt.uinteger = DAC1FID11_HUMIDITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1989|    329|#define DAC1FID11_HUMIDITY_NOT_AVAILABLE 127
  |  |  ------------------
  |  |  483|    329|	{"dewpoint",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.dewpoint,
  |  |  484|    329|                                       .dflt.uinteger = DAC1FID11_DEWPOINT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1991|    329|#define DAC1FID11_DEWPOINT_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  485|    329|	{"pressure",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.pressure,
  |  |  486|    329|                                       .dflt.uinteger = DAC1FID11_PRESSURE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1995|    329|#define DAC1FID11_PRESSURE_NOT_AVAILABLE 511
  |  |  ------------------
  |  |  487|    329|	{"pressuretend",  t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.pressuretend,
  |  |  488|    329|                                       .dflt.uinteger = DAC1FID11_PRESSURETREND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1998|    329|#define DAC1FID11_PRESSURETREND_NOT_AVAILABLE 3
  |  |  ------------------
  |  |  489|    329|	{"visibility",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.visibility,
  |  |  490|    329|                                       .dflt.uinteger = DAC1FID11_VISIBILITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2000|    329|#define DAC1FID11_VISIBILITY_NOT_AVAILABLE  255
  |  |  ------------------
  |  |  491|    329|	{"waterlevel",    t_integer,   .addr.integer = &ais->type8.dac1fid11.waterlevel,
  |  |  492|    329|                                       .dflt.integer = DAC1FID11_WATERLEVEL_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2003|    329|#define DAC1FID11_WATERLEVEL_NOT_AVAILABLE  511
  |  |  ------------------
  |  |  493|    329|	{"leveltrend",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.leveltrend,
  |  |  494|    329|                                       .dflt.uinteger = DAC1FID11_WATERLEVELTREND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2007|    329|#define DAC1FID11_WATERLEVELTREND_NOT_AVAILABLE 3
  |  |  ------------------
  |  |  495|    329|	{"cspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cspeed,
  |  |  496|    329|                                       .dflt.uinteger = DAC1FID11_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2009|    329|#define DAC1FID11_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  497|    329|	{"cdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdir,
  |  |  498|    329|                                       .dflt.uinteger = DAC1FID11_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2012|    329|#define DAC1FID11_CDIR_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  499|    329|	{"cspeed2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cspeed2,
  |  |  500|    329|                                       .dflt.uinteger = DAC1FID11_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2009|    329|#define DAC1FID11_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  501|    329|	{"cdir2",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdir2,
  |  |  502|    329|                                       .dflt.uinteger = DAC1FID11_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2012|    329|#define DAC1FID11_CDIR_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  503|    329|	{"cdepth2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdepth2,
  |  |  504|    329|                                       .dflt.uinteger = DAC1FID11_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2016|    329|#define DAC1FID11_CDEPTH_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  505|    329|	{"cspeed3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cspeed3,
  |  |  506|    329|                                       .dflt.uinteger = DAC1FID11_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2009|    329|#define DAC1FID11_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  507|    329|	{"cdir3",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdir3,
  |  |  508|    329|                                       .dflt.uinteger = DAC1FID11_CDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2012|    329|#define DAC1FID11_CDIR_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  509|    329|	{"cdepth3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.cdepth3,
  |  |  510|    329|                                       .dflt.uinteger = DAC1FID11_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2016|    329|#define DAC1FID11_CDEPTH_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  511|    329|	{"waveheight",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.waveheight,
  |  |  512|    329|                                       .dflt.uinteger = DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2021|    329|#define DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  513|    329|	{"waveperiod",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.waveperiod,
  |  |  514|    329|                                       .dflt.uinteger = DAC1FID11_WAVEPERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2024|    329|#define DAC1FID11_WAVEPERIOD_NOT_AVAILABLE 63
  |  |  ------------------
  |  |  515|    329|	{"wavedir",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.wavedir,
  |  |  516|    329|                                       .dflt.uinteger = DAC1FID11_WAVEDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2026|    329|#define DAC1FID11_WAVEDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  517|    329|	{"swellheight",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.swellheight,
  |  |  518|    329|                                       .dflt.uinteger = DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2021|    329|#define DAC1FID11_WAVEHEIGHT_NOT_AVAILABLE 255
  |  |  ------------------
  |  |  519|    329|	{"swellperiod",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.swellperiod,
  |  |  520|    329|                                       .dflt.uinteger = DAC1FID11_WAVEPERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2024|    329|#define DAC1FID11_WAVEPERIOD_NOT_AVAILABLE 63
  |  |  ------------------
  |  |  521|    329|	{"swelldir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.swelldir,
  |  |  522|    329|                                       .dflt.uinteger = DAC1FID11_WAVEDIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2026|    329|#define DAC1FID11_WAVEDIR_NOT_AVAILABLE    511
  |  |  ------------------
  |  |  523|    329|	{"seastate",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.seastate,
  |  |  524|    329|                                       .dflt.uinteger = DAC1FID11_SEASTATE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2031|    329|#define DAC1FID11_SEASTATE_NOT_AVAILABLE   15
  |  |  ------------------
  |  |  525|    329|	{"watertemp",     t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.watertemp,
  |  |  526|    329|                                       .dflt.uinteger = DAC1FID11_WATERTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2033|    329|#define DAC1FID11_WATERTEMP_NOT_AVAILABLE  1023
  |  |  ------------------
  |  |  527|    329|	{"preciptype",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.preciptype,
  |  |  528|    329|                                       .dflt.uinteger = DAC1FID11_PRECIPTYPE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2037|    329|#define DAC1FID11_PRECIPTYPE_NOT_AVAILABLE  7
  |  |  ------------------
  |  |  529|    329|	{"preciptype_text",   t_ignore},
  |  |  530|    329|	{"salinity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.salinity,
  |  |  531|    329|                                       .dflt.uinteger = DAC1FID11_SALINITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2039|    329|#define DAC1FID11_SALINITY_NOT_AVAILABLE   511
  |  |  ------------------
  |  |  532|    329|	{"ice",           t_uinteger,  .addr.uinteger = &ais->type8.dac1fid11.ice,
  |  |  533|    329|                                       .dflt.uinteger = DAC1FID11_ICE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2042|    329|#define DAC1FID11_ICE_NOT_AVAILABLE        3
  |  |  ------------------
  |  |  534|    329|	{"ice_text",   t_ignore},
  |  |  535|    329|        {NULL}
  |  |  536|    329|    };
  |  |  537|       |
  |  |  538|    329|    char closefrom[JSON_VAL_MAX+1];
  |  |  539|    329|    char closeto[JSON_VAL_MAX+1];
  |  |  540|    329|    const struct json_attr_t json_ais8_fid13[] = {
  |  |  541|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  542|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  543|    329|	{"reason",        t_string,    .addr.string = ais->type8.dac1fid13.reason,
  |  |  544|    329|                                       .len = sizeof(ais->type8.dac1fid13.reason)},
  |  |  545|    329|	{"closefrom",     t_string,    .addr.string = closefrom,
  |  |  546|    329|                                       .len = sizeof(closefrom)},
  |  |  547|    329|	{"closeto",       t_string,    .addr.string = closeto,
  |  |  548|    329|                                       .len = sizeof(closeto)},
  |  |  549|    329|	{"radius",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.radius,
  |  |  550|    329|                                       .dflt.uinteger = AIS_DAC1FID13_RADIUS_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2050|    329|#define AIS_DAC1FID13_RADIUS_NOT_AVAILABLE 10001
  |  |  ------------------
  |  |  551|    329|	{"extunit",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.extunit,
  |  |  552|    329|                                       .dflt.uinteger = AIS_DAC1FID13_EXTUNIT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2052|    329|#define AIS_DAC1FID13_EXTUNIT_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  553|    329|	{"fday",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fday,
  |  |  554|    329|                                       .dflt.uinteger = AIS_DAY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1574|    329|#define AIS_DAY_NOT_AVAILABLE   0
  |  |  ------------------
  |  |  555|    329|	{"fmonth",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fmonth,
  |  |  556|    329|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1572|    329|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  557|    329|	{"fhour",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fhour,
  |  |  558|    329|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1576|    329|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  559|    329|	{"fminute",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.fminute,
  |  |  560|    329|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1578|    329|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  561|    329|	{"tday",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.tday,
  |  |  562|    329|                                       .dflt.uinteger = AIS_DAY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1574|    329|#define AIS_DAY_NOT_AVAILABLE   0
  |  |  ------------------
  |  |  563|    329|	{"tmonth",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.tmonth,
  |  |  564|    329|                                       .dflt.uinteger = AIS_MONTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1572|    329|#define AIS_MONTH_NOT_AVAILABLE 0
  |  |  ------------------
  |  |  565|    329|	{"thour",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.thour,
  |  |  566|    329|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1576|    329|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  567|    329|	{"tminute",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid13.tminute,
  |  |  568|    329|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1578|    329|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  569|    329|        {NULL}
  |  |  570|    329|    };
  |  |  571|       |
  |  |  572|    329|    const struct json_attr_t json_ais8_fid15[] = {
  |  |  573|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  574|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  575|    329|	{"airdraught",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid15.airdraught,
  |  |  576|    329|                                       .dflt.uinteger = 0},
  |  |  577|    329|        {NULL}
  |  |  578|    329|    };
  |  |  579|       |
  |  |  580|    329|    const struct json_attr_t json_ais8_fid16[] = {
  |  |  581|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  582|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  583|    329|	{"persons",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid16.persons,
  |  |  584|    329|                                       .dflt.uinteger = 0},
  |  |  585|    329|        {NULL}
  |  |  586|    329|    };
  |  |  587|       |
  |  |  588|    329|    const struct json_attr_t json_ais8_fid17_targets_subtype[] = {
  |  |  589|    329|	{"idtype",        t_uinteger,STRUCTOBJECT(struct target_t, idtype),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  590|    329|                                       .dflt.uinteger = DAC1FID17_IDTYPE_OTHER},
  |  |  ------------------
  |  |  |  | 2077|    329|#define DAC1FID17_IDTYPE_OTHER          3
  |  |  ------------------
  |  |  591|    329|	{"id.mmsi",       t_uinteger,STRUCTOBJECT(struct target_t, id.mmsi),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  592|    329|                                       .dflt.uinteger = 0},
  |  |  593|    329|	{"id.imo",        t_uinteger,STRUCTOBJECT(struct target_t, id.imo),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  594|    329|                                       .dflt.uinteger = 0},
  |  |  595|    329|	{"id.callsign",   t_string,  STRUCTOBJECT(struct target_t, id.callsign),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  596|    329|                                       .len = DAC1FID17_ID_LENGTH},
  |  |  ------------------
  |  |  |  | 2082|    329|#define DAC1FID17_ID_LENGTH             7
  |  |  ------------------
  |  |  597|    329|	{"id.other",      t_string,  STRUCTOBJECT(struct target_t, id.other),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  598|    329|                                       .len = DAC1FID17_ID_LENGTH},
  |  |  ------------------
  |  |  |  | 2082|    329|#define DAC1FID17_ID_LENGTH             7
  |  |  ------------------
  |  |  599|    329|	{"lat",           t_integer, STRUCTOBJECT(struct target_t, lat),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  600|    329|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1504|    329|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  601|    329|	{"lon",           t_integer, STRUCTOBJECT(struct target_t, lon),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  602|    329|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1503|    329|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  603|    329|	{"course",        t_uinteger,STRUCTOBJECT(struct target_t, course),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  604|    329|                                       .dflt.uinteger = DAC1FID17_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2089|    329|#define DAC1FID17_COURSE_NOT_AVAILABLE  360
  |  |  ------------------
  |  |  605|    329|	{"second",        t_uinteger,STRUCTOBJECT(struct target_t, second),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  606|    329|                                       .dflt.uinteger = AIS_SECOND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1580|    329|#define AIS_SECOND_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  607|    329|	{"speed",         t_uinteger,STRUCTOBJECT(struct target_t, speed),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  608|    329|                                       .dflt.uinteger = DAC1FID17_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2092|    329|#define DAC1FID17_SPEED_NOT_AVAILABLE   255
  |  |  ------------------
  |  |  609|    329|        {NULL}
  |  |  610|    329|    };
  |  |  611|    329|    const struct json_attr_t json_ais8_fid17[] = {
  |  |  612|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  613|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  614|    329|	{"targets",       t_array,     STRUCTARRAY(ais->type8.dac1fid17.targets, json_ais8_fid17_targets_subtype, &ais->type8.dac1fid17.ntargets)},
  |  |  ------------------
  |  |  |  |  190|    329|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    329|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    329|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    329|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    329|        .addr.array.count = n, \
  |  |  |  |  195|    329|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    329| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  615|    329|        {NULL}
  |  |  616|    329|    };
  |  |  617|       |
  |  |  618|    329|    const struct json_attr_t json_ais8_fid19[] = {
  |  |  619|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  620|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  621|    329|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.linkage,
  |  |  622|    329|                                       .dflt.uinteger = 0},
  |  |  623|    329|	{"station",       t_string,    .addr.string = ais->type8.dac1fid19.station,
  |  |  624|    329|                                       .len = sizeof(ais->type8.dac1fid19.station)},
  |  |  625|    329|	{"lon",           t_integer,   .addr.integer = &ais->type8.dac1fid19.lon,
  |  |  626|    329|                                       .dflt.integer = AIS_LON3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1503|    329|#define AIS_LON3_NOT_AVAILABLE  181000
  |  |  ------------------
  |  |  627|    329|	{"lat",           t_integer,   .addr.integer = &ais->type8.dac1fid19.lat,
  |  |  628|    329|                                       .dflt.integer = AIS_LAT3_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1504|    329|#define AIS_LAT3_NOT_AVAILABLE  91000
  |  |  ------------------
  |  |  629|    329|	{"status",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.status,
  |  |  630|    329|                                       .dflt.uinteger = 0},
  |  |  631|    329|	{"signal",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.signal,
  |  |  632|    329|                                       .dflt.uinteger = 0},
  |  |  633|    329|	{"signal_text",   t_ignore},
  |  |  634|    329|	{"hour",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.hour,
  |  |  635|    329|                                       .dflt.uinteger = AIS_HOUR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1576|    329|#define AIS_HOUR_NOT_AVAILABLE  24
  |  |  ------------------
  |  |  636|    329|	{"minute",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.minute,
  |  |  637|    329|                                       .dflt.uinteger = AIS_MINUTE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1578|    329|#define AIS_MINUTE_NOT_AVAILABLE        60
  |  |  ------------------
  |  |  638|    329|	{"nextsignal",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid19.nextsignal,
  |  |  639|    329|                                       .dflt.uinteger = 0},
  |  |  640|    329|	{"nextsignal_type",   t_ignore},
  |  |  641|    329|        {NULL}
  |  |  642|    329|    };
  |  |  643|       |
  |  |  644|    329|    char end[JSON_VAL_MAX+1];
  |  |  645|    329|    const struct json_attr_t json_ais8_fid23[] = {
  |  |  646|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  647|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  648|    329|	{"start",         t_string,    .addr.string = start,
  |  |  649|    329|                                       .len = sizeof(start)},
  |  |  650|    329|	{"end",           t_string,    .addr.string = end,
  |  |  651|    329|                                       .len = sizeof(end)},
  |  |  652|    329|	{"start_lon",     t_integer,   .addr.integer = &ais->type8.dac200fid23.start_lon,
  |  |  653|    329|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    329|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  654|    329|	{"start_lat",     t_integer,   .addr.integer = &ais->type8.dac200fid23.start_lat,
  |  |  655|    329|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1509|    329|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  656|    329|	{"end_lon",       t_integer,   .addr.integer = &ais->type8.dac200fid23.end_lon,
  |  |  657|    329|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    329|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  658|    329|	{"end_lat",       t_integer,   .addr.integer = &ais->type8.dac200fid23.end_lat,
  |  |  659|    329|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1509|    329|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  660|    329|	{"type",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid23.type,
  |  |  661|    329|                                       .dflt.uinteger = DAC200FID23_TYPE_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1933|    329|#define DAC200FID23_TYPE_UNKNOWN        0
  |  |  ------------------
  |  |  662|    329|	{"type_text",   t_ignore},
  |  |  663|    329|	{"min",           t_integer,   .addr.integer = &ais->type8.dac200fid23.min,
  |  |  664|    329|                                       .dflt.integer = DAC200FID23_MIN_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1935|    329|#define DAC200FID23_MIN_UNKNOWN         255
  |  |  ------------------
  |  |  665|    329|	{"max",           t_integer,   .addr.integer = &ais->type8.dac200fid23.max,
  |  |  666|    329|                                       .dflt.integer = DAC200FID23_MAX_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1937|    329|#define DAC200FID23_MAX_UNKNOWN         255
  |  |  ------------------
  |  |  667|    329|	{"intensity",     t_uinteger,  .addr.uinteger = &ais->type8.dac200fid23.intensity,
  |  |  668|    329|                                       .dflt.uinteger = DAC200FID23_CLASS_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1939|    329|#define DAC200FID23_CLASS_UNKNOWN       0
  |  |  ------------------
  |  |  669|    329|	{"intensity_text",   t_ignore},
  |  |  670|    329|	{"wind",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid23.wind,
  |  |  671|    329|                                       .dflt.uinteger = DAC200FID23_WIND_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1941|    329|#define DAC200FID23_WIND_UNKNOWN        0
  |  |  ------------------
  |  |  672|    329|	{"wind_text",   t_ignore},
  |  |  673|    329|        {NULL}
  |  |  674|    329|    };
  |  |  675|       |
  |  |  676|    329|    const struct json_attr_t json_ais8_fid24_gauges_subtype[] = {
  |  |  677|    329|	{"id",            t_uinteger,STRUCTOBJECT(struct gauge_t, id),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  678|    329|                                       .dflt.uinteger = DAC200FID24_GAUGE_ID_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1948|    329|#define DAC200FID24_GAUGE_ID_UNKNOWN    0
  |  |  ------------------
  |  |  679|    329|	{"level",         t_integer, STRUCTOBJECT(struct gauge_t, level),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  680|    329|                                       .dflt.integer = DAC200FID24_GAUGE_LEVEL_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1950|    329|#define DAC200FID24_GAUGE_LEVEL_UNKNOWN 0
  |  |  ------------------
  |  |  681|    329|        {NULL}
  |  |  682|    329|    };
  |  |  683|    329|    const struct json_attr_t json_ais8_fid24[] = {
  |  |  684|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  685|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  686|    329|	{"country",       t_string,    .addr.string = ais->type8.dac200fid24.country,
  |  |  687|    329|                                       .len = sizeof(ais->type8.dac200fid24.country)},
  |  |  688|    329|	{"gauges",        t_array,     STRUCTARRAY(ais->type8.dac200fid24.gauges, json_ais8_fid24_gauges_subtype, &ais->type8.dac200fid24.ngauges)},
  |  |  ------------------
  |  |  |  |  190|    329|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    329|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    329|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    329|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    329|        .addr.array.count = n, \
  |  |  |  |  195|    329|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    329| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|    329|        {NULL}
  |  |  690|    329|    };
  |  |  691|       |
  |  |  692|    329|    const struct json_attr_t json_ais8_fid27_waypoints_subtype[] = {
  |  |  693|    329|	{"lon",           t_integer, STRUCTOBJECT(struct waypoint_t, lon),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  694|    329|                                       .dflt.integer = AIS_LON4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1508|    329|#define AIS_LON4_NOT_AVAILABLE  1810000
  |  |  ------------------
  |  |  695|    329|	{"lat",           t_integer, STRUCTOBJECT(struct waypoint_t, lat),
  |  |  ------------------
  |  |  |  |  188|    329|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  |  |  696|    329|                                       .dflt.integer = AIS_LAT4_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1509|    329|#define AIS_LAT4_NOT_AVAILABLE  910000
  |  |  ------------------
  |  |  697|    329|        {NULL}
  |  |  698|    329|    };
  |  |  699|    329|    const struct json_attr_t json_ais8_fid27[] = {
  |  |  700|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  701|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  702|    329|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.linkage,
  |  |  703|    329|                                       .dflt.uinteger = 0},
  |  |  704|    329|	{"sender",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.sender,
  |  |  705|    329|                                       .dflt.uinteger = 0},
  |  |  706|    329|	{"rtype",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.rtype,
  |  |  707|    329|                                       .dflt.uinteger = 0},
  |  |  708|    329|	{"rtype_text",   t_ignore},
  |  |  709|    329|	{"start",         t_string,    .addr.string = start,
  |  |  710|    329|                                       .len = sizeof(start)},
  |  |  711|    329|	{"duration",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid27.duration,
  |  |  712|    329|                                       .dflt.uinteger = 0},
  |  |  713|    329|	{"waypoints",     t_array,     STRUCTARRAY(ais->type8.dac1fid27.waypoints, json_ais8_fid27_waypoints_subtype, &ais->type8.dac1fid27.waycount)},
  |  |  ------------------
  |  |  |  |  190|    329|        .addr.array.element_type = t_structobject, \
  |  |  |  |  191|    329|        .addr.array.arr.objects.subtype = e, \
  |  |  |  |  192|    329|        .addr.array.arr.objects.base = (char*)a, \
  |  |  |  |  193|    329|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  |  |  194|    329|        .addr.array.count = n, \
  |  |  |  |  195|    329|        .addr.array.maxlen = NITEMS(a)
  |  |  |  |  ------------------
  |  |  |  |  |  |    4|    329| #define NITEMS(x) (int)(sizeof(x)/sizeof(x[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  714|    329|        {NULL}
  |  |  715|    329|    };
  |  |  716|       |
  |  |  717|    329|    const struct json_attr_t json_ais8_fid29[] = {
  |  |  718|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  719|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  720|    329|	{"linkage",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid29.linkage,
  |  |  721|    329|                                       .dflt.uinteger = 0},
  |  |  722|    329|	{"text",          t_string,    .addr.string = ais->type8.dac1fid29.text,
  |  |  723|    329|                                       .len = sizeof(ais->type8.dac1fid29.text)},
  |  |  724|    329|        {NULL}
  |  |  725|    329|    };
  |  |  726|       |
  |  |  727|    329|    const struct json_attr_t json_ais8_fid31[] = {
  |  |  728|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  729|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  730|    329|	{"lon",           t_integer,   .addr.integer = &ais->type8.dac1fid31.lon,
  |  |  731|    329|                                       .dflt.integer = DAC1FID31_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2121|    329|#define DAC1FID31_LON_NOT_AVAILABLE     (181*60*DAC1FID31_LATLON_SCALE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2119|    329|#define DAC1FID31_LATLON_SCALE  1000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  732|    329|	{"lat",           t_integer,   .addr.integer = &ais->type8.dac1fid31.lat,
  |  |  733|    329|                                       .dflt.integer = DAC1FID31_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2123|    329|#define DAC1FID31_LAT_NOT_AVAILABLE     (91*60*DAC1FID31_LATLON_SCALE)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2119|    329|#define DAC1FID31_LATLON_SCALE  1000
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  734|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type8.dac1fid31.accuracy,
  |  |  735|    329|                                       .dflt.boolean = false},
  |  |  736|    329|	{"timestamp",     t_string,    .addr.string = timestamp,
  |  |  737|    329|                                       .len = sizeof(timestamp)},
  |  |  738|    329|	{"wspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wspeed,
  |  |  739|    329|                                       .dflt.uinteger = DAC1FID31_WIND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2130|    329|#define DAC1FID31_WIND_NOT_AVAILABLE     127
  |  |  ------------------
  |  |  740|    329|	{"wgust",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wgust,
  |  |  741|    329|                                       .dflt.uinteger = DAC1FID31_WIND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2130|    329|#define DAC1FID31_WIND_NOT_AVAILABLE     127
  |  |  ------------------
  |  |  742|    329|	{"wdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wdir,
  |  |  743|    329|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    329|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  744|    329|	{"wgustdir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wgustdir,
  |  |  745|    329|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    329|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  746|    329|	{"airtemp",       t_integer,   .addr.integer = &ais->type8.dac1fid31.airtemp,
  |  |  747|    329|                                       .dflt.integer = DAC1FID31_AIRTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2135|    329|#define DAC1FID31_AIRTEMP_NOT_AVAILABLE  -1024
  |  |  ------------------
  |  |  748|    329|	{"humidity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.humidity,
  |  |  749|    329|                                       .dflt.uinteger = DAC1FID31_HUMIDITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2138|    329|#define DAC1FID31_HUMIDITY_NOT_AVAILABLE 101
  |  |  ------------------
  |  |  750|    329|	{"dewpoint",      t_integer,   .addr.integer = &ais->type8.dac1fid31.dewpoint,
  |  |  751|    329|                                       .dflt.integer = DAC1FID31_DEWPOINT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2140|    329|#define DAC1FID31_DEWPOINT_NOT_AVAILABLE 501
  |  |  ------------------
  |  |  752|    329|	{"pressure",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.pressure,
  |  |  753|    329|                                       .dflt.uinteger = DAC1FID31_PRESSURE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2143|    329|#define DAC1FID31_PRESSURE_NOT_AVAILABLE 511
  |  |  ------------------
  |  |  754|    329|	{"pressuretend",  t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.pressuretend,
  |  |  755|    329|                                       .dflt.uinteger = DAC1FID31_PRESSURETEND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2147|    329|#define DAC1FID31_PRESSURETEND_NOT_AVAILABLE  3
  |  |  ------------------
  |  |  756|    329|	{"visgreater",    t_boolean,   .addr.boolean = &ais->type8.dac1fid31.visgreater,
  |  |  757|    329|                                       .dflt.boolean = false},
  |  |  758|    329|	{"visibility",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.visibility,
  |  |  759|    329|                                       .dflt.uinteger = DAC1FID31_VISIBILITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2150|    329|#define DAC1FID31_VISIBILITY_NOT_AVAILABLE  127
  |  |  ------------------
  |  |  760|    329|	{"waterlevel",    t_integer,   .addr.integer = &ais->type8.dac1fid31.waterlevel,
  |  |  761|    329|                                       .dflt.integer = DAC1FID31_WATERLEVEL_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2153|    329|#define DAC1FID31_WATERLEVEL_NOT_AVAILABLE 4001
  |  |  ------------------
  |  |  762|    329|	{"leveltrend",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.leveltrend,
  |  |  763|    329|                                       .dflt.uinteger = DAC1FID31_WATERLEVELTREND_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2157|    329|#define DAC1FID31_WATERLEVELTREND_NOT_AVAILABLE 3
  |  |  ------------------
  |  |  764|    329|	{"cspeed",        t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cspeed,
  |  |  765|    329|                                       .dflt.uinteger = DAC1FID31_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2159|    329|#define DAC1FID31_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  766|    329|	{"cdir",          t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdir,
  |  |  767|    329|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    329|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  768|    329|	{"cspeed2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cspeed2,
  |  |  769|    329|                                       .dflt.uinteger = DAC1FID31_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2159|    329|#define DAC1FID31_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  770|    329|	{"cdir2",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdir2,
  |  |  771|    329|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    329|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  772|    329|	{"cdepth2",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdepth2,
  |  |  773|    329|                                       .dflt.uinteger = DAC1FID31_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2165|    329|#define DAC1FID31_CDEPTH_NOT_AVAILABLE     301
  |  |  ------------------
  |  |  774|    329|	{"cspeed3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cspeed3,
  |  |  775|    329|                                       .dflt.uinteger = DAC1FID31_CSPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2159|    329|#define DAC1FID31_CSPEED_NOT_AVAILABLE     255
  |  |  ------------------
  |  |  776|    329|	{"cdir3",         t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdir3,
  |  |  777|    329|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    329|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  778|    329|	{"cdepth3",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.cdepth3,
  |  |  779|    329|                                       .dflt.uinteger = DAC1FID31_CDEPTH_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2165|    329|#define DAC1FID31_CDEPTH_NOT_AVAILABLE     301
  |  |  ------------------
  |  |  780|    329|	{"waveheight",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.waveheight,
  |  |  781|    329|                                       .dflt.uinteger = DAC1FID31_HEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2171|    329|#define DAC1FID31_HEIGHT_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  782|    329|	{"waveperiod",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.waveperiod,
  |  |  783|    329|                                       .dflt.uinteger = DAC1FID31_PERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2174|    329|#define DAC1FID31_PERIOD_NOT_AVAILABLE     63
  |  |  ------------------
  |  |  784|    329|	{"wavedir",       t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.wavedir,
  |  |  785|    329|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    329|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  786|    329|	{"swellheight",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.swellheight,
  |  |  787|    329|                                       .dflt.uinteger = DAC1FID31_HEIGHT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2171|    329|#define DAC1FID31_HEIGHT_NOT_AVAILABLE     31
  |  |  ------------------
  |  |  788|    329|	{"swellperiod",   t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.swellperiod,
  |  |  789|    329|                                       .dflt.uinteger = DAC1FID31_PERIOD_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2174|    329|#define DAC1FID31_PERIOD_NOT_AVAILABLE     63
  |  |  ------------------
  |  |  790|    329|	{"swelldir",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.swelldir,
  |  |  791|    329|                                       .dflt.uinteger = DAC1FID31_DIR_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2133|    329|#define DAC1FID31_DIR_NOT_AVAILABLE      360
  |  |  ------------------
  |  |  792|    329|	{"seastate",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.seastate,
  |  |  793|    329|                                       .dflt.uinteger = DAC1FID31_SEASTATE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2180|    329|#define DAC1FID31_SEASTATE_NOT_AVAILABLE   15
  |  |  ------------------
  |  |  794|    329|	{"watertemp",     t_integer,   .addr.integer = &ais->type8.dac1fid31.watertemp,
  |  |  795|    329|                                       .dflt.integer = DAC1FID31_WATERTEMP_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2182|    329|#define DAC1FID31_WATERTEMP_NOT_AVAILABLE  601
  |  |  ------------------
  |  |  796|    329|	{"preciptype",    t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.preciptype,
  |  |  797|    329|                                       .dflt.uinteger = DAC1FID31_PRECIPTYPE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2185|    329|#define DAC1FID31_PRECIPTYPE_NOT_AVAILABLE 7
  |  |  ------------------
  |  |  798|    329|	{"preciptype_text",   t_ignore},
  |  |  799|    329|	{"salinity",      t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.salinity,
  |  |  800|    329|                                       .dflt.uinteger = DAC1FID31_SALINITY_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2187|    329|#define DAC1FID31_SALINITY_NOT_AVAILABLE   510
  |  |  ------------------
  |  |  801|    329|	{"ice",           t_uinteger,  .addr.uinteger = &ais->type8.dac1fid31.ice,
  |  |  802|    329|                                       .dflt.uinteger = DAC1FID31_ICE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2190|    329|#define DAC1FID31_ICE_NOT_AVAILABLE       3
  |  |  ------------------
  |  |  803|    329|        {NULL}
  |  |  804|    329|    };
  |  |  805|       |
  |  |  806|    329|    const struct json_attr_t json_ais8_fid40[] = {
  |  |  807|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  808|    329|	AIS_TYPE8
  |  |  ------------------
  |  |  |  |   68|    329|        {"dac",           t_uinteger,  .addr.uinteger = &ais->type8.dac,\
  |  |  |  |   69|    329|                                       .dflt.uinteger = 0},\
  |  |  |  |   70|    329|        {"fid",           t_uinteger,  .addr.uinteger = &ais->type8.fid,\
  |  |  |  |   71|    329|                                       .dflt.uinteger = 0},
  |  |  ------------------
  |  |  809|    329|	{"form",          t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.form,
  |  |  810|    329|                                       .dflt.uinteger = DAC200FID40_FORM_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1957|    329|#define DAC200FID40_FORM_UNKNOWN        0
  |  |  ------------------
  |  |  811|    329|	{"facing",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.facing,
  |  |  812|    329|                                       .dflt.uinteger = DAC200FID40_FACING_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1959|    329|#define DAC200FID40_FACING_UNKNOWN      0
  |  |  ------------------
  |  |  813|    329|	{"direction",     t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.direction,
  |  |  814|    329|                                       .dflt.uinteger = DAC200FID40_DIRECTION_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1961|    329|#define DAC200FID40_DIRECTION_UNKNOWN   0
  |  |  ------------------
  |  |  815|    329|	{"direction_text",   t_ignore},
  |  |  816|    329|	{"status",        t_uinteger,  .addr.uinteger = &ais->type8.dac200fid40.status,
  |  |  817|    329|                                       .dflt.uinteger = DAC200FID40_STATUS_UNKNOWN},
  |  |  ------------------
  |  |  |  | 1963|    329|#define DAC200FID40_STATUS_UNKNOWN      0
  |  |  ------------------
  |  |  818|    329|	{"status_text",   t_ignore},
  |  |  819|    329|        {NULL}
  |  |  820|    329|    };
  |  |  821|       |
  |  |  822|    329|    const struct json_attr_t json_ais9[] = {
  |  |  823|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  824|    329|	{"alt",           t_uinteger,  .addr.uinteger = &ais->type9.alt,
  |  |  825|    329|                                       .dflt.uinteger = AIS_ALT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2197|    329|#define AIS_ALT_NOT_AVAILABLE   4095
  |  |  ------------------
  |  |  826|    329|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type9.speed,
  |  |  827|    329|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1542|    329|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  828|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type9.accuracy,
  |  |  829|    329|                                       .dflt.boolean = false},
  |  |  830|    329|	{"lon",           t_integer,   .addr.integer = &ais->type9.lon,
  |  |  831|    329|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1547|    329|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |  832|    329|	{"lat",           t_integer,   .addr.integer = &ais->type9.lat,
  |  |  833|    329|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1549|    329|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |  834|    329|	{"course",        t_uinteger,  .addr.uinteger = &ais->type9.course,
  |  |  835|    329|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1551|    329|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |  836|    329|	{"second",        t_uinteger,  .addr.uinteger = &ais->type9.second,
  |  |  837|    329|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1558|    329|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |  838|    329|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type9.regional,
  |  |  839|    329|                                       .dflt.uinteger = 0},
  |  |  840|    329|	{"dte",           t_uinteger,  .addr.uinteger = &ais->type9.dte,
  |  |  841|    329|                                       .dflt.uinteger = 1},
  |  |  842|    329|	{"raim",          t_boolean,   .addr.boolean = &ais->type9.raim,
  |  |  843|    329|                                       .dflt.boolean = false},
  |  |  844|    329|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type9.radio,
  |  |  845|    329|                                       .dflt.uinteger = 0},
  |  |  846|    329|        {NULL}
  |  |  847|    329|    };
  |  |  848|       |
  |  |  849|    329|    const struct json_attr_t json_ais10[] = {
  |  |  850|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  851|    329|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type10.dest_mmsi,
  |  |  852|    329|                                       .dflt.uinteger = 0},
  |  |  853|    329|        {NULL}
  |  |  854|    329|    };
  |  |  855|       |
  |  |  856|    329|    const struct json_attr_t json_ais12[] = {
  |  |  857|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  858|    329|	{"seqno",         t_uinteger,  .addr.uinteger = &ais->type12.seqno,
  |  |  859|    329|                                       .dflt.uinteger = 0},
  |  |  860|    329|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type12.dest_mmsi,
  |  |  861|    329|                                       .dflt.uinteger = 0},
  |  |  862|    329|	{"retransmit",    t_boolean,   .addr.boolean = &ais->type12.retransmit,
  |  |  863|    329|                                       .dflt.boolean = 0},
  |  |  864|    329|	{"text",          t_string,    .addr.string = ais->type12.text,
  |  |  865|    329|                                       .len = sizeof(ais->type12.text)},
  |  |  866|    329|        {NULL}
  |  |  867|    329|    };
  |  |  868|       |
  |  |  869|    329|    const struct json_attr_t json_ais14[] = {
  |  |  870|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  871|    329|	{"text",          t_string,    .addr.string = ais->type14.text,
  |  |  872|    329|                                       .len = sizeof(ais->type14.text)},
  |  |  873|    329|        {NULL}
  |  |  874|    329|    };
  |  |  875|       |
  |  |  876|    329|    const struct json_attr_t json_ais15[] = {
  |  |  877|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  878|    329|	{"mmsi1",         t_uinteger,  .addr.uinteger = &ais->type15.mmsi1,
  |  |  879|    329|                                       .dflt.uinteger = 0},
  |  |  880|    329|	{"type1_1",       t_uinteger,  .addr.uinteger = &ais->type15.type1_1,
  |  |  881|    329|                                       .dflt.uinteger = 0},
  |  |  882|    329|	{"offset1_1",     t_uinteger,  .addr.uinteger = &ais->type15.offset1_1,
  |  |  883|    329|                                       .dflt.uinteger = 0},
  |  |  884|    329|	{"type1_2",       t_uinteger,  .addr.uinteger = &ais->type15.type1_2,
  |  |  885|    329|                                       .dflt.uinteger = 0},
  |  |  886|    329|	{"offset1_2",     t_uinteger,  .addr.uinteger = &ais->type15.offset1_2,
  |  |  887|    329|                                       .dflt.uinteger = 0},
  |  |  888|    329|	{"mmsi2",         t_uinteger,  .addr.uinteger = &ais->type15.mmsi2,
  |  |  889|    329|                                       .dflt.uinteger = 0},
  |  |  890|    329|	{"type2_1",       t_uinteger,  .addr.uinteger = &ais->type15.type2_1,
  |  |  891|    329|                                       .dflt.uinteger = 0},
  |  |  892|    329|	{"offset2_1",     t_uinteger,  .addr.uinteger = &ais->type15.offset2_1,
  |  |  893|    329|                                       .dflt.uinteger = 0},
  |  |  894|    329|        {NULL}
  |  |  895|    329|    };
  |  |  896|       |
  |  |  897|    329|    const struct json_attr_t json_ais16[] = {
  |  |  898|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  899|    329|	{"mmsi1",         t_uinteger,  .addr.uinteger = &ais->type16.mmsi1,
  |  |  900|    329|                                       .dflt.uinteger = 0},
  |  |  901|    329|	{"offset1",       t_uinteger,  .addr.uinteger = &ais->type16.offset1,
  |  |  902|    329|                                       .dflt.uinteger = 0},
  |  |  903|    329|	{"increment1",    t_uinteger,  .addr.uinteger = &ais->type16.increment1,
  |  |  904|    329|                                       .dflt.uinteger = 0},
  |  |  905|    329|	{"mmsi2",         t_uinteger,  .addr.uinteger = &ais->type16.mmsi2,
  |  |  906|    329|                                       .dflt.uinteger = 0},
  |  |  907|    329|	{"offset2",       t_uinteger,  .addr.uinteger = &ais->type16.offset2,
  |  |  908|    329|                                       .dflt.uinteger = 0},
  |  |  909|    329|	{"increment2",    t_uinteger,  .addr.uinteger = &ais->type16.increment2,
  |  |  910|    329|                                       .dflt.uinteger = 0},
  |  |  911|    329|        {NULL}
  |  |  912|    329|    };
  |  |  913|       |
  |  |  914|    329|    const struct json_attr_t json_ais17[] = {
  |  |  915|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  916|    329|	{"lon",           t_integer,   .addr.integer = &ais->type17.lon,
  |  |  917|    329|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2280|    329|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  |  918|    329|	{"lat",           t_integer,   .addr.integer = &ais->type17.lat,
  |  |  919|    329|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2282|    329|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  |  920|    329|	{"data",          t_string,    .addr.string = data,
  |  |  921|    329|                                       .len = sizeof(data)},
  |  |  922|    329|        {NULL}
  |  |  923|    329|    };
  |  |  924|       |
  |  |  925|    329|    const struct json_attr_t json_ais18[] = {
  |  |  926|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  927|    329|	{"reserved",      t_uinteger,  .addr.uinteger = &ais->type18.reserved,
  |  |  928|    329|                                       .dflt.uinteger = 0},
  |  |  929|    329|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type18.speed,
  |  |  930|    329|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1542|    329|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  931|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type18.accuracy,
  |  |  932|    329|                                       .dflt.boolean = false},
  |  |  933|    329|	{"lon",           t_integer,   .addr.integer = &ais->type18.lon,
  |  |  934|    329|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1547|    329|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |  935|    329|	{"lat",           t_integer,   .addr.integer = &ais->type18.lat,
  |  |  936|    329|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1549|    329|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |  937|    329|	{"course",        t_uinteger,  .addr.uinteger = &ais->type18.course,
  |  |  938|    329|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1551|    329|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |  939|    329|	{"heading",       t_uinteger,  .addr.uinteger = &ais->type18.heading,
  |  |  940|    329|                                       .dflt.uinteger = AIS_HEADING_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1553|    329|#define AIS_HEADING_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  941|    329|	{"second",        t_uinteger,  .addr.uinteger = &ais->type18.second,
  |  |  942|    329|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1558|    329|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |  943|    329|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type18.regional,
  |  |  944|    329|                                       .dflt.uinteger = 0},
  |  |  945|    329|	{"cs",            t_boolean,   .addr.boolean = &ais->type18.cs,
  |  |  946|    329|                                       .dflt.boolean = false},
  |  |  947|    329|	{"display",       t_boolean,   .addr.boolean = &ais->type18.display,
  |  |  948|    329|                                       .dflt.boolean = false},
  |  |  949|    329|	{"dsc",           t_boolean,   .addr.boolean = &ais->type18.dsc,
  |  |  950|    329|                                       .dflt.boolean = false},
  |  |  951|    329|	{"band",          t_boolean,   .addr.boolean = &ais->type18.band,
  |  |  952|    329|                                       .dflt.boolean = false},
  |  |  953|    329|	{"msg22",         t_boolean,   .addr.boolean = &ais->type18.msg22,
  |  |  954|    329|                                       .dflt.boolean = false},
  |  |  955|    329|	{"raim",          t_boolean,   .addr.boolean = &ais->type18.raim,
  |  |  956|    329|                                       .dflt.boolean = false},
  |  |  957|    329|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type18.radio,
  |  |  958|    329|                                       .dflt.uinteger = 0},
  |  |  959|    329|        {NULL}
  |  |  960|    329|    };
  |  |  961|       |
  |  |  962|    329|    const struct json_attr_t json_ais19[] = {
  |  |  963|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  |  964|    329|	{"reserved",      t_uinteger,  .addr.uinteger = &ais->type19.reserved,
  |  |  965|    329|                                       .dflt.uinteger = 0},
  |  |  966|    329|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type19.speed,
  |  |  967|    329|                                       .dflt.uinteger = AIS_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1542|    329|#define AIS_SPEED_NOT_AVAILABLE 1023
  |  |  ------------------
  |  |  968|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type19.accuracy,
  |  |  969|    329|                                       .dflt.boolean = false},
  |  |  970|    329|	{"lon",           t_integer,   .addr.integer = &ais->type19.lon,
  |  |  971|    329|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1547|    329|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  |  972|    329|	{"lat",           t_integer,   .addr.integer = &ais->type19.lat,
  |  |  973|    329|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1549|    329|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  |  974|    329|	{"course",        t_uinteger,  .addr.uinteger = &ais->type19.course,
  |  |  975|    329|                                       .dflt.uinteger = AIS_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1551|    329|#define AIS_COURSE_NOT_AVAILABLE        3600
  |  |  ------------------
  |  |  976|    329|	{"heading",       t_uinteger,  .addr.uinteger = &ais->type19.heading,
  |  |  977|    329|                                       .dflt.uinteger = AIS_HEADING_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1553|    329|#define AIS_HEADING_NOT_AVAILABLE       511
  |  |  ------------------
  |  |  978|    329|	{"second",        t_uinteger,  .addr.uinteger = &ais->type19.second,
  |  |  979|    329|                                       .dflt.uinteger = AIS_SEC_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1558|    329|#define AIS_SEC_NOT_AVAILABLE   60
  |  |  ------------------
  |  |  980|    329|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type19.regional,
  |  |  981|    329|                                       .dflt.uinteger = 0},
  |  |  982|    329|	{"shipname",      t_string,    .addr.string = ais->type19.shipname,
  |  |  983|    329|                                       .len = sizeof(ais->type19.shipname)},
  |  |  984|    329|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type19.shiptype,
  |  |  985|    329|                                       .dflt.uinteger = 0},
  |  |  986|    329|	{"shiptype_text",   t_ignore},
  |  |  987|    329|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type19.to_bow,
  |  |  988|    329|                                       .dflt.uinteger = 0},
  |  |  989|    329|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type19.to_stern,
  |  |  990|    329|                                       .dflt.uinteger = 0},
  |  |  991|    329|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type19.to_port,
  |  |  992|    329|                                       .dflt.uinteger = 0},
  |  |  993|    329|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type19.to_starboard,
  |  |  994|    329|                                       .dflt.uinteger = 0},
  |  |  995|    329|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type19.epfd,
  |  |  996|    329|                                       .dflt.uinteger = 0},
  |  |  997|    329|	{"epfd_text",   t_ignore},
  |  |  998|    329|	{"raim",          t_boolean,   .addr.boolean = &ais->type19.raim,
  |  |  999|    329|                                       .dflt.boolean = false},
  |  | 1000|    329|	{"dte",           t_uinteger,  .addr.uinteger = &ais->type19.dte,
  |  | 1001|    329|                                       .dflt.uinteger = 1},
  |  | 1002|    329|	{"assigned",      t_boolean,   .addr.boolean = &ais->type19.assigned,
  |  | 1003|    329|                                       .dflt.boolean = false},
  |  | 1004|    329|        {NULL}
  |  | 1005|    329|    };
  |  | 1006|       |
  |  | 1007|    329|    const struct json_attr_t json_ais20[] = {
  |  | 1008|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1009|    329|	{"offset1",       t_uinteger,  .addr.uinteger = &ais->type20.offset1,
  |  | 1010|    329|                                       .dflt.uinteger = 0},
  |  | 1011|    329|	{"number1",       t_uinteger,  .addr.uinteger = &ais->type20.number1,
  |  | 1012|    329|                                       .dflt.uinteger = 0},
  |  | 1013|    329|	{"timeout1",      t_uinteger,  .addr.uinteger = &ais->type20.timeout1,
  |  | 1014|    329|                                       .dflt.uinteger = 0},
  |  | 1015|    329|	{"increment1",    t_uinteger,  .addr.uinteger = &ais->type20.increment1,
  |  | 1016|    329|                                       .dflt.uinteger = 0},
  |  | 1017|    329|	{"offset2",       t_uinteger,  .addr.uinteger = &ais->type20.offset2,
  |  | 1018|    329|                                       .dflt.uinteger = 0},
  |  | 1019|    329|	{"number2",       t_uinteger,  .addr.uinteger = &ais->type20.number2,
  |  | 1020|    329|                                       .dflt.uinteger = 0},
  |  | 1021|    329|	{"timeout2",      t_uinteger,  .addr.uinteger = &ais->type20.timeout2,
  |  | 1022|    329|                                       .dflt.uinteger = 0},
  |  | 1023|    329|	{"increment2",    t_uinteger,  .addr.uinteger = &ais->type20.increment2,
  |  | 1024|    329|                                       .dflt.uinteger = 0},
  |  | 1025|    329|	{"offset3",       t_uinteger,  .addr.uinteger = &ais->type20.offset3,
  |  | 1026|    329|                                       .dflt.uinteger = 0},
  |  | 1027|    329|	{"number3",       t_uinteger,  .addr.uinteger = &ais->type20.number3,
  |  | 1028|    329|                                       .dflt.uinteger = 0},
  |  | 1029|    329|	{"timeout3",      t_uinteger,  .addr.uinteger = &ais->type20.timeout3,
  |  | 1030|    329|                                       .dflt.uinteger = 0},
  |  | 1031|    329|	{"increment3",    t_uinteger,  .addr.uinteger = &ais->type20.increment3,
  |  | 1032|    329|                                       .dflt.uinteger = 0},
  |  | 1033|    329|	{"offset4",       t_uinteger,  .addr.uinteger = &ais->type20.offset4,
  |  | 1034|    329|                                       .dflt.uinteger = 0},
  |  | 1035|    329|	{"number4",       t_uinteger,  .addr.uinteger = &ais->type20.number4,
  |  | 1036|    329|                                       .dflt.uinteger = 0},
  |  | 1037|    329|	{"timeout4",      t_uinteger,  .addr.uinteger = &ais->type20.timeout4,
  |  | 1038|    329|                                       .dflt.uinteger = 0},
  |  | 1039|    329|	{"increment4",    t_uinteger,  .addr.uinteger = &ais->type20.increment4,
  |  | 1040|    329|                                       .dflt.uinteger = 0},
  |  | 1041|    329|        {NULL}
  |  | 1042|    329|    };
  |  | 1043|       |
  |  | 1044|    329|    const struct json_attr_t json_ais21[] = {
  |  | 1045|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1046|    329|	{"aid_type",      t_uinteger,  .addr.uinteger = &ais->type21.aid_type,
  |  | 1047|    329|                                       .dflt.uinteger = 0},
  |  | 1048|    329|	{"aid_type_text",   t_ignore},
  |  | 1049|    329|	{"name",          t_string,    .addr.string = ais->type21.name,
  |  | 1050|    329|                                       .len = sizeof(ais->type21.name)},
  |  | 1051|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type21.accuracy,
  |  | 1052|    329|                                       .dflt.boolean = false},
  |  | 1053|    329|	{"lon",           t_integer,   .addr.integer = &ais->type21.lon,
  |  | 1054|    329|                                       .dflt.integer = AIS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1547|    329|#define AIS_LON_NOT_AVAILABLE   0x6791AC0
  |  |  ------------------
  |  | 1055|    329|	{"lat",           t_integer,   .addr.integer = &ais->type21.lat,
  |  | 1056|    329|                                       .dflt.integer = AIS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 1549|    329|#define AIS_LAT_NOT_AVAILABLE   0x3412140
  |  |  ------------------
  |  | 1057|    329|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type21.to_bow,
  |  | 1058|    329|                                       .dflt.uinteger = 0},
  |  | 1059|    329|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type21.to_stern,
  |  | 1060|    329|                                       .dflt.uinteger = 0},
  |  | 1061|    329|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type21.to_port,
  |  | 1062|    329|                                       .dflt.uinteger = 0},
  |  | 1063|    329|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type21.to_starboard,
  |  | 1064|    329|                                       .dflt.uinteger = 0},
  |  | 1065|    329|	{"epfd",          t_uinteger,  .addr.uinteger = &ais->type21.epfd,
  |  | 1066|    329|                                       .dflt.uinteger = 0},
  |  | 1067|    329|	{"epfd_text",   t_ignore},
  |  | 1068|    329|	{"second",        t_uinteger,  .addr.uinteger = &ais->type21.second,
  |  | 1069|    329|                                       .dflt.uinteger = 0},
  |  | 1070|    329|	{"regional",      t_uinteger,  .addr.uinteger = &ais->type21.regional,
  |  | 1071|    329|                                       .dflt.uinteger = 0},
  |  | 1072|    329|	{"off_position",  t_boolean,   .addr.boolean = &ais->type21.off_position,
  |  | 1073|    329|                                       .dflt.boolean = false},
  |  | 1074|    329|	{"raim",          t_boolean,   .addr.boolean = &ais->type21.raim,
  |  | 1075|    329|                                       .dflt.boolean = false},
  |  | 1076|    329|	{"virtual_aid",   t_boolean,   .addr.boolean = &ais->type21.virtual_aid,
  |  | 1077|    329|                                       .dflt.boolean = false},
  |  | 1078|    329|        {NULL}
  |  | 1079|    329|    };
  |  | 1080|       |
  |  | 1081|    329|    const struct json_attr_t json_ais22[] = {
  |  | 1082|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1083|    329|	{"channel_a",     t_uinteger,  .addr.uinteger = &ais->type22.channel_a,
  |  | 1084|    329|                                       .dflt.uinteger = 0},
  |  | 1085|    329|	{"channel_b",     t_uinteger,  .addr.uinteger = &ais->type22.channel_b,
  |  | 1086|    329|                                       .dflt.uinteger = 0},
  |  | 1087|    329|	{"txrx",          t_uinteger,  .addr.uinteger = &ais->type22.txrx,
  |  | 1088|    329|                                       .dflt.uinteger = 0},
  |  | 1089|    329|	{"power",         t_boolean,   .addr.boolean = &ais->type22.power,
  |  | 1090|    329|                                       .dflt.boolean = false},
  |  | 1091|    329|	{"ne_lon",        t_integer,   .addr.integer = &ais->type22.area.ne_lon,
  |  | 1092|    329|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2280|    329|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1093|    329|	{"ne_lat",        t_integer,   .addr.integer = &ais->type22.area.ne_lat,
  |  | 1094|    329|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2282|    329|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1095|    329|	{"sw_lon",        t_integer,   .addr.integer = &ais->type22.area.sw_lon,
  |  | 1096|    329|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2280|    329|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1097|    329|	{"sw_lat",        t_integer,   .addr.integer = &ais->type22.area.sw_lat,
  |  | 1098|    329|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2282|    329|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1099|    329|	{"dest1",         t_uinteger,  .addr.uinteger = &ais->type22.mmsi.dest1,
  |  | 1100|    329|                                       .dflt.uinteger = 0},
  |  | 1101|    329|	{"dest2",         t_uinteger,  .addr.uinteger = &ais->type22.mmsi.dest2,
  |  | 1102|    329|                                       .dflt.uinteger = 0},
  |  | 1103|    329|	{"addressed",     t_boolean,   .addr.boolean = &ais->type22.addressed,
  |  | 1104|    329|                                       .dflt.boolean = false},
  |  | 1105|    329|	{"band_a",        t_boolean,   .addr.boolean = &ais->type22.band_a,
  |  | 1106|    329|                                       .dflt.boolean = false},
  |  | 1107|    329|	{"band_b",        t_boolean,   .addr.boolean = &ais->type22.band_b,
  |  | 1108|    329|                                       .dflt.boolean = false},
  |  | 1109|    329|	{"zonesize",      t_uinteger,  .addr.uinteger = &ais->type22.zonesize,
  |  | 1110|    329|                                       .dflt.uinteger = 0},
  |  | 1111|    329|        {NULL}
  |  | 1112|    329|    };
  |  | 1113|       |
  |  | 1114|    329|    const struct json_attr_t json_ais23[] = {
  |  | 1115|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1116|    329|	{"ne_lon",        t_integer,   .addr.integer = &ais->type23.ne_lon,
  |  | 1117|    329|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2280|    329|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1118|    329|	{"ne_lat",        t_integer,   .addr.integer = &ais->type23.ne_lat,
  |  | 1119|    329|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2282|    329|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1120|    329|	{"sw_lon",        t_integer,   .addr.integer = &ais->type23.sw_lon,
  |  | 1121|    329|                                       .dflt.integer = AIS_GNS_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2280|    329|#define AIS_GNS_LON_NOT_AVAILABLE       0x1a838
  |  |  ------------------
  |  | 1122|    329|	{"sw_lat",        t_integer,   .addr.integer = &ais->type23.sw_lat,
  |  | 1123|    329|                                       .dflt.integer = AIS_GNS_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2282|    329|#define AIS_GNS_LAT_NOT_AVAILABLE       0xd548
  |  |  ------------------
  |  | 1124|    329|	{"stationtype",   t_uinteger,  .addr.uinteger = &ais->type23.stationtype,
  |  | 1125|    329|                                       .dflt.uinteger = 0},
  |  | 1126|    329|	{"stationtype_text",   t_ignore},
  |  | 1127|    329|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type23.shiptype,
  |  | 1128|    329|                                       .dflt.uinteger = 0},
  |  | 1129|    329|	{"shiptype_text",   t_ignore},
  |  | 1130|    329|	{"txrx",          t_uinteger,  .addr.uinteger = &ais->type23.txrx,
  |  | 1131|    329|                                       .dflt.uinteger = 0},
  |  | 1132|    329|	{"interval",      t_uinteger,  .addr.uinteger = &ais->type23.interval,
  |  | 1133|    329|                                       .dflt.uinteger = 0},
  |  | 1134|    329|	{"quiet",         t_uinteger,  .addr.uinteger = &ais->type23.quiet,
  |  | 1135|    329|                                       .dflt.uinteger = 0},
  |  | 1136|    329|        {NULL}
  |  | 1137|    329|    };
  |  | 1138|       |
  |  | 1139|    329|    const struct json_attr_t json_ais24[] = {
  |  | 1140|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1141|    329|	{"shipname",      t_string,    .addr.string = ais->type24.shipname,
  |  | 1142|    329|                                       .len = sizeof(ais->type24.shipname)},
  |  | 1143|    329|	{"shiptype",      t_uinteger,  .addr.uinteger = &ais->type24.shiptype,
  |  | 1144|    329|                                       .dflt.uinteger = 0},
  |  | 1145|    329|	{"shiptype_text",   t_ignore},
  |  | 1146|    329|	{"vendorid",      t_string,    .addr.string = ais->type24.vendorid,
  |  | 1147|    329|                                       .len = sizeof(ais->type24.vendorid)},
  |  | 1148|    329|	{"model",         t_uinteger,  .addr.uinteger = &ais->type24.model,
  |  | 1149|    329|                                       .dflt.uinteger = 0},
  |  | 1150|    329|	{"serial",        t_uinteger,  .addr.uinteger = &ais->type24.serial,
  |  | 1151|    329|                                       .dflt.uinteger = 0},
  |  | 1152|    329|	{"callsign",      t_string,    .addr.string = ais->type24.callsign,
  |  | 1153|    329|                                       .len = sizeof(ais->type24.callsign)},
  |  | 1154|    329|	{"mothership_mmsi",t_uinteger,  .addr.uinteger = &ais->type24.mothership_mmsi,
  |  | 1155|    329|                                       .dflt.uinteger = 0},
  |  | 1156|    329|	{"to_bow",        t_uinteger,  .addr.uinteger = &ais->type24.dim.to_bow,
  |  | 1157|    329|                                       .dflt.uinteger = 0},
  |  | 1158|    329|	{"to_stern",      t_uinteger,  .addr.uinteger = &ais->type24.dim.to_stern,
  |  | 1159|    329|                                       .dflt.uinteger = 0},
  |  | 1160|    329|	{"to_port",       t_uinteger,  .addr.uinteger = &ais->type24.dim.to_port,
  |  | 1161|    329|                                       .dflt.uinteger = 0},
  |  | 1162|    329|	{"to_starboard",  t_uinteger,  .addr.uinteger = &ais->type24.dim.to_starboard,
  |  | 1163|    329|                                       .dflt.uinteger = 0},
  |  | 1164|    329|        {NULL}
  |  | 1165|    329|    };
  |  | 1166|       |
  |  | 1167|    329|    const struct json_attr_t json_ais25[] = {
  |  | 1168|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1169|    329|	{"addressed",     t_boolean,   .addr.boolean = &ais->type25.addressed,
  |  | 1170|    329|                                       .dflt.boolean = false},
  |  | 1171|    329|	{"structured",    t_boolean,   .addr.boolean = &ais->type25.structured,
  |  | 1172|    329|                                       .dflt.boolean = false},
  |  | 1173|    329|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type25.dest_mmsi,
  |  | 1174|    329|                                       .dflt.uinteger = 0},
  |  | 1175|    329|	{"app_id",        t_uinteger,  .addr.uinteger = &ais->type25.app_id,
  |  | 1176|    329|                                       .dflt.uinteger = 0},
  |  | 1177|    329|	{"data",          t_string,    .addr.string = data,
  |  | 1178|    329|                                       .len = sizeof(data)},
  |  | 1179|    329|        {NULL}
  |  | 1180|    329|    };
  |  | 1181|       |
  |  | 1182|    329|    const struct json_attr_t json_ais26[] = {
  |  | 1183|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1184|    329|	{"addressed",     t_boolean,   .addr.boolean = &ais->type26.addressed,
  |  | 1185|    329|                                       .dflt.boolean = false},
  |  | 1186|    329|	{"structured",    t_boolean,   .addr.boolean = &ais->type26.structured,
  |  | 1187|    329|                                       .dflt.boolean = false},
  |  | 1188|    329|	{"dest_mmsi",     t_uinteger,  .addr.uinteger = &ais->type26.dest_mmsi,
  |  | 1189|    329|                                       .dflt.uinteger = 0},
  |  | 1190|    329|	{"app_id",        t_uinteger,  .addr.uinteger = &ais->type26.app_id,
  |  | 1191|    329|                                       .dflt.uinteger = 0},
  |  | 1192|    329|	{"data",          t_string,    .addr.string = data,
  |  | 1193|    329|                                       .len = sizeof(data)},
  |  | 1194|    329|	{"radio",         t_uinteger,  .addr.uinteger = &ais->type26.radio,
  |  | 1195|    329|                                       .dflt.uinteger = 0},
  |  | 1196|    329|        {NULL}
  |  | 1197|    329|    };
  |  | 1198|       |
  |  | 1199|    329|    const struct json_attr_t json_ais27[] = {
  |  | 1200|    329|	AIS_HEADER
  |  |  ------------------
  |  |  |  |   47|    329|        {"class",          t_check,    .dflt.check = "AIS"}, \
  |  |  |  |   48|    329|        {"type",           t_uinteger, .addr.uinteger = &ais->type}, \
  |  |  |  |   49|    329|        {"device",         t_string,   .addr.string = path, \
  |  |  |  |   50|    329|                                          .len = pathlen}, \
  |  |  |  |   51|    329|        {"repeat",         t_uinteger, .addr.uinteger = &ais->repeat}, \
  |  |  |  |   52|    329|        {"scaled",         t_boolean,  .addr.boolean = &scaled, \
  |  |  |  |   53|    329|                                          .dflt.boolean = false}, \
  |  |  |  |   54|    329|        {"mmsi",           t_uinteger, .addr.uinteger = &ais->mmsi},
  |  |  ------------------
  |  | 1201|    329|	{"status",        t_uinteger,  .addr.uinteger = &ais->type27.status,
  |  | 1202|    329|                                       .dflt.uinteger = 0},
  |  | 1203|    329|	{"speed",         t_uinteger,  .addr.uinteger = &ais->type27.speed,
  |  | 1204|    329|                                       .dflt.uinteger = AIS_LONGRANGE_SPEED_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2465|    329|#define AIS_LONGRANGE_SPEED_NOT_AVAILABLE 63
  |  |  ------------------
  |  | 1205|    329|	{"accuracy",      t_boolean,   .addr.boolean = &ais->type27.accuracy,
  |  | 1206|    329|                                       .dflt.boolean = false},
  |  | 1207|    329|	{"lon",           t_integer,   .addr.integer = &ais->type27.lon,
  |  | 1208|    329|                                       .dflt.integer = AIS_LONGRANGE_LON_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2461|    329|#define AIS_LONGRANGE_LON_NOT_AVAILABLE 0x1a838
  |  |  ------------------
  |  | 1209|    329|	{"lat",           t_integer,   .addr.integer = &ais->type27.lat,
  |  | 1210|    329|                                       .dflt.integer = AIS_LONGRANGE_LAT_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2463|    329|#define AIS_LONGRANGE_LAT_NOT_AVAILABLE 0xd548
  |  |  ------------------
  |  | 1211|    329|	{"course",        t_uinteger,  .addr.uinteger = &ais->type27.course,
  |  | 1212|    329|                                       .dflt.uinteger = AIS_LONGRANGE_COURSE_NOT_AVAILABLE},
  |  |  ------------------
  |  |  |  | 2467|    329|#define AIS_LONGRANGE_COURSE_NOT_AVAILABLE 511
  |  |  ------------------
  |  | 1213|    329|	{"raim",          t_boolean,   .addr.boolean = &ais->type27.raim,
  |  | 1214|    329|                                       .dflt.boolean = false},
  |  | 1215|    329|	{"gnss",          t_boolean,   .addr.boolean = &ais->type27.gnss,
  |  | 1216|    329|                                       .dflt.boolean = true},
  |  | 1217|    329|        {NULL}
  |  | 1218|    329|    };
  |  | 1219|       |
  |  | 1220|       |
  |  | 1221|       |
  |  | 1222|       |/* Generated code ends. */
  |  | 1223|       |
  ------------------
   76|       |
   77|    329|#undef AIS_HEADER
   78|       |
   79|    329|    memset(ais, '\0', sizeof(struct ais_t));
   80|       |
   81|    329|    if (NULL != strstr(buf, "\"type\":1,") ||
  ------------------
  |  Branch (81:9): [True: 1, False: 328]
  ------------------
   82|    329|        NULL != strstr(buf, "\"type\":2,") ||
  ------------------
  |  Branch (82:9): [True: 2, False: 326]
  ------------------
   83|    329|        NULL != strstr(buf, "\"type\":3,")) {
  ------------------
  |  Branch (83:9): [True: 3, False: 323]
  ------------------
   84|      6|        status = json_read_object(buf, json_ais1, endptr);
   85|    323|    } else if (NULL != strstr(buf, "\"type\":4,") ||
  ------------------
  |  Branch (85:16): [True: 5, False: 318]
  ------------------
   86|    323|               NULL != strstr(buf, "\"type\":11,")) {
  ------------------
  |  Branch (86:16): [True: 1, False: 317]
  ------------------
   87|      6|        status = json_read_object(buf, json_ais4, endptr);
   88|      6|        if (0 == status) {
  ------------------
  |  Branch (88:13): [True: 1, False: 5]
  ------------------
   89|       |            // no need to set zeros, again.
   90|       |            // ais->type4.year = AIS_YEAR_NOT_AVAILABLE;
   91|       |            // ais->type4.month = AIS_MONTH_NOT_AVAILABLE;
   92|       |            // ais->type4.day = AIS_DAY_NOT_AVAILABLE;
   93|      1|            ais->type4.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
   94|      1|            ais->type4.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
   95|      1|            ais->type4.second = AIS_SECOND_NOT_AVAILABLE;
  ------------------
  |  | 1580|      1|#define AIS_SECOND_NOT_AVAILABLE        60
  ------------------
   96|       |            /* We use %09u for the date to allow for dodgy years (>9999)
   97|       |             * to go through. */
   98|      1|            (void)sscanf(timestamp, "%09u-%02u-%02uT%02u:%02u:%02uZ",
   99|      1|                         &ais->type4.year,
  100|      1|                         &ais->type4.month,
  101|      1|                         &ais->type4.day,
  102|      1|                         &ais->type4.hour,
  103|      1|                         &ais->type4.minute,
  104|      1|                         &ais->type4.second);
  105|      1|        }
  106|    317|    } else if (strstr(buf, "\"type\":5,") != NULL) {
  ------------------
  |  Branch (106:16): [True: 12, False: 305]
  ------------------
  107|     12|        status = json_read_object(buf, json_ais5, endptr);
  108|     12|        if (status == 0) {
  ------------------
  |  Branch (108:13): [True: 2, False: 10]
  ------------------
  109|       |            // no need to set zeros, again.
  110|       |            // ais->type5.month = AIS_MONTH_NOT_AVAILABLE;
  111|       |            // ais->type5.day = AIS_DAY_NOT_AVAILABLE;
  112|      2|            ais->type5.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  113|      2|            ais->type5.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  114|      2|            (void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
  115|      2|                         &ais->type5.month,
  116|      2|                         &ais->type5.day,
  117|      2|                         &ais->type5.hour,
  118|      2|                         &ais->type5.minute);
  119|      2|        }
  120|    305|    } else if (strstr(buf, "\"type\":6,") != NULL) {
  ------------------
  |  Branch (120:16): [True: 124, False: 181]
  ------------------
  121|    124|        bool structured = false;
  122|    124|        if (strstr(buf, "\"dac\":1,") != NULL) {
  ------------------
  |  Branch (122:13): [True: 31, False: 93]
  ------------------
  123|     31|            if (strstr(buf, "\"fid\":12,") != NULL) {
  ------------------
  |  Branch (123:17): [True: 5, False: 26]
  ------------------
  124|      5|                status = json_read_object(buf, json_ais6_fid12, endptr);
  125|      5|                if (status == 0) {
  ------------------
  |  Branch (125:21): [True: 1, False: 4]
  ------------------
  126|       |                    // no need to set zeros, again.
  127|       |                    // ais->type6.dac1fid12.lmonth = AIS_MONTH_NOT_AVAILABLE;
  128|       |                    // ais->type6.dac1fid12.lday = AIS_DAY_NOT_AVAILABLE;
  129|      1|                    ais->type6.dac1fid12.lhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  130|      1|                    ais->type6.dac1fid12.lminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  131|       |                    // ais->type6.dac1fid12.nmonth = AIS_MONTH_NOT_AVAILABLE;
  132|       |                    // ais->type6.dac1fid12.nday = AIS_DAY_NOT_AVAILABLE;
  133|      1|                    ais->type6.dac1fid12.nhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  134|      1|                    ais->type6.dac1fid12.nminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  135|      1|                    (void)sscanf(departure, "%02u-%02uT%02u:%02uZ",
  136|      1|                                 &ais->type6.dac1fid12.lmonth,
  137|      1|                                 &ais->type6.dac1fid12.lday,
  138|      1|                                 &ais->type6.dac1fid12.lhour,
  139|      1|                                 &ais->type6.dac1fid12.lminute);
  140|      1|                    (void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
  141|      1|                                 &ais->type6.dac1fid12.nmonth,
  142|      1|                                 &ais->type6.dac1fid12.nday,
  143|      1|                                 &ais->type6.dac1fid12.nhour,
  144|      1|                                 &ais->type6.dac1fid12.nminute);
  145|      1|                }
  146|      5|                structured = true;
  147|      5|            }
  148|     26|            else if (strstr(buf, "\"fid\":15,") != NULL) {
  ------------------
  |  Branch (148:22): [True: 1, False: 25]
  ------------------
  149|      1|                status = json_read_object(buf, json_ais6_fid15, endptr);
  150|      1|                structured = true;
  151|      1|            }
  152|     25|            else if (strstr(buf, "\"fid\":16,") != NULL) {
  ------------------
  |  Branch (152:22): [True: 1, False: 24]
  ------------------
  153|      1|                status = json_read_object(buf, json_ais6_fid16, endptr);
  154|      1|                structured = true;
  155|      1|            }
  156|     24|            else if (strstr(buf, "\"fid\":18,") != NULL) {
  ------------------
  |  Branch (156:22): [True: 5, False: 19]
  ------------------
  157|      5|                status = json_read_object(buf, json_ais6_fid18, endptr);
  158|      5|                if (status == 0) {
  ------------------
  |  Branch (158:21): [True: 1, False: 4]
  ------------------
  159|       |                    // no need to set zeros, again.
  160|       |                    // ais->type6.dac1fid18.month = AIS_MONTH_NOT_AVAILABLE;
  161|       |                    // ais->type6.dac1fid18.day = AIS_DAY_NOT_AVAILABLE;
  162|      1|                    ais->type6.dac1fid18.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  163|      1|                    ais->type6.dac1fid18.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  164|      1|                    (void)sscanf(arrival, "%02u-%02uT%02u:%02uZ",
  165|      1|                                 &ais->type6.dac1fid18.month,
  166|      1|                                 &ais->type6.dac1fid18.day,
  167|      1|                                 &ais->type6.dac1fid18.hour,
  168|      1|                                 &ais->type6.dac1fid18.minute);
  169|      1|                }
  170|      5|                structured = true;
  171|      5|            }
  172|     19|            else if (strstr(buf, "\"fid\":20,") != NULL) {
  ------------------
  |  Branch (172:22): [True: 7, False: 12]
  ------------------
  173|      7|                status = json_read_object(buf, json_ais6_fid20, endptr);
  174|      7|                if (status == 0) {
  ------------------
  |  Branch (174:21): [True: 2, False: 5]
  ------------------
  175|       |                    // no need to set zeros, again.
  176|       |                    // ais->type6.dac1fid20.month = AIS_MONTH_NOT_AVAILABLE;
  177|       |                    // ais->type6.dac1fid20.day = AIS_DAY_NOT_AVAILABLE;
  178|      2|                    ais->type6.dac1fid20.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  179|      2|                    ais->type6.dac1fid20.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  180|      2|                    (void)sscanf(arrival, "%02u-%02uT%02u:%02uZ",
  181|      2|                                 &ais->type6.dac1fid20.month,
  182|      2|                                 &ais->type6.dac1fid20.day,
  183|      2|                                 &ais->type6.dac1fid20.hour,
  184|      2|                                 &ais->type6.dac1fid20.minute);
  185|      2|                }
  186|      7|                structured = true;
  187|      7|            }
  188|     12|            else if (strstr(buf, "\"fid\":25,") != NULL) {
  ------------------
  |  Branch (188:22): [True: 3, False: 9]
  ------------------
  189|      3|                status = json_read_object(buf, json_ais6_fid25, endptr);
  190|      3|                structured = true;
  191|      3|            }
  192|      9|            else if (strstr(buf, "\"fid\":28,") != NULL) {
  ------------------
  |  Branch (192:22): [True: 5, False: 4]
  ------------------
  193|      5|                status = json_read_object(buf, json_ais6_fid28, endptr);
  194|      5|                if (status == 0) {
  ------------------
  |  Branch (194:21): [True: 1, False: 4]
  ------------------
  195|       |                    // no need to set zeros, again.
  196|       |                    // ais->type6.dac1fid28.month = AIS_MONTH_NOT_AVAILABLE;
  197|       |                    // ais->type6.dac1fid28.day = AIS_DAY_NOT_AVAILABLE;
  198|      1|                    ais->type6.dac1fid28.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  199|      1|                    ais->type6.dac1fid28.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  200|      1|                    (void)sscanf(start, "%02u-%02uT%02u:%02uZ",
  201|      1|                                 &ais->type6.dac1fid28.month,
  202|      1|                                 &ais->type6.dac1fid28.day,
  203|      1|                                 &ais->type6.dac1fid28.hour,
  204|      1|                                 &ais->type6.dac1fid28.minute);
  205|      1|                }
  206|      5|                structured = true;
  207|      5|            }
  208|      4|            else if (strstr(buf, "\"fid\":30,") != NULL) {
  ------------------
  |  Branch (208:22): [True: 1, False: 3]
  ------------------
  209|      1|                status = json_read_object(buf, json_ais6_fid30, endptr);
  210|      1|                structured = true;
  211|      1|            }
  212|      3|            else if (strstr(buf, "\"fid\":32,") != NULL ||
  ------------------
  |  Branch (212:22): [True: 1, False: 2]
  ------------------
  213|      2|                     strstr(buf, "\"fid\":14,") != NULL) {
  ------------------
  |  Branch (213:22): [True: 1, False: 1]
  ------------------
  214|      2|                status = json_read_object(buf, json_ais6_fid32, endptr);
  215|      2|                structured = true;
  216|      2|            }
  217|     31|        }
  218|     93|        else if (strstr(buf, "\"dac\":235,") != NULL ||
  ------------------
  |  Branch (218:18): [True: 2, False: 91]
  ------------------
  219|     91|                 strstr(buf, "\"dac\":250,") != NULL) {
  ------------------
  |  Branch (219:18): [True: 2, False: 89]
  ------------------
  220|      4|            if (strstr(buf, "\"fid\":10,") != NULL) {
  ------------------
  |  Branch (220:17): [True: 2, False: 2]
  ------------------
  221|      2|                status = json_read_object(buf, json_ais6_fid10, endptr);
  222|      2|                structured = true;
  223|      2|            }
  224|      4|        }
  225|     89|        else if (strstr(buf, "\"dac\":200,") != NULL) {
  ------------------
  |  Branch (225:18): [True: 12, False: 77]
  ------------------
  226|     12|            if (strstr(buf, "\"fid\":21,") != NULL) {
  ------------------
  |  Branch (226:17): [True: 5, False: 7]
  ------------------
  227|      5|                status = json_read_object(buf, json_ais6_fid21, endptr);
  228|      5|                structured = true;
  229|      5|                if (status == 0) {
  ------------------
  |  Branch (229:21): [True: 1, False: 4]
  ------------------
  230|       |                    // no need to set zeros, again.
  231|       |                    // ais->type6.dac200fid21.month = AIS_MONTH_NOT_AVAILABLE;
  232|       |                    // ais->type6.dac200fid21.day = AIS_DAY_NOT_AVAILABLE;
  233|      1|                    ais->type6.dac200fid21.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  234|      1|                    ais->type6.dac200fid21.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  235|      1|                    (void)sscanf(eta, "%02u-%02uT%02u:%02u",
  236|      1|                                 &ais->type6.dac200fid21.month,
  237|      1|                                 &ais->type6.dac200fid21.day,
  238|      1|                                 &ais->type6.dac200fid21.hour,
  239|      1|                                 &ais->type6.dac200fid21.minute);
  240|      1|                }
  241|      5|            }
  242|      7|            else if (strstr(buf, "\"fid\":22,") != NULL) {
  ------------------
  |  Branch (242:22): [True: 5, False: 2]
  ------------------
  243|      5|                status = json_read_object(buf, json_ais6_fid22, endptr);
  244|      5|                structured = true;
  245|      5|                if (status == 0) {
  ------------------
  |  Branch (245:21): [True: 1, False: 4]
  ------------------
  246|       |                    // no need to set zeros, again.
  247|       |                    // ais->type6.dac200fid22.month = AIS_MONTH_NOT_AVAILABLE;
  248|       |                    // ais->type6.dac200fid22.day = AIS_DAY_NOT_AVAILABLE;
  249|      1|                    ais->type6.dac200fid22.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  250|      1|                    ais->type6.dac200fid22.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  251|      1|                    (void)sscanf(rta, "%02u-%02uT%02u:%02u",
  252|      1|                                 &ais->type6.dac200fid22.month,
  253|      1|                                 &ais->type6.dac200fid22.day,
  254|      1|                                 &ais->type6.dac200fid22.hour,
  255|      1|                                 &ais->type6.dac200fid22.minute);
  256|      1|                }
  257|      5|            }
  258|      2|            else if (strstr(buf, "\"fid\":55,") != NULL) {
  ------------------
  |  Branch (258:22): [True: 1, False: 1]
  ------------------
  259|      1|                status = json_read_object(buf, json_ais6_fid55, endptr);
  260|      1|                structured = true;
  261|      1|            }
  262|     12|        }
  263|    124|        if (!structured) {
  ------------------
  |  Branch (263:13): [True: 81, False: 43]
  ------------------
  264|     81|            status = json_read_object(buf, json_ais6, endptr);
  265|     81|            if (status == 0)
  ------------------
  |  Branch (265:17): [True: 74, False: 7]
  ------------------
  266|     74|                lenhex_unpack(data, &ais->type6.bitcount,
  267|     74|                              ais->type6.bitdata, sizeof(ais->type6.bitdata));
  268|     81|        }
  269|    124|        ais->type6.structured = structured;
  270|    181|    } else if (strstr(buf, "\"type\":7,") != NULL
  ------------------
  |  Branch (270:16): [True: 3, False: 178]
  ------------------
  271|    178|               || strstr(buf, "\"type\":13,") != NULL) {
  ------------------
  |  Branch (271:19): [True: 1, False: 177]
  ------------------
  272|      4|        status = json_read_object(buf, json_ais7, endptr);
  273|    177|    } else if (strstr(buf, "\"type\":8,") != NULL) {
  ------------------
  |  Branch (273:16): [True: 109, False: 68]
  ------------------
  274|    109|        bool structured = false;
  275|    109|        if (strstr(buf, "\"dac\":1,") != NULL) {
  ------------------
  |  Branch (275:13): [True: 69, False: 40]
  ------------------
  276|     69|            if (strstr(buf, "\"fid\":11,") != NULL) {
  ------------------
  |  Branch (276:17): [True: 4, False: 65]
  ------------------
  277|      4|                status = json_read_object(buf, json_ais8_fid11, endptr);
  278|      4|                if (status == 0) {
  ------------------
  |  Branch (278:21): [True: 1, False: 3]
  ------------------
  279|       |                    // ais->type8.dac1fid11.day = AIS_DAY_NOT_AVAILABLE;
  280|      1|                    ais->type8.dac1fid11.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  281|      1|                    ais->type8.dac1fid11.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  282|      1|                    (void)sscanf(timestamp, "%02uT%02u:%02uZ",
  283|      1|                                 &ais->type8.dac1fid11.day,
  284|      1|                                 &ais->type8.dac1fid11.hour,
  285|      1|                                 &ais->type8.dac1fid11.minute);
  286|      1|                }
  287|      4|                structured = true;
  288|      4|            }
  289|     65|            else if (strstr(buf, "\"fid\":13,") != NULL) {
  ------------------
  |  Branch (289:22): [True: 2, False: 63]
  ------------------
  290|      2|                status = json_read_object(buf, json_ais8_fid13, endptr);
  291|      2|                if (status == 0) {
  ------------------
  |  Branch (291:21): [True: 1, False: 1]
  ------------------
  292|       |                    // no need to set zeros, again.
  293|       |                    // ais->type8.dac1fid13.fmonth = AIS_MONTH_NOT_AVAILABLE;
  294|       |                    // ais->type8.dac1fid13.fday = AIS_DAY_NOT_AVAILABLE;
  295|      1|                    ais->type8.dac1fid13.fhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  296|      1|                    ais->type8.dac1fid13.fminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  297|      1|                    (void)sscanf(departure, "%02u-%02uT%02u:%02uZ",
  298|      1|                                 &ais->type8.dac1fid13.fmonth,
  299|      1|                                 &ais->type8.dac1fid13.fday,
  300|      1|                                 &ais->type8.dac1fid13.fhour,
  301|      1|                                 &ais->type8.dac1fid13.fminute);
  302|       |                    // no need to set zeros, again.
  303|       |                    // ais->type8.dac1fid13.tmonth = AIS_MONTH_NOT_AVAILABLE;
  304|       |                    // ais->type8.dac1fid13.tday = AIS_DAY_NOT_AVAILABLE;
  305|      1|                    ais->type8.dac1fid13.thour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  306|      1|                    ais->type8.dac1fid13.tminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  307|      1|                    (void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
  308|      1|                                 &ais->type8.dac1fid13.tmonth,
  309|      1|                                 &ais->type8.dac1fid13.tday,
  310|      1|                                 &ais->type8.dac1fid13.thour,
  311|      1|                                 &ais->type8.dac1fid13.tminute);
  312|      1|                }
  313|      2|                structured = true;
  314|      2|            }
  315|     63|            else if (strstr(buf, "\"fid\":15,") != NULL) {
  ------------------
  |  Branch (315:22): [True: 1, False: 62]
  ------------------
  316|      1|                status = json_read_object(buf, json_ais8_fid15, endptr);
  317|      1|                structured = true;
  318|      1|            }
  319|     62|            else if (strstr(buf, "\"fid\":16,") != NULL) {
  ------------------
  |  Branch (319:22): [True: 43, False: 19]
  ------------------
  320|     43|                status = json_read_object(buf, json_ais8_fid16, endptr);
  321|     43|                if (status == 0) {
  ------------------
  |  Branch (321:21): [True: 1, False: 42]
  ------------------
  322|      1|                        structured = true;
  323|      1|                }
  324|     43|            }
  325|     19|            else if (strstr(buf, "\"fid\":17,") != NULL) {
  ------------------
  |  Branch (325:22): [True: 1, False: 18]
  ------------------
  326|      1|                status = json_read_object(buf, json_ais8_fid17, endptr);
  327|      1|                structured = true;
  328|      1|            }
  329|     18|            else if (strstr(buf, "\"fid\":19,") != NULL) {
  ------------------
  |  Branch (329:22): [True: 1, False: 17]
  ------------------
  330|      1|                status = json_read_object(buf, json_ais8_fid19, endptr);
  331|      1|                structured = true;
  332|      1|            }
  333|     17|            else if (strstr(buf, "\"fid\":23,") != NULL) {
  ------------------
  |  Branch (333:22): [True: 5, False: 12]
  ------------------
  334|      5|                status = json_read_object(buf, json_ais8_fid23, endptr);
  335|      5|                if (status == 0) {
  ------------------
  |  Branch (335:21): [True: 1, False: 4]
  ------------------
  336|       |                    // no need to set zeros, again.
  337|       |                    /* ais->type8.dac200fid23.start_year =
  338|       |                     *     AIS_YEAR_NOT_AVAILABLE;
  339|       |                     * ais->type8.dac200fid23.start_month =
  340|       |                     *    AIS_MONTH_NOT_AVAILABLE; */
  341|       |                    // ais->type8.dac200fid23.start_day = AIS_DAY_NOT_AVAILABLE;
  342|      1|                    ais->type8.dac200fid23.start_hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  343|      1|                    ais->type8.dac200fid23.start_minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  344|       |                    /* ais->type8.dac200fid23.end_year =
  345|       |                     *     AIS_YEAR_NOT_AVAILABLE;
  346|       |                     * ais->type8.dac200fid23.end_month =
  347|       |                     *     AIS_MONTH_NOT_AVAILABLE; */
  348|       |                    // ais->type8.dac200fid23.end_day = AIS_DAY_NOT_AVAILABLE;
  349|      1|                    ais->type8.dac200fid23.end_hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  350|      1|                    ais->type8.dac200fid23.end_minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  351|      1|                    (void)sscanf(start, "%09u-%02u-%02uT%02u:%02u",
  352|      1|                             &ais->type8.dac200fid23.start_year,
  353|      1|                             &ais->type8.dac200fid23.start_month,
  354|      1|                             &ais->type8.dac200fid23.start_day,
  355|      1|                             &ais->type8.dac200fid23.start_hour,
  356|      1|                             &ais->type8.dac200fid23.start_minute);
  357|      1|                    (void)sscanf(end, "%09u-%02u-%02uT%02u:%02u",
  358|      1|                             &ais->type8.dac200fid23.end_year,
  359|      1|                             &ais->type8.dac200fid23.end_month,
  360|      1|                             &ais->type8.dac200fid23.end_day,
  361|      1|                             &ais->type8.dac200fid23.end_hour,
  362|      1|                             &ais->type8.dac200fid23.end_minute);
  363|      1|                }
  364|      5|                structured = true;
  365|      5|            }
  366|     12|            else if (strstr(buf, "\"fid\":24,") != NULL) {
  ------------------
  |  Branch (366:22): [True: 1, False: 11]
  ------------------
  367|      1|                status = json_read_object(buf, json_ais8_fid24, endptr);
  368|      1|                structured = true;
  369|      1|            }
  370|     11|            else if (strstr(buf, "\"fid\":27,") != NULL) {
  ------------------
  |  Branch (370:22): [True: 3, False: 8]
  ------------------
  371|      3|                status = json_read_object(buf, json_ais8_fid27, endptr);
  372|      3|                if (status == 0) {
  ------------------
  |  Branch (372:21): [True: 1, False: 2]
  ------------------
  373|       |                    // no need to set zeros, again.
  374|       |                    // ais->type8.dac1fid27.month = AIS_MONTH_NOT_AVAILABLE;
  375|       |                    // ais->type8.dac1fid27.day = AIS_DAY_NOT_AVAILABLE;
  376|      1|                    ais->type8.dac1fid27.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  377|      1|                    ais->type8.dac1fid27.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  378|      1|                    (void)sscanf(start, "%02u-%02uT%02u:%02uZ",
  379|      1|                                 &ais->type8.dac1fid27.month,
  380|      1|                                 &ais->type8.dac1fid27.day,
  381|      1|                                 &ais->type8.dac1fid27.hour,
  382|      1|                                 &ais->type8.dac1fid27.minute);
  383|      1|                }
  384|      3|                structured = true;
  385|      3|            }
  386|      8|            else if (strstr(buf, "\"fid\":29,") != NULL) {
  ------------------
  |  Branch (386:22): [True: 1, False: 7]
  ------------------
  387|      1|                status = json_read_object(buf, json_ais8_fid29, endptr);
  388|      1|                structured = true;
  389|      1|            }
  390|      7|            else if (strstr(buf, "\"fid\":31,") != NULL) {
  ------------------
  |  Branch (390:22): [True: 6, False: 1]
  ------------------
  391|      6|                status = json_read_object(buf, json_ais8_fid31, endptr);
  392|      6|                if (status == 0) {
  ------------------
  |  Branch (392:21): [True: 2, False: 4]
  ------------------
  393|       |                    // ais->type8.dac1fid31.day = AIS_DAY_NOT_AVAILABLE;
  394|      2|                    ais->type8.dac1fid31.hour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      2|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  395|      2|                    ais->type8.dac1fid31.minute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      2|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  396|      2|                    (void)sscanf(timestamp, "%02uT%02u:%02uZ",
  397|      2|                                 &ais->type8.dac1fid31.day,
  398|      2|                                 &ais->type8.dac1fid31.hour,
  399|      2|                                 &ais->type8.dac1fid31.minute);
  400|      2|                }
  401|      6|                structured = true;
  402|      6|            }
  403|     69|        }
  404|     40|        else if (strstr(buf, "\"dac\":200,") != NULL &&
  ------------------
  |  Branch (404:18): [True: 7, False: 33]
  ------------------
  405|      7|                 strstr(buf,"data")==NULL) {
  ------------------
  |  Branch (405:18): [True: 6, False: 1]
  ------------------
  406|      6|            if (strstr(buf, "\"fid\":10,") != NULL) {
  ------------------
  |  Branch (406:17): [True: 4, False: 2]
  ------------------
  407|      4|                status = json_read_object(buf, json_ais8_fid10, endptr);
  408|      4|                structured = true;
  409|      4|            }
  410|      6|            if (strstr(buf, "\"fid\":40,") != NULL) {
  ------------------
  |  Branch (410:17): [True: 4, False: 2]
  ------------------
  411|      4|                status = json_read_object(buf, json_ais8_fid40, endptr);
  412|      4|                structured = true;
  413|      4|            }
  414|      6|        }
  415|    109|        if (!structured) {
  ------------------
  |  Branch (415:13): [True: 78, False: 31]
  ------------------
  416|     78|            status = json_read_object(buf, json_ais8, endptr);
  417|     78|            if (status == 0)
  ------------------
  |  Branch (417:17): [True: 30, False: 48]
  ------------------
  418|     30|                lenhex_unpack(data, &ais->type8.bitcount,
  419|     30|                              ais->type8.bitdata, sizeof(ais->type8.bitdata));
  420|     78|        }
  421|    109|        ais->type8.structured = structured;
  422|    109|    } else if (strstr(buf, "\"type\":9,") != NULL) {
  ------------------
  |  Branch (422:16): [True: 2, False: 66]
  ------------------
  423|      2|        status = json_read_object(buf, json_ais9, endptr);
  424|     66|    } else if (strstr(buf, "\"type\":10,") != NULL) {
  ------------------
  |  Branch (424:16): [True: 1, False: 65]
  ------------------
  425|      1|        status = json_read_object(buf, json_ais10, endptr);
  426|     65|    } else if (strstr(buf, "\"type\":12,") != NULL) {
  ------------------
  |  Branch (426:16): [True: 2, False: 63]
  ------------------
  427|      2|        status = json_read_object(buf, json_ais12, endptr);
  428|     63|    } else if (strstr(buf, "\"type\":14,") != NULL) {
  ------------------
  |  Branch (428:16): [True: 2, False: 61]
  ------------------
  429|      2|        status = json_read_object(buf, json_ais14, endptr);
  430|     61|    } else if (strstr(buf, "\"type\":15,") != NULL) {
  ------------------
  |  Branch (430:16): [True: 1, False: 60]
  ------------------
  431|      1|        status = json_read_object(buf, json_ais15, endptr);
  432|     60|    } else if (strstr(buf, "\"type\":16,") != NULL) {
  ------------------
  |  Branch (432:16): [True: 1, False: 59]
  ------------------
  433|      1|        status = json_read_object(buf, json_ais16, endptr);
  434|     59|    } else if (strstr(buf, "\"type\":17,") != NULL) {
  ------------------
  |  Branch (434:16): [True: 3, False: 56]
  ------------------
  435|      3|        status = json_read_object(buf, json_ais17, endptr);
  436|      3|        if (status == 0)
  ------------------
  |  Branch (436:13): [True: 1, False: 2]
  ------------------
  437|      1|            lenhex_unpack(data, &ais->type17.bitcount,
  438|      1|                          ais->type17.bitdata, sizeof(ais->type17.bitdata));
  439|     56|    } else if (strstr(buf, "\"type\":18,") != NULL) {
  ------------------
  |  Branch (439:16): [True: 4, False: 52]
  ------------------
  440|      4|        status = json_read_object(buf, json_ais18, endptr);
  441|     52|    } else if (strstr(buf, "\"type\":19,") != NULL) {
  ------------------
  |  Branch (441:16): [True: 1, False: 51]
  ------------------
  442|      1|        status = json_read_object(buf, json_ais19, endptr);
  443|     51|    } else if (strstr(buf, "\"type\":20,") != NULL) {
  ------------------
  |  Branch (443:16): [True: 1, False: 50]
  ------------------
  444|      1|        status = json_read_object(buf, json_ais20, endptr);
  445|     50|    } else if (strstr(buf, "\"type\":21,") != NULL) {
  ------------------
  |  Branch (445:16): [True: 2, False: 48]
  ------------------
  446|      2|        status = json_read_object(buf, json_ais21, endptr);
  447|     48|    } else if (strstr(buf, "\"type\":22,") != NULL) {
  ------------------
  |  Branch (447:16): [True: 2, False: 46]
  ------------------
  448|      2|        status = json_read_object(buf, json_ais22, endptr);
  449|     46|    } else if (strstr(buf, "\"type\":23,") != NULL) {
  ------------------
  |  Branch (449:16): [True: 21, False: 25]
  ------------------
  450|     21|        status = json_read_object(buf, json_ais23, endptr);
  451|     25|    } else if (strstr(buf, "\"type\":24,") != NULL) {
  ------------------
  |  Branch (451:16): [True: 1, False: 24]
  ------------------
  452|      1|        status = json_read_object(buf, json_ais24, endptr);
  453|     24|    } else if (strstr(buf, "\"type\":25,") != NULL) {
  ------------------
  |  Branch (453:16): [True: 13, False: 11]
  ------------------
  454|     13|        status = json_read_object(buf, json_ais25, endptr);
  455|     13|        if (status == 0)
  ------------------
  |  Branch (455:13): [True: 11, False: 2]
  ------------------
  456|     11|            lenhex_unpack(data, &ais->type25.bitcount,
  457|     11|                          ais->type25.bitdata, sizeof(ais->type25.bitdata));
  458|     13|    } else if (strstr(buf, "\"type\":26,") != NULL) {
  ------------------
  |  Branch (458:16): [True: 9, False: 2]
  ------------------
  459|      9|        status = json_read_object(buf, json_ais26, endptr);
  460|      9|        if (status == 0)
  ------------------
  |  Branch (460:13): [True: 4, False: 5]
  ------------------
  461|      4|            lenhex_unpack(data, &ais->type26.bitcount,
  462|      4|                          ais->type26.bitdata, sizeof(ais->type26.bitdata));
  463|      9|    } else if (strstr(buf, "\"type\":27,") != NULL) {
  ------------------
  |  Branch (463:16): [True: 1, False: 1]
  ------------------
  464|      1|        status = json_read_object(buf, json_ais27, endptr);
  465|      1|    } else {
  466|      1|        if (NULL != endptr) {
  ------------------
  |  Branch (466:13): [True: 0, False: 1]
  ------------------
  467|      0|            *endptr = NULL;
  468|      0|        }
  469|      1|        return JSON_ERR_MISC;
  ------------------
  |  |  172|      1|#define JSON_ERR_MISC          21      // other data conversion error
  ------------------
  470|      1|    }
  471|    328|    return status;
  472|    329|}
ais_json.c:lenhex_unpack:
   29|    120|{
   30|    120|    const char *colon = strchr(from, ':');
   31|       |
   32|    120|    *plen = (size_t)atoi(from);
   33|    120|    if (NULL != colon) {
  ------------------
  |  Branch (33:9): [True: 111, False: 9]
  ------------------
   34|    111|        (void)gps_hexpack(colon + 1, (unsigned char *)to, maxlen);
   35|    111|    }
   36|    120|}

safe_atof:
  294|  5.38k|{
  295|  5.38k|    static int maxExponent = 511;   /* Largest possible base 10 exponent.  Any
  296|       |                                     * exponent larger than this will already
  297|       |                                     * produce underflow or overflow, so there's
  298|       |                                     * no need to worry about additional digits.
  299|       |                                     */
  300|       |    /* Table giving binary powers of 10.  Entry is 10^2^i.
  301|       |     * Used to convert decimal exponents into floating-point numbers. */
  302|  5.38k|    static double powersOf10[] = {
  303|  5.38k|        10.,
  304|  5.38k|        100.,
  305|  5.38k|        1.0e4,
  306|  5.38k|        1.0e8,
  307|  5.38k|        1.0e16,
  308|  5.38k|        1.0e32,
  309|  5.38k|        1.0e64,
  310|  5.38k|        1.0e128,
  311|  5.38k|        1.0e256
  312|  5.38k|    };
  313|       |
  314|  5.38k|    bool sign = false, expSign = false;
  315|  5.38k|    double fraction, dblExp, *d;
  316|  5.38k|    const char *p;
  317|  5.38k|    unsigned char c;
  318|  5.38k|    int exp = 0;                // Exponent read from "EX" field.
  319|  5.38k|    int fracExp = 0;            /* Exponent that derives from the fractional
  320|       |                                 * part.  Under normal circumstatnces, it is
  321|       |                                 * the negative of the number of digits in F.
  322|       |                                 * However, if I is very long, the last digits
  323|       |                                 * of I get dropped (otherwise a long I with a
  324|       |                                 * large negative exponent could cause an
  325|       |                                 * unnecessary overflow on I alone).  In this
  326|       |                                 * case, fracExp is incremented one for each
  327|       |                                 * dropped digit. */
  328|  5.38k|    int mantSize;               // Number of digits in mantissa.
  329|  5.38k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  330|       |                                 * point. */
  331|  5.38k|    const char *pExp;           /* Temporarily holds location of exponent
  332|       |                                 * in string. */
  333|       |
  334|       |    /*
  335|       |     * Strip off leading blanks and check for a sign.
  336|       |     */
  337|       |
  338|       |    // FIXME: JSON is UTF-8, but isspace() islocale dependent...
  339|       |
  340|  5.38k|    p = string;
  341|  5.38k|    while (isspace((int)*p)) {
  ------------------
  |  Branch (341:12): [True: 0, False: 5.38k]
  ------------------
  342|      0|        p += 1;
  343|      0|    }
  344|  5.38k|    if (isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (344:9): [True: 2.92k, False: 2.45k]
  ------------------
  345|       |        // ignore
  346|  2.92k|    } else if ('-' == *p) {
  ------------------
  |  Branch (346:16): [True: 490, False: 1.96k]
  ------------------
  347|    490|        sign = true;
  348|    490|        p += 1;
  349|  1.96k|    } else if ('+' == *p) {
  ------------------
  |  Branch (349:16): [True: 226, False: 1.73k]
  ------------------
  350|    226|        p += 1;
  351|  1.73k|    } else if ('.' == *p) {
  ------------------
  |  Branch (351:16): [True: 1.08k, False: 656]
  ------------------
  352|       |        // ignore
  353|  1.08k|    } else {
  354|    656|        return NAN;
  355|    656|    }
  356|       |
  357|       |    /*
  358|       |     * Count the number of digits in the mantissa (including the decimal
  359|       |     * point), and also locate the decimal point.
  360|       |     */
  361|       |
  362|  4.72k|    decPt = -1;
  363|  19.3k|    for (mantSize = 0; ; mantSize += 1) {
  364|  19.3k|        c = *p;
  365|  19.3k|        if (!isdigit(c)) {
  ------------------
  |  Branch (365:13): [True: 6.04k, False: 13.3k]
  ------------------
  366|  6.04k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (366:17): [True: 4.51k, False: 1.52k]
  |  Branch (366:31): [True: 208, False: 1.31k]
  ------------------
  367|  4.72k|                break;
  368|  4.72k|            }
  369|  1.31k|            decPt = mantSize;
  370|  1.31k|        }
  371|  14.6k|        p += 1;
  372|  14.6k|    }
  373|       |
  374|       |    /*
  375|       |     * Now suck up the digits in the mantissa.  Use two integers to
  376|       |     * collect 9 digits each (this is faster than using floating-point).
  377|       |     * If the mantissa has more than 18 digits, ignore the extras, since
  378|       |     * they can't affect the value anyway.
  379|       |     */
  380|       |
  381|  4.72k|    pExp  = p;
  382|  4.72k|    p -= mantSize;
  383|  4.72k|    if (decPt < 0) {
  ------------------
  |  Branch (383:9): [True: 3.40k, False: 1.31k]
  ------------------
  384|  3.40k|        decPt = mantSize;
  385|  3.40k|    } else {
  386|  1.31k|        mantSize -= 1;                  // One of the digits was the point.
  387|  1.31k|    }
  388|  4.72k|    if (mantSize > 18) {
  ------------------
  |  Branch (388:9): [True: 210, False: 4.51k]
  ------------------
  389|    210|        fracExp = decPt - 18;
  390|    210|        mantSize = 18;
  391|  4.51k|    } else {
  392|  4.51k|        fracExp = decPt - mantSize;
  393|  4.51k|    }
  394|  4.72k|    if (mantSize == 0) {
  ------------------
  |  Branch (394:9): [True: 1.13k, False: 3.58k]
  ------------------
  395|  1.13k|        fraction = 0.0;
  396|       |        // p = string;
  397|  1.13k|        goto done;
  398|  3.58k|    } else {
  399|  3.58k|        int frac1, frac2;
  400|       |
  401|  3.58k|        frac1 = 0;
  402|  6.13k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (402:17): [True: 2.55k, False: 3.58k]
  ------------------
  403|  2.55k|            c = *p;
  404|  2.55k|            p += 1;
  405|  2.55k|            if ('.' == c) {
  ------------------
  |  Branch (405:17): [True: 198, False: 2.35k]
  ------------------
  406|    198|                c = *p;
  407|    198|                p += 1;
  408|    198|            }
  409|  2.55k|            frac1 = 10*frac1 + (c - '0');
  410|  2.55k|        }
  411|  3.58k|        frac2 = 0;
  412|  12.6k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (412:16): [True: 9.04k, False: 3.58k]
  ------------------
  413|  9.04k|            c = *p;
  414|  9.04k|            p += 1;
  415|  9.04k|            if ('.' == c) {
  ------------------
  |  Branch (415:17): [True: 235, False: 8.80k]
  ------------------
  416|    235|                c = *p;
  417|    235|                p += 1;
  418|    235|            }
  419|  9.04k|            frac2 = 10*frac2 + (c - '0');
  420|  9.04k|        }
  421|  3.58k|        fraction = (1.0e9 * frac1) + frac2;
  422|  3.58k|    }
  423|       |
  424|       |    /*
  425|       |     * Skim off the exponent.
  426|       |     */
  427|       |
  428|  3.58k|    p = pExp;
  429|  3.58k|    if (('E' == *p) ||
  ------------------
  |  Branch (429:9): [True: 1.24k, False: 2.34k]
  ------------------
  430|  2.34k|        ('e' == *p)) {
  ------------------
  |  Branch (430:9): [True: 976, False: 1.36k]
  ------------------
  431|  2.21k|        p += 1;
  432|  2.21k|        if ('-' == *p) {
  ------------------
  |  Branch (432:13): [True: 548, False: 1.67k]
  ------------------
  433|    548|            expSign = true;
  434|    548|            p += 1;
  435|  1.67k|        } else {
  436|  1.67k|            if ('+' == *p) {
  ------------------
  |  Branch (436:17): [True: 196, False: 1.47k]
  ------------------
  437|    196|                p += 1;
  438|    196|            }
  439|  1.67k|            expSign = false;
  440|  1.67k|        }
  441|  4.69k|        while (isdigit((unsigned char) *p)) {
  ------------------
  |  Branch (441:16): [True: 4.69k, False: 1.41k]
  ------------------
  442|  4.69k|            exp = exp * 10 + (*p - '0');
  443|  4.69k|            if (1024 < exp) {
  ------------------
  |  Branch (443:17): [True: 808, False: 3.88k]
  ------------------
  444|    808|                if (true == expSign) {
  ------------------
  |  Branch (444:21): [True: 303, False: 505]
  ------------------
  445|       |                    // exponent underflow!
  446|    303|                    if (sign) {
  ------------------
  |  Branch (446:25): [True: 78, False: 225]
  ------------------
  447|     78|                        return -0.0;
  448|     78|                    }
  449|    225|                    return 0.0;
  450|    303|                } // else  exponent overflow!
  451|    505|                if (sign) {
  ------------------
  |  Branch (451:21): [True: 69, False: 436]
  ------------------
  452|     69|                    return -INFINITY;
  453|     69|                }
  454|    436|                return INFINITY;
  455|    505|            }
  456|  3.88k|            p += 1;
  457|  3.88k|        }
  458|  2.21k|    }
  459|  2.77k|    if (expSign) {
  ------------------
  |  Branch (459:9): [True: 245, False: 2.53k]
  ------------------
  460|    245|        exp = fracExp - exp;
  461|  2.53k|    } else {
  462|  2.53k|        exp = fracExp + exp;
  463|  2.53k|    }
  464|       |
  465|       |    /*
  466|       |     * Generate a floating-point number that represents the exponent.
  467|       |     * Do this by processing the exponent one bit at a time to combine
  468|       |     * many powers of 2 of 10. Then combine the exponent with the
  469|       |     * fraction.
  470|       |     */
  471|       |
  472|  2.77k|    if (0 > exp) {
  ------------------
  |  Branch (472:9): [True: 471, False: 2.30k]
  ------------------
  473|    471|        expSign = true;
  474|    471|        exp = -exp;
  475|  2.30k|    } else {
  476|  2.30k|        expSign = false;
  477|  2.30k|    }
  478|  2.77k|    if (exp > maxExponent) {
  ------------------
  |  Branch (478:9): [True: 226, False: 2.55k]
  ------------------
  479|    226|        exp = maxExponent;
  480|    226|        errno = ERANGE;
  481|    226|    }
  482|  2.77k|    dblExp = 1.0;
  483|  7.71k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (483:26): [True: 4.94k, False: 2.77k]
  ------------------
  484|  4.94k|        if (exp & 01) {
  ------------------
  |  Branch (484:13): [True: 3.71k, False: 1.22k]
  ------------------
  485|  3.71k|            dblExp *= *d;
  486|  3.71k|        }
  487|  4.94k|    }
  488|  2.77k|    if (expSign) {
  ------------------
  |  Branch (488:9): [True: 471, False: 2.30k]
  ------------------
  489|    471|        fraction /= dblExp;
  490|  2.30k|    } else {
  491|  2.30k|        fraction *= dblExp;
  492|  2.30k|    }
  493|       |
  494|  3.91k|done:
  495|  3.91k|    if (sign) {
  ------------------
  |  Branch (495:9): [True: 343, False: 3.57k]
  ------------------
  496|    343|        return -fraction;
  497|    343|    }
  498|  3.57k|    return fraction;
  499|  3.91k|}
mkgmtime:
  845|  1.74k|{
  846|  1.74k|    int year;
  847|  1.74k|    time_t result;
  848|  1.74k|    static const int cumdays[MONTHSPERYEAR] =
  849|  1.74k|        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
  850|       |
  851|       |    // check ranges, ignore tm_isdst and max tm_year
  852|  1.74k|    if (0 > t->tm_sec ||
  ------------------
  |  Branch (852:9): [True: 0, False: 1.74k]
  ------------------
  853|  1.74k|        0 > t->tm_min ||
  ------------------
  |  Branch (853:9): [True: 0, False: 1.74k]
  ------------------
  854|  1.74k|        0 > t->tm_hour ||
  ------------------
  |  Branch (854:9): [True: 0, False: 1.74k]
  ------------------
  855|  1.74k|        1 > t->tm_mday ||
  ------------------
  |  Branch (855:9): [True: 293, False: 1.45k]
  ------------------
  856|  1.45k|        0 > t->tm_mon ||
  ------------------
  |  Branch (856:9): [True: 0, False: 1.45k]
  ------------------
  857|  1.45k|        0 > t->tm_year ||
  ------------------
  |  Branch (857:9): [True: 630, False: 822]
  ------------------
  858|    822|        0 > t->tm_wday ||
  ------------------
  |  Branch (858:9): [True: 0, False: 822]
  ------------------
  859|    822|        0 > t->tm_yday ||
  ------------------
  |  Branch (859:9): [True: 0, False: 822]
  ------------------
  860|    822|        61 < t->tm_sec ||
  ------------------
  |  Branch (860:9): [True: 0, False: 822]
  ------------------
  861|    822|        59 < t->tm_min ||
  ------------------
  |  Branch (861:9): [True: 0, False: 822]
  ------------------
  862|    822|        23 < t->tm_hour ||
  ------------------
  |  Branch (862:9): [True: 0, False: 822]
  ------------------
  863|    822|        31 < t->tm_mday ||
  ------------------
  |  Branch (863:9): [True: 0, False: 822]
  ------------------
  864|    822|        11 < t->tm_mon ||
  ------------------
  |  Branch (864:9): [True: 0, False: 822]
  ------------------
  865|    822|        6 < t->tm_wday ||
  ------------------
  |  Branch (865:9): [True: 0, False: 822]
  ------------------
  866|    923|        365 < t->tm_yday) {
  ------------------
  |  Branch (866:9): [True: 0, False: 822]
  ------------------
  867|    923|        errno = EOVERFLOW;
  868|    923|        return -1;
  869|    923|    }
  870|  1.74k|    errno = 0;
  871|    822|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  501|    822|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  872|    822|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  501|    822|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  873|    822|    result += (year - 1968) / 4;
  874|    822|    result -= (year - 1900) / 100;
  875|    822|    result += (year - 1600) / 400;
  876|    822|    if (0 == (year % 4) &&
  ------------------
  |  Branch (876:9): [True: 363, False: 459]
  ------------------
  877|    363|        (0 != (year % 100) ||
  ------------------
  |  Branch (877:10): [True: 91, False: 272]
  ------------------
  878|    272|         0 == (year % 400)) &&
  ------------------
  |  Branch (878:10): [True: 72, False: 200]
  ------------------
  879|    163|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  501|    163|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (879:9): [True: 79, False: 84]
  ------------------
  880|     79|        result--;
  881|     79|    }
  882|    822|    result += t->tm_mday - 1;
  883|    822|    result *= 24;
  884|    822|    result += t->tm_hour;
  885|    822|    result *= 60;
  886|    822|    result += t->tm_min;
  887|    822|    result *= 60;
  888|    822|    result += t->tm_sec;
  889|       |    /* this is UTC, no DST
  890|       |     * if (t->tm_isdst == 1)
  891|       |     * result -= 3600;
  892|       |     */
  893|    822|    return result;
  894|  1.74k|}
iso8601_to_timespec:
  898|  1.74k|{
  899|  1.74k|    timespec_t ret = {0};
  900|       |
  901|       |#ifdef USE_QT
  902|       |  #ifndef __clang_analyzer__
  903|       |    double usec = 0;
  904|       |
  905|       |    QString t(isotime);
  906|       |    QDateTime d = QDateTime::fromString(isotime, Qt::ISODate);
  907|       |    QStringList sl = t.split(".");
  908|       |    if (1 < sl.size()) {
  909|       |        usec = sl[1].toInt() / pow(10., (double)sl[1].size());
  910|       |    }
  911|       |// toSecsSinceEpoch wasn't introduced until 5.8
  912|       |#if QT_VERSION < QT_VERSION_CHECK(5,8,0)
  913|       |    ret.tv_sec = d.toTime_t();
  914|       |#else
  915|       |    ret.tv_sec = d.toSecsSinceEpoch();
  916|       |#endif
  917|       |    ret.tv_nsec = usec * 1e9;
  918|       |  #endif  // __clang_analyzer__
  919|       |#else  // USE_QT
  920|  1.74k|    double usec = 0;
  921|  1.74k|    struct tm tm = {0};
  922|       |
  923|  1.74k|    {
  924|  1.74k|        char *dp = NULL;
  925|  1.74k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  926|  1.74k|        if (NULL != dp &&
  ------------------
  |  Branch (926:13): [True: 637, False: 1.10k]
  ------------------
  927|    637|            '.' == *dp) {
  ------------------
  |  Branch (927:13): [True: 194, False: 443]
  ------------------
  928|    194|            usec = strtod(dp, NULL);
  929|    194|        }
  930|  1.74k|    }
  931|       |
  932|       |    /*
  933|       |     * It would be nice if we could say mktime(&tm) - timezone + usec instead,
  934|       |     * but timezone is not available at all on some BSDs. Besides, when working
  935|       |     * with historical dates the value of timezone after an ordinary tzset(3)
  936|       |     * can be wrong; you have to do a redirect through the IANA historical
  937|       |     * timezone database to get it right.
  938|       |     */
  939|  1.74k|    ret.tv_sec = mkgmtime(&tm);
  940|  1.74k|    ret.tv_nsec = usec * 1e9;
  941|  1.74k|#endif  // USE_QT
  942|       |
  943|  1.74k|#if 4 < SIZEOF_TIME_T
  944|  1.74k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (944:9): [True: 202, False: 1.54k]
  ------------------
  945|       |        // enforce max "9999-12-31T23:59:59.999Z"
  946|    202|        ret.tv_sec = 253402300799LL;
  947|    202|    }
  948|  1.74k|#endif
  949|  1.74k|    return ret;
  950|  1.74k|}

gps_hexpack:
  119|    111|{
  120|    111|    ssize_t i, j;
  121|       |
  122|    111|    j = strnlen(src, BUFSIZ) / 2;
  123|    111|    if ((1 > j) ||
  ------------------
  |  Branch (123:9): [True: 2, False: 109]
  ------------------
  124|    109|        ((size_t)j > len)) {
  ------------------
  |  Branch (124:9): [True: 11, False: 98]
  ------------------
  125|     13|        return -2;
  126|     13|    }
  127|       |
  128|    391|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 353, False: 38]
  ------------------
  129|    353|        int k;
  130|    353|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 60, False: 293]
  ------------------
  131|     60|            return -1;
  132|     60|        }
  133|    293|        dst[i] = (char)(k & 0xff);
  134|    293|    }
  135|     38|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     38|    return j;
  137|     98|}
hex.c:hex2bin:
   82|    353|{
   83|    353|    int a, b;
   84|       |
   85|    353|    a = s[0] & 0xff;
   86|    353|    b = s[1] & 0xff;
   87|       |
   88|    353|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 110, False: 243]
  ------------------
   89|    110|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 101, False: 9]
  ------------------
   90|    101|        a = a + 10 - 'a';
   91|    252|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 134, False: 118]
  ------------------
   92|    134|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 117, False: 17]
  ------------------
   93|    117|        a = a + 10 - 'A';
   94|    135|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 126, False: 9]
  ------------------
   95|    126|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 104, False: 22]
  ------------------
   96|    104|        a -= '0';
   97|    104|    } else {
   98|     31|        return -1;
   99|     31|    }
  100|       |
  101|    322|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 98, False: 224]
  ------------------
  102|     98|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 91, False: 7]
  ------------------
  103|     91|        b = b + 10 - 'a';
  104|    231|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 123, False: 108]
  ------------------
  105|    123|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 109, False: 14]
  ------------------
  106|    109|        b = b + 10 - 'A';
  107|    122|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 113, False: 9]
  ------------------
  108|    113|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 93, False: 20]
  ------------------
  109|     93|        b -= '0';
  110|     93|    } else {
  111|     29|        return -1;
  112|     29|    }
  113|       |
  114|    293|    return ((a << 4) + b);
  115|    322|}

json_read_array:
  802|    855|{
  803|    855|    int substatus, offset, arrcount;
  804|    855|    char *tp;
  805|       |
  806|    855|    if (NULL != end)
  ------------------
  |  Branch (806:9): [True: 855, False: 0]
  ------------------
  807|    855|        *end = NULL;    // give it a well-defined value on parse failure
  808|       |
  809|    855|    json_debug_trace(1, "json: %s", "Entered json_read_array()\n");
  ------------------
  |  |  108|    855|    do {                                              \
  |  |  109|    855|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    855|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 855]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 855]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    855|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    855|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 855]
  |  |  ------------------
  ------------------
  810|       |
  811|    855|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (811:12): [True: 0, False: 855]
  ------------------
  812|      0|        cp++;
  813|      0|    }
  814|    855|    if (*cp != '[') {
  ------------------
  |  Branch (814:9): [True: 0, False: 855]
  ------------------
  815|      0|        json_debug_trace(1, "json: %s", "Didn't find expected array start\n");
  ------------------
  |  |  108|      0|    do {                                              \
  |  |  109|      0|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      0|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  816|      0|        return JSON_ERR_ARRAYSTART;
  ------------------
  |  |  161|      0|#define JSON_ERR_ARRAYSTART    10      // didn't find expected array start
  ------------------
  817|      0|    }
  818|    855|    cp++;
  819|       |
  820|    855|    tp = arr->arr.strings.store;
  821|    855|    arrcount = 0;
  822|       |
  823|       |    // Check for empty array
  824|    855|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (824:12): [True: 199, False: 855]
  ------------------
  825|    199|        cp++;
  826|    199|    }
  827|    855|    if (*cp == ']') {
  ------------------
  |  Branch (827:9): [True: 180, False: 675]
  ------------------
  828|    180|        goto breakout;
  829|    180|    }
  830|       |
  831|  7.66k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (831:22): [True: 7.66k, False: 1]
  ------------------
  832|  7.66k|        char *ep = NULL;
  833|       |
  834|  7.66k|        json_debug_trace(1, "json: Looking at %s\n", cp);
  ------------------
  |  |  108|  7.66k|    do {                                              \
  |  |  109|  7.66k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  7.66k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 7.66k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 7.66k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  7.66k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  7.66k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 7.66k]
  |  |  ------------------
  ------------------
  835|  7.66k|        switch (arr->element_type) {
  ------------------
  |  Branch (835:17): [True: 7.66k, False: 0]
  ------------------
  836|  2.91k|        case t_string:
  ------------------
  |  Branch (836:9): [True: 2.91k, False: 4.75k]
  ------------------
  837|  2.91k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (837:17): [True: 194, False: 2.72k]
  ------------------
  838|    194|                cp++;
  839|    194|            }
  840|  2.91k|            if (*cp != '"') {
  ------------------
  |  Branch (840:17): [True: 14, False: 2.90k]
  ------------------
  841|     14|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     14|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  842|  2.90k|            } else {
  843|  2.90k|                ++cp;
  844|  2.90k|            }
  845|  2.90k|            arr->arr.strings.ptrs[offset] = tp;
  846|  13.3k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (846:20): [True: 13.3k, False: 3]
  ------------------
  847|  10.4k|                 tp++)
  848|  13.3k|                if (*cp == '"') {
  ------------------
  |  Branch (848:21): [True: 2.89k, False: 10.4k]
  ------------------
  849|  2.89k|                    ++cp;
  850|  2.89k|                    *tp++ = '\0';
  851|  2.89k|                    goto stringend;
  852|  10.4k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (852:28): [True: 1, False: 10.4k]
  ------------------
  853|      1|                    json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  854|      1|                                      "Bad string syntax in string list.\n");
  855|      1|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      1|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  856|  10.4k|                } else {
  857|  10.4k|                    *tp = *cp++;
  858|  10.4k|                }
  859|      3|            json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      3|    do {                                              \
  |  |  109|      3|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      3|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 3]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 3]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      3|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
  860|      3|                             "Bad string syntax in string list.\n");
  861|      3|            return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      3|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  862|  2.89k|          stringend:
  863|  2.89k|            break;
  864|      0|        case t_object:
  ------------------
  |  Branch (864:9): [True: 0, False: 7.66k]
  ------------------
  865|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  866|  4.75k|        case t_structobject:
  ------------------
  |  Branch (866:9): [True: 4.75k, False: 2.91k]
  ------------------
  867|  4.75k|            substatus =
  868|  4.75k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  869|  4.75k|                                          offset, &cp);
  870|  4.75k|            if (substatus != 0) {
  ------------------
  |  Branch (870:17): [True: 151, False: 4.60k]
  ------------------
  871|    151|                if (NULL != end) {
  ------------------
  |  Branch (871:21): [True: 151, False: 0]
  ------------------
  872|    151|                    *end = cp;
  873|    151|                }
  874|    151|                return substatus;
  875|    151|            }
  876|  4.60k|            break;
  877|  4.60k|        case t_integer:
  ------------------
  |  Branch (877:9): [True: 0, False: 7.66k]
  ------------------
  878|      0|            arr->arr.integers.store[offset] = (int)strtol(cp, &ep, 0);
  879|      0|            if (ep == cp) {
  ------------------
  |  Branch (879:17): [True: 0, False: 0]
  ------------------
  880|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  881|      0|            }
  882|      0|            cp = ep;
  883|      0|            break;
  884|      0|        case t_uinteger:
  ------------------
  |  Branch (884:9): [True: 0, False: 7.66k]
  ------------------
  885|      0|            arr->arr.uintegers.store[offset] = (unsigned int)strtoul(cp,
  886|      0|                                                                     &ep, 0);
  887|      0|            if (ep == cp) {
  ------------------
  |  Branch (887:17): [True: 0, False: 0]
  ------------------
  888|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  889|      0|            }
  890|      0|            cp = ep;
  891|      0|            break;
  892|      0|        case t_longint:
  ------------------
  |  Branch (892:9): [True: 0, False: 7.66k]
  ------------------
  893|      0|            arr->arr.longint.store[offset] = strtol(cp, &ep, 0);
  894|      0|            if (ep == cp) {
  ------------------
  |  Branch (894:17): [True: 0, False: 0]
  ------------------
  895|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  896|      0|            }
  897|      0|            cp = ep;
  898|      0|            break;
  899|      0|        case t_ulongint:
  ------------------
  |  Branch (899:9): [True: 0, False: 7.66k]
  ------------------
  900|      0|            arr->arr.ulongint.store[offset] = strtoul(cp, &ep, 0);
  901|      0|            if (ep == cp) {
  ------------------
  |  Branch (901:17): [True: 0, False: 0]
  ------------------
  902|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  903|      0|            }
  904|      0|            cp = ep;
  905|      0|            break;
  906|      0|        case t_byte:
  ------------------
  |  Branch (906:9): [True: 0, False: 7.66k]
  ------------------
  907|      0|            arr->arr.bytes.store[offset] = (char)strtol(cp, &ep, 0);
  908|      0|            if (ep == cp) {
  ------------------
  |  Branch (908:17): [True: 0, False: 0]
  ------------------
  909|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  910|      0|            }
  911|      0|            cp = ep;
  912|      0|            break;
  913|      0|        case t_ubyte:
  ------------------
  |  Branch (913:9): [True: 0, False: 7.66k]
  ------------------
  914|      0|            arr->arr.ubytes.store[offset] = (unsigned char)strtoul(cp,
  915|      0|                                                                   &ep, 0);
  916|      0|            if (ep == cp) {
  ------------------
  |  Branch (916:17): [True: 0, False: 0]
  ------------------
  917|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  918|      0|            }
  919|      0|            cp = ep;
  920|      0|            break;
  921|      0|        case t_short:
  ------------------
  |  Branch (921:9): [True: 0, False: 7.66k]
  ------------------
  922|      0|            arr->arr.shorts.store[offset] = (short)strtol(cp, &ep, 0);
  923|      0|            if (ep == cp) {
  ------------------
  |  Branch (923:17): [True: 0, False: 0]
  ------------------
  924|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  925|      0|            }
  926|      0|            cp = ep;
  927|      0|            break;
  928|      0|        case t_ushort:
  ------------------
  |  Branch (928:9): [True: 0, False: 7.66k]
  ------------------
  929|      0|            arr->arr.ushorts.store[offset] = (unsigned short)strtoul(cp,
  930|      0|                                                                     &ep, 0);
  931|      0|            if (ep == cp) {
  ------------------
  |  Branch (931:17): [True: 0, False: 0]
  ------------------
  932|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  933|      0|            }
  934|      0|            cp = ep;
  935|      0|            break;
  936|      0|        case t_time:
  ------------------
  |  Branch (936:9): [True: 0, False: 7.66k]
  ------------------
  937|      0|            {
  938|      0|                timespec_t ts_tmp;
  939|      0|                if (*cp != '"') {
  ------------------
  |  Branch (939:21): [True: 0, False: 0]
  ------------------
  940|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  941|      0|                } else {
  942|      0|                    ++cp;
  943|      0|                }
  944|      0|                ts_tmp = iso8601_to_timespec(cp);
  945|      0|                arr->arr.timespecs.store[offset] = ts_tmp;
  946|      0|                while (*cp &&
  ------------------
  |  Branch (946:24): [True: 0, False: 0]
  ------------------
  947|      0|                       *cp != '"') {
  ------------------
  |  Branch (947:24): [True: 0, False: 0]
  ------------------
  948|      0|                    cp++;
  949|      0|                }
  950|      0|                if (*cp != '"') {
  ------------------
  |  Branch (950:21): [True: 0, False: 0]
  ------------------
  951|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  952|      0|                }
  953|      0|                ++cp;
  954|      0|            }
  955|      0|            break;
  956|      0|        case t_timespec:
  ------------------
  |  Branch (956:9): [True: 0, False: 7.66k]
  ------------------
  957|       |            // TODO not sure how to implement this
  958|      0|            return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  959|      0|            break;
  960|      0|        case t_real:
  ------------------
  |  Branch (960:9): [True: 0, False: 7.66k]
  ------------------
  961|      0|            arr->arr.reals.store[offset] = strtod(cp, &ep);
  962|      0|            if (ep == cp) {
  ------------------
  |  Branch (962:17): [True: 0, False: 0]
  ------------------
  963|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  964|      0|            }
  965|      0|            cp = ep;
  966|      0|            break;
  967|      0|        case t_boolean:
  ------------------
  |  Branch (967:9): [True: 0, False: 7.66k]
  ------------------
  968|      0|            if (str_starts_with(cp, "true")) {
  ------------------
  |  Branch (968:17): [True: 0, False: 0]
  ------------------
  969|      0|                arr->arr.booleans.store[offset] = true;
  970|      0|                cp += 4;
  971|      0|            } else if (str_starts_with(cp, "false")) {
  ------------------
  |  Branch (971:24): [True: 0, False: 0]
  ------------------
  972|      0|                arr->arr.booleans.store[offset] = false;
  973|      0|                cp += 5;
  974|      0|            }
  975|      0|            break;
  976|      0|        case t_character:
  ------------------
  |  Branch (976:9): [True: 0, False: 7.66k]
  ------------------
  977|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  978|      0|        case t_array:
  ------------------
  |  Branch (978:9): [True: 0, False: 7.66k]
  ------------------
  979|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  980|      0|        case t_check:
  ------------------
  |  Branch (980:9): [True: 0, False: 7.66k]
  ------------------
  981|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  982|      0|        case t_ignore:
  ------------------
  |  Branch (982:9): [True: 0, False: 7.66k]
  ------------------
  983|      0|            json_debug_trace(1, "json: %s", "Invalid array subtype.\n");
  ------------------
  |  |  108|      0|    do {                                              \
  |  |  109|      0|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      0|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  984|      0|            return JSON_ERR_SUBTYPE;
  ------------------
  |  |  165|      0|#define JSON_ERR_SUBTYPE       14      // unsupported array element type
  ------------------
  985|  7.66k|        }
  986|  7.49k|        arrcount++;
  987|  7.49k|        if (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (987:13): [True: 194, False: 7.30k]
  ------------------
  988|    194|            cp++;
  989|    194|        }
  990|  7.49k|        if (*cp == ']') {
  ------------------
  |  Branch (990:13): [True: 362, False: 7.13k]
  ------------------
  991|    362|            json_debug_trace(1, "json: %s", "End of array found.\n");
  ------------------
  |  |  108|    362|    do {                                              \
  |  |  109|    362|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    362|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 362]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 362]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    362|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    362|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 362]
  |  |  ------------------
  ------------------
  992|    362|            goto breakout;
  993|    362|        }
  994|  7.13k|        if (*cp == ',') {
  ------------------
  |  Branch (994:13): [True: 6.99k, False: 143]
  ------------------
  995|  6.99k|            cp++;
  996|  6.99k|        } else {
  997|    143|            json_debug_trace(1, "json: %s", "Bad trailing syntax on array.\n");
  ------------------
  |  |  108|    143|    do {                                              \
  |  |  109|    143|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    143|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 143]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 143]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    143|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    143|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 143]
  |  |  ------------------
  ------------------
  998|    143|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    143|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
  999|    143|        }
 1000|  7.13k|    }
 1001|      1|    json_debug_trace(1, "json: %s", "Too many elements in array.\n");
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1002|      1|    if (NULL != end) {
  ------------------
  |  Branch (1002:9): [True: 1, False: 0]
  ------------------
 1003|      1|        *end = cp;
 1004|      1|    }
 1005|      1|    return JSON_ERR_SUBTOOLONG;
  ------------------
  |  |  163|      1|#define JSON_ERR_SUBTOOLONG    12      // too many array elements
  ------------------
 1006|    542|  breakout:
 1007|    542|    if (NULL != arr->count) {
  ------------------
  |  Branch (1007:9): [True: 542, False: 0]
  ------------------
 1008|    542|        *(arr->count) = arrcount;
 1009|    542|    }
 1010|    542|    if (NULL != end) {
  ------------------
  |  Branch (1010:9): [True: 542, False: 0]
  ------------------
 1011|    542|        *end = cp;
 1012|    542|    }
 1013|    542|    json_debug_trace(1, "json: leaving json_read_array() with %d elements\n",
  ------------------
  |  |  108|    542|    do {                                              \
  |  |  109|    542|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    542|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 542]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 542]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    542|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    542|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 542]
  |  |  ------------------
  ------------------
 1014|    542|                      arrcount);
 1015|    542|    return 0;
 1016|    675|}
json_read_object:
 1020|  5.06k|{
 1021|  5.06k|    int st;
 1022|       |
 1023|  5.06k|    json_debug_trace(1, "json: json_read_object() sees '%s'\n", cp);
  ------------------
  |  |  108|  5.06k|    do {                                              \
  |  |  109|  5.06k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  5.06k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 5.06k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 5.06k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  5.06k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  5.06k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 5.06k]
  |  |  ------------------
  ------------------
 1024|       |    st = json_internal_read_object(cp, attrs, NULL, 0, end);
 1025|  5.06k|    return st;
 1026|  5.06k|}
json.c:json_internal_read_object:
  199|  9.81k|{
  200|  9.81k|    enum
  201|  9.81k|    { init, await_attr, in_attr, await_value, in_val_string,
  202|  9.81k|        in_escape, in_val_token, post_val, post_element, in_ignore_array
  203|  9.81k|    } state = 0;
  204|  9.81k|    char *statenames[] = {
  205|  9.81k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  206|  9.81k|        "in_escape", "in_val_token", "post_val", "post_element",
  207|  9.81k|        "in_ignore_array"
  208|  9.81k|    };
  209|  9.81k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  210|  9.81k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  211|  9.81k|    bool value_quoted = false;
  212|  9.81k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  213|  9.81k|    const struct json_attr_t *cursor;
  214|  9.81k|    int substatus, maxlen = 0;
  215|  9.81k|    unsigned int u;
  216|  9.81k|    const struct json_enum_t *mp;
  217|  9.81k|    char *lptr;
  218|       |
  219|  9.81k|    if (NULL != end) {
  ------------------
  |  Branch (219:9): [True: 4.75k, False: 5.06k]
  ------------------
  220|  4.75k|        *end = NULL;    // give it a well-defined value on parse failure
  221|  4.75k|    }
  222|  9.81k|    memset(valbuf, 0, sizeof(valbuf));
  223|       |
  224|       |    // stuff fields with defaults in case they're omitted in the JSON input
  225|   151k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (225:26): [True: 141k, False: 9.81k]
  ------------------
  226|   141k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (226:13): [True: 141k, False: 162]
  ------------------
  227|   141k|            lptr = json_target_address(cursor, parent, offset);
  228|   141k|            if (NULL != lptr)
  ------------------
  |  Branch (228:17): [True: 131k, False: 10.1k]
  ------------------
  229|   131k|                switch (cursor->type) {
  ------------------
  |  Branch (229:25): [True: 131k, False: 0]
  ------------------
  230|  3.16k|                case t_byte:
  ------------------
  |  Branch (230:17): [True: 3.16k, False: 127k]
  ------------------
  231|  3.16k|                    lptr[0] = cursor->dflt.byte;
  232|  3.16k|                    break;
  233|  18.7k|                case t_ubyte:
  ------------------
  |  Branch (233:17): [True: 18.7k, False: 112k]
  ------------------
  234|  18.7k|                    lptr[0] = cursor->dflt.ubyte;
  235|  18.7k|                    break;
  236|  17.4k|                case t_integer:
  ------------------
  |  Branch (236:17): [True: 17.4k, False: 113k]
  ------------------
  237|  17.4k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  238|  17.4k|                    break;
  239|  7.19k|                case t_uinteger:
  ------------------
  |  Branch (239:17): [True: 7.19k, False: 123k]
  ------------------
  240|  7.19k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  241|  7.19k|                    break;
  242|    936|                case t_longint:
  ------------------
  |  Branch (242:17): [True: 936, False: 130k]
  ------------------
  243|    936|                    memcpy(lptr, &cursor->dflt.longint, sizeof(long));
  244|    936|                    break;
  245|    123|                case t_ulongint:
  ------------------
  |  Branch (245:17): [True: 123, False: 130k]
  ------------------
  246|    123|                    memcpy(lptr, &cursor->dflt.ulongint,
  247|    123|                           sizeof(unsigned long));
  248|    123|                    break;
  249|  3.16k|                case t_short:
  ------------------
  |  Branch (249:17): [True: 3.16k, False: 127k]
  ------------------
  250|  3.16k|                    memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
  251|  3.16k|                    break;
  252|      0|                case t_ushort:
  ------------------
  |  Branch (252:17): [True: 0, False: 131k]
  ------------------
  253|      0|                    memcpy(lptr, &cursor->dflt.ushortint,
  254|      0|                           sizeof(unsigned short));
  255|      0|                    break;
  256|  1.64k|                case t_time:
  ------------------
  |  Branch (256:17): [True: 1.64k, False: 129k]
  ------------------
  257|  1.64k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  258|  1.64k|                    break;
  259|  1.11k|                case t_timespec:
  ------------------
  |  Branch (259:17): [True: 1.11k, False: 129k]
  ------------------
  260|  1.11k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  261|  1.11k|                    break;
  262|  56.1k|                case t_real:
  ------------------
  |  Branch (262:17): [True: 56.1k, False: 74.8k]
  ------------------
  263|  56.1k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  264|  56.1k|                    break;
  265|  10.6k|                case t_string:
  ------------------
  |  Branch (265:17): [True: 10.6k, False: 120k]
  ------------------
  266|  10.6k|                    if (parent != NULL
  ------------------
  |  Branch (266:25): [True: 4.35k, False: 6.25k]
  ------------------
  267|  4.35k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (267:28): [True: 0, False: 4.35k]
  ------------------
  268|      0|                        && offset > 0)
  ------------------
  |  Branch (268:28): [True: 0, False: 0]
  ------------------
  269|      0|                        return JSON_ERR_NOPARSTR;
  ------------------
  |  |  168|      0|#define JSON_ERR_NOPARSTR      17      // no strings in parallel arrays
  ------------------
  270|  10.6k|                    lptr[0] = '\0';
  271|  10.6k|                    break;
  272|  4.27k|                case t_boolean:
  ------------------
  |  Branch (272:17): [True: 4.27k, False: 126k]
  ------------------
  273|  4.27k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  274|  4.27k|                    break;
  275|  1.06k|                case t_character:
  ------------------
  |  Branch (275:17): [True: 1.06k, False: 129k]
  ------------------
  276|  1.06k|                    lptr[0] = cursor->dflt.character;
  277|  1.06k|                    break;
  278|      0|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (278:17): [True: 0, False: 131k]
  ------------------
  279|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  280|      0|                case t_structobject:
  ------------------
  |  Branch (280:17): [True: 0, False: 131k]
  ------------------
  281|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  282|      0|                case t_array:
  ------------------
  |  Branch (282:17): [True: 0, False: 131k]
  ------------------
  283|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  284|    556|                case t_check:
  ------------------
  |  Branch (284:17): [True: 556, False: 130k]
  ------------------
  285|    556|                    FALLTHROUGH
  ------------------
  |  |   55|    556|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  286|  5.28k|                case t_ignore:
  ------------------
  |  Branch (286:17): [True: 4.73k, False: 126k]
  ------------------
  287|  5.28k|                    break;
  288|   131k|                }
  289|   141k|        }
  290|       |
  291|  9.81k|    json_debug_trace(1, "json: JSON parse of '%s' begins.\n", cp);
  ------------------
  |  |  108|  9.81k|    do {                                              \
  |  |  109|  9.81k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  9.81k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9.81k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9.81k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  9.81k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  9.81k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9.81k]
  |  |  ------------------
  ------------------
  292|       |
  293|       |    // parse input JSON
  294|   566k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (294:12): [True: 563k, False: 3.09k]
  ------------------
  295|   563k|        json_debug_trace(2, "json: State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  108|   563k|    do {                                              \
  |  |  109|   563k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   563k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 563k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 563k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   563k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   563k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 563k]
  |  |  ------------------
  ------------------
  296|   563k|                          statenames[state], *cp, cp);
  297|   563k|        switch (state) {
  ------------------
  |  Branch (297:17): [True: 563k, False: 0]
  ------------------
  298|  10.3k|        case init:
  ------------------
  |  Branch (298:9): [True: 10.3k, False: 552k]
  ------------------
  299|  10.3k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (299:17): [True: 597, False: 9.77k]
  ------------------
  300|    597|                continue;
  301|    597|            }
  302|  9.77k|            if (*cp == '{') {
  ------------------
  |  Branch (302:17): [True: 9.72k, False: 44]
  ------------------
  303|  9.72k|                state = await_attr;
  304|  9.72k|            } else {
  305|     44|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     44|    do {                                              \
  |  |  109|     44|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     44|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     44|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     44|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 44]
  |  |  ------------------
  ------------------
  306|     44|                                  "Non-WS when expecting object start.\n");
  307|     44|                if (NULL != end) {
  ------------------
  |  Branch (307:21): [True: 44, False: 0]
  ------------------
  308|     44|                    *end = cp;
  309|     44|                }
  310|     44|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     44|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  311|     44|            }
  312|  9.72k|            break;
  313|  39.6k|        case await_attr:
  ------------------
  |  Branch (313:9): [True: 39.6k, False: 523k]
  ------------------
  314|  39.6k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (314:17): [True: 204, False: 39.4k]
  ------------------
  315|    204|                continue;
  316|    204|            }
  317|  39.4k|            if (*cp == '"') {
  ------------------
  |  Branch (317:17): [True: 39.1k, False: 284]
  ------------------
  318|  39.1k|                state = in_attr;
  319|  39.1k|                pattr = attrbuf;
  320|  39.1k|                if (NULL != end) {
  ------------------
  |  Branch (320:21): [True: 6.14k, False: 33.0k]
  ------------------
  321|  6.14k|                    *end = cp;
  322|  6.14k|                }
  323|  39.1k|            } else if (*cp == '}') {
  ------------------
  |  Branch (323:24): [True: 196, False: 88]
  ------------------
  324|    196|                break;
  325|    196|            } else {
  326|     88|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     88|    do {                                              \
  |  |  109|     88|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     88|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 88]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 88]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     88|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     88|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 88]
  |  |  ------------------
  ------------------
  327|     88|                          "Non-WS when expecting attribute.\n");
  328|     88|                if (NULL != end) {
  ------------------
  |  Branch (328:21): [True: 2, False: 86]
  ------------------
  329|      2|                    *end = cp;
  330|      2|                }
  331|     88|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|     88|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  332|     88|            }
  333|  39.1k|            break;
  334|   169k|        case in_attr:
  ------------------
  |  Branch (334:9): [True: 169k, False: 393k]
  ------------------
  335|   169k|            if (NULL == pattr) {
  ------------------
  |  Branch (335:17): [True: 0, False: 169k]
  ------------------
  336|       |                // don't update end here, leave at attribute start
  337|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  338|      0|            }
  339|   169k|            if (*cp == '"') {
  ------------------
  |  Branch (339:17): [True: 39.0k, False: 130k]
  ------------------
  340|  39.0k|                *pattr++ = '\0';
  341|  39.0k|                json_debug_trace(1, "json: Collected attribute name %s\n",
  ------------------
  |  |  108|  39.0k|    do {                                              \
  |  |  109|  39.0k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  39.0k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 39.0k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 39.0k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  39.0k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  39.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 39.0k]
  |  |  ------------------
  ------------------
  342|  39.0k|                                  attrbuf);
  343|   435k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (343:38): [True: 435k, False: 98]
  ------------------
  344|   435k|                    json_debug_trace(2, "json: Checking against %s\n",
  ------------------
  |  |  108|   435k|    do {                                              \
  |  |  109|   435k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   435k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 435k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 435k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   435k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   435k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 435k]
  |  |  ------------------
  ------------------
  345|   435k|                                      cursor->attribute);
  346|   435k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (346:25): [True: 25.3k, False: 410k]
  ------------------
  347|  25.3k|                        break;
  348|  25.3k|                    }
  349|   410k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (349:25): [True: 13.8k, False: 396k]
  ------------------
  350|  13.8k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (350:25): [True: 13.6k, False: 217]
  ------------------
  351|  13.6k|                        break;
  352|  13.6k|                    }
  353|   410k|                }
  354|  39.0k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (354:21): [True: 98, False: 38.9k]
  ------------------
  355|     98|                    json_debug_trace(1,
  ------------------
  |  |  108|     98|    do {                                              \
  |  |  109|     98|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     98|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 98]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 98]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     98|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     98|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 98]
  |  |  ------------------
  ------------------
  356|     98|                                      "json: Unknown attribute name '%s'"
  357|     98|                                      " (attributes begin with '%s').\n",
  358|     98|                                      attrbuf, attrs->attribute);
  359|       |                    // don't update end here, leave at attribute start
  360|     98|                    return JSON_ERR_BADATTR;
  ------------------
  |  |  154|     98|#define JSON_ERR_BADATTR        3      // unknown attribute name
  ------------------
  361|     98|                }
  362|  38.9k|                state = await_value;
  363|  38.9k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (363:21): [True: 1.08k, False: 37.9k]
  ------------------
  364|  1.08k|                    maxlen = (int)cursor->len - 1;
  365|  37.9k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (365:28): [True: 2.13k, False: 35.7k]
  ------------------
  366|  2.13k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  2.13k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  367|  35.7k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (367:28): [True: 2.53k, False: 33.2k]
  ------------------
  368|  33.2k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (368:28): [True: 18.5k, False: 14.6k]
  ------------------
  369|  21.1k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  21.1k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  370|  21.1k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (370:28): [True: 444, False: 14.2k]
  ------------------
  371|    444|                    maxlen = (int)sizeof(valbuf) - 1;
  372|    444|                }
  373|  38.9k|                pval = valbuf;
  374|   130k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   130k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (374:24): [True: 24, False: 130k]
  ------------------
  375|     24|                json_debug_trace(1, "json: %s","Attribute name too long.\n");
  ------------------
  |  |  108|     24|    do {                                              \
  |  |  109|     24|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     24|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 24]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 24]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     24|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     24|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 24]
  |  |  ------------------
  ------------------
  376|       |                // don't update end here, leave at attribute start
  377|     24|                return JSON_ERR_ATTRLEN;
  ------------------
  |  |  155|     24|#define JSON_ERR_ATTRLEN        4      // attribute name too long
  ------------------
  378|   130k|            } else {
  379|   130k|                *pattr++ = *cp;
  380|   130k|            }
  381|   169k|            break;
  382|   169k|        case await_value:
  ------------------
  |  Branch (382:9): [True: 41.4k, False: 521k]
  ------------------
  383|  41.4k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (383:17): [True: 199, False: 41.2k]
  ------------------
  384|  41.2k|                *cp == ':') {
  ------------------
  |  Branch (384:17): [True: 2.35k, False: 38.8k]
  ------------------
  385|  2.55k|                continue;
  386|  2.55k|            }
  387|  38.8k|            if (*cp == '[') {
  ------------------
  |  Branch (387:17): [True: 2.26k, False: 36.6k]
  ------------------
  388|  2.26k|                if (cursor->type == t_ignore) {
  ------------------
  |  Branch (388:21): [True: 1.37k, False: 883]
  ------------------
  389|       |                    /* skip to terminating ], not being fooled by
  390|       |                     * sub arrays, etc.
  391|       |                     * FIXME:  someday  */
  392|  1.37k|                    state = in_ignore_array;;
  393|  1.37k|                    value_quoted = false;
  394|  1.37k|                    break;
  395|  1.37k|                }
  396|    883|                if (cursor->type != t_array) {
  ------------------
  |  Branch (396:21): [True: 28, False: 855]
  ------------------
  397|     28|                    json_debug_trace(1,"json: %s",
  ------------------
  |  |  108|     28|    do {                                              \
  |  |  109|     28|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     28|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 28]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 28]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     28|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     28|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 28]
  |  |  ------------------
  ------------------
  398|     28|                                      "Saw [ when not expecting array.\n");
  399|     28|                    if (NULL != end) {
  ------------------
  |  Branch (399:25): [True: 4, False: 24]
  ------------------
  400|      4|                        *end = cp;
  401|      4|                    }
  402|     28|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|     28|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  403|     28|                }
  404|    855|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  405|    855|                if (substatus != 0) {
  ------------------
  |  Branch (405:21): [True: 313, False: 542]
  ------------------
  406|    313|                    return substatus;
  407|    313|                }
  408|    542|                state = post_element;
  409|  36.6k|            } else if (cursor->type == t_array) {
  ------------------
  |  Branch (409:24): [True: 1, False: 36.6k]
  ------------------
  410|      1|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  411|      1|                                  "Array element was specified, but no [.\n");
  412|      1|                if (NULL != end) {
  ------------------
  |  Branch (412:21): [True: 0, False: 1]
  ------------------
  413|      0|                    *end = cp;
  414|      0|                }
  415|      1|                return JSON_ERR_NOBRAK;
  ------------------
  |  |  157|      1|#define JSON_ERR_NOBRAK         6      // array element specified, but no [
  ------------------
  416|  36.6k|            } else if (*cp == '"') {
  ------------------
  |  Branch (416:24): [True: 8.88k, False: 27.7k]
  ------------------
  417|  8.88k|                value_quoted = true;
  418|  8.88k|                state = in_val_string;
  419|  8.88k|                pval = valbuf;
  420|  27.7k|            } else {
  421|  27.7k|                value_quoted = false;
  422|  27.7k|                state = in_val_token;
  423|  27.7k|                pval = valbuf;
  424|  27.7k|                *pval++ = *cp;
  425|  27.7k|            }
  426|  37.1k|            break;
  427|  90.1k|        case in_ignore_array:
  ------------------
  |  Branch (427:9): [True: 90.1k, False: 473k]
  ------------------
  428|  90.1k|            if (*cp == '"') {
  ------------------
  |  Branch (428:17): [True: 21.8k, False: 68.3k]
  ------------------
  429|  21.8k|                if (value_quoted == false) {
  ------------------
  |  Branch (429:21): [True: 10.9k, False: 10.8k]
  ------------------
  430|       |                    // now in quotes
  431|  10.9k|                    value_quoted = true;
  432|  10.9k|                } else {
  433|  10.8k|                    value_quoted = false;
  434|  10.8k|                }
  435|  68.3k|            } else if (*cp == ']') {
  ------------------
  |  Branch (435:24): [True: 1.22k, False: 67.1k]
  ------------------
  436|       |                // FIXME: does not handle sub arrays, etc.
  437|  1.22k|                if (value_quoted == false) {
  ------------------
  |  Branch (437:21): [True: 999, False: 228]
  ------------------
  438|    999|                    state = post_val;
  439|    999|                }
  440|       |                // else in quotes, ignore it.
  441|  1.22k|            }
  442|  90.1k|            break;
  443|  64.6k|        case in_val_string:
  ------------------
  |  Branch (443:9): [True: 64.6k, False: 498k]
  ------------------
  444|  64.6k|            if (NULL == pval) {
  ------------------
  |  Branch (444:17): [True: 0, False: 64.6k]
  ------------------
  445|       |                // don't update end here, leave at value start
  446|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  447|      0|            }
  448|  64.6k|            if (*cp == '\\') {
  ------------------
  |  Branch (448:17): [True: 1.70k, False: 62.9k]
  ------------------
  449|  1.70k|                state = in_escape;
  450|  62.9k|            } else if (*cp == '"') {
  ------------------
  |  Branch (450:24): [True: 8.46k, False: 54.4k]
  ------------------
  451|  8.46k|                *pval++ = '\0';
  452|  8.46k|                json_debug_trace(1, "json: Collected string value %s\n", valbuf);
  ------------------
  |  |  108|  8.46k|    do {                                              \
  |  |  109|  8.46k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.46k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.46k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.46k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.46k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.46k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.46k]
  |  |  ------------------
  ------------------
  453|  8.46k|                state = post_val;
  454|  54.4k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  54.4k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (454:24): [True: 3, False: 54.4k]
  ------------------
  455|  54.4k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (455:24): [True: 106, False: 54.3k]
  ------------------
  456|    109|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|    109|    do {                                              \
  |  |  109|    109|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    109|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 109]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 109]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    109|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    109|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 109]
  |  |  ------------------
  ------------------
  457|       |                // don't update end here, leave at value start
  458|    109|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|    109|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  459|  54.3k|            } else {
  460|  54.3k|                *pval++ = *cp;
  461|  54.3k|            }
  462|  64.5k|            break;
  463|  64.5k|        case in_escape:
  ------------------
  |  Branch (463:9): [True: 1.69k, False: 561k]
  ------------------
  464|  1.69k|            if (NULL == pval) {
  ------------------
  |  Branch (464:17): [True: 0, False: 1.69k]
  ------------------
  465|       |                /* don't update end here, leave at value start */
  466|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  467|      0|            }
  468|  1.69k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  1.69k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (468:17): [True: 3, False: 1.69k]
  ------------------
  469|  1.69k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (469:17): [True: 8, False: 1.68k]
  ------------------
  470|     11|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|     11|    do {                                              \
  |  |  109|     11|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     11|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 11]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 11]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     11|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     11|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 11]
  |  |  ------------------
  ------------------
  471|       |                // don't update end here, leave at value start
  472|     11|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|     11|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  473|     11|            }
  474|  1.68k|            switch (*cp) {
  475|    207|            case 'b':
  ------------------
  |  Branch (475:13): [True: 207, False: 1.48k]
  ------------------
  476|    207|                *pval++ = '\b';
  477|    207|                break;
  478|    194|            case 'f':
  ------------------
  |  Branch (478:13): [True: 194, False: 1.49k]
  ------------------
  479|    194|                *pval++ = '\f';
  480|    194|                break;
  481|    198|            case 'n':
  ------------------
  |  Branch (481:13): [True: 198, False: 1.49k]
  ------------------
  482|    198|                *pval++ = '\n';
  483|    198|                break;
  484|    195|            case 'r':
  ------------------
  |  Branch (484:13): [True: 195, False: 1.49k]
  ------------------
  485|    195|                *pval++ = '\r';
  486|    195|                break;
  487|    400|            case 't':
  ------------------
  |  Branch (487:13): [True: 400, False: 1.28k]
  ------------------
  488|    400|                *pval++ = '\t';
  489|    400|                break;
  490|    277|            case 'u':
  ------------------
  |  Branch (490:13): [True: 277, False: 1.41k]
  ------------------
  491|    277|                {
  492|    277|                    unsigned n;
  493|       |
  494|    277|                    cp++;                   // skip the 'u'
  495|       |                    // NetBSD 6 wants the cast
  496|  1.13k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (496:33): [True: 943, False: 194]
  |  Branch (496:42): [True: 860, False: 83]
  ------------------
  497|    860|                        uescape[n] = *cp++;
  498|    860|                    }
  499|    277|                    uescape[n] = '\0';      // terminate
  500|    277|                    --cp;
  501|       |                    // ECMA-404 says JSON \u must have 4 hex digits
  502|    277|                    if ((4 != n) ||
  ------------------
  |  Branch (502:25): [True: 83, False: 194]
  ------------------
  503|    194|                        (1 != sscanf(uescape, "%4x", &u))) {
  ------------------
  |  Branch (503:25): [True: 0, False: 194]
  ------------------
  504|     83|                        return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     83|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  505|     83|                    }
  506|       |                    // truncate values above 0xff
  507|    194|                    *pval++ = (unsigned char)u;
  508|    194|                }
  509|      0|                break;
  510|    217|            default:            // handles double quote and solidus
  ------------------
  |  Branch (510:13): [True: 217, False: 1.47k]
  ------------------
  511|    217|                *pval++ = *cp;
  512|    217|                break;
  513|  1.68k|            }
  514|  1.60k|            state = in_val_string;
  515|  1.60k|            break;
  516|   109k|        case in_val_token:
  ------------------
  |  Branch (516:9): [True: 109k, False: 454k]
  ------------------
  517|   109k|            if (NULL == pval) {
  ------------------
  |  Branch (517:17): [True: 0, False: 109k]
  ------------------
  518|       |                // don't update end here, leave at value start
  519|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  520|      0|            }
  521|   109k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (521:17): [True: 370, False: 108k]
  ------------------
  522|   108k|                *cp == ',' ||
  ------------------
  |  Branch (522:17): [True: 22.4k, False: 86.3k]
  ------------------
  523|  86.3k|                *cp == '}') {
  ------------------
  |  Branch (523:17): [True: 4.73k, False: 81.5k]
  ------------------
  524|  27.5k|                *pval = '\0';
  525|  27.5k|                json_debug_trace(1, "json: Collected token valuen %s\n",
  ------------------
  |  |  108|  27.5k|    do {                                              \
  |  |  109|  27.5k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  27.5k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 27.5k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 27.5k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  27.5k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  27.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
  526|  27.5k|                                 valbuf);
  527|  27.5k|                state = post_val;
  528|  27.5k|                if (*cp == '}' ||
  ------------------
  |  Branch (528:21): [True: 4.73k, False: 22.7k]
  ------------------
  529|  27.1k|                    *cp == ',') {
  ------------------
  |  Branch (529:21): [True: 22.4k, False: 370]
  ------------------
  530|  27.1k|                    --cp;
  531|  27.1k|                }
  532|  81.5k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|  81.5k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (532:24): [True: 6, False: 81.5k]
  ------------------
  533|      6|                json_debug_trace(1, "json: %s", "Token value too long.\n");
  ------------------
  |  |  108|      6|    do {                                              \
  |  |  109|      6|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      6|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 6]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 6]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      6|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      6|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
  534|       |                // don't update end here, leave at value start
  535|      6|                return JSON_ERR_TOKLONG;
  ------------------
  |  |  159|      6|#define JSON_ERR_TOKLONG        8      // token value too long
  ------------------
  536|  81.5k|            } else {
  537|  81.5k|                *pval++ = *cp;
  538|  81.5k|            }
  539|   109k|            break;
  540|       |            // coverity[unterminated_case]
  541|   109k|        case post_val:
  ------------------
  |  Branch (541:9): [True: 35.8k, False: 527k]
  ------------------
  542|       |            // Ignore whitespace after either string or token values.
  543|  35.8k|	  if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (543:8): [True: 269, False: 35.5k]
  ------------------
  544|  1.30k|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (544:24): [True: 1.29k, False: 14]
  |  Branch (544:39): [True: 1.03k, False: 255]
  ------------------
  545|  1.03k|                    ++cp;
  546|  1.03k|                }
  547|    269|                json_debug_trace(1,
  ------------------
  |  |  108|    269|    do {                                              \
  |  |  109|    269|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    269|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 269]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 269]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    269|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    269|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 269]
  |  |  ------------------
  ------------------
  548|    269|                    "json: Skipped trailing whitespace: value \"%s\"\n", valbuf);
  549|    269|            }
  550|       |            /*
  551|       |             * We know that cursor points at the first spec matching
  552|       |             * the current attribute.  We don't know that it's *the*
  553|       |             * correct spec; our dialect allows there to be any number
  554|       |             * of adjacent ones with the same attrname but different
  555|       |             * types.  Here's where we try to seek forward for a
  556|       |             * matching type/attr pair if we're not looking at one.
  557|       |             */
  558|  35.8k|            for (;;) {
  559|  35.8k|                int seeking = cursor->type;
  560|       |
  561|  35.8k|                if (value_quoted &&
  ------------------
  |  Branch (561:21): [True: 7.35k, False: 28.4k]
  ------------------
  562|  7.35k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (562:22): [True: 1.05k, False: 6.30k]
  ------------------
  563|  6.30k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (563:22): [True: 1.74k, False: 4.56k]
  ------------------
  564|  2.79k|                    break;
  565|  2.79k|                }
  566|  33.0k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (566:22): [True: 1.93k, False: 31.0k]
  ------------------
  567|  31.0k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (567:22): [True: 204, False: 30.8k]
  ------------------
  568|  2.14k|                    seeking == t_boolean) {
  ------------------
  |  Branch (568:21): [True: 1.62k, False: 515]
  ------------------
  569|  1.62k|                    break;
  570|  1.62k|                }
  571|  31.4k|                if (isdigit((unsigned char) valbuf[0])) {
  ------------------
  |  Branch (571:21): [True: 17.1k, False: 14.2k]
  ------------------
  572|  17.1k|                    bool decimal = strchr(valbuf, '.') != NULL;
  573|       |
  574|  17.1k|                    if (decimal &&
  ------------------
  |  Branch (574:25): [True: 978, False: 16.1k]
  ------------------
  575|    978|                        seeking == t_real) {
  ------------------
  |  Branch (575:25): [True: 210, False: 768]
  ------------------
  576|    210|                        break;
  577|    210|                    }
  578|  16.9k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (578:25): [True: 16.1k, False: 768]
  |  Branch (578:38): [True: 196, False: 15.9k]
  ------------------
  579|  15.9k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (579:38): [True: 372, False: 15.6k]
  ------------------
  580|  15.6k|                                     seeking == t_integer ||
  ------------------
  |  Branch (580:38): [True: 1.12k, False: 14.4k]
  ------------------
  581|  14.4k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (581:38): [True: 727, False: 13.7k]
  ------------------
  582|  13.7k|                                     seeking == t_longint ||
  ------------------
  |  Branch (582:38): [True: 613, False: 13.1k]
  ------------------
  583|  13.1k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (583:38): [True: 400, False: 12.7k]
  ------------------
  584|  12.7k|                                     seeking == t_time ||
  ------------------
  |  Branch (584:38): [True: 221, False: 12.5k]
  ------------------
  585|  12.5k|                                     seeking == t_short ||
  ------------------
  |  Branch (585:38): [True: 1.49k, False: 11.0k]
  ------------------
  586|  11.0k|                                     seeking == t_ushort))
  ------------------
  |  Branch (586:38): [True: 0, False: 11.0k]
  ------------------
  587|  5.14k|                        break;
  588|  16.9k|                }
  589|  26.0k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (589:21): [True: 17.8k, False: 8.21k]
  ------------------
  590|  17.8k|                    break;
  591|  17.8k|                }
  592|  8.21k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (592:21): [True: 8.21k, False: 0]
  ------------------
  593|  8.21k|                    break;
  594|  8.21k|                }
  595|      0|                ++cursor;
  596|      0|            }
  597|  35.8k|            if (value_quoted &&
  ------------------
  |  Branch (597:17): [True: 7.35k, False: 28.4k]
  ------------------
  598|  7.35k|                (cursor->type != t_string &&
  ------------------
  |  Branch (598:18): [True: 6.30k, False: 1.05k]
  ------------------
  599|  6.30k|                 cursor->type != t_character &&
  ------------------
  |  Branch (599:18): [True: 6.10k, False: 200]
  ------------------
  600|  6.10k|                 cursor->type != t_check &&
  ------------------
  |  Branch (600:18): [True: 5.38k, False: 722]
  ------------------
  601|  5.38k|                 cursor->type != t_time &&
  ------------------
  |  Branch (601:18): [True: 3.64k, False: 1.74k]
  ------------------
  602|  3.64k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (602:18): [True: 460, False: 3.18k]
  ------------------
  603|    460|                 cursor->map == 0)) {
  ------------------
  |  Branch (603:18): [True: 24, False: 436]
  ------------------
  604|     24|                json_debug_trace(1, "json: %s", "Saw quoted value when expecting"
  ------------------
  |  |  108|     24|    do {                                              \
  |  |  109|     24|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     24|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 24]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 24]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     24|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     24|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 24]
  |  |  ------------------
  ------------------
  605|     24|                                  " non-string.\n");
  606|     24|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     24|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  607|     24|            }
  608|  35.7k|            if (!value_quoted &&
  ------------------
  |  Branch (608:17): [True: 28.4k, False: 7.33k]
  ------------------
  609|  28.4k|                (cursor->type == t_string ||
  ------------------
  |  Branch (609:18): [True: 20, False: 28.4k]
  ------------------
  610|  28.4k|                 cursor->type == t_check ||
  ------------------
  |  Branch (610:18): [True: 30, False: 28.4k]
  ------------------
  611|  28.4k|                 cursor->map != 0)) {
  ------------------
  |  Branch (611:18): [True: 7, False: 28.4k]
  ------------------
  612|     57|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     57|    do {                                              \
  |  |  109|     57|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     57|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 57]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 57]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     57|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     57|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 57]
  |  |  ------------------
  ------------------
  613|     57|                                 "Didn't see quoted value when expecting"
  614|     57|                                 " string.\n");
  615|     57|                return JSON_ERR_NONQSTRING;
  ------------------
  |  |  171|     57|#define JSON_ERR_NONQSTRING    20      // no quoted value when expecting string
  ------------------
  616|     57|            }
  617|  35.7k|            if (cursor->map != 0) {
  ------------------
  |  Branch (617:17): [True: 436, False: 35.3k]
  ------------------
  618|    867|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (618:40): [True: 805, False: 62]
  ------------------
  619|    805|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (619:25): [True: 374, False: 431]
  ------------------
  620|    374|                        goto foundit;
  621|    374|                    }
  622|     62|                json_debug_trace(1,
  ------------------
  |  |  108|     62|    do {                                              \
  |  |  109|     62|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     62|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 62]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 62]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     62|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     62|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 62]
  |  |  ------------------
  ------------------
  623|     62|                                 "json: Invalid enumerated value string %s.\n",
  624|     62|                                  valbuf);
  625|     62|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     62|#define JSON_ERR_BADENUM       18      // invalid enumerated value
  ------------------
  626|    374|              foundit:
  627|    374|                (void)snprintf(valbuf, sizeof(valbuf), "%d", mp->value);
  628|    374|            }
  629|  35.6k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (629:17): [True: 722, False: 34.9k]
  ------------------
  630|    722|                lptr = cursor->dflt.check;
  631|  34.9k|            } else {
  632|  34.9k|                lptr = json_target_address(cursor, parent, offset);
  633|  34.9k|            }
  634|  35.6k|            if (NULL != lptr) {
  ------------------
  |  Branch (634:17): [True: 20.1k, False: 15.5k]
  ------------------
  635|  20.1k|                switch (cursor->type) {
  ------------------
  |  Branch (635:25): [True: 20.1k, False: 0]
  ------------------
  636|    221|                case t_byte:
  ------------------
  |  Branch (636:17): [True: 221, False: 19.9k]
  ------------------
  637|    221|                    {
  638|    221|                        int tmp = atoi(valbuf);
  639|    221|                        lptr[0] = (char)tmp;
  640|    221|                    }
  641|    221|                    break;
  642|    820|                case t_ubyte:
  ------------------
  |  Branch (642:17): [True: 820, False: 19.3k]
  ------------------
  643|    820|                    {
  644|    820|                        int tmp = atoi(valbuf);
  645|    820|                        lptr[0] = (unsigned char)tmp;
  646|    820|                    }
  647|    820|                    break;
  648|  1.67k|                case t_integer:
  ------------------
  |  Branch (648:17): [True: 1.67k, False: 18.4k]
  ------------------
  649|  1.67k|                    {
  650|  1.67k|                        int tmp = atoi(valbuf);
  651|  1.67k|                        memcpy(lptr, &tmp, sizeof(int));
  652|  1.67k|                    }
  653|  1.67k|                    break;
  654|  1.03k|                case t_uinteger:
  ------------------
  |  Branch (654:17): [True: 1.03k, False: 19.0k]
  ------------------
  655|  1.03k|                    {
  656|  1.03k|                        unsigned int tmp = (unsigned int)atol(valbuf);
  657|  1.03k|                        memcpy(lptr, &tmp, sizeof(unsigned int));
  658|  1.03k|                    }
  659|  1.03k|                    break;
  660|    626|                case t_longint:
  ------------------
  |  Branch (660:17): [True: 626, False: 19.5k]
  ------------------
  661|    626|                    {
  662|    626|                        long tmp = atol(valbuf);
  663|    626|                        memcpy(lptr, &tmp, sizeof(long));
  664|    626|                    }
  665|    626|                    break;
  666|    424|                case t_ulongint:
  ------------------
  |  Branch (666:17): [True: 424, False: 19.7k]
  ------------------
  667|    424|                    {
  668|    424|                        unsigned long tmp = (unsigned long)atoll(valbuf);
  669|    424|                        memcpy(lptr, &tmp, sizeof(unsigned long));
  670|    424|                    }
  671|    424|                    break;
  672|  1.50k|                case t_short:
  ------------------
  |  Branch (672:17): [True: 1.50k, False: 18.6k]
  ------------------
  673|  1.50k|                    {
  674|  1.50k|                        short tmp = atoi(valbuf);
  675|  1.50k|                        memcpy(lptr, &tmp, sizeof(short));
  676|  1.50k|                    }
  677|  1.50k|                    break;
  678|      0|                case t_ushort:
  ------------------
  |  Branch (678:17): [True: 0, False: 20.1k]
  ------------------
  679|      0|                    {
  680|      0|                        unsigned short tmp = (unsigned int)atoi(valbuf);
  681|      0|                        memcpy(lptr, &tmp, sizeof(unsigned short));
  682|      0|                    }
  683|      0|                    break;
  684|  2.52k|                case t_time:
  ------------------
  |  Branch (684:17): [True: 2.52k, False: 17.6k]
  ------------------
  685|  2.52k|                    {
  686|  2.52k|                        timespec_t ts_tmp = {0, 0};
  687|       |
  688|  2.52k|                        if (value_quoted) {
  ------------------
  |  Branch (688:29): [True: 1.74k, False: 783]
  ------------------
  689|  1.74k|                            ts_tmp = iso8601_to_timespec(valbuf);
  690|  1.74k|                        } else if (NULL == strchr(valbuf, '.')) {
  ------------------
  |  Branch (690:36): [True: 284, False: 499]
  ------------------
  691|       |                            // integer
  692|    284|                            ts_tmp.tv_sec = (time_t)atoll(valbuf);
  693|    499|                        } else {
  694|       |                            // real
  695|    499|                            double sec_tmp = safe_atof(valbuf);
  696|    499|                            if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (696:33): [True: 302, False: 197]
  ------------------
  697|    302|                                DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    302|    do { \
  |  |  145|    302|        double int_part; \
  |  |  146|    302|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    302|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    302|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 302]
  |  |  ------------------
  ------------------
  698|    302|                            }  // else, leave at default
  699|    499|                        }
  700|  2.52k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  701|  2.52k|                    }
  702|  2.52k|                    break;
  703|    389|                case t_timespec:
  ------------------
  |  Branch (703:17): [True: 389, False: 19.7k]
  ------------------
  704|    389|                    {
  705|    389|                        double sec_tmp = safe_atof(valbuf);
  706|    389|                        timespec_t ts_tmp;
  707|    389|                        if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (707:29): [True: 194, False: 195]
  ------------------
  708|    194|                            DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    194|    do { \
  |  |  145|    194|        double int_part; \
  |  |  146|    194|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    194|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    194|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 194]
  |  |  ------------------
  ------------------
  709|    194|                            memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  710|    194|                        } // else leave at .dflt
  711|    389|                    }
  712|    389|                    break;
  713|  4.49k|                case t_real:
  ------------------
  |  Branch (713:17): [True: 4.49k, False: 15.6k]
  ------------------
  714|  4.49k|                    {
  715|  4.49k|                        double tmp = safe_atof(valbuf);
  716|  4.49k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (716:29): [True: 3.49k, False: 994]
  ------------------
  717|  3.49k|                            memcpy(lptr, &tmp, sizeof(double));
  718|  3.49k|                        } // else leave at .dflt
  719|  4.49k|                    }
  720|  4.49k|                    break;
  721|  1.05k|                case t_string:
  ------------------
  |  Branch (721:17): [True: 1.05k, False: 19.0k]
  ------------------
  722|  1.05k|                    if (NULL != parent &&
  ------------------
  |  Branch (722:25): [True: 388, False: 662]
  ------------------
  723|    388|                        parent->element_type != t_structobject &&
  ------------------
  |  Branch (723:25): [True: 0, False: 388]
  ------------------
  724|      0|                        offset > 0) {
  ------------------
  |  Branch (724:25): [True: 0, False: 0]
  ------------------
  725|      0|                        return JSON_ERR_NOPARSTR;
  ------------------
  |  |  168|      0|#define JSON_ERR_NOPARSTR      17      // no strings in parallel arrays
  ------------------
  726|      0|                    }
  727|  1.05k|                    (void)strlcpy(lptr, valbuf, cursor->len);
  728|  1.05k|                    break;
  729|  1.90k|                case t_boolean:
  ------------------
  |  Branch (729:17): [True: 1.90k, False: 18.2k]
  ------------------
  730|  1.90k|                    {
  731|  1.90k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  732|  1.90k|                        memcpy(lptr, &tmp, sizeof(bool));
  733|  1.90k|                    }
  734|  1.90k|                    break;
  735|    559|                case t_character:
  ------------------
  |  Branch (735:17): [True: 559, False: 19.5k]
  ------------------
  736|    559|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (736:25): [True: 9, False: 550]
  ------------------
  737|       |                        // don't update end here, leave at value start
  738|      9|                        return JSON_ERR_STRLONG;
  ------------------
  |  |  158|      9|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  739|    550|                    } else {
  740|    550|                        lptr[0] = valbuf[0];
  741|    550|                    }
  742|    550|                    break;
  743|  2.18k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (743:17): [True: 2.18k, False: 17.9k]
  ------------------
  744|  2.18k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.18k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  745|  2.18k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (745:17): [True: 0, False: 20.1k]
  ------------------
  746|  2.18k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.18k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  747|  2.18k|                case t_structobject:
  ------------------
  |  Branch (747:17): [True: 0, False: 20.1k]
  ------------------
  748|  2.18k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.18k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  749|  2.18k|                case t_array:
  ------------------
  |  Branch (749:17): [True: 0, False: 20.1k]
  ------------------
  750|  2.18k|                    break;
  751|    722|                case t_check:
  ------------------
  |  Branch (751:17): [True: 722, False: 19.4k]
  ------------------
  752|    722|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (752:25): [True: 165, False: 557]
  ------------------
  753|    165|                        json_debug_trace(1, "json: Required attribute value %s"
  ------------------
  |  |  108|    165|    do {                                              \
  |  |  109|    165|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    165|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 165]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 165]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    165|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    165|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 165]
  |  |  ------------------
  ------------------
  754|    165|                                          " not present.\n",
  755|    165|                                          cursor->dflt.check);
  756|       |                        // don't update end here, leave at start of attribute
  757|    165|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    165|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  758|    165|                    }
  759|    557|                    break;
  760|  20.1k|                }
  761|  20.1k|            }
  762|  35.5k|            FALLTHROUGH
  ------------------
  |  |   55|  35.5k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  763|  36.2k|        case post_element:
  ------------------
  |  Branch (763:9): [True: 703, False: 562k]
  ------------------
  764|  36.2k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (764:17): [True: 209, False: 35.9k]
  ------------------
  765|    209|                continue;
  766|    209|            }
  767|  35.9k|            if (*cp == ',') {
  ------------------
  |  Branch (767:17): [True: 30.4k, False: 5.59k]
  ------------------
  768|  30.4k|                state = await_attr;
  769|  30.4k|            } else if (*cp == '}') {
  ------------------
  |  Branch (769:24): [True: 5.08k, False: 519]
  ------------------
  770|  5.08k|                ++cp;
  771|  5.08k|                goto good_parse;
  772|  5.08k|            } else {
  773|    519|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|    519|    do {                                              \
  |  |  109|    519|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    519|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 519]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 519]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    519|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    519|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 519]
  |  |  ------------------
  ------------------
  774|    519|                                "Garbage while expecting comma or }\n");
  775|    519|                if (NULL != end) {
  ------------------
  |  Branch (775:21): [True: 26, False: 493]
  ------------------
  776|     26|                    *end = cp;
  777|     26|                }
  778|    519|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    519|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  779|    519|            }
  780|  30.4k|            break;
  781|   563k|        }
  782|   563k|    }
  783|  3.09k|    if (state == init) {
  ------------------
  |  Branch (783:9): [True: 41, False: 3.05k]
  ------------------
  784|     41|        json_debug_trace(1, "json: %s", "Input was empty or white-space only\n");
  ------------------
  |  |  108|     41|    do {                                              \
  |  |  109|     41|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     41|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 41]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 41]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     41|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     41|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 41]
  |  |  ------------------
  ------------------
  785|     41|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     41|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  786|     41|    }
  787|       |
  788|  8.13k|  good_parse:
  789|       |    // in case there's another object following, consume trailing WS
  790|  8.13k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (790:12): [True: 207, False: 8.13k]
  ------------------
  791|    207|        ++cp;
  792|    207|    }
  793|  8.13k|    if (NULL != end) {
  ------------------
  |  Branch (793:9): [True: 4.60k, False: 3.53k]
  ------------------
  794|  4.60k|        *end = cp;
  795|  4.60k|    }
  796|  8.13k|    json_debug_trace(1, "%s", "json: JSON parse ends.\n");
  ------------------
  |  |  108|  8.13k|    do {                                              \
  |  |  109|  8.13k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.13k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.13k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.13k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.13k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.13k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.13k]
  |  |  ------------------
  ------------------
  797|  8.13k|    return 0;
  798|  3.09k|}
json.c:json_target_address:
  119|   176k|{
  120|   176k|    char *targetaddr = NULL;
  121|   176k|    if (NULL == parent ||
  ------------------
  |  Branch (121:9): [True: 102k, False: 73.5k]
  ------------------
  122|   102k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (122:9): [True: 0, False: 73.5k]
  ------------------
  123|       |        // ordinary case - use the address in the cursor structure
  124|   102k|        switch (cursor->type) {
  125|      0|        case t_byte:
  ------------------
  |  Branch (125:9): [True: 0, False: 102k]
  ------------------
  126|      0|            targetaddr = (char *)&cursor->addr.byte[offset];
  127|      0|            break;
  128|    863|        case t_ubyte:
  ------------------
  |  Branch (128:9): [True: 863, False: 101k]
  ------------------
  129|    863|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  130|    863|            break;
  131|  20.0k|        case t_ignore:
  ------------------
  |  Branch (131:9): [True: 20.0k, False: 82.5k]
  ------------------
  132|  20.0k|            targetaddr = NULL;
  133|  20.0k|            break;
  134|  18.0k|        case t_integer:
  ------------------
  |  Branch (134:9): [True: 18.0k, False: 84.5k]
  ------------------
  135|  18.0k|            targetaddr = (char *)&cursor->addr.integer[offset];
  136|  18.0k|            break;
  137|  6.05k|        case t_uinteger:
  ------------------
  |  Branch (137:9): [True: 6.05k, False: 96.5k]
  ------------------
  138|  6.05k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  139|  6.05k|            break;
  140|  1.56k|        case t_longint:
  ------------------
  |  Branch (140:9): [True: 1.56k, False: 100k]
  ------------------
  141|  1.56k|            targetaddr = (char *)&cursor->addr.longint[offset];
  142|  1.56k|            break;
  143|    547|        case t_ulongint:
  ------------------
  |  Branch (143:9): [True: 547, False: 102k]
  ------------------
  144|    547|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  145|    547|            break;
  146|      0|        case t_short:
  ------------------
  |  Branch (146:9): [True: 0, False: 102k]
  ------------------
  147|      0|            targetaddr = (char *)&cursor->addr.shortint[offset];
  148|      0|            break;
  149|      0|        case t_ushort:
  ------------------
  |  Branch (149:9): [True: 0, False: 102k]
  ------------------
  150|      0|            targetaddr = (char *)&cursor->addr.ushortint[offset];
  151|      0|            break;
  152|  3.61k|        case t_time:
  ------------------
  |  Branch (152:9): [True: 3.61k, False: 98.9k]
  ------------------
  153|  3.61k|            targetaddr = (char *)&cursor->addr.ts[offset];
  154|  3.61k|            break;
  155|      0|        case t_timespec:
  ------------------
  |  Branch (155:9): [True: 0, False: 102k]
  ------------------
  156|      0|            targetaddr = (char *)&cursor->addr.ts[offset];
  157|      0|            break;
  158|  36.6k|        case t_real:
  ------------------
  |  Branch (158:9): [True: 36.6k, False: 65.9k]
  ------------------
  159|  36.6k|            targetaddr = (char *)&cursor->addr.real[offset];
  160|  36.6k|            break;
  161|  6.92k|        case t_string:
  ------------------
  |  Branch (161:9): [True: 6.92k, False: 95.6k]
  ------------------
  162|  6.92k|            targetaddr = cursor->addr.string;
  163|  6.92k|            break;
  164|  1.57k|        case t_boolean:
  ------------------
  |  Branch (164:9): [True: 1.57k, False: 100k]
  ------------------
  165|  1.57k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  166|  1.57k|            break;
  167|  1.06k|        case t_character:
  ------------------
  |  Branch (167:9): [True: 1.06k, False: 101k]
  ------------------
  168|  1.06k|            targetaddr = (char *)&cursor->addr.character[offset];
  169|  1.06k|            break;
  170|    624|        case t_array:
  ------------------
  |  Branch (170:9): [True: 624, False: 101k]
  ------------------
  171|    624|            FALLTHROUGH
  ------------------
  |  |   55|    624|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  172|  5.68k|        case t_check:
  ------------------
  |  Branch (172:9): [True: 5.06k, False: 97.4k]
  ------------------
  173|  5.68k|            FALLTHROUGH
  ------------------
  |  |   55|  5.68k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  174|  5.68k|        case t_object:
  ------------------
  |  Branch (174:9): [True: 0, False: 102k]
  ------------------
  175|  5.68k|            FALLTHROUGH
  ------------------
  |  |   55|  5.68k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  176|  5.68k|        case t_structobject:
  ------------------
  |  Branch (176:9): [True: 0, False: 102k]
  ------------------
  177|  5.68k|            FALLTHROUGH
  ------------------
  |  |   55|  5.68k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  178|  5.68k|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 102k]
  ------------------
  179|  5.68k|            targetaddr = NULL;
  180|  5.68k|            break;
  181|   102k|        }
  182|   102k|    } else {
  183|       |        // tricky case - hacking a member in an array of structures
  184|  73.5k|        targetaddr =
  185|  73.5k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  186|  73.5k|            cursor->addr.offset;
  187|  73.5k|    }
  188|   176k|    json_debug_trace(1, "json: Target address for %s (offset %d) is %p\n",
  ------------------
  |  |  108|   176k|    do {                                              \
  |  |  109|   176k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   176k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 176k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 176k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   176k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   176k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 176k]
  |  |  ------------------
  ------------------
  189|   176k|                      cursor->attribute, offset, targetaddr);
  190|   176k|    return targetaddr;
  191|   176k|}

json_toff_read:
  677|  2.84k|{
  678|  2.84k|    int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0;
  679|  2.84k|    const struct json_attr_t json_attrs_toff[] = {
  680|       |        // *INDENT-OFF*
  681|  2.84k|        {"class",     t_check,   .dflt.check = "TOFF"},
  682|  2.84k|        {"device",    t_string,  .addr.string = gpsdata->dev.path,
  683|  2.84k|                                 .len = sizeof(gpsdata->dev.path)},
  684|  2.84k|        {"real_sec",  t_integer, .addr.integer = &real_sec,
  685|  2.84k|                                 .dflt.integer = 0},
  686|  2.84k|        {"real_nsec", t_integer, .addr.integer = &real_nsec,
  687|  2.84k|                                 .dflt.integer = 0},
  688|  2.84k|        {"clock_sec", t_integer, .addr.integer = &clock_sec,
  689|  2.84k|                                 .dflt.integer = 0},
  690|  2.84k|        {"clock_nsec",t_integer, .addr.integer = &clock_nsec,
  691|  2.84k|                                 .dflt.integer = 0},
  692|       |        // ignore unknown keys, for cross-version compatibility
  693|  2.84k|        {"", t_ignore},
  694|  2.84k|        {NULL},
  695|       |        // *INDENT-ON*
  696|  2.84k|    };
  697|  2.84k|    int status;
  698|       |
  699|  2.84k|    memset(&gpsdata->toff, 0, sizeof(gpsdata->toff));
  700|  2.84k|    status = json_read_object(buf, json_attrs_toff, endptr);
  701|  2.84k|    gpsdata->toff.real.tv_sec = (time_t)real_sec;
  702|  2.84k|    gpsdata->toff.real.tv_nsec = (long)real_nsec;
  703|  2.84k|    gpsdata->toff.clock.tv_sec = (time_t)clock_sec;
  704|  2.84k|    gpsdata->toff.clock.tv_nsec = (long)clock_nsec;
  705|  2.84k|    if (status != 0)
  ------------------
  |  Branch (705:9): [True: 564, False: 2.27k]
  ------------------
  706|    564|        return status;
  707|       |
  708|  2.27k|    return status;
  709|  2.84k|}
json_pps_read:
  713|     39|{
  714|     39|    int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0, precision=0;
  715|     39|    int qErr = 0;
  716|       |
  717|     39|    const struct json_attr_t json_attrs_pps[] = {
  718|       |        // *INDENT-OFF*
  719|     39|        {"class",     t_check,   .dflt.check = "PPS"},
  720|     39|        {"device",    t_string,  .addr.string = gpsdata->dev.path,
  721|     39|                                 .len = sizeof(gpsdata->dev.path)},
  722|     39|        {"real_sec",  t_integer, .addr.integer = &real_sec,
  723|     39|                                 .dflt.integer = 0},
  724|     39|        {"real_nsec", t_integer, .addr.integer = &real_nsec,
  725|     39|                                 .dflt.integer = 0},
  726|     39|        {"clock_sec", t_integer, .addr.integer = &clock_sec,
  727|     39|                                 .dflt.integer = 0},
  728|     39|        {"clock_nsec",t_integer, .addr.integer = &clock_nsec,
  729|     39|                                 .dflt.integer = 0},
  730|     39|        {"precision", t_integer, .addr.integer = &precision,
  731|     39|                                 .dflt.integer = 0},
  732|     39|        {"qErr", t_integer, .addr.integer = &qErr,
  733|     39|                                 .dflt.integer = 0},
  734|       |        // ignore unknown keys, for cross-version compatibility
  735|     39|        {"", t_ignore},
  736|     39|        {NULL},
  737|       |        // *INDENT-ON*
  738|     39|    };
  739|     39|    int status;
  740|       |
  741|     39|    memset(&gpsdata->pps, 0, sizeof(gpsdata->pps));
  742|     39|    status = json_read_object(buf, json_attrs_pps, endptr);
  743|       |
  744|       |    // This is good until GPS are more than nanosec accurate
  745|     39|    gpsdata->pps.real.tv_sec = (time_t)real_sec;
  746|     39|    gpsdata->pps.real.tv_nsec = (long)real_nsec;
  747|     39|    gpsdata->pps.clock.tv_sec = (time_t)clock_sec;
  748|     39|    gpsdata->pps.clock.tv_nsec = (long)clock_nsec;
  749|       |    // hope qErr fits in int
  750|     39|    gpsdata->qErr = (long)qErr;
  751|       |
  752|       |    // FIXME: precision is currently parsed but discarded
  753|     39|    return status;
  754|     39|}
json_oscillator_read:
  758|      9|{
  759|      9|    bool running = false, reference = false, disciplined = false;
  760|      9|    int delta = 0;
  761|      9|    const struct json_attr_t json_attrs_osc[] = {
  762|       |        // *INDENT-OFF*
  763|      9|        {"class",       t_check,   .dflt.check = "OSC"},
  764|      9|        {"device",      t_string,  .addr.string = gpsdata->dev.path,
  765|      9|                                   .len = sizeof(gpsdata->dev.path)},
  766|      9|        {"running",     t_boolean, .addr.boolean = &running,
  767|      9|                                   .dflt.boolean = false},
  768|      9|        {"reference",   t_boolean, .addr.boolean = &reference,
  769|      9|                                   .dflt.boolean = false},
  770|      9|        {"disciplined", t_boolean, .addr.boolean = &disciplined,
  771|      9|                                   .dflt.boolean = false},
  772|      9|        {"delta",       t_integer, .addr.integer = &delta,
  773|      9|                                   .dflt.integer = 0},
  774|       |        // ignore unknown keys, for cross-version compatibility
  775|      9|        {"", t_ignore},
  776|      9|        {NULL},
  777|       |        // *INDENT-ON*
  778|      9|    };
  779|      9|    int status;
  780|       |
  781|      9|    memset(&gpsdata->osc, 0, sizeof(gpsdata->osc));
  782|      9|    status = json_read_object(buf, json_attrs_osc, endptr);
  783|       |
  784|      9|    gpsdata->osc.running = running;
  785|      9|    gpsdata->osc.reference = reference;
  786|      9|    gpsdata->osc.disciplined = disciplined;
  787|      9|    gpsdata->osc.delta = delta;
  788|       |
  789|      9|    return status;
  790|      9|}
libgps_json_unpack:
  810|  2.81k|{
  811|  2.81k|    int status;
  812|  2.81k|    const char *classtag = strstr(buf, "\"class\":");
  813|       |
  814|  2.81k|    if (NULL == classtag) {
  ------------------
  |  Branch (814:9): [True: 388, False: 2.42k]
  ------------------
  815|    388|        return -1;
  816|    388|    }
  817|       |
  818|  2.42k|    if (str_starts_with(classtag, "\"class\":\"TPV\"")) {
  ------------------
  |  Branch (818:9): [True: 468, False: 1.95k]
  ------------------
  819|    468|        status = json_tpv_read(buf, gpsdata, end);
  820|    468|        gpsdata->set = STATUS_SET;
  ------------------
  |  | 2877|    468|#define STATUS_SET      (1llu<<9)
  ------------------
  821|    468|        if (0 != gpsdata->fix.time.tv_sec) {
  ------------------
  |  Branch (821:13): [True: 292, False: 176]
  ------------------
  822|    292|            gpsdata->set |= TIME_SET;
  ------------------
  |  | 2870|    292|#define TIME_SET        (1llu<<2)
  ------------------
  823|    292|        }
  824|    468|        if (0 != isfinite(gpsdata->fix.ept)) {
  ------------------
  |  Branch (824:13): [True: 2, False: 466]
  ------------------
  825|      2|            gpsdata->set |= TIMERR_SET;
  ------------------
  |  | 2871|      2|#define TIMERR_SET      (1llu<<3)
  ------------------
  826|      2|        }
  827|    468|        if (0 != isfinite(gpsdata->fix.longitude)) {
  ------------------
  |  Branch (827:13): [True: 2, False: 466]
  ------------------
  828|      2|            gpsdata->set |= LATLON_SET;
  ------------------
  |  | 2872|      2|#define LATLON_SET      (1llu<<4)
  ------------------
  829|      2|        }
  830|    468|        if (0 != isfinite(gpsdata->fix.altitude) ||
  ------------------
  |  Branch (830:13): [True: 1, False: 467]
  ------------------
  831|    467|            0 != isfinite(gpsdata->fix.altHAE) ||
  ------------------
  |  Branch (831:13): [True: 1, False: 466]
  ------------------
  832|    466|            0 != isfinite(gpsdata->fix.depth) ||
  ------------------
  |  Branch (832:13): [True: 1, False: 465]
  ------------------
  833|    465|            0 != isfinite(gpsdata->fix.altMSL)) {
  ------------------
  |  Branch (833:13): [True: 1, False: 464]
  ------------------
  834|      4|            gpsdata->set |= ALTITUDE_SET;
  ------------------
  |  | 2873|      4|#define ALTITUDE_SET    (1llu<<5)
  ------------------
  835|      4|        }
  836|    468|        if (0 != isfinite(gpsdata->fix.epx) &&
  ------------------
  |  Branch (836:13): [True: 3, False: 465]
  ------------------
  837|      3|            0 != isfinite(gpsdata->fix.epy)) {
  ------------------
  |  Branch (837:13): [True: 2, False: 1]
  ------------------
  838|      2|            gpsdata->set |= HERR_SET;
  ------------------
  |  | 2880|      2|#define HERR_SET        (1llu<<12)
  ------------------
  839|      2|        }
  840|    468|        if (0 != isfinite(gpsdata->fix.epv)) {
  ------------------
  |  Branch (840:13): [True: 2, False: 466]
  ------------------
  841|      2|            gpsdata->set |= VERR_SET;
  ------------------
  |  | 2881|      2|#define VERR_SET        (1llu<<13)
  ------------------
  842|      2|        }
  843|    468|        if (0 != isfinite(gpsdata->fix.track)) {
  ------------------
  |  Branch (843:13): [True: 1, False: 467]
  ------------------
  844|      1|            gpsdata->set |= TRACK_SET;
  ------------------
  |  | 2875|      1|#define TRACK_SET       (1llu<<7)
  ------------------
  845|      1|        }
  846|    468|        if (0 != isfinite(gpsdata->fix.magnetic_track) ||
  ------------------
  |  Branch (846:13): [True: 1, False: 467]
  ------------------
  847|    467|            0 != isfinite(gpsdata->fix.magnetic_var)) {
  ------------------
  |  Branch (847:13): [True: 1, False: 466]
  ------------------
  848|      2|            gpsdata->set |= MAGNETIC_TRACK_SET;
  ------------------
  |  | 2906|      2|#define MAGNETIC_TRACK_SET (1llu<<38)
  ------------------
  849|      2|        }
  850|    468|        if (0 != isfinite(gpsdata->fix.speed)) {
  ------------------
  |  Branch (850:13): [True: 1, False: 467]
  ------------------
  851|      1|            gpsdata->set |= SPEED_SET;
  ------------------
  |  | 2874|      1|#define SPEED_SET       (1llu<<6)
  ------------------
  852|      1|        }
  853|    468|        if (0 != isfinite(gpsdata->fix.climb)) {
  ------------------
  |  Branch (853:13): [True: 1, False: 467]
  ------------------
  854|      1|            gpsdata->set |= CLIMB_SET;
  ------------------
  |  | 2876|      1|#define CLIMB_SET       (1llu<<8)
  ------------------
  855|      1|        }
  856|    468|        if (0 != isfinite(gpsdata->fix.epd)) {
  ------------------
  |  Branch (856:13): [True: 1, False: 467]
  ------------------
  857|      1|            gpsdata->set |= TRACKERR_SET;
  ------------------
  |  | 2885|      1|#define TRACKERR_SET    (1llu<<17)
  ------------------
  858|      1|        }
  859|    468|        if (0 != isfinite(gpsdata->fix.eps)) {
  ------------------
  |  Branch (859:13): [True: 1, False: 467]
  ------------------
  860|      1|            gpsdata->set |= SPEEDERR_SET;
  ------------------
  |  | 2884|      1|#define SPEEDERR_SET    (1llu<<16)
  ------------------
  861|      1|        }
  862|    468|        if (0 != isfinite(gpsdata->fix.epc)) {
  ------------------
  |  Branch (862:13): [True: 1, False: 467]
  ------------------
  863|      1|            gpsdata->set |= CLIMBERR_SET;
  ------------------
  |  | 2886|      1|#define CLIMBERR_SET    (1llu<<18)
  ------------------
  864|      1|        }
  865|    468|        if (MODE_NOT_SEEN != gpsdata->fix.mode) {
  ------------------
  |  |  215|    468|#define MODE_NOT_SEEN   0       // mode update not seen yet
  ------------------
  |  Branch (865:13): [True: 57, False: 411]
  ------------------
  866|     57|            gpsdata->set |= MODE_SET;
  ------------------
  |  | 2878|     57|#define MODE_SET        (1llu<<10)
  ------------------
  867|     57|        }
  868|    468|        if (0 != isfinite(gpsdata->fix.wanglem) ||
  ------------------
  |  Branch (868:13): [True: 1, False: 467]
  ------------------
  869|    467|            0 != isfinite(gpsdata->fix.wangler) ||
  ------------------
  |  Branch (869:13): [True: 1, False: 466]
  ------------------
  870|    466|            0 != isfinite(gpsdata->fix.wanglet) ||
  ------------------
  |  Branch (870:13): [True: 1, False: 465]
  ------------------
  871|    465|            0 != isfinite(gpsdata->fix.wspeedr) ||
  ------------------
  |  Branch (871:13): [True: 1, False: 464]
  ------------------
  872|    464|            0 != isfinite(gpsdata->fix.wspeedt)) {
  ------------------
  |  Branch (872:13): [True: 1, False: 463]
  ------------------
  873|      5|            gpsdata->set |= NAVDATA_SET;
  ------------------
  |  | 2902|      5|#define NAVDATA_SET     (1llu<<34)
  ------------------
  874|      5|        }
  875|    468|        if (0 != isfinite(gpsdata->fix.NED.relPosN) ||
  ------------------
  |  Branch (875:13): [True: 1, False: 467]
  ------------------
  876|    467|            0 != isfinite(gpsdata->fix.NED.relPosE) ||
  ------------------
  |  Branch (876:13): [True: 1, False: 466]
  ------------------
  877|    466|            0 != isfinite(gpsdata->fix.NED.relPosD) ||
  ------------------
  |  Branch (877:13): [True: 1, False: 465]
  ------------------
  878|    465|            0 != isfinite(gpsdata->fix.NED.relPosH) ||
  ------------------
  |  Branch (878:13): [True: 1, False: 464]
  ------------------
  879|    464|            0 != isfinite(gpsdata->fix.NED.relPosL) ||
  ------------------
  |  Branch (879:13): [True: 1, False: 463]
  ------------------
  880|    463|            0 != isfinite(gpsdata->fix.NED.velN) ||
  ------------------
  |  Branch (880:13): [True: 1, False: 462]
  ------------------
  881|    462|            0 != isfinite(gpsdata->fix.NED.velE) ||
  ------------------
  |  Branch (881:13): [True: 1, False: 461]
  ------------------
  882|    461|            0 != isfinite(gpsdata->fix.NED.velD)) {
  ------------------
  |  Branch (882:13): [True: 1, False: 460]
  ------------------
  883|      8|            gpsdata->set |= NED_SET;
  ------------------
  |  | 2908|      8|#define NED_SET         (1llu<<40)
  ------------------
  884|      8|        }
  885|    468|        if ((0 != isfinite(gpsdata->fix.ecef.x)) &&
  ------------------
  |  Branch (885:13): [True: 3, False: 465]
  ------------------
  886|      3|            (0 != isfinite(gpsdata->fix.ecef.y)) &&
  ------------------
  |  Branch (886:13): [True: 2, False: 1]
  ------------------
  887|      2|            (0 != isfinite(gpsdata->fix.ecef.z))) {
  ------------------
  |  Branch (887:13): [True: 1, False: 1]
  ------------------
  888|       |            // All, or none.  Clients can just do their own isfinite()s
  889|      1|            gpsdata->set |= ECEF_SET;
  ------------------
  |  | 2904|      1|#define ECEF_SET        (1llu<<36)
  ------------------
  890|      1|        }
  891|    468|        if ((0 != isfinite(gpsdata->fix.ecef.vx)) &&
  ------------------
  |  Branch (891:13): [True: 4, False: 464]
  ------------------
  892|      4|            (0 != isfinite(gpsdata->fix.ecef.vy)) &&
  ------------------
  |  Branch (892:13): [True: 3, False: 1]
  ------------------
  893|      3|            (0 != isfinite(gpsdata->fix.ecef.vz))) {
  ------------------
  |  Branch (893:13): [True: 1, False: 2]
  ------------------
  894|       |            // All, or none.  Clients can just do their own isfinite()s
  895|      1|            gpsdata->set |= VECEF_SET;
  ------------------
  |  | 2905|      1|#define VECEF_SET       (1llu<<37)
  ------------------
  896|      1|        }
  897|    468|        return FILTER(status);
  ------------------
  |  |  798|    468|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    936|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 468]
  |  |  ------------------
  |  |  799|    468|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    468|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 467]
  |  |  ------------------
  ------------------
  898|    468|    }
  899|  1.95k|    if (str_starts_with(classtag, "\"class\":\"GST\"")) {
  ------------------
  |  Branch (899:9): [True: 311, False: 1.64k]
  ------------------
  900|    311|        status = json_noise_read(buf, gpsdata, end);
  901|    311|        if (PASS(status)) {
  ------------------
  |  |  800|    311|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    311|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    622|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 311]
  |  |  |  |  ------------------
  |  |  |  |  799|    311|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    311|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 310]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 285, False: 26]
  |  |  ------------------
  ------------------
  902|    285|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|    285|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|    285|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|    285|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|    285|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|    285|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|    285|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|    285|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|    285|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|    285|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|    285|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|    285|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|    285|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|    285|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|    285|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|    285|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|    285|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|    285|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  903|    285|            gpsdata->set |= GST_SET;
  ------------------
  |  | 2895|    285|#define GST_SET         (1llu<<27)
  ------------------
  904|    285|        }
  905|    311|        return FILTER(status);
  ------------------
  |  |  798|    311|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    622|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 311]
  |  |  ------------------
  |  |  799|    311|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    311|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 310]
  |  |  ------------------
  ------------------
  906|    311|    }
  907|  1.64k|    if (str_starts_with(classtag, "\"class\":\"SKY\"")) {
  ------------------
  |  Branch (907:9): [True: 173, False: 1.47k]
  ------------------
  908|    173|        status = json_sky_read(buf, gpsdata, end);
  909|    173|        return FILTER(status);
  ------------------
  |  |  798|    173|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    346|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 173]
  |  |  ------------------
  |  |  799|    173|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    173|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 3, False: 170]
  |  |  ------------------
  ------------------
  910|    173|    }
  911|  1.47k|    if (str_starts_with(classtag, "\"class\":\"ATT\"")) {
  ------------------
  |  Branch (911:9): [True: 73, False: 1.39k]
  ------------------
  912|     73|        status = json_att_read(buf, gpsdata, end);
  913|     73|        if (PASS(status)) {
  ------------------
  |  |  800|     73|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     73|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    146|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 73]
  |  |  |  |  ------------------
  |  |  |  |  799|     73|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     73|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 3, False: 70]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 39, False: 34]
  |  |  ------------------
  ------------------
  914|     39|            gpsdata->set |= ATTITUDE_SET;
  ------------------
  |  | 2882|     39|#define ATTITUDE_SET    (1llu<<14)
  ------------------
  915|     39|        }
  916|     73|        return FILTER(status);
  ------------------
  |  |  798|     73|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    146|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 73]
  |  |  ------------------
  |  |  799|     73|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     73|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 3, False: 70]
  |  |  ------------------
  ------------------
  917|     73|    }
  918|  1.39k|    if (str_starts_with(classtag, "\"class\":\"IMU\"")) {
  ------------------
  |  Branch (918:9): [True: 50, False: 1.34k]
  ------------------
  919|     50|        status = json_imu_read(buf, gpsdata, end);
  920|     50|        if (PASS(status)) {
  ------------------
  |  |  800|     50|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     50|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    100|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 50]
  |  |  |  |  ------------------
  |  |  |  |  799|     50|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     50|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 49]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 22, False: 28]
  |  |  ------------------
  ------------------
  921|     22|            gpsdata->set |= IMU_SET;
  ------------------
  |  | 2911|     22|#define IMU_SET         (1llu<<43)
  ------------------
  922|     22|        }
  923|     50|        return FILTER(status);
  ------------------
  |  |  798|     50|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    100|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 50]
  |  |  ------------------
  |  |  799|     50|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     50|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 49]
  |  |  ------------------
  ------------------
  924|     50|    }
  925|  1.34k|    if (str_starts_with(classtag, "\"class\":\"DEVICES\"")) {
  ------------------
  |  Branch (925:9): [True: 68, False: 1.28k]
  ------------------
  926|     68|        status = json_devicelist_read(buf, gpsdata, end);
  927|     68|        if (PASS(status)) {
  ------------------
  |  |  800|     68|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     68|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    136|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 68]
  |  |  |  |  ------------------
  |  |  |  |  799|     68|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     68|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 67]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 8, False: 60]
  |  |  ------------------
  ------------------
  928|      8|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|      8|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|      8|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|      8|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|      8|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|      8|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|      8|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|      8|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|      8|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|      8|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|      8|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|      8|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|      8|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|      8|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|      8|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|      8|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|      8|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|      8|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  929|      8|            gpsdata->set |= DEVICELIST_SET;
  ------------------
  |  | 2888|      8|#define DEVICELIST_SET  (1llu<<20)
  ------------------
  930|      8|        }
  931|     68|        return FILTER(status);
  ------------------
  |  |  798|     68|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    136|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 68]
  |  |  ------------------
  |  |  799|     68|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     68|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 67]
  |  |  ------------------
  ------------------
  932|     68|    }
  933|  1.28k|    if (str_starts_with(classtag, "\"class\":\"DEVICE\"")) {
  ------------------
  |  Branch (933:9): [True: 17, False: 1.26k]
  ------------------
  934|     17|        status = json_device_read(buf, &gpsdata->dev, end);
  935|     17|        if (PASS(status))
  ------------------
  |  |  800|     17|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     17|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     34|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 17]
  |  |  |  |  ------------------
  |  |  |  |  799|     17|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     17|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 4, False: 13]
  |  |  ------------------
  ------------------
  936|      4|            gpsdata->set |= DEVICE_SET;
  ------------------
  |  | 2887|      4|#define DEVICE_SET      (1llu<<19)
  ------------------
  937|     17|        return FILTER(status);
  ------------------
  |  |  798|     17|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     34|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 17]
  |  |  ------------------
  |  |  799|     17|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     17|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 16]
  |  |  ------------------
  ------------------
  938|     17|    }
  939|  1.26k|    if (str_starts_with(classtag, "\"class\":\"WATCH\"")) {
  ------------------
  |  Branch (939:9): [True: 54, False: 1.21k]
  ------------------
  940|     54|        status = json_watch_read(buf, &gpsdata->policy, end);
  941|     54|        if (PASS(status)) {
  ------------------
  |  |  800|     54|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     54|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    108|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 54]
  |  |  |  |  ------------------
  |  |  |  |  799|     54|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     54|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 53]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 50, False: 4]
  |  |  ------------------
  ------------------
  942|     50|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     50|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     50|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     50|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     50|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     50|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     50|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     50|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     50|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     50|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     50|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     50|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     50|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     50|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     50|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     50|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     50|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     50|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  943|     50|            gpsdata->set |= POLICY_SET;
  ------------------
  |  | 2897|     50|#define POLICY_SET      (1llu<<29)
  ------------------
  944|     50|        }
  945|     54|        return FILTER(status);
  ------------------
  |  |  798|     54|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    108|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 54]
  |  |  ------------------
  |  |  799|     54|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     54|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 53]
  |  |  ------------------
  ------------------
  946|     54|    }
  947|  1.21k|    if (str_starts_with(classtag, "\"class\":\"VERSION\"")) {
  ------------------
  |  Branch (947:9): [True: 16, False: 1.19k]
  ------------------
  948|     16|        status = json_version_read(buf, gpsdata, end);
  949|     16|        if (status ==  0) {
  ------------------
  |  Branch (949:13): [True: 3, False: 13]
  ------------------
  950|      3|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|      3|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|      3|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|      3|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|      3|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|      3|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|      3|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|      3|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|      3|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|      3|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|      3|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|      3|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|      3|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|      3|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|      3|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|      3|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|      3|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|      3|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  951|      3|            gpsdata->set |= VERSION_SET;
  ------------------
  |  | 2896|      3|#define VERSION_SET     (1llu<<28)
  ------------------
  952|      3|        }
  953|     16|        return FILTER(status);
  ------------------
  |  |  798|     16|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     32|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 16]
  |  |  ------------------
  |  |  799|     16|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     16|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 15]
  |  |  ------------------
  ------------------
  954|     16|    }
  955|  1.19k|    if (str_starts_with(classtag, "\"class\":\"RTCM2\"")) {
  ------------------
  |  Branch (955:9): [True: 306, False: 888]
  ------------------
  956|    306|        status = json_rtcm2_read(buf,
  957|    306|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  958|    306|                                 &gpsdata->rtcm2, end);
  959|    306|        if (PASS(status)) {
  ------------------
  |  |  800|    306|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    306|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    612|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 10, False: 296]
  |  |  |  |  ------------------
  |  |  |  |  799|    306|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    296|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 295]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 91, False: 215]
  |  |  ------------------
  ------------------
  960|     91|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     91|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     91|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     91|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     91|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     91|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     91|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     91|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     91|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     91|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     91|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     91|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     91|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     91|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     91|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     91|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     91|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     91|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  961|     91|            gpsdata->set |= RTCM2_SET;
  ------------------
  |  | 2890|     91|#define RTCM2_SET       (1llu<<22)
  ------------------
  962|     91|        }
  963|    306|        return FILTER(status);
  ------------------
  |  |  798|    306|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    612|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 10, False: 296]
  |  |  ------------------
  |  |  799|    306|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    296|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 295]
  |  |  ------------------
  ------------------
  964|    306|    }
  965|    888|    if (str_starts_with(classtag, "\"class\":\"RTCM3\"")) {
  ------------------
  |  Branch (965:9): [True: 124, False: 764]
  ------------------
  966|    124|        status = json_rtcm3_read(buf,
  967|    124|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  968|    124|                                 &gpsdata->rtcm3, end);
  969|    124|        if (PASS(status)) {
  ------------------
  |  |  800|    124|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    124|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    248|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 2, False: 122]
  |  |  |  |  ------------------
  |  |  |  |  799|    124|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    122|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 121]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 42, False: 82]
  |  |  ------------------
  ------------------
  970|     42|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     42|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     42|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     42|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     42|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     42|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     42|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     42|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     42|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     42|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     42|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     42|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     42|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     42|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     42|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     42|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     42|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     42|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  971|     42|            gpsdata->set |= RTCM3_SET;
  ------------------
  |  | 2891|     42|#define RTCM3_SET       (1llu<<23)
  ------------------
  972|     42|        }
  973|    124|        return FILTER(status);
  ------------------
  |  |  798|    124|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    248|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 2, False: 122]
  |  |  ------------------
  |  |  799|    124|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    122|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 121]
  |  |  ------------------
  ------------------
  974|    124|    }
  975|    764|#ifdef AIVDM_ENABLE
  976|    764|    if (str_starts_with(classtag, "\"class\":\"AIS\"")) {
  ------------------
  |  Branch (976:9): [True: 329, False: 435]
  ------------------
  977|    329|        status = json_ais_read(buf,
  978|    329|                               gpsdata->dev.path, sizeof(gpsdata->dev.path),
  979|    329|                               &gpsdata->ais, end);
  980|    329|        if (PASS(status)) {
  ------------------
  |  |  800|    329|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    329|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    658|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 43, False: 286]
  |  |  |  |  ------------------
  |  |  |  |  799|    329|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    286|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 2, False: 284]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 195, False: 134]
  |  |  ------------------
  ------------------
  981|    195|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|    195|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|    195|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|    195|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|    195|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|    195|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|    195|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|    195|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|    195|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|    195|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|    195|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|    195|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|    195|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|    195|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|    195|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|    195|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|    195|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|    195|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  982|    195|            gpsdata->set |= AIS_SET;
  ------------------
  |  | 2892|    195|#define AIS_SET         (1llu<<24)
  ------------------
  983|    195|        }
  984|    329|        return FILTER(status);
  ------------------
  |  |  798|    329|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    658|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 43, False: 286]
  |  |  ------------------
  |  |  799|    329|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    286|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 2, False: 284]
  |  |  ------------------
  ------------------
  985|    329|    }
  986|    435|#endif  // AIVDM_ENABLE
  987|    435|    if (str_starts_with(classtag, "\"class\":\"ERROR\"")) {
  ------------------
  |  Branch (987:9): [True: 11, False: 424]
  ------------------
  988|     11|        status = json_error_read(buf, gpsdata, end);
  989|     11|        if (PASS(status)) {
  ------------------
  |  |  800|     11|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     11|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     22|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 11]
  |  |  |  |  ------------------
  |  |  |  |  799|     11|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     11|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 4, False: 7]
  |  |  ------------------
  ------------------
  990|      4|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|      4|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|      4|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|      4|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|      4|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|      4|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|      4|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|      4|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|      4|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|      4|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|      4|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|      4|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|      4|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|      4|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|      4|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|      4|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|      4|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|      4|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  991|      4|            gpsdata->set |= ERROR_SET;
  ------------------
  |  | 2899|      4|#define ERROR_SET       (1llu<<31)
  ------------------
  992|      4|        }
  993|     11|        return FILTER(status);
  ------------------
  |  |  798|     11|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     22|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 11]
  |  |  ------------------
  |  |  799|     11|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     11|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 10]
  |  |  ------------------
  ------------------
  994|     11|    }
  995|    424|    if (str_starts_with(classtag, "\"class\":\"TOFF\"")) {
  ------------------
  |  Branch (995:9): [True: 29, False: 395]
  ------------------
  996|     29|        status = json_toff_read(buf, gpsdata, end);
  997|     29|        if (PASS(status)) {
  ------------------
  |  |  800|     29|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     29|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     58|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 29]
  |  |  |  |  ------------------
  |  |  |  |  799|     29|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     29|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 17, False: 12]
  |  |  ------------------
  ------------------
  998|     17|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     17|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     17|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     17|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     17|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     17|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     17|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     17|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     17|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     17|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     17|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     17|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     17|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     17|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     17|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     17|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     17|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     17|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  999|     17|            gpsdata->set |= TOFF_SET;
  ------------------
  |  | 2900|     17|#define TOFF_SET        (1llu<<32)      // not yet used
  ------------------
 1000|     17|        }
 1001|     29|        return FILTER(status);
  ------------------
  |  |  798|     29|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     58|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 29]
  |  |  ------------------
  |  |  799|     29|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     29|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 28]
  |  |  ------------------
  ------------------
 1002|     29|    }
 1003|    395|    if (str_starts_with(classtag, "\"class\":\"PPS\"")) {
  ------------------
  |  Branch (1003:9): [True: 39, False: 356]
  ------------------
 1004|     39|        status = json_pps_read(buf, gpsdata, end);
 1005|     39|        if (PASS(status)) {
  ------------------
  |  |  800|     39|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     39|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     78|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 39]
  |  |  |  |  ------------------
  |  |  |  |  799|     39|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     39|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 38]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 25, False: 14]
  |  |  ------------------
  ------------------
 1006|     25|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     25|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     25|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     25|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     25|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     25|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     25|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     25|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     25|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     25|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     25|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     25|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     25|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     25|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     25|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     25|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     25|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     25|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
 1007|     25|            gpsdata->set |= PPS_SET;
  ------------------
  |  | 2901|     25|#define PPS_SET         (1llu<<33)
  ------------------
 1008|     25|        }
 1009|     39|        return FILTER(status);
  ------------------
  |  |  798|     39|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     78|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 39]
  |  |  ------------------
  |  |  799|     39|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     39|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 38]
  |  |  ------------------
  ------------------
 1010|     39|    }
 1011|    356|    if (str_starts_with(classtag, "\"class\":\"OSC\"")) {
  ------------------
  |  Branch (1011:9): [True: 9, False: 347]
  ------------------
 1012|      9|        status = json_oscillator_read(buf, gpsdata, end);
 1013|      9|        if (PASS(status)) {
  ------------------
  |  |  800|      9|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|      9|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     18|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 9]
  |  |  |  |  ------------------
  |  |  |  |  799|      9|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|      9|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 2, False: 7]
  |  |  ------------------
  ------------------
 1014|      2|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|      2|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|      2|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|      2|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|      2|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|      2|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|      2|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|      2|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|      2|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|      2|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|      2|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|      2|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|      2|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|      2|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|      2|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|      2|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|      2|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|      2|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
 1015|      2|            gpsdata->set |= OSCILLATOR_SET;
  ------------------
  |  | 2903|      2|#define OSCILLATOR_SET  (1llu<<35)
  ------------------
 1016|      2|        }
 1017|      9|        return FILTER(status);
  ------------------
  |  |  798|      9|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     18|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 9]
  |  |  ------------------
  |  |  799|      9|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|      9|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 8]
  |  |  ------------------
  ------------------
 1018|      9|    }
 1019|    347|    if (str_starts_with(classtag, "\"class\":\"RAW\"")) {
  ------------------
  |  Branch (1019:9): [True: 128, False: 219]
  ------------------
 1020|    128|        status = json_raw_read(buf, gpsdata, end);
 1021|    128|        if (PASS(status)) {
  ------------------
  |  |  800|    128|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    128|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    256|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 128]
  |  |  |  |  ------------------
  |  |  |  |  799|    128|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    128|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 2, False: 126]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 17, False: 111]
  |  |  ------------------
  ------------------
 1022|     17|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     17|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     17|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     17|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     17|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     17|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     17|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     17|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     17|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     17|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     17|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     17|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     17|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     17|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     17|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     17|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     17|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     17|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
 1023|     17|            gpsdata->set |= RAW_SET;
  ------------------
  |  | 2907|     17|#define RAW_SET         (1llu<<39)
  ------------------
 1024|     17|        }
 1025|    128|        return FILTER(status);
  ------------------
  |  |  798|    128|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    256|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 128]
  |  |  ------------------
  |  |  799|    128|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    128|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 2, False: 126]
  |  |  ------------------
  ------------------
 1026|    128|    }
 1027|       |    // else, unknown class type
 1028|    219|    return -1;
 1029|    347|}
libgps_json.c:json_tpv_read:
   37|    468|{
   38|    468|    int ret;
   39|       |
   40|    468|    const struct json_attr_t json_attrs_1[] = {
   41|       |        // *INDENT-OFF*
   42|    468|        {"class",  t_check,   .dflt.check = "TPV"},
   43|    468|        {"alt",    t_real,    .addr.real = &gpsdata->fix.altitude,
   44|    468|                                 .dflt.real = NAN}, // DEPRECATED, undefined
   45|    468|        {"altHAE", t_real,    .addr.real = &gpsdata->fix.altHAE,
   46|    468|                                 .dflt.real = NAN},
   47|    468|        {"altMSL", t_real,    .addr.real = &gpsdata->fix.altMSL,
   48|    468|                                 .dflt.real = NAN},
   49|    468|        {"ant",    t_integer, .addr.integer = &gpsdata->fix.ant_stat,
   50|    468|                                 .dflt.integer = 0},
   51|    468|        {"antPwr",    t_integer, .addr.integer = &gpsdata->fix.ant_power,
   52|    468|                                 .dflt.integer = 0},
   53|    468|        {"baseS",     t_integer,   .addr.integer = &gpsdata->fix.base.status,
   54|    468|         .dflt.integer = STATUS_UNK},     // aka zero
  ------------------
  |  |  226|    468|#define STATUS_UNK      0       // Unknown status
  ------------------
   55|    468|        {"baseE",     t_real,      .addr.real = &gpsdata->fix.base.east,
   56|    468|         .dflt.real = NAN},
   57|    468|        {"baseN",     t_real,      .addr.real = &gpsdata->fix.base.north,
   58|    468|         .dflt.real = NAN},
   59|    468|        {"baseU",     t_real,      .addr.real = &gpsdata->fix.base.up,
   60|    468|         .dflt.real = NAN},
   61|    468|        {"baseL",     t_real,      .addr.real = &gpsdata->fix.base.length,
   62|    468|         .dflt.real = NAN},
   63|    468|        {"baseC",     t_real,      .addr.real = &gpsdata->fix.base.course,
   64|    468|         .dflt.real = NAN},
   65|    468|        {"climb",     t_real,      .addr.real = &gpsdata->fix.climb,
   66|    468|                                   .dflt.real = NAN},
   67|    468|        {"clockbias", t_longint, .addr.longint = &gpsdata->fix.clockbias,
   68|    468|                                 .dflt.longint = 0},
   69|    468|        {"clockdrift", t_longint, .addr.longint = &gpsdata->fix.clockdrift,
   70|    468|                                 .dflt.longint = 0},
   71|    468|        {"datum",  t_string,  .addr.string = gpsdata->fix.datum,
   72|    468|                                 .len = sizeof(gpsdata->fix.datum)},
   73|    468|        {"device", t_string,  .addr.string = gpsdata->dev.path,
   74|    468|                                 .len = sizeof(gpsdata->dev.path)},
   75|    468|        {"depth", t_real,  .addr.real = &gpsdata->fix.depth,
   76|    468|                                 .dflt.real = NAN},
   77|    468|        {"dgpsAge", t_real, .addr.real = &gpsdata->fix.dgps_age,
   78|    468|                                 .dflt.real = NAN},
   79|    468|        {"dgpsRatio", t_real, .addr.real = &gpsdata->fix.base.ratio,
   80|    468|                                 .dflt.real = NAN},
   81|    468|        {"dgpsSta", t_integer, .addr.integer = &gpsdata->fix.dgps_station,
   82|    468|                                 .dflt.integer = -1},
   83|    468|        {"ecefx",  t_real,    .addr.real = &gpsdata->fix.ecef.x,
   84|    468|                                 .dflt.real = NAN},
   85|    468|        {"ecefy",  t_real,    .addr.real = &gpsdata->fix.ecef.y,
   86|    468|                                 .dflt.real = NAN},
   87|    468|        {"ecefz",  t_real,    .addr.real = &gpsdata->fix.ecef.z,
   88|    468|                                 .dflt.real = NAN},
   89|    468|        {"ecefvx", t_real,    .addr.real = &gpsdata->fix.ecef.vx,
   90|    468|                                 .dflt.real = NAN},
   91|    468|        {"ecefvy", t_real,    .addr.real = &gpsdata->fix.ecef.vy,
   92|    468|                                 .dflt.real = NAN},
   93|    468|        {"ecefvz", t_real,    .addr.real = &gpsdata->fix.ecef.vz,
   94|    468|                                 .dflt.real = NAN},
   95|    468|        {"ecefpAcc", t_real,  .addr.real = &gpsdata->fix.ecef.pAcc,
   96|    468|                                 .dflt.real = NAN},
   97|    468|        {"ecefvAcc", t_real,  .addr.real = &gpsdata->fix.ecef.vAcc,
   98|    468|                                 .dflt.real = NAN},
   99|    468|        {"epc",    t_real,    .addr.real = &gpsdata->fix.epc,
  100|    468|                                 .dflt.real = NAN},
  101|    468|        {"epd",    t_real,    .addr.real = &gpsdata->fix.epd,
  102|    468|                                 .dflt.real = NAN},
  103|    468|        {"eph",    t_real,    .addr.real = &gpsdata->fix.eph,
  104|    468|                                 .dflt.real = NAN},
  105|    468|        {"eps",    t_real,    .addr.real = &gpsdata->fix.eps,
  106|    468|                                 .dflt.real = NAN},
  107|    468|        {"ept",    t_real,    .addr.real = &gpsdata->fix.ept,
  108|    468|                                 .dflt.real = NAN},
  109|    468|        {"epx",    t_real,    .addr.real = &gpsdata->fix.epx,
  110|    468|                                 .dflt.real = NAN},
  111|    468|        {"epy",    t_real,    .addr.real = &gpsdata->fix.epy,
  112|    468|                                 .dflt.real = NAN},
  113|    468|        {"epv",    t_real,    .addr.real = &gpsdata->fix.epv,
  114|    468|                                 .dflt.real = NAN},
  115|    468|        {"geoidSep", t_real,  .addr.real = &gpsdata->fix.geoid_sep,
  116|    468|                                 .dflt.real = NAN},
  117|    468|        {"lat",    t_real,    .addr.real = &gpsdata->fix.latitude,
  118|    468|                                 .dflt.real = NAN},
  119|    468|        {"jam",    t_integer, .addr.integer = &gpsdata->fix.jam,
  120|    468|                                 .dflt.integer = -1},
  121|    468|        {"leapseconds",   t_integer, .addr.integer = &gpsdata->leap_seconds,
  122|    468|                                 .dflt.integer = 0},
  123|    468|        {"lon",    t_real,    .addr.real = &gpsdata->fix.longitude,
  124|    468|                                 .dflt.real = NAN},
  125|    468|        {"magtrack",  t_real,    .addr.real = &gpsdata->fix.magnetic_track,
  126|    468|                                 .dflt.real = NAN},
  127|    468|        {"magvar",  t_real,   .addr.real = &gpsdata->fix.magnetic_var,
  128|    468|                                 .dflt.real = NAN},
  129|    468|        {"mode",   t_integer, .addr.integer = &gpsdata->fix.mode,
  130|    468|                                 .dflt.integer = MODE_NOT_SEEN},
  ------------------
  |  |  215|    468|#define MODE_NOT_SEEN   0       // mode update not seen yet
  ------------------
  131|    468|        {"relD", t_real,  .addr.real = &gpsdata->fix.NED.relPosD,
  132|    468|                                 .dflt.real = NAN},
  133|    468|        {"relE", t_real,  .addr.real = &gpsdata->fix.NED.relPosE,
  134|    468|                                 .dflt.real = NAN},
  135|    468|        {"relN", t_real,  .addr.real = &gpsdata->fix.NED.relPosN,
  136|    468|                                 .dflt.real = NAN},
  137|    468|        {"relH", t_real,  .addr.real = &gpsdata->fix.NED.relPosH,
  138|    468|                                 .dflt.real = NAN},
  139|    468|        {"relL", t_real,  .addr.real = &gpsdata->fix.NED.relPosL,
  140|    468|                                 .dflt.real = NAN},
  141|    468|        {"temp",   t_real, .addr.real = &gpsdata->fix.temp,
  142|    468|                                 .dflt.real = NAN},
  143|    468|        {"time",   t_time,    .addr.ts = &gpsdata->fix.time,
  144|    468|                                 .dflt.ts = {0, 0}},
  145|    468|        {"track",  t_real,    .addr.real = &gpsdata->fix.track,
  146|    468|                                 .dflt.real = NAN},
  147|    468|        {"sep",    t_real,    .addr.real = &gpsdata->fix.sep,
  148|    468|                                 .dflt.real = NAN},
  149|    468|        {"speed",  t_real,    .addr.real = &gpsdata->fix.speed,
  150|    468|                                 .dflt.real = NAN},
  151|    468|        {"status", t_integer, .addr.integer = &gpsdata->fix.status,
  152|    468|                                 .dflt.integer = STATUS_UNK},
  ------------------
  |  |  226|    468|#define STATUS_UNK      0       // Unknown status
  ------------------
  153|    468|        {"velD", t_real,  .addr.real = &gpsdata->fix.NED.velD,
  154|    468|                                 .dflt.real = NAN},
  155|    468|        {"velE", t_real,  .addr.real = &gpsdata->fix.NED.velE,
  156|    468|                                 .dflt.real = NAN},
  157|    468|        {"velN", t_real,  .addr.real = &gpsdata->fix.NED.velN,
  158|    468|                                 .dflt.real = NAN},
  159|    468|        {"wanglem", t_real, .addr.real = &gpsdata->fix.wanglem,
  160|    468|                                 .dflt.real = NAN},
  161|    468|        {"wangler", t_real, .addr.real = &gpsdata->fix.wangler,
  162|    468|                                 .dflt.real = NAN},
  163|    468|        {"wanglet", t_real, .addr.real = &gpsdata->fix.wanglet,
  164|    468|                                 .dflt.real = NAN},
  165|    468|        {"wspeedr", t_real, .addr.real = &gpsdata->fix.wspeedr,
  166|    468|                                 .dflt.real = NAN},
  167|    468|        {"wspeedt", t_real, .addr.real = &gpsdata->fix.wspeedt,
  168|    468|                                 .dflt.real = NAN},
  169|    468|        {"wtemp", t_real, .addr.real = &gpsdata->fix.wtemp,
  170|    468|                                 .dflt.real = NAN},
  171|       |        // ignore unknown keys, for cross-version compatibility
  172|    468|        {"", t_ignore},
  173|       |
  174|    468|        {NULL},
  175|       |        // *INDENT-ON*
  176|    468|    };
  177|       |
  178|    468|    ret = json_read_object(buf, json_attrs_1, endptr);
  179|    468|    return ret;
  180|    468|}
libgps_json.c:json_noise_read:
  184|    311|{
  185|    311|    int ret;
  186|       |
  187|    311|    const struct json_attr_t json_attrs_1[] = {
  188|       |        // *INDENT-OFF*
  189|    311|        {"class",  t_check,   .dflt.check = "GST"},
  190|    311|        {"device", t_string,  .addr.string = gpsdata->dev.path,
  191|    311|                                 .len = sizeof(gpsdata->dev.path)},
  192|    311|        {"time",   t_time,    .addr.ts = &gpsdata->gst.utctime,
  193|    311|                                 .dflt.ts = {0, 0}},
  194|    311|        {"alt",    t_real,    .addr.real = &gpsdata->gst.alt_err_deviation,
  195|    311|                                 .dflt.real = NAN},
  196|    311|        {"lat",    t_real,    .addr.real = &gpsdata->gst.lat_err_deviation,
  197|    311|                                 .dflt.real = NAN},
  198|    311|        {"lon",    t_real,    .addr.real = &gpsdata->gst.lon_err_deviation,
  199|    311|                                 .dflt.real = NAN},
  200|    311|        {"major",  t_real,    .addr.real = &gpsdata->gst.smajor_deviation,
  201|    311|                                 .dflt.real = NAN},
  202|    311|        {"minor",  t_real,    .addr.real = &gpsdata->gst.sminor_deviation,
  203|    311|                                 .dflt.real = NAN},
  204|    311|        {"orient", t_real,    .addr.real = &gpsdata->gst.smajor_orientation,
  205|    311|                                 .dflt.real = NAN},
  206|    311|        {"rms",    t_real,    .addr.real = &gpsdata->gst.rms_deviation,
  207|    311|                                 .dflt.real = NAN},
  208|    311|        {"ve",     t_real,    .addr.real = &gpsdata->gst.ve_err_deviation,
  209|    311|                                 .dflt.real = NAN},
  210|    311|        {"vn",     t_real,    .addr.real = &gpsdata->gst.vn_err_deviation,
  211|    311|                                 .dflt.real = NAN},
  212|    311|        {"vu",     t_real,    .addr.real = &gpsdata->gst.vu_err_deviation,
  213|    311|                                 .dflt.real = NAN},
  214|       |        // ignore unknown keys, for cross-version compatibility
  215|    311|        {"", t_ignore},
  216|    311|        {NULL},
  217|       |        // *INDENT-ON*
  218|    311|    };
  219|       |
  220|    311|    ret = json_read_object(buf, json_attrs_1, endptr);
  221|       |
  222|    311|    return ret;
  223|    311|}
libgps_json.c:json_sky_read:
  300|    173|{
  301|       |
  302|    173|    const struct json_attr_t json_attrs_satellites[] = {
  303|       |        // *INDENT-OFF*
  304|    173|        {"PRN",    t_short,   STRUCTOBJECT(struct satellite_t, PRN)},
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  305|    173|        {"az",     t_real,    STRUCTOBJECT(struct satellite_t, azimuth),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  306|    173|                              .dflt.real = NAN},
  307|    173|        {"el",     t_real,    STRUCTOBJECT(struct satellite_t, elevation),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  308|    173|                              .dflt.real = NAN},
  309|    173|        {"freqid", t_byte,    STRUCTOBJECT(struct satellite_t, freqid),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  310|    173|                              .dflt.byte = -1},
  311|    173|        {"gnssid", t_ubyte,   STRUCTOBJECT(struct satellite_t, gnssid)},
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  312|    173|        {"health", t_ubyte,   STRUCTOBJECT(struct satellite_t, health),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  313|    173|                              .dflt.ubyte = SAT_HEALTH_UNK},
  ------------------
  |  | 2609|    173|#define SAT_HEALTH_UNK 0
  ------------------
  314|    173|        {"pr",     t_real,    STRUCTOBJECT(struct satellite_t, pr),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  315|    173|                              .dflt.real = NAN},
  316|    173|        {"prRate", t_real,    STRUCTOBJECT(struct satellite_t, prRate),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  317|    173|                              .dflt.real = NAN},
  318|    173|        {"prRes",  t_real,    STRUCTOBJECT(struct satellite_t, prRes),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  319|    173|                              .dflt.real = NAN},
  320|    173|        {"ss",     t_real,    STRUCTOBJECT(struct satellite_t, ss),
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  321|    173|                              .dflt.real = NAN},
  322|    173|        {"sigid",  t_ubyte,   STRUCTOBJECT(struct satellite_t, sigid)},
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  323|    173|        {"svid",   t_ubyte,   STRUCTOBJECT(struct satellite_t, svid)},
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  324|    173|        {"used",   t_boolean, STRUCTOBJECT(struct satellite_t, used)},
  ------------------
  |  |  188|    173|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  325|       |        // ignore unknown keys, for cross-version compatibility
  326|    173|        {"", t_ignore},
  327|       |        // *INDENT-ON*
  328|    173|        {NULL},
  329|    173|    };
  330|       |
  331|    173|    int nSat = -1;  // Use nSat only to know if sats are in SKY
  332|       |
  333|    173|    const struct json_attr_t json_attrs_2[] = {
  334|       |        // *INDENT-OFF*
  335|    173|        {"class",      t_check,   .dflt.check = "SKY"},
  336|    173|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  337|    173|                                     .len = sizeof(gpsdata->dev.path)},
  338|    173|        {"gdop",       t_real,    .addr.real    = &gpsdata->dop.gdop,
  339|    173|                                     .dflt.real = NAN},
  340|    173|        {"hdop",       t_real,    .addr.real    = &gpsdata->dop.hdop,
  341|    173|                                     .dflt.real = NAN},
  342|    173|        {"nSat",       t_integer, .addr.integer = &nSat,
  343|    173|                                     .dflt.integer = -1},
  344|    173|        {"pdop",       t_real,    .addr.real    = &gpsdata->dop.pdop,
  345|    173|                                     .dflt.real = NAN},
  346|    173|        {"tdop",       t_real,    .addr.real    = &gpsdata->dop.tdop,
  347|    173|                                     .dflt.real = NAN},
  348|    173|        {"vdop",       t_real,    .addr.real    = &gpsdata->dop.vdop,
  349|    173|                                     .dflt.real = NAN},
  350|    173|        {"xdop",       t_real,    .addr.real    = &gpsdata->dop.xdop,
  351|    173|                                     .dflt.real = NAN},
  352|    173|        {"ydop",       t_real,    .addr.real    = &gpsdata->dop.ydop,
  353|    173|                                     .dflt.real = NAN},
  354|    173|        {"satellites", t_array,
  355|    173|                                   STRUCTARRAY(gpsdata->skyview,
  ------------------
  |  |  190|    173|        .addr.array.element_type = t_structobject, \
  |  |  191|    173|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    173|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    173|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    173|        .addr.array.count = n, \
  |  |  195|    173|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    173|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    173|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    173|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    173|            struct { \
  |  |  |  |  |  |   71|    173|                int unused_int; \
  |  |  |  |  |  |   72|    173|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    173|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    173|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    173|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    173|            }; \
  |  |  |  |  |  |   77|    173|            1; \
  |  |  |  |  |  |   78|    173|        })) \
  |  |  |  |  |  |   79|    173|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|    173|                                         json_attrs_satellites,
  357|    173|                                         &gpsdata->satellites_visible)},
  358|    173|        {"time",       t_time,    .addr.ts = &gpsdata->skyview_time,
  359|    173|                                     .dflt.ts = {0, 0}},
  360|    173|        {"uSat",       t_integer, .addr.integer = &gpsdata->satellites_used,
  361|    173|                                     .dflt.integer = 0},
  362|       |        // ignore unknown keys, for cross-version compatibility
  363|    173|        {"", t_ignore},
  364|    173|        {NULL},
  365|       |        // *INDENT-ON*
  366|    173|    };
  367|    173|    int status, i;
  368|       |
  369|    173|    memset(&gpsdata->skyview, 0, sizeof(gpsdata->skyview));
  370|       |
  371|    173|    status = json_read_object(buf, json_attrs_2, endptr);
  372|    173|    if (0 != status) {
  ------------------
  |  Branch (372:9): [True: 62, False: 111]
  ------------------
  373|     62|        return status;
  374|     62|    }
  375|       |
  376|    111|    if (1 == isfinite(gpsdata->dop.hdop) ||
  ------------------
  |  Branch (376:9): [True: 1, False: 110]
  ------------------
  377|    110|        1 == isfinite(gpsdata->dop.xdop) ||
  ------------------
  |  Branch (377:9): [True: 1, False: 109]
  ------------------
  378|    109|        1 == isfinite(gpsdata->dop.ydop) ||
  ------------------
  |  Branch (378:9): [True: 1, False: 108]
  ------------------
  379|    108|        1 == isfinite(gpsdata->dop.vdop) ||
  ------------------
  |  Branch (379:9): [True: 1, False: 107]
  ------------------
  380|    107|        1 == isfinite(gpsdata->dop.tdop) ||
  ------------------
  |  Branch (380:9): [True: 1, False: 106]
  ------------------
  381|    106|        1 == isfinite(gpsdata->dop.pdop) ||
  ------------------
  |  Branch (381:9): [True: 1, False: 105]
  ------------------
  382|    105|        1 == isfinite(gpsdata->dop.gdop)) {
  ------------------
  |  Branch (382:9): [True: 1, False: 104]
  ------------------
  383|       |        // got at least one DOP
  384|      7|        gpsdata->set |= DOP_SET;
  ------------------
  |  | 2879|      7|#define DOP_SET         (1llu<<11)
  ------------------
  385|      7|    }
  386|       |
  387|    111|    gpsdata->satellites_visible = 0;
  388|       |
  389|    111|    if (-1 == nSat) {
  ------------------
  |  Branch (389:9): [True: 17, False: 94]
  ------------------
  390|       |        // no sats in the SKY, likely just dops.  Maybe uSat
  391|     17|        gpsdata->set &= ~SATELLITE_SET;
  ------------------
  |  | 2883|     17|#define SATELLITE_SET   (1llu<<15)
  ------------------
  392|     17|        return 0;
  393|     17|    }
  394|     94|    gpsdata->satellites_used = 0;
  395|       |
  396|     94|    gpsdata->set |= SATELLITE_SET;
  ------------------
  |  | 2883|     94|#define SATELLITE_SET   (1llu<<15)
  ------------------
  397|       |    // recalculate used and visible, do not use nSat, uSat
  398|  21.7k|    for (i = 0; i < MAXCHANNELS; i++) {
  ------------------
  |  |  132|  21.7k|#define MAXCHANNELS     230
  ------------------
  |  Branch (398:17): [True: 21.6k, False: 94]
  ------------------
  399|  21.6k|        if (0 < gpsdata->skyview[i].PRN) {
  ------------------
  |  Branch (399:13): [True: 1.31k, False: 20.3k]
  ------------------
  400|  1.31k|            gpsdata->satellites_visible++;
  401|  1.31k|        }
  402|  21.6k|        if (gpsdata->skyview[i].used) {
  ------------------
  |  Branch (402:13): [True: 1.29k, False: 20.3k]
  ------------------
  403|  1.29k|            gpsdata->satellites_used++;
  404|  1.29k|        }
  405|  21.6k|    }
  406|       |
  407|     94|    return 0;
  408|    111|}
libgps_json.c:json_att_read:
  413|     73|{
  414|     73|    struct attitude_t *datap = &gpsdata->attitude;
  415|       |
  416|     73|    const struct json_attr_t json_attrs_1[] = {
  417|       |        // *INDENT-OFF*
  418|     73|        {"class",     t_check,     .dflt.check = "ATT"},
  419|     73|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  420|     73|         .len = sizeof(gpsdata->dev.path)},
  421|     73|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  422|     73|         .dflt.real = NAN},
  423|     73|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  424|     73|         .dflt.real = NAN},
  425|     73|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  426|     73|         .dflt.real = NAN},
  427|     73|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  428|     73|         .dflt.real = NAN},
  429|     73|        {"baseS",     t_integer,   .addr.integer = &datap->base.status,
  430|     73|         .dflt.integer = STATUS_UNK},     // aka zero
  ------------------
  |  |  226|     73|#define STATUS_UNK      0       // Unknown status
  ------------------
  431|     73|        {"baseE",     t_real,      .addr.real = &datap->base.east,
  432|     73|         .dflt.real = NAN},
  433|     73|        {"baseN",     t_real,      .addr.real = &datap->base.north,
  434|     73|         .dflt.real = NAN},
  435|     73|        {"baseU",     t_real,      .addr.real = &datap->base.up,
  436|     73|         .dflt.real = NAN},
  437|     73|        {"baseL",     t_real,      .addr.real = &datap->base.length,
  438|     73|         .dflt.real = NAN},
  439|     73|        {"baseC",     t_real,      .addr.real = &datap->base.course,
  440|     73|         .dflt.real = NAN},
  441|     73|        {"dgpsRatio", t_real, .addr.real = &datap->base.ratio,
  442|     73|         .dflt.real = NAN},
  443|     73|        {"depth",     t_real,      .addr.real = &datap->depth,
  444|     73|         .dflt.real = NAN},
  445|     73|        {"dip",       t_real,      .addr.real = &datap->dip,
  446|     73|         .dflt.real = NAN},
  447|     73|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_x,
  448|     73|         .dflt.real = NAN},
  449|     73|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  450|     73|         .dflt.real = NAN},
  451|     73|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  452|     73|         .dflt.real = NAN},
  453|     73|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  454|     73|         .dflt.real = NAN},
  455|     73|        {"heading",   t_real,      .addr.real = &datap->heading,
  456|     73|         .dflt.real = NAN},
  457|     73|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  458|     73|         .dflt.real = NAN},
  459|     73|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  460|     73|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  461|     73|         .dflt.real = NAN},
  462|     73|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  463|     73|         .dflt.real = NAN},
  464|     73|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  465|     73|         .dflt.real = NAN},
  466|     73|        {"mheading",   t_real,     .addr.real = &datap->mheading,
  467|     73|         .dflt.real = NAN},
  468|     73|        {"msg",       t_string,    .addr.string = datap->msg,
  469|     73|         .len = sizeof(datap->msg)},
  470|     73|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  471|     73|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  472|     73|         .dflt.real = NAN},
  473|     73|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  474|     73|        {"roll",      t_real,      .addr.real = &datap->roll,
  475|     73|         .dflt.real = NAN},
  476|     73|        {"temp",      t_real,      .addr.real = &datap->temp,
  477|     73|         .dflt.real = NAN},
  478|     73|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  479|     73|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  480|     73|         .dflt.ulongint = 0},
  481|     73|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  482|     73|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  483|       |
  484|       |        // ignore unknown keys, for cross-version compatibility
  485|     73|        {"", t_ignore},
  486|     73|        {NULL},
  487|       |        // *INDENT-ON*
  488|     73|    };
  489|       |
  490|     73|    return json_read_object(buf, json_attrs_1, endptr);
  491|     73|}
libgps_json.c:json_imu_read:
  496|     50|{
  497|       |    // the client only uses the first slot.
  498|     50|    struct attitude_t *datap = &gpsdata->imu[0];
  499|       |
  500|     50|    const struct json_attr_t json_attrs_1[] = {
  501|       |        // *INDENT-OFF*
  502|     50|        {"class",     t_check,     .dflt.check = "IMU"},
  503|     50|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  504|     50|         .len = sizeof(gpsdata->dev.path)},
  505|     50|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  506|     50|         .dflt.real = NAN},
  507|     50|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  508|     50|         .dflt.real = NAN},
  509|     50|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  510|     50|         .dflt.real = NAN},
  511|     50|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  512|     50|         .dflt.real = NAN},
  513|     50|        {"depth",     t_real,      .addr.real = &datap->depth,
  514|     50|         .dflt.real = NAN},
  515|     50|        {"dip",       t_real,      .addr.real = &datap->dip,
  516|     50|         .dflt.real = NAN},
  517|     50|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_temp,
  518|     50|         .dflt.real = NAN},
  519|     50|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  520|     50|         .dflt.real = NAN},
  521|     50|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  522|     50|         .dflt.real = NAN},
  523|     50|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  524|     50|         .dflt.real = NAN},
  525|     50|        {"heading",   t_real,      .addr.real = &datap->heading,
  526|     50|         .dflt.real = NAN},
  527|     50|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  528|     50|         .dflt.real = NAN},
  529|     50|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  530|     50|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  531|     50|         .dflt.real = NAN},
  532|     50|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  533|     50|         .dflt.real = NAN},
  534|     50|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  535|     50|         .dflt.real = NAN},
  536|     50|        {"msg",       t_string,    .addr.string = datap->msg,
  537|     50|         .len = sizeof(datap->msg)},
  538|     50|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  539|     50|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  540|     50|         .dflt.real = NAN},
  541|     50|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  542|     50|        {"roll",      t_real,      .addr.real = &datap->roll,
  543|     50|         .dflt.real = NAN},
  544|     50|        {"temp",      t_real,      .addr.real = &datap->temp,
  545|     50|         .dflt.real = NAN},
  546|     50|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  547|     50|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  548|     50|         .dflt.ulongint = 0},
  549|     50|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  550|     50|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  551|       |
  552|       |        // ignore unknown keys, for cross-version compatibility
  553|     50|        {"", t_ignore},
  554|     50|        {NULL},
  555|       |        // *INDENT-ON*
  556|     50|    };
  557|       |
  558|     50|    return json_read_object(buf, json_attrs_1, endptr);
  559|     50|}
libgps_json.c:json_devicelist_read:
  563|     68|{
  564|     68|    const struct json_attr_t json_attrs_subdevices[] = {
  565|       |        // *INDENT-OFF*
  566|     68|        {"class",      t_check,      .dflt.check = "DEVICE"},
  567|     68|        {"path",       t_string,     STRUCTOBJECT(struct devconfig_t, path),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  568|     68|         .len = sizeof(gpsdata->devices.list[0].path)},
  569|     68|        {"activated",  t_time,
  570|     68|         STRUCTOBJECT(struct devconfig_t, activated)},
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  571|     68|        {"flags",      t_integer,    STRUCTOBJECT(struct devconfig_t, flags)},
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  572|     68|        {"driver",     t_string,     STRUCTOBJECT(struct devconfig_t, driver),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  573|     68|         .len = sizeof(gpsdata->devices.list[0].driver)},
  574|     68|        {"hexdata",    t_string,     STRUCTOBJECT(struct devconfig_t, hexdata),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  575|     68|         .len = sizeof(gpsdata->devices.list[0].hexdata)},
  576|     68|        {"sernum",     t_string,     STRUCTOBJECT(struct devconfig_t, sernum),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  577|     68|                            .len = sizeof(gpsdata->devices.list[0].sernum)},
  578|     68|        {"subtype",    t_string,     STRUCTOBJECT(struct devconfig_t, subtype),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  579|     68|                            .len = sizeof(gpsdata->devices.list[0].subtype)},
  580|     68|        {"subtype1",   t_string,     STRUCTOBJECT(struct devconfig_t, subtype1),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  581|     68|                            .len = sizeof(gpsdata->devices.list[0].subtype1)},
  582|     68|        {"native",     t_integer, STRUCTOBJECT(struct devconfig_t, driver_mode),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  583|     68|                                        .dflt.integer = -1},
  584|     68|        {"bps",        t_uinteger,   STRUCTOBJECT(struct devconfig_t, baudrate),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  585|     68|                                        .dflt.uinteger = DEVDEFAULT_BPS},
  ------------------
  |  |   51|     68|#define DEVDEFAULT_BPS          0
  ------------------
  586|     68|        {"parity",     t_character,  STRUCTOBJECT(struct devconfig_t, parity),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  587|     68|                                        .dflt.character = DEVDEFAULT_PARITY},
  ------------------
  |  |   52|     68|#define DEVDEFAULT_PARITY       'X'
  ------------------
  588|     68|        {"stopbits",   t_uinteger,   STRUCTOBJECT(struct devconfig_t, stopbits),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  589|     68|                                        .dflt.integer = DEVDEFAULT_STOPBITS},
  ------------------
  |  |   53|     68|#define DEVDEFAULT_STOPBITS     3
  ------------------
  590|     68|        {"cycle",      t_timespec,   STRUCTOBJECT(struct devconfig_t, cycle),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  591|     68|                                        .dflt.ts = {0,0}},
  592|     68|        {"mincycle",   t_timespec,   STRUCTOBJECT(struct devconfig_t, mincycle),
  ------------------
  |  |  188|     68|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  593|     68|                                        .dflt.ts = {0,0}},
  594|       |        // ignore unknown keys, for cross-version compatibility
  595|     68|        {"", t_ignore},
  596|     68|        {NULL},
  597|       |        // *INDENT-ON*
  598|     68|    };
  599|     68|    const struct json_attr_t json_attrs_devices[] = {
  600|     68|        {"class", t_check,.dflt.check = "DEVICES"},
  601|     68|        {"devices", t_array, STRUCTARRAY(gpsdata->devices.list,
  ------------------
  |  |  190|     68|        .addr.array.element_type = t_structobject, \
  |  |  191|     68|        .addr.array.arr.objects.subtype = e, \
  |  |  192|     68|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|     68|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|     68|        .addr.array.count = n, \
  |  |  195|     68|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|     68|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|     68|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|     68|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|     68|            struct { \
  |  |  |  |  |  |   71|     68|                int unused_int; \
  |  |  |  |  |  |   72|     68|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|     68|            } zero_init = {0}; \
  |  |  |  |  |  |   74|     68|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|     68|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|     68|            }; \
  |  |  |  |  |  |   77|     68|            1; \
  |  |  |  |  |  |   78|     68|        })) \
  |  |  |  |  |  |   79|     68|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|     68|                                         json_attrs_subdevices,
  603|     68|                                         &gpsdata->devices.ndevices)},
  604|       |        // ignore unknown keys, for cross-version compatibility
  605|     68|        {"", t_ignore},
  606|     68|        {NULL},
  607|     68|    };
  608|     68|    int status;
  609|       |
  610|     68|    memset(&gpsdata->devices, 0, sizeof(gpsdata->devices));
  611|     68|    status = json_read_object(buf, json_attrs_devices, endptr);
  612|     68|    if (status != 0) {
  ------------------
  |  Branch (612:9): [True: 61, False: 7]
  ------------------
  613|     61|        return status;
  614|     61|    }
  615|       |
  616|       |    // json.c should ensure this never happens
  617|     68|    assert(MAXUSERDEVS >= gpsdata->devices.ndevices);
  ------------------
  |  Branch (617:5): [True: 0, False: 7]
  |  Branch (617:5): [True: 7, False: 0]
  ------------------
  618|       |
  619|      7|    (void)clock_gettime(CLOCK_REALTIME, &gpsdata->devices.time);
  620|      7|    return 0;
  621|      7|}
libgps_json.c:json_version_read:
  625|     16|{
  626|     16|    const struct json_attr_t json_attrs_version[] = {
  627|       |        // *INDENT-OFF*
  628|     16|        {"class",     t_check,   .dflt.check = "VERSION"},
  629|     16|        {"release",   t_string,  .addr.string  = gpsdata->version.release,
  630|     16|                                    .len = sizeof(gpsdata->version.release)},
  631|     16|        {"rev",       t_string,  .addr.string  = gpsdata->version.rev,
  632|     16|                                    .len = sizeof(gpsdata->version.rev)},
  633|     16|        {"proto_major", t_integer,
  634|     16|         .addr.integer = &gpsdata->version.proto_major},
  635|     16|        {"proto_minor", t_integer,
  636|     16|         .addr.integer = &gpsdata->version.proto_minor},
  637|     16|        {"remote",    t_string,  .addr.string  = gpsdata->version.remote,
  638|     16|                                    .len = sizeof(gpsdata->version.remote)},
  639|       |        // ignore unknown keys, for cross-version compatibility
  640|     16|        {"", t_ignore},
  641|     16|        {NULL},
  642|       |        // *INDENT-ON*
  643|     16|    };
  644|     16|    int status;
  645|       |
  646|     16|    memset(&gpsdata->version, 0, sizeof(gpsdata->version));
  647|     16|    status = json_read_object(buf, json_attrs_version, endptr);
  648|       |
  649|     16|    return status;
  650|     16|}
libgps_json.c:json_error_read:
  654|     11|{
  655|     11|    const struct json_attr_t json_attrs_error[] = {
  656|       |        // *INDENT-OFF*
  657|     11|        {"class",     t_check,   .dflt.check = "ERROR"},
  658|     11|        {"message",   t_string,  .addr.string  = gpsdata->error,
  659|     11|                                    .len = sizeof(gpsdata->error)},
  660|       |        // ignore unknown keys, for cross-version compatibility
  661|     11|        {"", t_ignore},
  662|     11|        {NULL},
  663|       |        // *INDENT-ON*
  664|     11|    };
  665|     11|    int status;
  666|       |
  667|     11|    memset(&gpsdata->error, 0, sizeof(gpsdata->error));
  668|     11|    status = json_read_object(buf, json_attrs_error, endptr);
  669|     11|    if (status != 0)
  ------------------
  |  Branch (669:9): [True: 8, False: 3]
  ------------------
  670|      8|        return status;
  671|       |
  672|      3|    return status;
  673|     11|}
libgps_json.c:json_raw_read:
  228|    128|{
  229|    128|    int measurements;
  230|       |    // initialized to shut up clang
  231|    128|    double mtime_s = 0.0, mtime_ns = 0.0;
  232|       |
  233|    128|    const struct json_attr_t json_attrs_meas[] = {
  234|       |        // *INDENT-OFF*
  235|    128|        {"gnssid",       t_ubyte,    STRUCTOBJECT(struct meas_t, gnssid)},
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  236|    128|        {"svid",         t_ubyte,    STRUCTOBJECT(struct meas_t, svid)},
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  237|    128|        {"sigid",        t_ubyte,    STRUCTOBJECT(struct meas_t, sigid),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  238|    128|                                     .dflt.ubyte = 0},
  239|    128|        {"snr",          t_ubyte,    STRUCTOBJECT(struct meas_t, snr)},
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  240|    128|        {"freqid",       t_ubyte,    STRUCTOBJECT(struct meas_t, freqid),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  241|    128|                                     .dflt.ubyte = 0},
  242|    128|        {"obs",          t_string,   STRUCTOBJECT(struct meas_t, obs_code),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  243|    128|                                .len = sizeof(gpsdata->raw.meas[0].obs_code)},
  244|    128|        {"lli",          t_ubyte,    STRUCTOBJECT(struct meas_t, lli),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  245|    128|                                     .dflt.ubyte = 0},
  246|    128|        {"locktime",     t_uinteger, STRUCTOBJECT(struct meas_t, locktime),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  247|    128|                                     .dflt.uinteger = 0},
  248|    128|        {"carrierphase", t_real,     STRUCTOBJECT(struct meas_t, carrierphase),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  249|    128|                                     .dflt.real = NAN},
  250|    128|        {"pseudorange",  t_real,     STRUCTOBJECT(struct meas_t, pseudorange),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  251|    128|                                     .dflt.real = NAN},
  252|    128|        {"doppler",      t_real,     STRUCTOBJECT(struct meas_t, doppler),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  253|    128|                                     .dflt.real = NAN},
  254|    128|        {"c2c",          t_real,     STRUCTOBJECT(struct meas_t, c2c),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  255|    128|                                    .dflt.real = NAN},
  256|    128|        {"l2c",          t_real,     STRUCTOBJECT(struct meas_t, l2c),
  ------------------
  |  |  188|    128|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  257|    128|                                    .dflt.real = NAN},
  258|       |        // ignore unknown keys, for cross-version compatibility
  259|    128|        {"", t_ignore},
  260|       |        // *INDENT-ON*
  261|    128|        {NULL},
  262|    128|    };
  263|    128|    const struct json_attr_t json_attrs_raw[] = {
  264|       |        // *INDENT-OFF*
  265|    128|        {"class",      t_check,   .dflt.check = "RAW"},
  266|    128|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  267|    128|                                    .len = sizeof(gpsdata->dev.path)},
  268|    128|        {"time",       t_real,    .addr.real = &mtime_s,
  269|    128|                                 .dflt.real = NAN},
  270|    128|        {"nsec",       t_real,    .addr.real = &mtime_ns,
  271|    128|                                 .dflt.real = NAN},
  272|    128|        {"rawdata",    t_array,   STRUCTARRAY(gpsdata->raw.meas,
  ------------------
  |  |  190|    128|        .addr.array.element_type = t_structobject, \
  |  |  191|    128|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    128|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    128|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    128|        .addr.array.count = n, \
  |  |  195|    128|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    128|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    128|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    128|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    128|            struct { \
  |  |  |  |  |  |   71|    128|                int unused_int; \
  |  |  |  |  |  |   72|    128|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    128|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    128|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    128|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    128|            }; \
  |  |  |  |  |  |   77|    128|            1; \
  |  |  |  |  |  |   78|    128|        })) \
  |  |  |  |  |  |   79|    128|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|    128|                                     json_attrs_meas, &measurements)},
  274|       |        // ignore unknown keys, for cross-version compatibility
  275|    128|        {"", t_ignore},
  276|    128|        {NULL},
  277|       |        // *INDENT-ON*
  278|    128|    };
  279|    128|    int status;
  280|       |
  281|    128|    memset(&gpsdata->raw, 0, sizeof(gpsdata->raw));
  282|       |
  283|    128|    status = json_read_object(buf, json_attrs_raw, endptr);
  284|    128|    if (0 != status) {
  ------------------
  |  Branch (284:9): [True: 113, False: 15]
  ------------------
  285|    113|        return status;
  286|    113|    }
  287|     15|    gpsdata->set |= RAW_SET;
  ------------------
  |  | 2907|     15|#define RAW_SET         (1llu<<39)
  ------------------
  288|     15|    if (0 == isfinite(mtime_s) ||
  ------------------
  |  Branch (288:9): [True: 13, False: 2]
  ------------------
  289|     14|        0 == isfinite(mtime_ns)) {
  ------------------
  |  Branch (289:9): [True: 1, False: 1]
  ------------------
  290|     14|        return status;
  291|     14|    }
  292|      1|    gpsdata->raw.mtime.tv_sec = (time_t)mtime_s;
  293|      1|    gpsdata->raw.mtime.tv_nsec = (long)mtime_ns;
  294|       |
  295|      1|    return 0;
  296|     15|}

strlcpy:
  275|  1.05k|{
  276|  1.05k|    size_t len = strlen(src);
  277|  1.05k|    if (0!= siz ) {
  ------------------
  |  Branch (277:9): [True: 1.05k, False: 0]
  ------------------
  278|  1.05k|        if (len >= siz) {
  ------------------
  |  Branch (278:13): [True: 194, False: 856]
  ------------------
  279|    194|            memcpy(dst, src, siz - 1);
  280|    194|            dst[siz - 1] = '\0';
  281|    856|        } else {
  282|    856|            memcpy(dst, src, len + 1);
  283|    856|        }
  284|  1.05k|    }
  285|  1.05k|    return len;
  286|  1.05k|}

json_rtcm2_read:
   32|    306|{
   33|       |
   34|    306|    static char *stringptrs[NITEMS(rtcm2->words)];
   35|    306|    static char stringstore[sizeof(rtcm2->words) * 2];
   36|    306|    static int stringcount;
   37|       |
   38|       |// *INDENT-OFF*
   39|    306|#define RTCM2_HEADER \
   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
   42|    306|        {"device",         t_string,   .addr.string = path, \
   43|    306|                                          .len = pathlen}, \
   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
   46|    306|                                          .dflt.real = NAN}, \
   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
   50|       |
   51|    306|    int status = 0, satcount = 0;
   52|       |
   53|    306|    const struct json_attr_t rtcm1_satellite[] = {
   54|    306|        {"ident",     t_uinteger, STRUCTOBJECT(struct gps_rangesat_t, ident)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   55|    306|        {"udre",      t_uinteger, STRUCTOBJECT(struct gps_rangesat_t, udre)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   56|    306|        {"iod",       t_uinteger, STRUCTOBJECT(struct gps_rangesat_t, iod)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   57|    306|        {"prc",       t_real,     STRUCTOBJECT(struct gps_rangesat_t, prc)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   58|    306|        {"rrc",       t_real,     STRUCTOBJECT(struct gps_rangesat_t, rrc)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
   59|    306|        {NULL},
   60|    306|    };
   61|    306|    const struct json_attr_t json_rtcm1[] = {
   62|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
   63|    306|        {"satellites", t_array, STRUCTARRAY(rtcm2->gps_ranges.sat,
  ------------------
  |  |  190|    306|        .addr.array.element_type = t_structobject, \
  |  |  191|    306|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    306|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    306|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    306|        .addr.array.count = n, \
  |  |  195|    306|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    306|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    306|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    306|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    306|            struct { \
  |  |  |  |  |  |   71|    306|                int unused_int; \
  |  |  |  |  |  |   72|    306|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    306|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    306|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    306|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    306|            }; \
  |  |  |  |  |  |   77|    306|            1; \
  |  |  |  |  |  |   78|    306|        })) \
  |  |  |  |  |  |   79|    306|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   64|    306|                                            rtcm1_satellite, &satcount)},
   65|    306|        {NULL},
   66|    306|    };
   67|       |
   68|    306|    const struct json_attr_t json_rtcm3[] = {
   69|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
   70|    306|        {"x",              t_real,    .addr.real = &rtcm2->ref_sta.x,
   71|    306|                                         .dflt.real = NAN},
   72|    306|        {"y",              t_real,    .addr.real = &rtcm2->ref_sta.y,
   73|    306|                                         .dflt.real = NAN},
   74|    306|        {"z",              t_real,    .addr.real = &rtcm2->ref_sta.z,
   75|    306|                                         .dflt.real = NAN},
   76|    306|        {NULL},
   77|    306|    };
   78|       |
   79|       |    /*
   80|       |     * Beware! Needs to stay synchronized with a corresponding
   81|       |     * name array in the RTCM2 JSON dump code. This interpretation of
   82|       |     * NAVSYSTEM_GALILEO is assumed from RTCM3, it's not actually
   83|       |     * documented in RTCM 2.1.
   84|       |     */
   85|    306|    const struct json_enum_t system_table[] = {
   86|    306|        {"GPS", 0}, {"GLONASS", 1}, {"GALILEO", 2}, {"UNKNOWN", 3}, {NULL}
   87|    306|    };
   88|    306|    const struct json_attr_t json_rtcm4[] = {
   89|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
   90|    306|        {"valid",          t_boolean, .addr.boolean = &rtcm2->reference.valid},
   91|    306|        {"system",         t_integer, .addr.integer = &rtcm2->reference.system,
   92|    306|                                         .map=system_table},
   93|    306|        {"sense",          t_integer, .addr.integer = &rtcm2->reference.sense},
   94|    306|        {"datum",          t_string,  .addr.string = rtcm2->reference.datum,
   95|    306|                                         .len = sizeof(rtcm2->reference.datum)},
   96|    306|        {"dx",             t_real,    .addr.real = &rtcm2->reference.dx,
   97|    306|                                         .dflt.real = NAN},
   98|    306|        {"dy",             t_real,    .addr.real = &rtcm2->reference.dy,
   99|    306|                                         .dflt.real = NAN},
  100|    306|        {"dz",             t_real,    .addr.real = &rtcm2->reference.dz,
  101|    306|                                         .dflt.real = NAN},
  102|    306|        {NULL},
  103|    306|    };
  104|       |
  105|    306|    const struct json_attr_t rtcm5_satellite[] = {
  106|    306|        {"ident",       t_uinteger, STRUCTOBJECT(struct consat_t, ident)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  107|    306|        {"iodl",        t_boolean,  STRUCTOBJECT(struct consat_t, iodl)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  108|    306|        {"health",      t_uinteger, STRUCTOBJECT(struct consat_t, health)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  109|    306|        {"snr",         t_integer,  STRUCTOBJECT(struct consat_t, snr)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  110|    306|        {"health_en",   t_boolean,  STRUCTOBJECT(struct consat_t, health_en)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  111|    306|        {"new_data",    t_boolean,  STRUCTOBJECT(struct consat_t, new_data)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  112|    306|        {"los_warning", t_boolean,  STRUCTOBJECT(struct consat_t, los_warning)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  113|    306|        {"tou",         t_uinteger, STRUCTOBJECT(struct consat_t, tou)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  114|    306|        {NULL},
  115|    306|    };
  116|    306|    const struct json_attr_t json_rtcm5[] = {
  117|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  118|    306|        {"satellites", t_array, STRUCTARRAY(rtcm2->conhealth.sat,
  ------------------
  |  |  190|    306|        .addr.array.element_type = t_structobject, \
  |  |  191|    306|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    306|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    306|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    306|        .addr.array.count = n, \
  |  |  195|    306|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    306|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    306|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    306|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    306|            struct { \
  |  |  |  |  |  |   71|    306|                int unused_int; \
  |  |  |  |  |  |   72|    306|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    306|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    306|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    306|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    306|            }; \
  |  |  |  |  |  |   77|    306|            1; \
  |  |  |  |  |  |   78|    306|        })) \
  |  |  |  |  |  |   79|    306|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  119|    306|                                            rtcm5_satellite, &satcount)},
  120|    306|        {NULL},
  121|    306|    };
  122|       |
  123|    306|    const struct json_attr_t json_rtcm6[] = {
  124|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  125|       |        // No-op or keepalive message
  126|    306|        {NULL},
  127|    306|    };
  128|       |
  129|    306|    const struct json_attr_t rtcm7_satellite[] = {
  130|    306|        {"lat",         t_real,     STRUCTOBJECT(struct station_t, latitude)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  131|    306|        {"lon",         t_real,     STRUCTOBJECT(struct station_t, longitude)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  132|    306|        {"range",       t_uinteger, STRUCTOBJECT(struct station_t, range)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  133|    306|        {"frequency",   t_real,     STRUCTOBJECT(struct station_t, frequency)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  134|    306|        {"health",      t_uinteger, STRUCTOBJECT(struct station_t, health)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  135|    306|        {"station_id",  t_uinteger, STRUCTOBJECT(struct station_t, station_id)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  136|    306|        {"bitrate",     t_uinteger, STRUCTOBJECT(struct station_t, bitrate)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  137|    306|        {NULL},
  138|    306|    };
  139|    306|    const struct json_attr_t json_rtcm7[] = {
  140|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  141|    306|        {"satellites", t_array, STRUCTARRAY(rtcm2->almanac.station,
  ------------------
  |  |  190|    306|        .addr.array.element_type = t_structobject, \
  |  |  191|    306|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    306|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    306|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    306|        .addr.array.count = n, \
  |  |  195|    306|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    306|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    306|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    306|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    306|            struct { \
  |  |  |  |  |  |   71|    306|                int unused_int; \
  |  |  |  |  |  |   72|    306|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    306|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    306|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    306|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    306|            }; \
  |  |  |  |  |  |   77|    306|            1; \
  |  |  |  |  |  |   78|    306|        })) \
  |  |  |  |  |  |   79|    306|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  142|    306|                                            rtcm7_satellite, &satcount)},
  143|    306|        {NULL},
  144|    306|    };
  145|       |
  146|    306|    const struct json_attr_t json_rtcm13[] = {
  147|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  148|    306|        {"status",       t_boolean,  .addr.boolean = &rtcm2->xmitter.status},
  149|    306|        {"rangeflag",    t_boolean,  .addr.boolean = &rtcm2->xmitter.rangeflag},
  150|    306|        {"lat",          t_real,     .addr.real = &rtcm2->xmitter.lat,
  151|    306|                                        .dflt.real = NAN},
  152|    306|        {"lon",          t_real,     .addr.real = &rtcm2->xmitter.lon,
  153|    306|                                        .dflt.real = NAN},
  154|    306|        {"range",        t_uinteger, .addr.uinteger = &rtcm2->xmitter.range},
  155|    306|        {NULL},
  156|    306|    };
  157|       |
  158|    306|    const struct json_attr_t json_rtcm14[] = {
  159|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  160|    306|        {"week",              t_uinteger,
  161|    306|                              .addr.uinteger = &rtcm2->gpstime.week},
  162|    306|        {"hour",              t_uinteger,
  163|    306|                              .addr.uinteger = &rtcm2->gpstime.hour},
  164|    306|        {"leapsecs",          t_uinteger,
  165|    306|                              .addr.uinteger = &rtcm2->gpstime.leapsecs},
  166|    306|        {NULL},
  167|    306|    };
  168|       |
  169|    306|    const struct json_attr_t json_rtcm16[] = {
  170|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  171|    306|        {"message",        t_string,  .addr.string = rtcm2->message,
  172|    306|                                         .len = sizeof(rtcm2->message)},
  173|    306|        {NULL},
  174|    306|    };
  175|       |
  176|    306|    const struct json_attr_t rtcm31_satellite[] = {
  177|    306|        {"ident",     t_uinteger,
  178|    306|                              STRUCTOBJECT(struct glonass_rangesat_t, ident)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  179|    306|        {"udre",      t_uinteger,
  180|    306|                              STRUCTOBJECT(struct glonass_rangesat_t, udre)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  181|    306|        {"change",    t_boolean,
  182|    306|                              STRUCTOBJECT(struct glonass_rangesat_t, change)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  183|    306|        {"tod",       t_uinteger, STRUCTOBJECT(struct glonass_rangesat_t, tod)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  184|    306|        {"prc",       t_real,     STRUCTOBJECT(struct glonass_rangesat_t, prc)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  185|    306|        {"rrc",       t_real,     STRUCTOBJECT(struct glonass_rangesat_t, rrc)},
  ------------------
  |  |  188|    306|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  186|    306|        {NULL},
  187|    306|    };
  188|    306|    const struct json_attr_t json_rtcm31[] = {
  189|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  190|    306|        {"satellites", t_array, STRUCTARRAY(rtcm2->glonass_ranges.sat,
  ------------------
  |  |  190|    306|        .addr.array.element_type = t_structobject, \
  |  |  191|    306|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    306|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    306|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    306|        .addr.array.count = n, \
  |  |  195|    306|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    306|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    306|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    306|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    306|            struct { \
  |  |  |  |  |  |   71|    306|                int unused_int; \
  |  |  |  |  |  |   72|    306|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    306|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    306|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    306|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    306|            }; \
  |  |  |  |  |  |   77|    306|            1; \
  |  |  |  |  |  |   78|    306|        })) \
  |  |  |  |  |  |   79|    306|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|    306|                                            rtcm31_satellite, &satcount)},
  192|    306|        {NULL},
  193|    306|    };
  194|       |
  195|    306|    const struct json_attr_t json_rtcm2_fallback[] = {
  196|    306|        RTCM2_HEADER
  ------------------
  |  |   40|    306|        {"class",          t_check,    .dflt.check = "RTCM2"}, \
  |  |   41|    306|        {"type",           t_uinteger, .addr.uinteger = &rtcm2->type}, \
  |  |   42|    306|        {"device",         t_string,   .addr.string = path, \
  |  |   43|    306|                                          .len = pathlen}, \
  |  |   44|    306|        {"station_id",     t_uinteger, .addr.uinteger = &rtcm2->refstaid}, \
  |  |   45|    306|        {"zcount",         t_real,     .addr.real = &rtcm2->zcount, \
  |  |   46|    306|                                          .dflt.real = NAN}, \
  |  |   47|    306|        {"seqnum",         t_uinteger, .addr.uinteger = &rtcm2->seqnum}, \
  |  |   48|    306|        {"length",         t_uinteger, .addr.uinteger = &rtcm2->length}, \
  |  |   49|    306|        {"station_health", t_uinteger, .addr.uinteger = &rtcm2->stathlth},
  ------------------
  197|    306|        {"data",         t_array, .addr.array.element_type = t_string,
  198|    306|                         .addr.array.arr.strings.ptrs = stringptrs,
  199|    306|                         .addr.array.arr.strings.store = stringstore,
  200|    306|                         .addr.array.arr.strings.storelen = sizeof(stringstore),
  201|    306|                         .addr.array.count = &stringcount,
  202|    306|                         .addr.array.maxlen = NITEMS(stringptrs)},
  ------------------
  |  | 1212|    306|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|    306|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|    306|        0 * (int) sizeof(({ \
  |  |  |  |   70|    306|            struct { \
  |  |  |  |   71|    306|                int unused_int; \
  |  |  |  |   72|    306|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|    306|            } zero_init = {0}; \
  |  |  |  |   74|    306|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|    306|                zero_init.unused_arr[0], \
  |  |  |  |   76|    306|            }; \
  |  |  |  |   77|    306|            1; \
  |  |  |  |   78|    306|        })) \
  |  |  |  |   79|    306|    )
  |  |  ------------------
  ------------------
  203|    306|        {NULL},
  204|    306|    };
  205|       |
  206|    306|#undef RTCM2_HEADER
  207|       |/* *INDENT-ON* */
  208|       |
  209|    306|    memset(rtcm2, '\0', sizeof(struct rtcm2_t));
  210|       |
  211|    306|    if (strstr(buf, "\"type\":1,") != NULL
  ------------------
  |  Branch (211:9): [True: 4, False: 302]
  ------------------
  212|    302|        || strstr(buf, "\"type\":9,") != NULL) {
  ------------------
  |  Branch (212:12): [True: 3, False: 299]
  ------------------
  213|      7|        status = json_read_object(buf, json_rtcm1, endptr);
  214|      7|        if (status == 0)
  ------------------
  |  Branch (214:13): [True: 1, False: 6]
  ------------------
  215|      1|            rtcm2->gps_ranges.nentries = (unsigned)satcount;
  216|    299|    } else if (strstr(buf, "\"type\":3,") != NULL) {
  ------------------
  |  Branch (216:16): [True: 73, False: 226]
  ------------------
  217|     73|        status = json_read_object(buf, json_rtcm3, endptr);
  218|     73|        if (status == 0) {
  ------------------
  |  Branch (218:13): [True: 66, False: 7]
  ------------------
  219|     66|            rtcm2->ref_sta.valid = (isfinite(rtcm2->ref_sta.x) != 0)
  ------------------
  |  Branch (219:36): [True: 30, False: 36]
  ------------------
  220|     30|                && (isfinite(rtcm2->ref_sta.y) != 0)
  ------------------
  |  Branch (220:20): [True: 19, False: 11]
  ------------------
  221|     19|                && (isfinite(rtcm2->ref_sta.z) != 0);
  ------------------
  |  Branch (221:20): [True: 2, False: 17]
  ------------------
  222|     66|        }
  223|    226|    } else if (strstr(buf, "\"type\":4,") != NULL) {
  ------------------
  |  Branch (223:16): [True: 86, False: 140]
  ------------------
  224|     86|        status = json_read_object(buf, json_rtcm4, endptr);
  225|     86|        if (status == 0)
  ------------------
  |  Branch (225:13): [True: 4, False: 82]
  ------------------
  226|      4|            rtcm2->reference.valid = (isfinite(rtcm2->reference.dx) != 0)
  ------------------
  |  Branch (226:38): [True: 2, False: 2]
  ------------------
  227|      2|                && (isfinite(rtcm2->reference.dy) != 0)
  ------------------
  |  Branch (227:20): [True: 1, False: 1]
  ------------------
  228|      1|                && (isfinite(rtcm2->reference.dz) != 0);
  ------------------
  |  Branch (228:20): [True: 0, False: 1]
  ------------------
  229|    140|    } else if (strstr(buf, "\"type\":5,") != NULL) {
  ------------------
  |  Branch (229:16): [True: 8, False: 132]
  ------------------
  230|      8|        status = json_read_object(buf, json_rtcm5, endptr);
  231|      8|        if (status == 0)
  ------------------
  |  Branch (231:13): [True: 1, False: 7]
  ------------------
  232|      1|            rtcm2->conhealth.nentries = (unsigned)satcount;
  233|    132|    } else if (strstr(buf, "\"type\":6,") != NULL) {
  ------------------
  |  Branch (233:16): [True: 1, False: 131]
  ------------------
  234|      1|        status = json_read_object(buf, json_rtcm6, endptr);
  235|    131|    } else if (strstr(buf, "\"type\":7,") != NULL) {
  ------------------
  |  Branch (235:16): [True: 6, False: 125]
  ------------------
  236|      6|        status = json_read_object(buf, json_rtcm7, endptr);
  237|      6|        if (status == 0)
  ------------------
  |  Branch (237:13): [True: 1, False: 5]
  ------------------
  238|      1|            rtcm2->almanac.nentries = (unsigned)satcount;
  239|    125|    } else if (strstr(buf, "\"type\":13,") != NULL) {
  ------------------
  |  Branch (239:16): [True: 1, False: 124]
  ------------------
  240|      1|        status = json_read_object(buf, json_rtcm13, endptr);
  241|    124|    } else if (strstr(buf, "\"type\":14,") != NULL) {
  ------------------
  |  Branch (241:16): [True: 1, False: 123]
  ------------------
  242|      1|        status = json_read_object(buf, json_rtcm14, endptr);
  243|    123|    } else if (strstr(buf, "\"type\":16,") != NULL) {
  ------------------
  |  Branch (243:16): [True: 2, False: 121]
  ------------------
  244|      2|        status = json_read_object(buf, json_rtcm16, endptr);
  245|    121|    } else if (strstr(buf, "\"type\":31,") != NULL) {
  ------------------
  |  Branch (245:16): [True: 5, False: 116]
  ------------------
  246|      5|        status = json_read_object(buf, json_rtcm31, endptr);
  247|      5|        if (status == 0)
  ------------------
  |  Branch (247:13): [True: 1, False: 4]
  ------------------
  248|      1|            rtcm2->glonass_ranges.nentries = (unsigned)satcount;
  249|    116|    } else {
  250|    116|        int n;
  251|    116|        status = json_read_object(buf, json_rtcm2_fallback, endptr);
  252|  1.83k|        for (n = 0; n < NITEMS(rtcm2->words); n++) {
  ------------------
  |  | 1212|  1.83k|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|  1.83k|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|  1.83k|        0 * (int) sizeof(({ \
  |  |  |  |   70|  1.83k|            struct { \
  |  |  |  |   71|  1.83k|                int unused_int; \
  |  |  |  |   72|  1.83k|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|  1.83k|            } zero_init = {0}; \
  |  |  |  |   74|  1.83k|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|  1.83k|                zero_init.unused_arr[0], \
  |  |  |  |   76|  1.83k|            }; \
  |  |  |  |   77|  1.83k|            1; \
  |  |  |  |   78|  1.83k|        })) \
  |  |  |  |   79|  1.83k|    )
  |  |  ------------------
  ------------------
  |  Branch (252:21): [True: 1.78k, False: 55]
  ------------------
  253|  1.78k|            if (n >= stringcount) {
  ------------------
  |  Branch (253:17): [True: 1.56k, False: 224]
  ------------------
  254|  1.56k|                rtcm2->words[n] = 0;
  255|  1.56k|            } else {
  256|    224|                unsigned int u;
  257|    224|                int fldcount = sscanf(stringptrs[n], "0x%08x\n", &u);
  258|    224|                if (fldcount != 1)
  ------------------
  |  Branch (258:21): [True: 61, False: 163]
  ------------------
  259|     61|                    return JSON_ERR_MISC;
  ------------------
  |  |  172|     61|#define JSON_ERR_MISC          21      // other data conversion error
  ------------------
  260|    163|                else
  261|    163|                    rtcm2->words[n] = (isgps30bits_t) u;
  262|    224|            }
  263|  1.78k|        }
  264|    116|    }
  265|    245|    return status;
  266|    306|}

json_rtcm3_read:
   29|    124|{
   30|    124|    static char *stringptrs[NITEMS(rtcm3->rtcmtypes.data)];
   31|    124|    static char stringstore[sizeof(rtcm3->rtcmtypes.data) * 2];
   32|    124|    static int stringcount;
   33|       |
   34|       |// *INDENT-OFF*
   35|    124|#define RTCM3_HEADER \
   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
   40|       |
   41|    124|    int status = 0, satcount = 0;
   42|       |
   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
   44|    124|    const struct json_attr_t rtcm1001_satellite[] = {
   45|    124|        {"ident",     t_uinteger, RTCM3FIELD(1001, ident)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   46|    124|        {"ind",       t_uinteger, RTCM3FIELD(1001, L1.indicator)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   47|    124|        {"prange",    t_real,     RTCM3FIELD(1001, L1.pseudorange)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   48|    124|        {"delta",     t_real,     RTCM3FIELD(1001, L1.rangediff)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   49|    124|        {"lockt",     t_uinteger, RTCM3FIELD(1001, L1.locktime)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   50|    124|        {NULL},
   51|    124|    };
   52|       |
   53|    124|    const struct json_attr_t rtcm1002_satellite[] = {
   54|    124|        {"ident",     t_uinteger, RTCM3FIELD(1002, ident)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   55|    124|        {"ind",       t_uinteger, RTCM3FIELD(1002, L1.indicator)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   56|    124|        {"prange",    t_real,     RTCM3FIELD(1002, L1.pseudorange)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   57|    124|        {"delta",     t_real,     RTCM3FIELD(1002, L1.rangediff)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   58|    124|        {"lockt",     t_uinteger, RTCM3FIELD(1002, L1.locktime)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   59|    124|        {"amb",       t_uinteger, RTCM3FIELD(1002, L1.ambiguity)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   60|    124|        {"CNR",       t_real,     RTCM3FIELD(1002, L1.CNR)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   61|    124|        {NULL},
   62|    124|    };
   63|       |
   64|    124|    const struct json_attr_t rtcm1009_satellite[] = {
   65|    124|        {"ident",     t_uinteger, RTCM3FIELD(1009, ident)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   66|    124|        {"ind",       t_uinteger, RTCM3FIELD(1009, L1.indicator)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   67|    124|        {"channel",   t_uinteger, RTCM3FIELD(1009, L1.channel)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   68|    124|        {"prange",    t_real,     RTCM3FIELD(1009, L1.pseudorange)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   69|    124|        {"delta",     t_real,     RTCM3FIELD(1009, L1.rangediff)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   70|    124|        {"lockt",     t_uinteger, RTCM3FIELD(1009, L1.locktime)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   71|    124|        {NULL},
   72|    124|    };
   73|       |
   74|    124|    const struct json_attr_t rtcm1010_satellite[] = {
   75|    124|        {"ident",     t_uinteger, RTCM3FIELD(1010, ident)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   76|    124|        {"ind",       t_uinteger, RTCM3FIELD(1010, L1.indicator)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   77|    124|        {"channel",   t_uinteger, RTCM3FIELD(1010, L1.channel)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   78|    124|        {"prange",    t_real,     RTCM3FIELD(1010, L1.pseudorange)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   79|    124|        {"delta",     t_real,     RTCM3FIELD(1010, L1.rangediff)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   80|    124|        {"lockt",     t_uinteger, RTCM3FIELD(1010, L1.locktime)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   81|    124|        {"amb",       t_uinteger, RTCM3FIELD(1010, L1.ambiguity)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   82|    124|        {"CNR",       t_real,     RTCM3FIELD(1010, L1.CNR)},
  ------------------
  |  |   43|    124|#define RTCM3FIELD(type, fld)   STRUCTOBJECT(struct rtcm3_ ## type ## _t, fld)
  |  |  ------------------
  |  |  |  |  188|    124|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  |  |  ------------------
  ------------------
   83|    124|        {NULL},
   84|    124|    };
   85|    124|#undef RTCM3FIELD
   86|       |
   87|    124|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
   88|    124|    const struct json_attr_t json_rtcm1001[] = {
   89|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
   90|    124|        {"station_id", t_uinteger, .addr.uinteger = R1001.station_id},
  ------------------
  |  |   87|    124|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   91|    124|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1001.tow},
  ------------------
  |  |   87|    124|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   92|    124|        {"sync",       t_boolean,  .addr.boolean = R1001.sync},
  ------------------
  |  |   87|    124|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   93|    124|        {"smoothing",  t_boolean,  .addr.boolean = R1001.smoothing},
  ------------------
  |  |   87|    124|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   94|    124|        {"interval",   t_uinteger, .addr.uinteger = R1001.interval},
  ------------------
  |  |   87|    124|#define R1001   &rtcm3->rtcmtypes.rtcm3_1001.header
  ------------------
   95|    124|        {"satellites", t_array,
   96|    124|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1001.rtk_data,
  ------------------
  |  |  190|    124|        .addr.array.element_type = t_structobject, \
  |  |  191|    124|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    124|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    124|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    124|        .addr.array.count = n, \
  |  |  195|    124|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    124|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    124|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    124|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    124|            struct { \
  |  |  |  |  |  |   71|    124|                int unused_int; \
  |  |  |  |  |  |   72|    124|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    124|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    124|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    124|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    124|            }; \
  |  |  |  |  |  |   77|    124|            1; \
  |  |  |  |  |  |   78|    124|        })) \
  |  |  |  |  |  |   79|    124|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   97|    124|         rtcm1001_satellite, &satcount)},
   98|    124|        {NULL},
   99|    124|    };
  100|    124|#undef R1001
  101|       |
  102|    124|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  103|    124|    const struct json_attr_t json_rtcm1002[] = {
  104|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  105|    124|        {"station_id", t_uinteger, .addr.uinteger = R1002.station_id},
  ------------------
  |  |  102|    124|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  106|    124|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1002.tow},
  ------------------
  |  |  102|    124|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  107|    124|        {"sync",       t_boolean,  .addr.boolean = R1002.sync},
  ------------------
  |  |  102|    124|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  108|    124|        {"smoothing",  t_boolean,  .addr.boolean = R1002.smoothing},
  ------------------
  |  |  102|    124|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  109|    124|        {"interval",   t_uinteger, .addr.uinteger = R1002.interval},
  ------------------
  |  |  102|    124|#define R1002   &rtcm3->rtcmtypes.rtcm3_1002.header
  ------------------
  110|    124|        {"satellites", t_array,
  111|    124|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1002.rtk_data,
  ------------------
  |  |  190|    124|        .addr.array.element_type = t_structobject, \
  |  |  191|    124|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    124|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    124|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    124|        .addr.array.count = n, \
  |  |  195|    124|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    124|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    124|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    124|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    124|            struct { \
  |  |  |  |  |  |   71|    124|                int unused_int; \
  |  |  |  |  |  |   72|    124|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    124|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    124|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    124|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    124|            }; \
  |  |  |  |  |  |   77|    124|            1; \
  |  |  |  |  |  |   78|    124|        })) \
  |  |  |  |  |  |   79|    124|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  112|    124|         rtcm1002_satellite, &satcount)},
  113|    124|        {NULL},
  114|    124|    };
  115|    124|#undef R1002
  116|       |
  117|    124|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  118|    124|    const struct json_attr_t json_rtcm1007[] = {
  119|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  120|    124|        {"station_id", t_uinteger, .addr.uinteger = &R1007.station_id},
  ------------------
  |  |  117|    124|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  121|    124|        {"desc",       t_string,   .addr.string = R1007.descriptor,
  ------------------
  |  |  117|    124|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  122|    124|                                         .len = sizeof(R1007.descriptor)},
  ------------------
  |  |  117|    124|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  123|    124|        {"setup_id",   t_uinteger, .addr.uinteger = &R1007.setup_id},
  ------------------
  |  |  117|    124|#define R1007   rtcm3->rtcmtypes.rtcm3_1007
  ------------------
  124|    124|        {NULL},
  125|    124|    };
  126|    124|#undef R1002
  127|       |
  128|    124|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  129|    124|    const struct json_attr_t json_rtcm1008[] = {
  130|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  131|    124|        {"station_id", t_uinteger, .addr.uinteger = &R1008.station_id},
  ------------------
  |  |  128|    124|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  132|    124|        {"desc",       t_string,   .addr.string = R1008.descriptor,
  ------------------
  |  |  128|    124|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  133|    124|                                         .len = sizeof(R1008.descriptor)},
  ------------------
  |  |  128|    124|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  134|    124|        {"setup_id",   t_uinteger, .addr.uinteger = &R1008.setup_id},
  ------------------
  |  |  128|    124|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  135|    124|        {"serial",     t_string,   .addr.string = R1008.serial,
  ------------------
  |  |  128|    124|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  136|    124|                                         .len = sizeof(R1008.serial)},
  ------------------
  |  |  128|    124|#define R1008   rtcm3->rtcmtypes.rtcm3_1008
  ------------------
  137|    124|        {NULL},
  138|    124|    };
  139|    124|#undef R1008
  140|       |
  141|    124|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  142|    124|    const struct json_attr_t json_rtcm1009[] = {
  143|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  144|    124|        {"station_id", t_uinteger, .addr.uinteger = R1009.station_id},
  ------------------
  |  |  141|    124|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  145|    124|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1009.tow},
  ------------------
  |  |  141|    124|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  146|    124|        {"sync",       t_boolean,  .addr.boolean = R1009.sync},
  ------------------
  |  |  141|    124|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  147|    124|        {"smoothing",  t_boolean,  .addr.boolean = R1009.smoothing},
  ------------------
  |  |  141|    124|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  148|    124|        {"interval",   t_uinteger, .addr.uinteger = R1009.interval},
  ------------------
  |  |  141|    124|#define R1009   &rtcm3->rtcmtypes.rtcm3_1009.header
  ------------------
  149|    124|        {"satellites", t_array,
  150|    124|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1009.rtk_data,
  ------------------
  |  |  190|    124|        .addr.array.element_type = t_structobject, \
  |  |  191|    124|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    124|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    124|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    124|        .addr.array.count = n, \
  |  |  195|    124|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    124|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    124|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    124|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    124|            struct { \
  |  |  |  |  |  |   71|    124|                int unused_int; \
  |  |  |  |  |  |   72|    124|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    124|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    124|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    124|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    124|            }; \
  |  |  |  |  |  |   77|    124|            1; \
  |  |  |  |  |  |   78|    124|        })) \
  |  |  |  |  |  |   79|    124|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  151|    124|         rtcm1009_satellite, &satcount)},
  152|    124|        {NULL},
  153|    124|    };
  154|    124|#undef R1010
  155|       |
  156|    124|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  157|    124|    const struct json_attr_t json_rtcm1010[] = {
  158|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  159|    124|        {"station_id", t_uinteger, .addr.uinteger = R1010.station_id},
  ------------------
  |  |  156|    124|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  160|    124|        {"tow",        t_uinteger, .addr.uinteger = (unsigned int *)R1010.tow},
  ------------------
  |  |  156|    124|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  161|    124|        {"sync",       t_boolean,  .addr.boolean = R1010.sync},
  ------------------
  |  |  156|    124|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  162|    124|        {"smoothing",  t_boolean,  .addr.boolean = R1010.smoothing},
  ------------------
  |  |  156|    124|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  163|    124|        {"interval",   t_uinteger, .addr.uinteger = R1010.interval},
  ------------------
  |  |  156|    124|#define R1010   &rtcm3->rtcmtypes.rtcm3_1010.header
  ------------------
  164|    124|        {"satellites", t_array,
  165|    124|         STRUCTARRAY(rtcm3->rtcmtypes.rtcm3_1010.rtk_data,
  ------------------
  |  |  190|    124|        .addr.array.element_type = t_structobject, \
  |  |  191|    124|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    124|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    124|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    124|        .addr.array.count = n, \
  |  |  195|    124|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    124|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    124|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    124|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    124|            struct { \
  |  |  |  |  |  |   71|    124|                int unused_int; \
  |  |  |  |  |  |   72|    124|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    124|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    124|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    124|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    124|            }; \
  |  |  |  |  |  |   77|    124|            1; \
  |  |  |  |  |  |   78|    124|        })) \
  |  |  |  |  |  |   79|    124|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  166|    124|         rtcm1010_satellite, &satcount)},
  167|    124|        {NULL},
  168|    124|    };
  169|    124|#undef R1010
  170|       |
  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  172|    124|    const struct json_attr_t json_rtcm1014[] = {
  173|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  174|    124|        {"netid",      t_uinteger, .addr.uinteger = R1014.network_id},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  175|    124|        {"subnetid",   t_uinteger, .addr.uinteger = R1014.subnetwork_id},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  176|    124|        {"statcount",  t_uinteger, .addr.uinteger = R1014.stationcount},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  177|    124|        {"master",     t_uinteger, .addr.uinteger = R1014.master_id},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  178|    124|        {"aux",        t_uinteger, .addr.uinteger = R1014.aux_id},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  179|    124|        {"lat",        t_real,     .addr.real = R1014.d_lat},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  180|    124|        {"lon",        t_real,     .addr.real = R1014.d_lon},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  181|    124|        {"alt",        t_real,     .addr.real = R1014.d_alt},
  ------------------
  |  |  171|    124|#define R1014   &rtcm3->rtcmtypes.rtcm3_1014
  ------------------
  182|    124|        {NULL},
  183|    124|    };
  184|    124|#undef R1014
  185|       |
  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  187|    124|    const struct json_attr_t json_rtcm1033[] = {
  188|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  189|    124|        {"station_id", t_uinteger, .addr.uinteger = &R1033.station_id},
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  190|    124|        {"desc",       t_string,   .addr.string = R1033.descriptor,
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  191|    124|                                         .len = sizeof(R1033.descriptor)},
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  192|    124|        {"setup_id",   t_uinteger, .addr.uinteger = &R1033.setup_id},
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  193|    124|        {"serial",     t_string,   .addr.string = R1033.serial,
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  194|    124|                                         .len = sizeof(R1033.serial)},
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  195|    124|        {"receiver",   t_string,   .addr.string = R1033.receiver,
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  196|    124|                                         .len = sizeof(R1033.receiver)},
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  197|    124|        {"firmware",   t_string,   .addr.string = R1033.firmware,
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  198|    124|                                         .len = sizeof(R1033.firmware)},
  ------------------
  |  |  186|    124|#define R1033   rtcm3->rtcmtypes.rtcm3_1033
  ------------------
  199|    124|        {NULL},
  200|    124|    };
  201|    124|#undef R1033
  202|       |
  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  204|    124|    const struct json_attr_t json_rtcm1230[] = {
  205|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  206|    124|        {"station_id", t_uinteger, .addr.uinteger = &R1230.station_id},
  ------------------
  |  |  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  207|    124|        {"ind",        t_ubyte,    .addr.ubyte = &R1230.bias_indicator},
  ------------------
  |  |  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  208|    124|        {"sm",         t_ubyte,    .addr.ubyte = &R1230.signals_mask},
  ------------------
  |  |  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  209|    124|        {"l1_ca",      t_integer,  .addr.integer = &R1230.l1_ca_bias,
  ------------------
  |  |  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  210|    124|                                   .dflt.integer = 0},
  211|    124|        {"l1p",        t_integer,  .addr.integer = &R1230.l1_p_bias,
  ------------------
  |  |  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  212|    124|                                   .dflt.integer = 0},
  213|    124|        {"l2ca",       t_integer,  .addr.integer = &R1230.l2_ca_bias,
  ------------------
  |  |  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  214|    124|                                   .dflt.integer = 0},
  215|    124|        {"l2p",        t_integer,  .addr.integer = &R1230.l2_p_bias,
  ------------------
  |  |  203|    124|#define R1230   rtcm3->rtcmtypes.rtcm3_1230
  ------------------
  216|    124|                                   .dflt.integer = 0},
  217|    124|        {NULL},
  218|    124|    };
  219|    124|#undef R1033
  220|       |
  221|    124|    const struct json_attr_t json_rtcm3_fallback[] = {
  222|    124|        RTCM3_HEADER
  ------------------
  |  |   36|    124|        {"class",          t_check,    .dflt.check = "RTCM3"}, \
  |  |   37|    124|        {"type",           t_uinteger, .addr.uinteger = &rtcm3->type}, \
  |  |   38|    124|        {"device",         t_string,   .addr.string = path, .len = pathlen}, \
  |  |   39|    124|        {"length",         t_uinteger, .addr.uinteger = &rtcm3->length},
  ------------------
  223|    124|        {"data", t_array, .addr.array.element_type = t_string,
  224|    124|                          .addr.array.arr.strings.ptrs = stringptrs,
  225|    124|                          .addr.array.arr.strings.store = stringstore,
  226|    124|                         .addr.array.arr.strings.storelen = sizeof(stringstore),
  227|    124|                          .addr.array.count = &stringcount,
  228|    124|                          .addr.array.maxlen = NITEMS(stringptrs)},
  ------------------
  |  | 1212|    124|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|    124|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|    124|        0 * (int) sizeof(({ \
  |  |  |  |   70|    124|            struct { \
  |  |  |  |   71|    124|                int unused_int; \
  |  |  |  |   72|    124|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|    124|            } zero_init = {0}; \
  |  |  |  |   74|    124|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|    124|                zero_init.unused_arr[0], \
  |  |  |  |   76|    124|            }; \
  |  |  |  |   77|    124|            1; \
  |  |  |  |   78|    124|        })) \
  |  |  |  |   79|    124|    )
  |  |  ------------------
  ------------------
  229|       |        // ignore unknown keys
  230|    124|        {"", t_ignore},
  231|       |
  232|    124|        {NULL},
  233|    124|    };
  234|       |
  235|    124|#undef RTCM3_HEADER
  236|       |// *INDENT-ON*
  237|       |
  238|    124|    memset(rtcm3, '\0', sizeof(struct rtcm3_t));
  239|       |
  240|    124|    if (strstr(buf, "\"type\":1001,") != NULL) {
  ------------------
  |  Branch (240:9): [True: 5, False: 119]
  ------------------
  241|      5|        status = json_read_object(buf, json_rtcm1001, endptr);
  242|      5|        if (status == 0)
  ------------------
  |  Branch (242:13): [True: 1, False: 4]
  ------------------
  243|      1|            rtcm3->rtcmtypes.rtcm3_1001.header.satcount =
  244|      1|                (unsigned short)satcount;
  245|    119|    } else if (strstr(buf, "\"type\":1002,") != NULL) {
  ------------------
  |  Branch (245:16): [True: 5, False: 114]
  ------------------
  246|      5|        status = json_read_object(buf, json_rtcm1002, endptr);
  247|      5|        if (status == 0)
  ------------------
  |  Branch (247:13): [True: 1, False: 4]
  ------------------
  248|      1|            rtcm3->rtcmtypes.rtcm3_1002.header.satcount =
  249|      1|               (unsigned short)satcount;
  250|    114|    } else if (strstr(buf, "\"type\":1007,") != NULL) {
  ------------------
  |  Branch (250:16): [True: 1, False: 113]
  ------------------
  251|      1|        status = json_read_object(buf, json_rtcm1007, endptr);
  252|    113|    } else if (strstr(buf, "\"type\":1008,") != NULL) {
  ------------------
  |  Branch (252:16): [True: 1, False: 112]
  ------------------
  253|      1|        status = json_read_object(buf, json_rtcm1008, endptr);
  254|    112|    } else if (strstr(buf, "\"type\":1009,") != NULL) {
  ------------------
  |  Branch (254:16): [True: 1, False: 111]
  ------------------
  255|      1|        status = json_read_object(buf, json_rtcm1009, endptr);
  256|    111|    } else if (strstr(buf, "\"type\":1010,") != NULL) {
  ------------------
  |  Branch (256:16): [True: 1, False: 110]
  ------------------
  257|      1|        status = json_read_object(buf, json_rtcm1010, endptr);
  258|    110|    } else if (strstr(buf, "\"type\":1014,") != NULL) {
  ------------------
  |  Branch (258:16): [True: 1, False: 109]
  ------------------
  259|      1|        status = json_read_object(buf, json_rtcm1014, endptr);
  260|    109|    } else if (strstr(buf, "\"type\":1033,") != NULL) {
  ------------------
  |  Branch (260:16): [True: 1, False: 108]
  ------------------
  261|      1|        status = json_read_object(buf, json_rtcm1033, endptr);
  262|    108|    } else if (strstr(buf, "\"type\":1230,") != NULL) {
  ------------------
  |  Branch (262:16): [True: 22, False: 86]
  ------------------
  263|     22|        status = json_read_object(buf, json_rtcm1230, endptr);
  264|     86|    } else {
  265|       |        // a type we don't decode yet, grabe just the header.
  266|     86|        int n;
  267|     86|        status = json_read_object(buf, json_rtcm3_fallback, endptr);
  268|  52.3k|        for (n = 0; n < NITEMS(rtcm3->rtcmtypes.data); n++) {
  ------------------
  |  | 1212|  52.3k|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  ------------------
  |  |  |  |   68|  52.3k|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |   69|  52.3k|        0 * (int) sizeof(({ \
  |  |  |  |   70|  52.3k|            struct { \
  |  |  |  |   71|  52.3k|                int unused_int; \
  |  |  |  |   72|  52.3k|                __typeof__(arr) unused_arr; \
  |  |  |  |   73|  52.3k|            } zero_init = {0}; \
  |  |  |  |   74|  52.3k|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |   75|  52.3k|                zero_init.unused_arr[0], \
  |  |  |  |   76|  52.3k|            }; \
  |  |  |  |   77|  52.3k|            1; \
  |  |  |  |   78|  52.3k|        })) \
  |  |  |  |   79|  52.3k|    )
  |  |  ------------------
  ------------------
  |  Branch (268:21): [True: 52.3k, False: 51]
  ------------------
  269|  52.3k|            if (n >= stringcount) {
  ------------------
  |  Branch (269:17): [True: 50.6k, False: 1.71k]
  ------------------
  270|  50.6k|                rtcm3->rtcmtypes.data[n] = '\0';
  271|  50.6k|            } else {
  272|  1.71k|                unsigned int u;
  273|  1.71k|                int fldcount = sscanf(stringptrs[n], "0x%02x\n", &u);
  274|  1.71k|                if (fldcount != 1)
  ------------------
  |  Branch (274:21): [True: 35, False: 1.68k]
  ------------------
  275|     35|                    return JSON_ERR_MISC;
  ------------------
  |  |  172|     35|#define JSON_ERR_MISC          21      // other data conversion error
  ------------------
  276|  1.68k|                else
  277|  1.68k|                    rtcm3->rtcmtypes.data[n] = (char)u;
  278|  1.71k|            }
  279|  52.3k|        }
  280|     86|    }
  281|     89|    return status;
  282|    124|}

json_device_read:
   31|     17|{
   32|       |    // initialized to shut up clang
   33|     17|    double d_cycle = 0.0, d_mincycle = 0.0;
   34|       |
   35|       |    // *INDENT-OFF*
   36|     17|    const struct json_attr_t json_attrs_device[] = {
   37|     17|        {"class",      t_check,      .dflt.check = "DEVICE"},
   38|       |
   39|     17|        {"path",       t_string,     .addr.string  = dev->path,
   40|     17|                                        .len = sizeof(dev->path)},
   41|       |        // odd, device->gpsdata.online is sent, but put in dev->activated?
   42|     17|        {"activated",  t_time,       .addr.ts = &dev->activated,
   43|     17|                                        .dflt.ts = {0, 0}},
   44|     17|        {"flags",      t_integer,    .addr.integer = &dev->flags},
   45|     17|        {"driver",     t_string,     .addr.string  = dev->driver,
   46|     17|                                        .len = sizeof(dev->driver)},
   47|     17|        {"sernum",     t_string,     .addr.string  = dev->sernum,
   48|     17|                                        .len = sizeof(dev->sernum)},
   49|     17|        {"subtype",    t_string,     .addr.string  = dev->subtype,
   50|     17|                                        .len = sizeof(dev->subtype)},
   51|     17|        {"subtype1",   t_string,     .addr.string  = dev->subtype1,
   52|     17|                                        .len = sizeof(dev->subtype1)},
   53|     17|        {"hexdata",    t_string,     .addr.string  = dev->hexdata,
   54|     17|                                        .len = sizeof(dev->hexdata)},
   55|     17|        {"native",     t_integer,    .addr.integer = &dev->driver_mode,
   56|     17|                                        .dflt.integer = DEVDEFAULT_NATIVE},
  ------------------
  |  |   54|     17|#define DEVDEFAULT_NATIVE       -1
  ------------------
   57|     17|        {"bps",        t_uinteger,   .addr.uinteger = &dev->baudrate,
   58|     17|                                        .dflt.uinteger = DEVDEFAULT_BPS},
  ------------------
  |  |   51|     17|#define DEVDEFAULT_BPS          0
  ------------------
   59|     17|        {"parity",     t_character,  .addr.character = &dev->parity,
   60|     17|                                        .dflt.character = DEVDEFAULT_PARITY},
  ------------------
  |  |   52|     17|#define DEVDEFAULT_PARITY       'X'
  ------------------
   61|     17|        {"stopbits",   t_uinteger,   .addr.uinteger = &dev->stopbits,
   62|     17|                                        .dflt.uinteger = DEVDEFAULT_STOPBITS},
  ------------------
  |  |   53|     17|#define DEVDEFAULT_STOPBITS     3
  ------------------
   63|     17|        {"cycle",      t_real,       .addr.real = &d_cycle,
   64|     17|                                        .dflt.real = NAN},
   65|     17|        {"mincycle",   t_real,       .addr.real = &d_mincycle,
   66|     17|                                        .dflt.real = NAN},
   67|       |        // ignore unknown keys, for cross-version compatibility
   68|     17|        {"", t_ignore},
   69|     17|        {NULL},
   70|     17|    };
   71|       |    // *INDENT-ON*
   72|     17|    int status;
   73|       |
   74|     17|    status = json_read_object(buf, json_attrs_device, endptr);
   75|     17|    if (0 != status) {
  ------------------
  |  Branch (75:9): [True: 14, False: 3]
  ------------------
   76|     14|        return status;
   77|     14|    }
   78|       |
   79|      3|    if (0 == isfinite(d_cycle)) {
  ------------------
  |  Branch (79:9): [True: 2, False: 1]
  ------------------
   80|      2|        dev->cycle.tv_sec = 0;
   81|      2|        dev->cycle.tv_nsec = 0;
   82|      2|    } else {
   83|      1|        DTOTS(&dev->cycle, d_cycle);
  ------------------
  |  |  144|      1|    do { \
  |  |  145|      1|        double int_part; \
  |  |  146|      1|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      1|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   84|      1|    }
   85|      3|    if (0 == isfinite(d_mincycle)) {
  ------------------
  |  Branch (85:9): [True: 2, False: 1]
  ------------------
   86|      2|        dev->mincycle.tv_sec = 0;
   87|      2|        dev->mincycle.tv_nsec = 0;
   88|      2|    } else {
   89|      1|        DTOTS(&dev->mincycle, d_mincycle);
  ------------------
  |  |  144|      1|    do { \
  |  |  145|      1|        double int_part; \
  |  |  146|      1|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      1|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   90|      1|    }
   91|       |
   92|      3|    return 0;
   93|     17|}
json_watch_read:
   98|     54|{
   99|       |    // *INDENT-OFF*
  100|     54|    struct json_attr_t chanconfig_attrs[] = {
  101|     54|        {"class",          t_check,    .dflt.check = "WATCH"},
  102|       |
  103|     54|        {"device",         t_string,   .addr.string = ccp->devpath,
  104|     54|                                          .len = sizeof(ccp->devpath)},
  105|     54|        {"enable",         t_boolean,  .addr.boolean = &ccp->watcher,
  106|     54|                                          .dflt.boolean = true},
  107|     54|        {"json",           t_boolean,  .addr.boolean = &ccp->json,
  108|     54|                                          .nodefault = true},
  109|     54|        {"nmea",           t_boolean,  .addr.boolean = &ccp->nmea,
  110|     54|                                          .nodefault = true},
  111|     54|        {"pps",            t_boolean,  .addr.boolean = &ccp->pps},
  112|     54|        {"raw",            t_integer,  .addr.integer = &ccp->raw,
  113|     54|                                          .nodefault = true},
  114|     54|        {"remote",         t_string,   .addr.string = ccp->remote,
  115|     54|                                          .len = sizeof(ccp->remote)},
  116|     54|        {"scaled",         t_boolean,  .addr.boolean = &ccp->scaled},
  117|     54|        {"split24",        t_boolean,  .addr.boolean = &ccp->split24},
  118|     54|        {"timing",         t_boolean,  .addr.boolean = &ccp->timing},
  119|       |        // ignore unknown keys, for cross-version compatibility
  120|     54|        {"", t_ignore},
  121|     54|        {NULL},
  122|     54|    };
  123|       |    // *INDENT-ON*
  124|     54|    int status;
  125|       |
  126|     54|    status = json_read_object(buf, chanconfig_attrs, endptr);
  127|     54|    return status;
  128|     54|}

