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

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

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

safe_atof:
  294|  5.52k|{
  295|  5.52k|    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.52k|    static double powersOf10[] = {
  303|  5.52k|        10.,
  304|  5.52k|        100.,
  305|  5.52k|        1.0e4,
  306|  5.52k|        1.0e8,
  307|  5.52k|        1.0e16,
  308|  5.52k|        1.0e32,
  309|  5.52k|        1.0e64,
  310|  5.52k|        1.0e128,
  311|  5.52k|        1.0e256
  312|  5.52k|    };
  313|       |
  314|  5.52k|    bool sign = false, expSign = false;
  315|  5.52k|    double fraction, dblExp, *d;
  316|  5.52k|    const char *p;
  317|  5.52k|    unsigned char c;
  318|  5.52k|    int exp = 0;                // Exponent read from "EX" field.
  319|  5.52k|    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.52k|    int mantSize;               // Number of digits in mantissa.
  329|  5.52k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  330|       |                                 * point. */
  331|  5.52k|    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.52k|    p = string;
  341|  5.52k|    while (isspace((int)*p)) {
  ------------------
  |  Branch (341:12): [True: 0, False: 5.52k]
  ------------------
  342|      0|        p += 1;
  343|      0|    }
  344|  5.52k|    if (isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (344:9): [True: 2.63k, False: 2.88k]
  ------------------
  345|       |        // ignore
  346|  2.88k|    } else if ('-' == *p) {
  ------------------
  |  Branch (346:16): [True: 840, False: 2.04k]
  ------------------
  347|    840|        sign = true;
  348|    840|        p += 1;
  349|  2.04k|    } else if ('+' == *p) {
  ------------------
  |  Branch (349:16): [True: 203, False: 1.84k]
  ------------------
  350|    203|        p += 1;
  351|  1.84k|    } else if ('.' == *p) {
  ------------------
  |  Branch (351:16): [True: 1.20k, False: 637]
  ------------------
  352|       |        // ignore
  353|  1.20k|    } else {
  354|    637|        return NAN;
  355|    637|    }
  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.88k|    decPt = -1;
  363|  20.8k|    for (mantSize = 0; ; mantSize += 1) {
  364|  20.8k|        c = *p;
  365|  20.8k|        if (!isdigit(c)) {
  ------------------
  |  Branch (365:13): [True: 6.31k, False: 14.5k]
  ------------------
  366|  6.31k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (366:17): [True: 4.68k, False: 1.63k]
  |  Branch (366:31): [True: 205, False: 1.42k]
  ------------------
  367|  4.88k|                break;
  368|  4.88k|            }
  369|  1.42k|            decPt = mantSize;
  370|  1.42k|        }
  371|  15.9k|        p += 1;
  372|  15.9k|    }
  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.88k|    pExp  = p;
  382|  4.88k|    p -= mantSize;
  383|  4.88k|    if (decPt < 0) {
  ------------------
  |  Branch (383:9): [True: 3.46k, False: 1.42k]
  ------------------
  384|  3.46k|        decPt = mantSize;
  385|  3.46k|    } else {
  386|  1.42k|        mantSize -= 1;                  // One of the digits was the point.
  387|  1.42k|    }
  388|  4.88k|    if (mantSize > 18) {
  ------------------
  |  Branch (388:9): [True: 208, False: 4.68k]
  ------------------
  389|    208|        fracExp = decPt - 18;
  390|    208|        mantSize = 18;
  391|  4.68k|    } else {
  392|  4.68k|        fracExp = decPt - mantSize;
  393|  4.68k|    }
  394|  4.88k|    if (mantSize == 0) {
  ------------------
  |  Branch (394:9): [True: 1.37k, False: 3.51k]
  ------------------
  395|  1.37k|        fraction = 0.0;
  396|       |        // p = string;
  397|  1.37k|        goto done;
  398|  3.51k|    } else {
  399|  3.51k|        int frac1, frac2;
  400|       |
  401|  3.51k|        frac1 = 0;
  402|  6.24k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (402:17): [True: 2.73k, False: 3.51k]
  ------------------
  403|  2.73k|            c = *p;
  404|  2.73k|            p += 1;
  405|  2.73k|            if ('.' == c) {
  ------------------
  |  Branch (405:17): [True: 212, False: 2.51k]
  ------------------
  406|    212|                c = *p;
  407|    212|                p += 1;
  408|    212|            }
  409|  2.73k|            frac1 = 10*frac1 + (c - '0');
  410|  2.73k|        }
  411|  3.51k|        frac2 = 0;
  412|  12.8k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (412:16): [True: 9.35k, False: 3.51k]
  ------------------
  413|  9.35k|            c = *p;
  414|  9.35k|            p += 1;
  415|  9.35k|            if ('.' == c) {
  ------------------
  |  Branch (415:17): [True: 221, False: 9.13k]
  ------------------
  416|    221|                c = *p;
  417|    221|                p += 1;
  418|    221|            }
  419|  9.35k|            frac2 = 10*frac2 + (c - '0');
  420|  9.35k|        }
  421|  3.51k|        fraction = (1.0e9 * frac1) + frac2;
  422|  3.51k|    }
  423|       |
  424|       |    /*
  425|       |     * Skim off the exponent.
  426|       |     */
  427|       |
  428|  3.51k|    p = pExp;
  429|  3.51k|    if (('E' == *p) ||
  ------------------
  |  Branch (429:9): [True: 1.24k, False: 2.26k]
  ------------------
  430|  2.26k|        ('e' == *p)) {
  ------------------
  |  Branch (430:9): [True: 865, False: 1.40k]
  ------------------
  431|  2.11k|        p += 1;
  432|  2.11k|        if ('-' == *p) {
  ------------------
  |  Branch (432:13): [True: 593, False: 1.52k]
  ------------------
  433|    593|            expSign = true;
  434|    593|            p += 1;
  435|  1.52k|        } else {
  436|  1.52k|            if ('+' == *p) {
  ------------------
  |  Branch (436:17): [True: 194, False: 1.32k]
  ------------------
  437|    194|                p += 1;
  438|    194|            }
  439|  1.52k|            expSign = false;
  440|  1.52k|        }
  441|  4.42k|        while (isdigit((unsigned char) *p)) {
  ------------------
  |  Branch (441:16): [True: 4.42k, False: 1.33k]
  ------------------
  442|  4.42k|            exp = exp * 10 + (*p - '0');
  443|  4.42k|            if (1024 < exp) {
  ------------------
  |  Branch (443:17): [True: 780, False: 3.64k]
  ------------------
  444|    780|                if (true == expSign) {
  ------------------
  |  Branch (444:21): [True: 388, False: 392]
  ------------------
  445|       |                    // exponent underflow!
  446|    388|                    if (sign) {
  ------------------
  |  Branch (446:25): [True: 194, False: 194]
  ------------------
  447|    194|                        return -0.0;
  448|    194|                    }
  449|    194|                    return 0.0;
  450|    388|                } // else  exponent overflow!
  451|    392|                if (sign) {
  ------------------
  |  Branch (451:21): [True: 194, False: 198]
  ------------------
  452|    194|                    return -INFINITY;
  453|    194|                }
  454|    198|                return INFINITY;
  455|    392|            }
  456|  3.64k|            p += 1;
  457|  3.64k|        }
  458|  2.11k|    }
  459|  2.73k|    if (expSign) {
  ------------------
  |  Branch (459:9): [True: 205, False: 2.52k]
  ------------------
  460|    205|        exp = fracExp - exp;
  461|  2.52k|    } else {
  462|  2.52k|        exp = fracExp + exp;
  463|  2.52k|    }
  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.73k|    if (0 > exp) {
  ------------------
  |  Branch (472:9): [True: 440, False: 2.29k]
  ------------------
  473|    440|        expSign = true;
  474|    440|        exp = -exp;
  475|  2.29k|    } else {
  476|  2.29k|        expSign = false;
  477|  2.29k|    }
  478|  2.73k|    if (exp > maxExponent) {
  ------------------
  |  Branch (478:9): [True: 221, False: 2.51k]
  ------------------
  479|    221|        exp = maxExponent;
  480|    221|        errno = ERANGE;
  481|    221|    }
  482|  2.73k|    dblExp = 1.0;
  483|  7.29k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (483:26): [True: 4.55k, False: 2.73k]
  ------------------
  484|  4.55k|        if (exp & 01) {
  ------------------
  |  Branch (484:13): [True: 3.52k, False: 1.03k]
  ------------------
  485|  3.52k|            dblExp *= *d;
  486|  3.52k|        }
  487|  4.55k|    }
  488|  2.73k|    if (expSign) {
  ------------------
  |  Branch (488:9): [True: 440, False: 2.29k]
  ------------------
  489|    440|        fraction /= dblExp;
  490|  2.29k|    } else {
  491|  2.29k|        fraction *= dblExp;
  492|  2.29k|    }
  493|       |
  494|  4.10k|done:
  495|  4.10k|    if (sign) {
  ------------------
  |  Branch (495:9): [True: 452, False: 3.65k]
  ------------------
  496|    452|        return -fraction;
  497|    452|    }
  498|  3.65k|    return fraction;
  499|  4.10k|}
mkgmtime:
  845|  2.17k|{
  846|  2.17k|    int year;
  847|  2.17k|    time_t result;
  848|  2.17k|    static const int cumdays[MONTHSPERYEAR] =
  849|  2.17k|        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
  850|       |
  851|       |    // check ranges, ignore tm_isdst and max tm_year
  852|  2.17k|    if (0 > t->tm_sec ||
  ------------------
  |  Branch (852:9): [True: 0, False: 2.17k]
  ------------------
  853|  2.17k|        0 > t->tm_min ||
  ------------------
  |  Branch (853:9): [True: 0, False: 2.17k]
  ------------------
  854|  2.17k|        0 > t->tm_hour ||
  ------------------
  |  Branch (854:9): [True: 0, False: 2.17k]
  ------------------
  855|  2.17k|        1 > t->tm_mday ||
  ------------------
  |  Branch (855:9): [True: 240, False: 1.93k]
  ------------------
  856|  1.93k|        0 > t->tm_mon ||
  ------------------
  |  Branch (856:9): [True: 0, False: 1.93k]
  ------------------
  857|  1.93k|        0 > t->tm_year ||
  ------------------
  |  Branch (857:9): [True: 622, False: 1.31k]
  ------------------
  858|  1.31k|        0 > t->tm_wday ||
  ------------------
  |  Branch (858:9): [True: 0, False: 1.31k]
  ------------------
  859|  1.31k|        0 > t->tm_yday ||
  ------------------
  |  Branch (859:9): [True: 0, False: 1.31k]
  ------------------
  860|  1.31k|        61 < t->tm_sec ||
  ------------------
  |  Branch (860:9): [True: 0, False: 1.31k]
  ------------------
  861|  1.31k|        59 < t->tm_min ||
  ------------------
  |  Branch (861:9): [True: 0, False: 1.31k]
  ------------------
  862|  1.31k|        23 < t->tm_hour ||
  ------------------
  |  Branch (862:9): [True: 0, False: 1.31k]
  ------------------
  863|  1.31k|        31 < t->tm_mday ||
  ------------------
  |  Branch (863:9): [True: 0, False: 1.31k]
  ------------------
  864|  1.31k|        11 < t->tm_mon ||
  ------------------
  |  Branch (864:9): [True: 0, False: 1.31k]
  ------------------
  865|  1.31k|        6 < t->tm_wday ||
  ------------------
  |  Branch (865:9): [True: 0, False: 1.31k]
  ------------------
  866|  1.31k|        365 < t->tm_yday) {
  ------------------
  |  Branch (866:9): [True: 0, False: 1.31k]
  ------------------
  867|    862|        errno = EOVERFLOW;
  868|    862|        return -1;
  869|    862|    }
  870|  2.17k|    errno = 0;
  871|  1.31k|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  501|  1.31k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  872|  1.31k|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  501|  1.31k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  873|  1.31k|    result += (year - 1968) / 4;
  874|  1.31k|    result -= (year - 1900) / 100;
  875|  1.31k|    result += (year - 1600) / 400;
  876|  1.31k|    if (0 == (year % 4) &&
  ------------------
  |  Branch (876:9): [True: 642, False: 675]
  ------------------
  877|    642|        (0 != (year % 100) ||
  ------------------
  |  Branch (877:10): [True: 227, False: 415]
  ------------------
  878|    415|         0 == (year % 400)) &&
  ------------------
  |  Branch (878:10): [True: 201, False: 214]
  ------------------
  879|    428|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  501|    428|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (879:9): [True: 211, False: 217]
  ------------------
  880|    211|        result--;
  881|    211|    }
  882|  1.31k|    result += t->tm_mday - 1;
  883|  1.31k|    result *= 24;
  884|  1.31k|    result += t->tm_hour;
  885|  1.31k|    result *= 60;
  886|  1.31k|    result += t->tm_min;
  887|  1.31k|    result *= 60;
  888|  1.31k|    result += t->tm_sec;
  889|       |    /* this is UTC, no DST
  890|       |     * if (t->tm_isdst == 1)
  891|       |     * result -= 3600;
  892|       |     */
  893|  1.31k|    return result;
  894|  2.17k|}
iso8601_to_timespec:
  898|  2.17k|{
  899|  2.17k|    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|  2.17k|    double usec = 0;
  921|  2.17k|    struct tm tm = {0};
  922|       |
  923|  2.17k|    {
  924|  2.17k|        char *dp = NULL;
  925|  2.17k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  926|  2.17k|        if (NULL != dp &&
  ------------------
  |  Branch (926:13): [True: 788, False: 1.39k]
  ------------------
  927|    788|            '.' == *dp) {
  ------------------
  |  Branch (927:13): [True: 194, False: 594]
  ------------------
  928|    194|            usec = strtod(dp, NULL);
  929|    194|        }
  930|  2.17k|    }
  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|  2.17k|    ret.tv_sec = mkgmtime(&tm);
  940|  2.17k|    ret.tv_nsec = usec * 1e9;
  941|  2.17k|#endif  // USE_QT
  942|       |
  943|  2.17k|#if 4 < SIZEOF_TIME_T
  944|  2.17k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (944:9): [True: 347, False: 1.83k]
  ------------------
  945|       |        // enforce max "9999-12-31T23:59:59.999Z"
  946|    347|        ret.tv_sec = 253402300799LL;
  947|    347|    }
  948|  2.17k|#endif
  949|  2.17k|    return ret;
  950|  2.17k|}

gps_hexpack:
  119|    114|{
  120|    114|    ssize_t i, j;
  121|       |
  122|    114|    j = strnlen(src, BUFSIZ) / 2;
  123|    114|    if ((1 > j) ||
  ------------------
  |  Branch (123:9): [True: 2, False: 112]
  ------------------
  124|    112|        ((size_t)j > len)) {
  ------------------
  |  Branch (124:9): [True: 11, False: 101]
  ------------------
  125|     13|        return -2;
  126|     13|    }
  127|       |
  128|    392|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 354, False: 38]
  ------------------
  129|    354|        int k;
  130|    354|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 63, False: 291]
  ------------------
  131|     63|            return -1;
  132|     63|        }
  133|    291|        dst[i] = (char)(k & 0xff);
  134|    291|    }
  135|     38|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     38|    return j;
  137|    101|}
hex.c:hex2bin:
   82|    354|{
   83|    354|    int a, b;
   84|       |
   85|    354|    a = s[0] & 0xff;
   86|    354|    b = s[1] & 0xff;
   87|       |
   88|    354|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 89, False: 265]
  ------------------
   89|     89|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 80, False: 9]
  ------------------
   90|     80|        a = a + 10 - 'a';
   91|    274|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 101, False: 173]
  ------------------
   92|    101|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 83, False: 18]
  ------------------
   93|     83|        a = a + 10 - 'A';
   94|    191|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 182, False: 9]
  ------------------
   95|    182|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 161, False: 21]
  ------------------
   96|    161|        a -= '0';
   97|    161|    } else {
   98|     30|        return -1;
   99|     30|    }
  100|       |
  101|    324|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 80, False: 244]
  ------------------
  102|     80|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 69, False: 11]
  ------------------
  103|     69|        b = b + 10 - 'a';
  104|    255|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 96, False: 159]
  ------------------
  105|     96|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 77, False: 19]
  ------------------
  106|     77|        b = b + 10 - 'A';
  107|    178|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 169, False: 9]
  ------------------
  108|    169|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 145, False: 24]
  ------------------
  109|    145|        b -= '0';
  110|    145|    } else {
  111|     33|        return -1;
  112|     33|    }
  113|       |
  114|    291|    return ((a << 4) + b);
  115|    324|}

json_read_array:
  802|  1.10k|{
  803|  1.10k|    int substatus;
  804|  1.10k|    unsigned offset, arrcount;
  805|  1.10k|    char *tp;
  806|       |
  807|  1.10k|    if (NULL != end) {
  ------------------
  |  Branch (807:9): [True: 1.10k, False: 0]
  ------------------
  808|  1.10k|        *end = NULL;    // give it a well-defined value on parse failure
  809|  1.10k|    }
  810|       |
  811|  1.10k|    json_debug_trace(1, "json: %s", "Entered json_read_array()\n");
  ------------------
  |  |  108|  1.10k|    do {                                              \
  |  |  109|  1.10k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  1.10k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1.10k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1.10k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  1.10k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  1.10k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1.10k]
  |  |  ------------------
  ------------------
  812|       |
  813|  1.10k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (813:12): [True: 0, False: 1.10k]
  ------------------
  814|      0|        cp++;
  815|      0|    }
  816|  1.10k|    if (*cp != '[') {
  ------------------
  |  Branch (816:9): [True: 0, False: 1.10k]
  ------------------
  817|      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]
  |  |  ------------------
  ------------------
  818|      0|        return JSON_ERR_ARRAYSTART;
  ------------------
  |  |  161|      0|#define JSON_ERR_ARRAYSTART    10      // didn't find expected array start
  ------------------
  819|      0|    }
  820|  1.10k|    cp++;
  821|       |
  822|  1.10k|    tp = arr->arr.strings.store;
  823|  1.10k|    arrcount = 0;
  824|       |
  825|       |    // Check for empty array
  826|  1.10k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (826:12): [True: 194, False: 1.10k]
  ------------------
  827|    194|        cp++;
  828|    194|    }
  829|  1.10k|    if (*cp == ']') {
  ------------------
  |  Branch (829:9): [True: 217, False: 887]
  ------------------
  830|    217|        goto breakout;
  831|    217|    }
  832|       |
  833|  9.23k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (833:22): [True: 9.23k, False: 1]
  ------------------
  834|  9.23k|        char *ep = NULL;
  835|       |
  836|  9.23k|        json_debug_trace(1, "json: Looking at %s\n", cp);
  ------------------
  |  |  108|  9.23k|    do {                                              \
  |  |  109|  9.23k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  9.23k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9.23k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9.23k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  9.23k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  9.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9.23k]
  |  |  ------------------
  ------------------
  837|  9.23k|        switch (arr->element_type) {
  ------------------
  |  Branch (837:17): [True: 9.23k, False: 0]
  ------------------
  838|  2.94k|        case t_string:
  ------------------
  |  Branch (838:9): [True: 2.94k, False: 6.29k]
  ------------------
  839|  2.94k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (839:17): [True: 194, False: 2.75k]
  ------------------
  840|    194|                cp++;
  841|    194|            }
  842|  2.94k|            if (*cp != '"') {
  ------------------
  |  Branch (842:17): [True: 12, False: 2.93k]
  ------------------
  843|     12|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     12|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  844|  2.93k|            } else {
  845|  2.93k|                ++cp;
  846|  2.93k|            }
  847|  2.93k|            arr->arr.strings.ptrs[offset] = tp;
  848|  13.4k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (848:20): [True: 13.4k, False: 3]
  ------------------
  849|  10.5k|                 tp++)
  850|  13.4k|                if (*cp == '"') {
  ------------------
  |  Branch (850:21): [True: 2.93k, False: 10.5k]
  ------------------
  851|  2.93k|                    ++cp;
  852|  2.93k|                    *tp++ = '\0';
  853|  2.93k|                    goto stringend;
  854|  10.5k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (854:28): [True: 1, False: 10.5k]
  ------------------
  855|      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]
  |  |  ------------------
  ------------------
  856|      1|                                      "Bad string syntax in string list.\n");
  857|      1|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      1|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  858|  10.5k|                } else {
  859|  10.5k|                    *tp = *cp++;
  860|  10.5k|                }
  861|      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]
  |  |  ------------------
  ------------------
  862|      3|                             "Bad string syntax in string list.\n");
  863|      3|            return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      3|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  864|  2.93k|          stringend:
  865|  2.93k|            break;
  866|      0|        case t_object:
  ------------------
  |  Branch (866:9): [True: 0, False: 9.23k]
  ------------------
  867|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  868|  6.29k|        case t_structobject:
  ------------------
  |  Branch (868:9): [True: 6.29k, False: 2.94k]
  ------------------
  869|  6.29k|            substatus =
  870|  6.29k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  871|  6.29k|                                          offset, &cp);
  872|  6.29k|            if (substatus != 0) {
  ------------------
  |  Branch (872:17): [True: 159, False: 6.13k]
  ------------------
  873|    159|                if (NULL != end) {
  ------------------
  |  Branch (873:21): [True: 159, False: 0]
  ------------------
  874|    159|                    *end = cp;
  875|    159|                }
  876|    159|                return substatus;
  877|    159|            }
  878|  6.13k|            break;
  879|  6.13k|        case t_integer:
  ------------------
  |  Branch (879:9): [True: 0, False: 9.23k]
  ------------------
  880|      0|            arr->arr.integers.store[offset] = (int)strtol(cp, &ep, 0);
  881|      0|            if (ep == cp) {
  ------------------
  |  Branch (881:17): [True: 0, False: 0]
  ------------------
  882|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  883|      0|            }
  884|      0|            cp = ep;
  885|      0|            break;
  886|      0|        case t_uinteger:
  ------------------
  |  Branch (886:9): [True: 0, False: 9.23k]
  ------------------
  887|      0|            arr->arr.uintegers.store[offset] = (unsigned int)strtoul(cp,
  888|      0|                                                                     &ep, 0);
  889|      0|            if (ep == cp) {
  ------------------
  |  Branch (889:17): [True: 0, False: 0]
  ------------------
  890|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  891|      0|            }
  892|      0|            cp = ep;
  893|      0|            break;
  894|      0|        case t_longint:
  ------------------
  |  Branch (894:9): [True: 0, False: 9.23k]
  ------------------
  895|      0|            arr->arr.longint.store[offset] = strtol(cp, &ep, 0);
  896|      0|            if (ep == cp) {
  ------------------
  |  Branch (896:17): [True: 0, False: 0]
  ------------------
  897|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  898|      0|            }
  899|      0|            cp = ep;
  900|      0|            break;
  901|      0|        case t_ulongint:
  ------------------
  |  Branch (901:9): [True: 0, False: 9.23k]
  ------------------
  902|      0|            arr->arr.ulongint.store[offset] = strtoul(cp, &ep, 0);
  903|      0|            if (ep == cp) {
  ------------------
  |  Branch (903:17): [True: 0, False: 0]
  ------------------
  904|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  905|      0|            }
  906|      0|            cp = ep;
  907|      0|            break;
  908|      0|        case t_byte:
  ------------------
  |  Branch (908:9): [True: 0, False: 9.23k]
  ------------------
  909|      0|            arr->arr.bytes.store[offset] = (char)strtol(cp, &ep, 0);
  910|      0|            if (ep == cp) {
  ------------------
  |  Branch (910:17): [True: 0, False: 0]
  ------------------
  911|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  912|      0|            }
  913|      0|            cp = ep;
  914|      0|            break;
  915|      0|        case t_ubyte:
  ------------------
  |  Branch (915:9): [True: 0, False: 9.23k]
  ------------------
  916|      0|            arr->arr.ubytes.store[offset] = (unsigned char)strtoul(cp,
  917|      0|                                                                   &ep, 0);
  918|      0|            if (ep == cp) {
  ------------------
  |  Branch (918:17): [True: 0, False: 0]
  ------------------
  919|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  920|      0|            }
  921|      0|            cp = ep;
  922|      0|            break;
  923|      0|        case t_short:
  ------------------
  |  Branch (923:9): [True: 0, False: 9.23k]
  ------------------
  924|      0|            arr->arr.shorts.store[offset] = (short)strtol(cp, &ep, 0);
  925|      0|            if (ep == cp) {
  ------------------
  |  Branch (925:17): [True: 0, False: 0]
  ------------------
  926|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  927|      0|            }
  928|      0|            cp = ep;
  929|      0|            break;
  930|      0|        case t_ushort:
  ------------------
  |  Branch (930:9): [True: 0, False: 9.23k]
  ------------------
  931|      0|            arr->arr.ushorts.store[offset] = (unsigned short)strtoul(cp,
  932|      0|                                                                     &ep, 0);
  933|      0|            if (ep == cp) {
  ------------------
  |  Branch (933:17): [True: 0, False: 0]
  ------------------
  934|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  935|      0|            }
  936|      0|            cp = ep;
  937|      0|            break;
  938|      0|        case t_time:
  ------------------
  |  Branch (938:9): [True: 0, False: 9.23k]
  ------------------
  939|      0|            {
  940|      0|                timespec_t ts_tmp;
  941|      0|                if (*cp != '"') {
  ------------------
  |  Branch (941:21): [True: 0, False: 0]
  ------------------
  942|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  943|      0|                } else {
  944|      0|                    ++cp;
  945|      0|                }
  946|      0|                ts_tmp = iso8601_to_timespec(cp);
  947|      0|                arr->arr.timespecs.store[offset] = ts_tmp;
  948|      0|                while (*cp &&
  ------------------
  |  Branch (948:24): [True: 0, False: 0]
  ------------------
  949|      0|                       *cp != '"') {
  ------------------
  |  Branch (949:24): [True: 0, False: 0]
  ------------------
  950|      0|                    cp++;
  951|      0|                }
  952|      0|                if (*cp != '"') {
  ------------------
  |  Branch (952:21): [True: 0, False: 0]
  ------------------
  953|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  954|      0|                }
  955|      0|                ++cp;
  956|      0|            }
  957|      0|            break;
  958|      0|        case t_timespec:
  ------------------
  |  Branch (958:9): [True: 0, False: 9.23k]
  ------------------
  959|       |            // TODO not sure how to implement this
  960|      0|            return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  961|      0|            break;
  962|      0|        case t_real:
  ------------------
  |  Branch (962:9): [True: 0, False: 9.23k]
  ------------------
  963|      0|            arr->arr.reals.store[offset] = strtod(cp, &ep);
  964|      0|            if (ep == cp) {
  ------------------
  |  Branch (964:17): [True: 0, False: 0]
  ------------------
  965|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  966|      0|            }
  967|      0|            cp = ep;
  968|      0|            break;
  969|      0|        case t_boolean:
  ------------------
  |  Branch (969:9): [True: 0, False: 9.23k]
  ------------------
  970|      0|            if (str_starts_with(cp, "true")) {
  ------------------
  |  Branch (970:17): [True: 0, False: 0]
  ------------------
  971|      0|                arr->arr.booleans.store[offset] = true;
  972|      0|                cp += 4;
  973|      0|            } else if (str_starts_with(cp, "false")) {
  ------------------
  |  Branch (973:24): [True: 0, False: 0]
  ------------------
  974|      0|                arr->arr.booleans.store[offset] = false;
  975|      0|                cp += 5;
  976|      0|            }
  977|      0|            break;
  978|      0|        case t_character:
  ------------------
  |  Branch (978:9): [True: 0, False: 9.23k]
  ------------------
  979|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  980|      0|        case t_array:
  ------------------
  |  Branch (980:9): [True: 0, False: 9.23k]
  ------------------
  981|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  982|      0|        case t_check:
  ------------------
  |  Branch (982:9): [True: 0, False: 9.23k]
  ------------------
  983|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  984|      0|        case t_ignore:
  ------------------
  |  Branch (984:9): [True: 0, False: 9.23k]
  ------------------
  985|      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]
  |  |  ------------------
  ------------------
  986|      0|            return JSON_ERR_SUBTYPE;
  ------------------
  |  |  165|      0|#define JSON_ERR_SUBTYPE       14      // unsupported array element type
  ------------------
  987|  9.23k|        }
  988|  9.06k|        arrcount++;
  989|  9.06k|        if (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (989:13): [True: 194, False: 8.86k]
  ------------------
  990|    194|            cp++;
  991|    194|        }
  992|  9.06k|        if (*cp == ']') {
  ------------------
  |  Branch (992:13): [True: 564, False: 8.49k]
  ------------------
  993|    564|            json_debug_trace(1, "json: %s", "End of array found.\n");
  ------------------
  |  |  108|    564|    do {                                              \
  |  |  109|    564|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    564|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 564]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 564]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    564|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    564|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 564]
  |  |  ------------------
  ------------------
  994|    564|            goto breakout;
  995|    564|        }
  996|  8.49k|        if (*cp == ',') {
  ------------------
  |  Branch (996:13): [True: 8.35k, False: 147]
  ------------------
  997|  8.35k|            cp++;
  998|  8.35k|        } else {
  999|    147|            json_debug_trace(1, "json: %s", "Bad trailing syntax on array.\n");
  ------------------
  |  |  108|    147|    do {                                              \
  |  |  109|    147|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    147|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 147]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 147]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    147|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    147|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 147]
  |  |  ------------------
  ------------------
 1000|    147|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    147|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
 1001|    147|        }
 1002|  8.49k|    }
 1003|      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]
  |  |  ------------------
  ------------------
 1004|      1|    if (NULL != end) {
  ------------------
  |  Branch (1004:9): [True: 1, False: 0]
  ------------------
 1005|      1|        *end = cp;
 1006|      1|    }
 1007|      1|    return JSON_ERR_SUBTOOLONG;
  ------------------
  |  |  163|      1|#define JSON_ERR_SUBTOOLONG    12      // too many array elements
  ------------------
 1008|    781|  breakout:
 1009|    781|    if (NULL != arr->count) {
  ------------------
  |  Branch (1009:9): [True: 781, False: 0]
  ------------------
 1010|    781|        *(arr->count) = arrcount;
 1011|    781|    }
 1012|    781|    if (NULL != end) {
  ------------------
  |  Branch (1012:9): [True: 781, False: 0]
  ------------------
 1013|    781|        *end = cp;
 1014|    781|    }
 1015|    781|    json_debug_trace(1, "json: leaving json_read_array() with %d elements\n",
  ------------------
  |  |  108|    781|    do {                                              \
  |  |  109|    781|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    781|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 781]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 781]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    781|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    781|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 781]
  |  |  ------------------
  ------------------
 1016|    781|                      arrcount);
 1017|    781|    return 0;
 1018|    887|}
json_read_object:
 1022|  5.15k|{
 1023|  5.15k|    int st;
 1024|       |
 1025|  5.15k|    json_debug_trace(1, "json: json_read_object() sees '%s'\n", cp);
  ------------------
  |  |  108|  5.15k|    do {                                              \
  |  |  109|  5.15k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  5.15k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 5.15k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 5.15k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  5.15k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  5.15k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 5.15k]
  |  |  ------------------
  ------------------
 1026|       |    st = json_internal_read_object(cp, attrs, NULL, 0, end);
 1027|  5.15k|    return st;
 1028|  5.15k|}
json.c:json_internal_read_object:
  199|  11.4k|{
  200|  11.4k|    enum
  201|  11.4k|    { init, await_attr, in_attr, await_value, in_val_string,
  202|  11.4k|        in_escape, in_val_token, post_val, post_element, in_ignore_array
  203|  11.4k|    } state = 0;
  204|  11.4k|    char *statenames[] = {
  205|  11.4k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  206|  11.4k|        "in_escape", "in_val_token", "post_val", "post_element",
  207|  11.4k|        "in_ignore_array"
  208|  11.4k|    };
  209|  11.4k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  210|  11.4k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  211|  11.4k|    bool value_quoted = false;
  212|  11.4k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  213|  11.4k|    const struct json_attr_t *cursor;
  214|  11.4k|    int substatus, maxlen = 0;
  215|  11.4k|    unsigned int u;
  216|  11.4k|    const struct json_enum_t *mp;
  217|  11.4k|    char *lptr;
  218|       |
  219|  11.4k|    if (NULL != end) {
  ------------------
  |  Branch (219:9): [True: 6.29k, False: 5.15k]
  ------------------
  220|  6.29k|        *end = NULL;    // give it a well-defined value on parse failure
  221|  6.29k|    }
  222|  11.4k|    memset(valbuf, 0, sizeof(valbuf));
  223|       |
  224|       |    // stuff fields with defaults in case they're omitted in the JSON input
  225|   176k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (225:26): [True: 165k, False: 11.4k]
  ------------------
  226|   165k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (226:13): [True: 165k, False: 150]
  ------------------
  227|   165k|            lptr = json_target_address(cursor, parent, offset);
  228|   165k|            if (NULL != lptr)
  ------------------
  |  Branch (228:17): [True: 154k, False: 10.3k]
  ------------------
  229|   154k|                switch (cursor->type) {
  ------------------
  |  Branch (229:25): [True: 154k, False: 0]
  ------------------
  230|  3.86k|                case t_byte:
  ------------------
  |  Branch (230:17): [True: 3.86k, False: 150k]
  ------------------
  231|  3.86k|                    lptr[0] = cursor->dflt.byte;
  232|  3.86k|                    break;
  233|  21.5k|                case t_ubyte:
  ------------------
  |  Branch (233:17): [True: 21.5k, False: 133k]
  ------------------
  234|  21.5k|                    lptr[0] = cursor->dflt.ubyte;
  235|  21.5k|                    break;
  236|  19.3k|                case t_integer:
  ------------------
  |  Branch (236:17): [True: 19.3k, False: 135k]
  ------------------
  237|  19.3k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  238|  19.3k|                    break;
  239|  9.07k|                case t_uinteger:
  ------------------
  |  Branch (239:17): [True: 9.07k, False: 145k]
  ------------------
  240|  9.07k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  241|  9.07k|                    break;
  242|    936|                case t_longint:
  ------------------
  |  Branch (242:17): [True: 936, False: 153k]
  ------------------
  243|    936|                    memcpy(lptr, &cursor->dflt.longint, sizeof(long));
  244|    936|                    break;
  245|    120|                case t_ulongint:
  ------------------
  |  Branch (245:17): [True: 120, False: 154k]
  ------------------
  246|    120|                    memcpy(lptr, &cursor->dflt.ulongint,
  247|    120|                           sizeof(unsigned long));
  248|    120|                    break;
  249|  3.86k|                case t_short:
  ------------------
  |  Branch (249:17): [True: 3.86k, False: 150k]
  ------------------
  250|  3.86k|                    memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
  251|  3.86k|                    break;
  252|      0|                case t_ushort:
  ------------------
  |  Branch (252:17): [True: 0, False: 154k]
  ------------------
  253|      0|                    memcpy(lptr, &cursor->dflt.ushortint,
  254|      0|                           sizeof(unsigned short));
  255|      0|                    break;
  256|  2.50k|                case t_time:
  ------------------
  |  Branch (256:17): [True: 2.50k, False: 152k]
  ------------------
  257|  2.50k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  258|  2.50k|                    break;
  259|  2.81k|                case t_timespec:
  ------------------
  |  Branch (259:17): [True: 2.81k, False: 151k]
  ------------------
  260|  2.81k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  261|  2.81k|                    break;
  262|  60.4k|                case t_real:
  ------------------
  |  Branch (262:17): [True: 60.4k, False: 94.3k]
  ------------------
  263|  60.4k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  264|  60.4k|                    break;
  265|  15.7k|                case t_string:
  ------------------
  |  Branch (265:17): [True: 15.7k, False: 138k]
  ------------------
  266|  15.7k|                    if (parent != NULL
  ------------------
  |  Branch (266:25): [True: 9.43k, False: 6.35k]
  ------------------
  267|  9.43k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (267:28): [True: 0, False: 9.43k]
  ------------------
  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|  15.7k|                    lptr[0] = '\0';
  271|  15.7k|                    break;
  272|  4.99k|                case t_boolean:
  ------------------
  |  Branch (272:17): [True: 4.99k, False: 149k]
  ------------------
  273|  4.99k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  274|  4.99k|                    break;
  275|  1.90k|                case t_character:
  ------------------
  |  Branch (275:17): [True: 1.90k, False: 152k]
  ------------------
  276|  1.90k|                    lptr[0] = cursor->dflt.character;
  277|  1.90k|                    break;
  278|      0|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (278:17): [True: 0, False: 154k]
  ------------------
  279|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  280|      0|                case t_structobject:
  ------------------
  |  Branch (280:17): [True: 0, False: 154k]
  ------------------
  281|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  282|      0|                case t_array:
  ------------------
  |  Branch (282:17): [True: 0, False: 154k]
  ------------------
  283|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  284|  1.40k|                case t_check:
  ------------------
  |  Branch (284:17): [True: 1.40k, False: 153k]
  ------------------
  285|  1.40k|                    FALLTHROUGH
  ------------------
  |  |   55|  1.40k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  286|  7.67k|                case t_ignore:
  ------------------
  |  Branch (286:17): [True: 6.27k, False: 148k]
  ------------------
  287|  7.67k|                    break;
  288|   154k|                }
  289|   165k|        }
  290|       |
  291|  11.4k|    json_debug_trace(1, "json: JSON parse of '%s' begins.\n", cp);
  ------------------
  |  |  108|  11.4k|    do {                                              \
  |  |  109|  11.4k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  11.4k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 11.4k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 11.4k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  11.4k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  11.4k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 11.4k]
  |  |  ------------------
  ------------------
  292|       |
  293|       |    // parse input JSON
  294|   612k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (294:12): [True: 609k, False: 3.12k]
  ------------------
  295|   609k|        json_debug_trace(2, "json: State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  108|   609k|    do {                                              \
  |  |  109|   609k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   609k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 609k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 609k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   609k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   609k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 609k]
  |  |  ------------------
  ------------------
  296|   609k|                          statenames[state], *cp, cp);
  297|   609k|        switch (state) {
  ------------------
  |  Branch (297:17): [True: 609k, False: 0]
  ------------------
  298|  11.9k|        case init:
  ------------------
  |  Branch (298:9): [True: 11.9k, False: 597k]
  ------------------
  299|  11.9k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (299:17): [True: 596, False: 11.3k]
  ------------------
  300|    596|                continue;
  301|    596|            }
  302|  11.3k|            if (*cp == '{') {
  ------------------
  |  Branch (302:17): [True: 11.3k, False: 39]
  ------------------
  303|  11.3k|                state = await_attr;
  304|  11.3k|            } else {
  305|     39|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     39|    do {                                              \
  |  |  109|     39|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     39|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 39]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 39]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     39|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     39|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 39]
  |  |  ------------------
  ------------------
  306|     39|                                  "Non-WS when expecting object start.\n");
  307|     39|                if (NULL != end) {
  ------------------
  |  Branch (307:21): [True: 39, False: 0]
  ------------------
  308|     39|                    *end = cp;
  309|     39|                }
  310|     39|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     39|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  311|     39|            }
  312|  11.3k|            break;
  313|  42.2k|        case await_attr:
  ------------------
  |  Branch (313:9): [True: 42.2k, False: 567k]
  ------------------
  314|  42.2k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (314:17): [True: 211, False: 42.0k]
  ------------------
  315|    211|                continue;
  316|    211|            }
  317|  42.0k|            if (*cp == '"') {
  ------------------
  |  Branch (317:17): [True: 41.7k, False: 298]
  ------------------
  318|  41.7k|                state = in_attr;
  319|  41.7k|                pattr = attrbuf;
  320|  41.7k|                if (NULL != end) {
  ------------------
  |  Branch (320:21): [True: 7.70k, False: 34.0k]
  ------------------
  321|  7.70k|                    *end = cp;
  322|  7.70k|                }
  323|  41.7k|            } else if (*cp == '}') {
  ------------------
  |  Branch (323:24): [True: 204, False: 94]
  ------------------
  324|    204|                break;
  325|    204|            } else {
  326|     94|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     94|    do {                                              \
  |  |  109|     94|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     94|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 94]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 94]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     94|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     94|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 94]
  |  |  ------------------
  ------------------
  327|     94|                          "Non-WS when expecting attribute.\n");
  328|     94|                if (NULL != end) {
  ------------------
  |  Branch (328:21): [True: 2, False: 92]
  ------------------
  329|      2|                    *end = cp;
  330|      2|                }
  331|     94|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|     94|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  332|     94|            }
  333|  41.7k|            break;
  334|   179k|        case in_attr:
  ------------------
  |  Branch (334:9): [True: 179k, False: 430k]
  ------------------
  335|   179k|            if (NULL == pattr) {
  ------------------
  |  Branch (335:17): [True: 0, False: 179k]
  ------------------
  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|   179k|            if (*cp == '"') {
  ------------------
  |  Branch (339:17): [True: 41.6k, False: 137k]
  ------------------
  340|  41.6k|                *pattr++ = '\0';
  341|  41.6k|                json_debug_trace(1, "json: Collected attribute name %s\n",
  ------------------
  |  |  108|  41.6k|    do {                                              \
  |  |  109|  41.6k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  41.6k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 41.6k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 41.6k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  41.6k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  41.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 41.6k]
  |  |  ------------------
  ------------------
  342|  41.6k|                                  attrbuf);
  343|   480k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (343:38): [True: 480k, False: 98]
  ------------------
  344|   480k|                    json_debug_trace(2, "json: Checking against %s\n",
  ------------------
  |  |  108|   480k|    do {                                              \
  |  |  109|   480k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   480k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 480k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 480k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   480k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   480k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 480k]
  |  |  ------------------
  ------------------
  345|   480k|                                      cursor->attribute);
  346|   480k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (346:25): [True: 28.0k, False: 452k]
  ------------------
  347|  28.0k|                        break;
  348|  28.0k|                    }
  349|   452k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (349:25): [True: 13.7k, False: 438k]
  ------------------
  350|  13.7k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (350:25): [True: 13.4k, False: 241]
  ------------------
  351|  13.4k|                        break;
  352|  13.4k|                    }
  353|   452k|                }
  354|  41.6k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (354:21): [True: 98, False: 41.5k]
  ------------------
  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|  41.5k|                state = await_value;
  363|  41.5k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (363:21): [True: 1.09k, False: 40.4k]
  ------------------
  364|  1.09k|                    maxlen = (int)cursor->len - 1;
  365|  40.4k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (365:28): [True: 2.14k, False: 38.3k]
  ------------------
  366|  2.14k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  2.14k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  367|  38.3k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (367:28): [True: 3.12k, False: 35.2k]
  ------------------
  368|  35.2k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (368:28): [True: 19.6k, False: 15.5k]
  ------------------
  369|  22.7k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  22.7k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  370|  22.7k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (370:28): [True: 448, False: 15.1k]
  ------------------
  371|    448|                    maxlen = (int)sizeof(valbuf) - 1;
  372|    448|                }
  373|  41.5k|                pval = valbuf;
  374|   137k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   137k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (374:24): [True: 24, False: 137k]
  ------------------
  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|   137k|            } else {
  379|   137k|                *pattr++ = *cp;
  380|   137k|            }
  381|   179k|            break;
  382|   179k|        case await_value:
  ------------------
  |  Branch (382:9): [True: 43.9k, False: 565k]
  ------------------
  383|  43.9k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (383:17): [True: 208, False: 43.7k]
  ------------------
  384|  43.7k|                *cp == ':') {
  ------------------
  |  Branch (384:17): [True: 2.31k, False: 41.4k]
  ------------------
  385|  2.52k|                continue;
  386|  2.52k|            }
  387|  41.4k|            if (*cp == '[') {
  ------------------
  |  Branch (387:17): [True: 2.92k, False: 38.5k]
  ------------------
  388|  2.92k|                if (cursor->type == t_ignore) {
  ------------------
  |  Branch (388:21): [True: 1.79k, False: 1.13k]
  ------------------
  389|       |                    /* skip to terminating ], not being fooled by
  390|       |                     * sub arrays, etc.
  391|       |                     * FIXME:  someday  */
  392|  1.79k|                    state = in_ignore_array;;
  393|  1.79k|                    value_quoted = false;
  394|  1.79k|                    break;
  395|  1.79k|                }
  396|  1.13k|                if (cursor->type != t_array) {
  ------------------
  |  Branch (396:21): [True: 29, False: 1.10k]
  ------------------
  397|     29|                    json_debug_trace(1,"json: %s",
  ------------------
  |  |  108|     29|    do {                                              \
  |  |  109|     29|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     29|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 29]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 29]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     29|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     29|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 29]
  |  |  ------------------
  ------------------
  398|     29|                                      "Saw [ when not expecting array.\n");
  399|     29|                    if (NULL != end) {
  ------------------
  |  Branch (399:25): [True: 2, False: 27]
  ------------------
  400|      2|                        *end = cp;
  401|      2|                    }
  402|     29|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|     29|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  403|     29|                }
  404|  1.10k|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  405|  1.10k|                if (substatus != 0) {
  ------------------
  |  Branch (405:21): [True: 323, False: 781]
  ------------------
  406|    323|                    return substatus;
  407|    323|                }
  408|    781|                state = post_element;
  409|  38.5k|            } else if (cursor->type == t_array) {
  ------------------
  |  Branch (409:24): [True: 1, False: 38.5k]
  ------------------
  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|  38.5k|            } else if (*cp == '"') {
  ------------------
  |  Branch (416:24): [True: 9.60k, False: 28.9k]
  ------------------
  417|  9.60k|                value_quoted = true;
  418|  9.60k|                state = in_val_string;
  419|  9.60k|                pval = valbuf;
  420|  28.9k|            } else {
  421|  28.9k|                value_quoted = false;
  422|  28.9k|                state = in_val_token;
  423|  28.9k|                pval = valbuf;
  424|  28.9k|                *pval++ = *cp;
  425|  28.9k|            }
  426|  39.3k|            break;
  427|   114k|        case in_ignore_array:
  ------------------
  |  Branch (427:9): [True: 114k, False: 495k]
  ------------------
  428|   114k|            if (*cp == '"') {
  ------------------
  |  Branch (428:17): [True: 30.1k, False: 84.2k]
  ------------------
  429|  30.1k|                if (value_quoted == false) {
  ------------------
  |  Branch (429:21): [True: 15.1k, False: 15.0k]
  ------------------
  430|       |                    // now in quotes
  431|  15.1k|                    value_quoted = true;
  432|  15.1k|                } else {
  433|  15.0k|                    value_quoted = false;
  434|  15.0k|                }
  435|  84.2k|            } else if (*cp == ']') {
  ------------------
  |  Branch (435:24): [True: 1.73k, False: 82.4k]
  ------------------
  436|       |                // FIXME: does not handle sub arrays, etc.
  437|  1.73k|                if (value_quoted == false) {
  ------------------
  |  Branch (437:21): [True: 1.39k, False: 342]
  ------------------
  438|  1.39k|                    state = post_val;
  439|  1.39k|                }
  440|       |                // else in quotes, ignore it.
  441|  1.73k|            }
  442|   114k|            break;
  443|  75.9k|        case in_val_string:
  ------------------
  |  Branch (443:9): [True: 75.9k, False: 533k]
  ------------------
  444|  75.9k|            if (NULL == pval) {
  ------------------
  |  Branch (444:17): [True: 0, False: 75.9k]
  ------------------
  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|  75.9k|            if (*cp == '\\') {
  ------------------
  |  Branch (448:17): [True: 1.69k, False: 74.2k]
  ------------------
  449|  1.69k|                state = in_escape;
  450|  74.2k|            } else if (*cp == '"') {
  ------------------
  |  Branch (450:24): [True: 9.16k, False: 65.0k]
  ------------------
  451|  9.16k|                *pval++ = '\0';
  452|  9.16k|                json_debug_trace(1, "json: Collected string value %s\n", valbuf);
  ------------------
  |  |  108|  9.16k|    do {                                              \
  |  |  109|  9.16k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  9.16k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9.16k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9.16k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  9.16k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  9.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9.16k]
  |  |  ------------------
  ------------------
  453|  9.16k|                state = post_val;
  454|  65.0k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  65.0k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (454:24): [True: 3, False: 65.0k]
  ------------------
  455|  65.0k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (455:24): [True: 115, False: 64.9k]
  ------------------
  456|    118|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|    118|    do {                                              \
  |  |  109|    118|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    118|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 118]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 118]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    118|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    118|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 118]
  |  |  ------------------
  ------------------
  457|       |                // don't update end here, leave at value start
  458|    118|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|    118|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  459|  64.9k|            } else {
  460|  64.9k|                *pval++ = *cp;
  461|  64.9k|            }
  462|  75.8k|            break;
  463|  75.8k|        case in_escape:
  ------------------
  |  Branch (463:9): [True: 1.68k, False: 607k]
  ------------------
  464|  1.68k|            if (NULL == pval) {
  ------------------
  |  Branch (464:17): [True: 0, False: 1.68k]
  ------------------
  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.68k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  1.68k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (468:17): [True: 3, False: 1.68k]
  ------------------
  469|  1.68k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (469:17): [True: 6, False: 1.67k]
  ------------------
  470|      9|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|      9|    do {                                              \
  |  |  109|      9|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      9|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      9|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      9|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9]
  |  |  ------------------
  ------------------
  471|       |                // don't update end here, leave at value start
  472|      9|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|      9|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  473|      9|            }
  474|  1.67k|            switch (*cp) {
  475|    198|            case 'b':
  ------------------
  |  Branch (475:13): [True: 198, False: 1.47k]
  ------------------
  476|    198|                *pval++ = '\b';
  477|    198|                break;
  478|    200|            case 'f':
  ------------------
  |  Branch (478:13): [True: 200, False: 1.47k]
  ------------------
  479|    200|                *pval++ = '\f';
  480|    200|                break;
  481|    201|            case 'n':
  ------------------
  |  Branch (481:13): [True: 201, False: 1.47k]
  ------------------
  482|    201|                *pval++ = '\n';
  483|    201|                break;
  484|    202|            case 'r':
  ------------------
  |  Branch (484:13): [True: 202, False: 1.47k]
  ------------------
  485|    202|                *pval++ = '\r';
  486|    202|                break;
  487|    383|            case 't':
  ------------------
  |  Branch (487:13): [True: 383, False: 1.29k]
  ------------------
  488|    383|                *pval++ = '\t';
  489|    383|                break;
  490|    277|            case 'u':
  ------------------
  |  Branch (490:13): [True: 277, False: 1.40k]
  ------------------
  491|    277|                {
  492|    277|                    unsigned n;
  493|       |
  494|    277|                    cp++;                   // skip the 'u'
  495|       |                    // NetBSD 6 wants the cast
  496|  1.12k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (496:33): [True: 933, False: 194]
  |  Branch (496:42): [True: 850, False: 83]
  ------------------
  497|    850|                        uescape[n] = *cp++;
  498|    850|                    }
  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|    216|            default:            // handles double quote and solidus
  ------------------
  |  Branch (510:13): [True: 216, False: 1.46k]
  ------------------
  511|    216|                *pval++ = *cp;
  512|    216|                break;
  513|  1.67k|            }
  514|  1.59k|            state = in_val_string;
  515|  1.59k|            break;
  516|   100k|        case in_val_token:
  ------------------
  |  Branch (516:9): [True: 100k, False: 508k]
  ------------------
  517|   100k|            if (NULL == pval) {
  ------------------
  |  Branch (517:17): [True: 0, False: 100k]
  ------------------
  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|   100k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (521:17): [True: 329, False: 100k]
  ------------------
  522|   100k|                *cp == ',' ||
  ------------------
  |  Branch (522:17): [True: 22.1k, False: 78.1k]
  ------------------
  523|  78.1k|                *cp == '}') {
  ------------------
  |  Branch (523:17): [True: 6.24k, False: 71.9k]
  ------------------
  524|  28.7k|                *pval = '\0';
  525|  28.7k|                json_debug_trace(1, "json: Collected token valuen %s\n",
  ------------------
  |  |  108|  28.7k|    do {                                              \
  |  |  109|  28.7k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  28.7k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 28.7k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 28.7k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  28.7k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  28.7k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 28.7k]
  |  |  ------------------
  ------------------
  526|  28.7k|                                 valbuf);
  527|  28.7k|                state = post_val;
  528|  28.7k|                if (*cp == '}' ||
  ------------------
  |  Branch (528:21): [True: 6.24k, False: 22.4k]
  ------------------
  529|  28.4k|                    *cp == ',') {
  ------------------
  |  Branch (529:21): [True: 22.1k, False: 329]
  ------------------
  530|  28.4k|                    --cp;
  531|  28.4k|                }
  532|  71.9k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|  71.9k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (532:24): [True: 6, False: 71.9k]
  ------------------
  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|  71.9k|            } else {
  537|  71.9k|                *pval++ = *cp;
  538|  71.9k|            }
  539|   100k|            break;
  540|       |            // coverity[unterminated_case]
  541|   100k|        case post_val:
  ------------------
  |  Branch (541:9): [True: 38.1k, False: 571k]
  ------------------
  542|       |            // Ignore whitespace after either string or token values.
  543|  38.1k|	  if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (543:8): [True: 237, False: 37.8k]
  ------------------
  544|    871|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (544:24): [True: 857, False: 14]
  |  Branch (544:39): [True: 634, False: 223]
  ------------------
  545|    634|                    ++cp;
  546|    634|                }
  547|    237|                json_debug_trace(1,
  ------------------
  |  |  108|    237|    do {                                              \
  |  |  109|    237|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    237|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 237]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 237]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    237|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    237|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 237]
  |  |  ------------------
  ------------------
  548|    237|                    "json: Skipped trailing whitespace: value \"%s\"\n", valbuf);
  549|    237|            }
  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|  38.1k|            for (;;) {
  559|  38.1k|                int seeking = cursor->type;
  560|       |
  561|  38.1k|                if (value_quoted &&
  ------------------
  |  Branch (561:21): [True: 8.05k, False: 30.0k]
  ------------------
  562|  8.05k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (562:22): [True: 1.05k, False: 6.99k]
  ------------------
  563|  6.99k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (563:22): [True: 2.17k, False: 4.81k]
  ------------------
  564|  3.23k|                    break;
  565|  3.23k|                }
  566|  34.8k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (566:22): [True: 2.12k, False: 32.7k]
  ------------------
  567|  32.7k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (567:22): [True: 195, False: 32.5k]
  ------------------
  568|  2.32k|                    seeking == t_boolean) {
  ------------------
  |  Branch (568:21): [True: 1.82k, False: 495]
  ------------------
  569|  1.82k|                    break;
  570|  1.82k|                }
  571|  33.0k|                if (isdigit((unsigned char) valbuf[0])) {
  ------------------
  |  Branch (571:21): [True: 17.4k, False: 15.5k]
  ------------------
  572|  17.4k|                    bool decimal = strchr(valbuf, '.') != NULL;
  573|       |
  574|  17.4k|                    if (decimal &&
  ------------------
  |  Branch (574:25): [True: 843, False: 16.6k]
  ------------------
  575|    843|                        seeking == t_real) {
  ------------------
  |  Branch (575:25): [True: 208, False: 635]
  ------------------
  576|    208|                        break;
  577|    208|                    }
  578|  17.2k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (578:25): [True: 16.6k, False: 635]
  |  Branch (578:38): [True: 194, False: 16.4k]
  ------------------
  579|  16.4k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (579:38): [True: 329, False: 16.1k]
  ------------------
  580|  16.1k|                                     seeking == t_integer ||
  ------------------
  |  Branch (580:38): [True: 1.16k, False: 14.9k]
  ------------------
  581|  14.9k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (581:38): [True: 732, False: 14.2k]
  ------------------
  582|  14.2k|                                     seeking == t_longint ||
  ------------------
  |  Branch (582:38): [True: 617, False: 13.5k]
  ------------------
  583|  13.5k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (583:38): [True: 403, False: 13.1k]
  ------------------
  584|  13.1k|                                     seeking == t_time ||
  ------------------
  |  Branch (584:38): [True: 285, False: 12.9k]
  ------------------
  585|  12.9k|                                     seeking == t_short ||
  ------------------
  |  Branch (585:38): [True: 1.85k, False: 11.0k]
  ------------------
  586|  11.0k|                                     seeking == t_ushort))
  ------------------
  |  Branch (586:38): [True: 0, False: 11.0k]
  ------------------
  587|  5.57k|                        break;
  588|  17.2k|                }
  589|  27.2k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (589:21): [True: 18.9k, False: 8.35k]
  ------------------
  590|  18.9k|                    break;
  591|  18.9k|                }
  592|  8.35k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (592:21): [True: 8.35k, False: 0]
  ------------------
  593|  8.35k|                    break;
  594|  8.35k|                }
  595|      0|                ++cursor;
  596|      0|            }
  597|  38.1k|            if (value_quoted &&
  ------------------
  |  Branch (597:17): [True: 8.05k, False: 30.0k]
  ------------------
  598|  8.05k|                (cursor->type != t_string &&
  ------------------
  |  Branch (598:18): [True: 6.99k, False: 1.05k]
  ------------------
  599|  6.99k|                 cursor->type != t_character &&
  ------------------
  |  Branch (599:18): [True: 6.79k, False: 200]
  ------------------
  600|  6.79k|                 cursor->type != t_check &&
  ------------------
  |  Branch (600:18): [True: 6.08k, False: 708]
  ------------------
  601|  6.08k|                 cursor->type != t_time &&
  ------------------
  |  Branch (601:18): [True: 3.90k, False: 2.17k]
  ------------------
  602|  3.90k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (602:18): [True: 463, False: 3.44k]
  ------------------
  603|    463|                 cursor->map == 0)) {
  ------------------
  |  Branch (603:18): [True: 23, False: 440]
  ------------------
  604|     23|                json_debug_trace(1, "json: %s", "Saw quoted value when expecting"
  ------------------
  |  |  108|     23|    do {                                              \
  |  |  109|     23|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     23|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 23]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 23]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     23|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     23|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 23]
  |  |  ------------------
  ------------------
  605|     23|                                  " non-string.\n");
  606|     23|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     23|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  607|     23|            }
  608|  38.0k|            if (!value_quoted &&
  ------------------
  |  Branch (608:17): [True: 30.0k, False: 8.02k]
  ------------------
  609|  30.0k|                (cursor->type == t_string ||
  ------------------
  |  Branch (609:18): [True: 22, False: 30.0k]
  ------------------
  610|  30.0k|                 cursor->type == t_check ||
  ------------------
  |  Branch (610:18): [True: 31, False: 30.0k]
  ------------------
  611|  30.0k|                 cursor->map != 0)) {
  ------------------
  |  Branch (611:18): [True: 7, False: 30.0k]
  ------------------
  612|     60|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     60|    do {                                              \
  |  |  109|     60|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     60|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 60]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 60]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     60|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     60|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 60]
  |  |  ------------------
  ------------------
  613|     60|                                 "Didn't see quoted value when expecting"
  614|     60|                                 " string.\n");
  615|     60|                return JSON_ERR_NONQSTRING;
  ------------------
  |  |  171|     60|#define JSON_ERR_NONQSTRING    20      // no quoted value when expecting string
  ------------------
  616|     60|            }
  617|  38.0k|            if (cursor->map != 0) {
  ------------------
  |  Branch (617:17): [True: 440, False: 37.5k]
  ------------------
  618|    887|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (618:40): [True: 821, False: 66]
  ------------------
  619|    821|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (619:25): [True: 374, False: 447]
  ------------------
  620|    374|                        goto foundit;
  621|    374|                    }
  622|     66|                json_debug_trace(1,
  ------------------
  |  |  108|     66|    do {                                              \
  |  |  109|     66|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     66|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 66]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 66]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     66|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     66|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 66]
  |  |  ------------------
  ------------------
  623|     66|                                 "json: Invalid enumerated value string %s.\n",
  624|     66|                                  valbuf);
  625|     66|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     66|#define JSON_ERR_BADENUM       18      // invalid enumerated value
  ------------------
  626|    374|              foundit:
  627|    374|                (void)snprintf(valbuf, sizeof(valbuf), "%d", mp->value);
  628|    374|            }
  629|  37.9k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (629:17): [True: 708, False: 37.2k]
  ------------------
  630|    708|                lptr = cursor->dflt.check;
  631|  37.2k|            } else {
  632|  37.2k|                lptr = json_target_address(cursor, parent, offset);
  633|  37.2k|            }
  634|  37.9k|            if (NULL != lptr) {
  ------------------
  |  Branch (634:17): [True: 22.2k, False: 15.6k]
  ------------------
  635|  22.2k|                switch (cursor->type) {
  ------------------
  |  Branch (635:25): [True: 22.2k, False: 0]
  ------------------
  636|    228|                case t_byte:
  ------------------
  |  Branch (636:17): [True: 228, False: 22.0k]
  ------------------
  637|    228|                    {
  638|    228|                        int tmp = atoi(valbuf);
  639|    228|                        lptr[0] = (char)tmp;
  640|    228|                    }
  641|    228|                    break;
  642|    660|                case t_ubyte:
  ------------------
  |  Branch (642:17): [True: 660, False: 21.6k]
  ------------------
  643|    660|                    {
  644|    660|                        int tmp = atoi(valbuf);
  645|    660|                        lptr[0] = (unsigned char)tmp;
  646|    660|                    }
  647|    660|                    break;
  648|  1.71k|                case t_integer:
  ------------------
  |  Branch (648:17): [True: 1.71k, False: 20.5k]
  ------------------
  649|  1.71k|                    {
  650|  1.71k|                        int tmp = atoi(valbuf);
  651|  1.71k|                        memcpy(lptr, &tmp, sizeof(int));
  652|  1.71k|                    }
  653|  1.71k|                    break;
  654|  1.04k|                case t_uinteger:
  ------------------
  |  Branch (654:17): [True: 1.04k, False: 21.2k]
  ------------------
  655|  1.04k|                    {
  656|  1.04k|                        unsigned int tmp = (unsigned int)atol(valbuf);
  657|  1.04k|                        memcpy(lptr, &tmp, sizeof(unsigned int));
  658|  1.04k|                    }
  659|  1.04k|                    break;
  660|    635|                case t_longint:
  ------------------
  |  Branch (660:17): [True: 635, False: 21.6k]
  ------------------
  661|    635|                    {
  662|    635|                        long tmp = atol(valbuf);
  663|    635|                        memcpy(lptr, &tmp, sizeof(long));
  664|    635|                    }
  665|    635|                    break;
  666|    424|                case t_ulongint:
  ------------------
  |  Branch (666:17): [True: 424, False: 21.8k]
  ------------------
  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.87k|                case t_short:
  ------------------
  |  Branch (672:17): [True: 1.87k, False: 20.4k]
  ------------------
  673|  1.87k|                    {
  674|  1.87k|                        short tmp = atoi(valbuf);
  675|  1.87k|                        memcpy(lptr, &tmp, sizeof(short));
  676|  1.87k|                    }
  677|  1.87k|                    break;
  678|      0|                case t_ushort:
  ------------------
  |  Branch (678:17): [True: 0, False: 22.2k]
  ------------------
  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|  3.11k|                case t_time:
  ------------------
  |  Branch (684:17): [True: 3.11k, False: 19.1k]
  ------------------
  685|  3.11k|                    {
  686|  3.11k|                        timespec_t ts_tmp = {0, 0};
  687|       |
  688|  3.11k|                        if (value_quoted) {
  ------------------
  |  Branch (688:29): [True: 2.17k, False: 939]
  ------------------
  689|  2.17k|                            ts_tmp = iso8601_to_timespec(valbuf);
  690|  2.17k|                        } else if (NULL == strchr(valbuf, '.')) {
  ------------------
  |  Branch (690:36): [True: 347, False: 592]
  ------------------
  691|       |                            // integer
  692|    347|                            ts_tmp.tv_sec = (time_t)atoll(valbuf);
  693|    592|                        } else {
  694|       |                            // real
  695|    592|                            double sec_tmp = safe_atof(valbuf);
  696|    592|                            if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (696:33): [True: 397, False: 195]
  ------------------
  697|    397|                                DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    397|    do { \
  |  |  145|    397|        double int_part; \
  |  |  146|    397|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    397|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    397|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 397]
  |  |  ------------------
  ------------------
  698|    397|                            }  // else, leave at default
  699|    592|                        }
  700|  3.11k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  701|  3.11k|                    }
  702|  3.11k|                    break;
  703|    389|                case t_timespec:
  ------------------
  |  Branch (703:17): [True: 389, False: 21.8k]
  ------------------
  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.54k|                case t_real:
  ------------------
  |  Branch (713:17): [True: 4.54k, False: 17.7k]
  ------------------
  714|  4.54k|                    {
  715|  4.54k|                        double tmp = safe_atof(valbuf);
  716|  4.54k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (716:29): [True: 3.66k, False: 880]
  ------------------
  717|  3.66k|                            memcpy(lptr, &tmp, sizeof(double));
  718|  3.66k|                        } // else leave at .dflt
  719|  4.54k|                    }
  720|  4.54k|                    break;
  721|  1.05k|                case t_string:
  ------------------
  |  Branch (721:17): [True: 1.05k, False: 21.2k]
  ------------------
  722|  1.05k|                    if (NULL != parent &&
  ------------------
  |  Branch (722:25): [True: 388, False: 668]
  ------------------
  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|  2.21k|                case t_boolean:
  ------------------
  |  Branch (729:17): [True: 2.21k, False: 20.0k]
  ------------------
  730|  2.21k|                    {
  731|  2.21k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  732|  2.21k|                        memcpy(lptr, &tmp, sizeof(bool));
  733|  2.21k|                    }
  734|  2.21k|                    break;
  735|    563|                case t_character:
  ------------------
  |  Branch (735:17): [True: 563, False: 21.7k]
  ------------------
  736|    563|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (736:25): [True: 9, False: 554]
  ------------------
  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|    554|                    } else {
  740|    554|                        lptr[0] = valbuf[0];
  741|    554|                    }
  742|    554|                    break;
  743|  3.11k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (743:17): [True: 3.11k, False: 19.1k]
  ------------------
  744|  3.11k|                    FALLTHROUGH
  ------------------
  |  |   55|  3.11k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  745|  3.11k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (745:17): [True: 0, False: 22.2k]
  ------------------
  746|  3.11k|                    FALLTHROUGH
  ------------------
  |  |   55|  3.11k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  747|  3.11k|                case t_structobject:
  ------------------
  |  Branch (747:17): [True: 0, False: 22.2k]
  ------------------
  748|  3.11k|                    FALLTHROUGH
  ------------------
  |  |   55|  3.11k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  749|  3.11k|                case t_array:
  ------------------
  |  Branch (749:17): [True: 0, False: 22.2k]
  ------------------
  750|  3.11k|                    break;
  751|    708|                case t_check:
  ------------------
  |  Branch (751:17): [True: 708, False: 21.5k]
  ------------------
  752|    708|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (752:25): [True: 173, False: 535]
  ------------------
  753|    173|                        json_debug_trace(1, "json: Required attribute value %s"
  ------------------
  |  |  108|    173|    do {                                              \
  |  |  109|    173|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    173|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 173]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 173]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    173|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    173|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 173]
  |  |  ------------------
  ------------------
  754|    173|                                          " not present.\n",
  755|    173|                                          cursor->dflt.check);
  756|       |                        // don't update end here, leave at start of attribute
  757|    173|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    173|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  758|    173|                    }
  759|    535|                    break;
  760|  22.2k|                }
  761|  22.2k|            }
  762|  37.7k|            FALLTHROUGH
  ------------------
  |  |   55|  37.7k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  763|  38.7k|        case post_element:
  ------------------
  |  Branch (763:9): [True: 980, False: 608k]
  ------------------
  764|  38.7k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (764:17): [True: 248, False: 38.5k]
  ------------------
  765|    248|                continue;
  766|    248|            }
  767|  38.5k|            if (*cp == ',') {
  ------------------
  |  Branch (767:17): [True: 31.3k, False: 7.15k]
  ------------------
  768|  31.3k|                state = await_attr;
  769|  31.3k|            } else if (*cp == '}') {
  ------------------
  |  Branch (769:24): [True: 6.62k, False: 534]
  ------------------
  770|  6.62k|                ++cp;
  771|  6.62k|                goto good_parse;
  772|  6.62k|            } else {
  773|    534|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|    534|    do {                                              \
  |  |  109|    534|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    534|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 534]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 534]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    534|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    534|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 534]
  |  |  ------------------
  ------------------
  774|    534|                                "Garbage while expecting comma or }\n");
  775|    534|                if (NULL != end) {
  ------------------
  |  Branch (775:21): [True: 27, False: 507]
  ------------------
  776|     27|                    *end = cp;
  777|     27|                }
  778|    534|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    534|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  779|    534|            }
  780|  31.3k|            break;
  781|   609k|        }
  782|   609k|    }
  783|  3.12k|    if (state == init) {
  ------------------
  |  Branch (783:9): [True: 47, False: 3.08k]
  ------------------
  784|     47|        json_debug_trace(1, "json: %s", "Input was empty or white-space only\n");
  ------------------
  |  |  108|     47|    do {                                              \
  |  |  109|     47|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     47|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 47]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 47]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     47|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     47|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 47]
  |  |  ------------------
  ------------------
  785|     47|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     47|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  786|     47|    }
  787|       |
  788|  9.70k|  good_parse:
  789|       |    // in case there's another object following, consume trailing WS
  790|  9.70k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (790:12): [True: 204, False: 9.70k]
  ------------------
  791|    204|        ++cp;
  792|    204|    }
  793|  9.70k|    if (NULL != end) {
  ------------------
  |  Branch (793:9): [True: 6.13k, False: 3.57k]
  ------------------
  794|  6.13k|        *end = cp;
  795|  6.13k|    }
  796|  9.70k|    json_debug_trace(1, "%s", "json: JSON parse ends.\n");
  ------------------
  |  |  108|  9.70k|    do {                                              \
  |  |  109|  9.70k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  9.70k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9.70k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9.70k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  9.70k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  9.70k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9.70k]
  |  |  ------------------
  ------------------
  797|  9.70k|    return 0;
  798|  3.12k|}
json.c:json_target_address:
  119|   202k|{
  120|   202k|    char *targetaddr = NULL;
  121|   202k|    if (NULL == parent ||
  ------------------
  |  Branch (121:9): [True: 104k, False: 98.3k]
  ------------------
  122|   104k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (122:9): [True: 0, False: 98.3k]
  ------------------
  123|       |        // ordinary case - use the address in the cursor structure
  124|   104k|        switch (cursor->type) {
  125|      0|        case t_byte:
  ------------------
  |  Branch (125:9): [True: 0, False: 104k]
  ------------------
  126|      0|            targetaddr = (char *)&cursor->addr.byte[offset];
  127|      0|            break;
  128|    698|        case t_ubyte:
  ------------------
  |  Branch (128:9): [True: 698, False: 103k]
  ------------------
  129|    698|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  130|    698|            break;
  131|  20.2k|        case t_ignore:
  ------------------
  |  Branch (131:9): [True: 20.2k, False: 83.7k]
  ------------------
  132|  20.2k|            targetaddr = NULL;
  133|  20.2k|            break;
  134|  18.2k|        case t_integer:
  ------------------
  |  Branch (134:9): [True: 18.2k, False: 85.7k]
  ------------------
  135|  18.2k|            targetaddr = (char *)&cursor->addr.integer[offset];
  136|  18.2k|            break;
  137|  6.25k|        case t_uinteger:
  ------------------
  |  Branch (137:9): [True: 6.25k, False: 97.7k]
  ------------------
  138|  6.25k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  139|  6.25k|            break;
  140|  1.57k|        case t_longint:
  ------------------
  |  Branch (140:9): [True: 1.57k, False: 102k]
  ------------------
  141|  1.57k|            targetaddr = (char *)&cursor->addr.longint[offset];
  142|  1.57k|            break;
  143|    544|        case t_ulongint:
  ------------------
  |  Branch (143:9): [True: 544, False: 103k]
  ------------------
  144|    544|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  145|    544|            break;
  146|      0|        case t_short:
  ------------------
  |  Branch (146:9): [True: 0, False: 104k]
  ------------------
  147|      0|            targetaddr = (char *)&cursor->addr.shortint[offset];
  148|      0|            break;
  149|      0|        case t_ushort:
  ------------------
  |  Branch (149:9): [True: 0, False: 104k]
  ------------------
  150|      0|            targetaddr = (char *)&cursor->addr.ushortint[offset];
  151|      0|            break;
  152|  4.21k|        case t_time:
  ------------------
  |  Branch (152:9): [True: 4.21k, False: 99.8k]
  ------------------
  153|  4.21k|            targetaddr = (char *)&cursor->addr.ts[offset];
  154|  4.21k|            break;
  155|      0|        case t_timespec:
  ------------------
  |  Branch (155:9): [True: 0, False: 104k]
  ------------------
  156|      0|            targetaddr = (char *)&cursor->addr.ts[offset];
  157|      0|            break;
  158|  36.7k|        case t_real:
  ------------------
  |  Branch (158:9): [True: 36.7k, False: 67.2k]
  ------------------
  159|  36.7k|            targetaddr = (char *)&cursor->addr.real[offset];
  160|  36.7k|            break;
  161|  7.02k|        case t_string:
  ------------------
  |  Branch (161:9): [True: 7.02k, False: 96.9k]
  ------------------
  162|  7.02k|            targetaddr = cursor->addr.string;
  163|  7.02k|            break;
  164|  1.64k|        case t_boolean:
  ------------------
  |  Branch (164:9): [True: 1.64k, False: 102k]
  ------------------
  165|  1.64k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  166|  1.64k|            break;
  167|  1.06k|        case t_character:
  ------------------
  |  Branch (167:9): [True: 1.06k, False: 102k]
  ------------------
  168|  1.06k|            targetaddr = (char *)&cursor->addr.character[offset];
  169|  1.06k|            break;
  170|    651|        case t_array:
  ------------------
  |  Branch (170:9): [True: 651, False: 103k]
  ------------------
  171|    651|            FALLTHROUGH
  ------------------
  |  |   55|    651|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  172|  5.80k|        case t_check:
  ------------------
  |  Branch (172:9): [True: 5.15k, False: 98.8k]
  ------------------
  173|  5.80k|            FALLTHROUGH
  ------------------
  |  |   55|  5.80k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  174|  5.80k|        case t_object:
  ------------------
  |  Branch (174:9): [True: 0, False: 104k]
  ------------------
  175|  5.80k|            FALLTHROUGH
  ------------------
  |  |   55|  5.80k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  176|  5.80k|        case t_structobject:
  ------------------
  |  Branch (176:9): [True: 0, False: 104k]
  ------------------
  177|  5.80k|            FALLTHROUGH
  ------------------
  |  |   55|  5.80k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  178|  5.80k|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 104k]
  ------------------
  179|  5.80k|            targetaddr = NULL;
  180|  5.80k|            break;
  181|   104k|        }
  182|   104k|    } else {
  183|       |        // tricky case - hacking a member in an array of structures
  184|  98.3k|        targetaddr =
  185|  98.3k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  186|  98.3k|            cursor->addr.offset;
  187|  98.3k|    }
  188|   202k|    json_debug_trace(1, "json: Target address for %s (offset %d) is %p\n",
  ------------------
  |  |  108|   202k|    do {                                              \
  |  |  109|   202k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   202k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 202k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 202k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   202k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   202k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 202k]
  |  |  ------------------
  ------------------
  189|   202k|                      cursor->attribute, offset, targetaddr);
  190|   202k|    return targetaddr;
  191|   202k|}

json_toff_read:
  677|  2.88k|{
  678|  2.88k|    int real_sec = 0, real_nsec = 0, clock_sec = 0, clock_nsec = 0;
  679|  2.88k|    const struct json_attr_t json_attrs_toff[] = {
  680|       |        // *INDENT-OFF*
  681|  2.88k|        {"class",     t_check,   .dflt.check = "TOFF"},
  682|  2.88k|        {"device",    t_string,  .addr.string = gpsdata->dev.path,
  683|  2.88k|                                 .len = sizeof(gpsdata->dev.path)},
  684|  2.88k|        {"real_sec",  t_integer, .addr.integer = &real_sec,
  685|  2.88k|                                 .dflt.integer = 0},
  686|  2.88k|        {"real_nsec", t_integer, .addr.integer = &real_nsec,
  687|  2.88k|                                 .dflt.integer = 0},
  688|  2.88k|        {"clock_sec", t_integer, .addr.integer = &clock_sec,
  689|  2.88k|                                 .dflt.integer = 0},
  690|  2.88k|        {"clock_nsec",t_integer, .addr.integer = &clock_nsec,
  691|  2.88k|                                 .dflt.integer = 0},
  692|       |        // ignore unknown keys, for cross-version compatibility
  693|  2.88k|        {"", t_ignore},
  694|  2.88k|        {NULL},
  695|       |        // *INDENT-ON*
  696|  2.88k|    };
  697|  2.88k|    int status;
  698|       |
  699|  2.88k|    memset(&gpsdata->toff, 0, sizeof(gpsdata->toff));
  700|  2.88k|    status = json_read_object(buf, json_attrs_toff, endptr);
  701|  2.88k|    gpsdata->toff.real.tv_sec = (time_t)real_sec;
  702|  2.88k|    gpsdata->toff.real.tv_nsec = (long)real_nsec;
  703|  2.88k|    gpsdata->toff.clock.tv_sec = (time_t)clock_sec;
  704|  2.88k|    gpsdata->toff.clock.tv_nsec = (long)clock_nsec;
  705|  2.88k|    if (status != 0)
  ------------------
  |  Branch (705:9): [True: 583, False: 2.30k]
  ------------------
  706|    583|        return status;
  707|       |
  708|  2.30k|    return status;
  709|  2.88k|}
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|     10|{
  759|     10|    bool running = false, reference = false, disciplined = false;
  760|     10|    int delta = 0;
  761|     10|    const struct json_attr_t json_attrs_osc[] = {
  762|       |        // *INDENT-OFF*
  763|     10|        {"class",       t_check,   .dflt.check = "OSC"},
  764|     10|        {"device",      t_string,  .addr.string = gpsdata->dev.path,
  765|     10|                                   .len = sizeof(gpsdata->dev.path)},
  766|     10|        {"running",     t_boolean, .addr.boolean = &running,
  767|     10|                                   .dflt.boolean = false},
  768|     10|        {"reference",   t_boolean, .addr.boolean = &reference,
  769|     10|                                   .dflt.boolean = false},
  770|     10|        {"disciplined", t_boolean, .addr.boolean = &disciplined,
  771|     10|                                   .dflt.boolean = false},
  772|     10|        {"delta",       t_integer, .addr.integer = &delta,
  773|     10|                                   .dflt.integer = 0},
  774|       |        // ignore unknown keys, for cross-version compatibility
  775|     10|        {"", t_ignore},
  776|     10|        {NULL},
  777|       |        // *INDENT-ON*
  778|     10|    };
  779|     10|    int status;
  780|       |
  781|     10|    memset(&gpsdata->osc, 0, sizeof(gpsdata->osc));
  782|     10|    status = json_read_object(buf, json_attrs_osc, endptr);
  783|       |
  784|     10|    gpsdata->osc.running = running;
  785|     10|    gpsdata->osc.reference = reference;
  786|     10|    gpsdata->osc.disciplined = disciplined;
  787|     10|    gpsdata->osc.delta = delta;
  788|       |
  789|     10|    return status;
  790|     10|}
libgps_json_unpack:
  810|  2.85k|{
  811|  2.85k|    int status;
  812|  2.85k|    const char *classtag = strstr(buf, "\"class\":");
  813|       |
  814|  2.85k|    if (NULL == classtag) {
  ------------------
  |  Branch (814:9): [True: 388, False: 2.47k]
  ------------------
  815|    388|        return -1;
  816|    388|    }
  817|       |
  818|  2.47k|    if (str_starts_with(classtag, "\"class\":\"TPV\"")) {
  ------------------
  |  Branch (818:9): [True: 468, False: 2.00k]
  ------------------
  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: 290, False: 178]
  ------------------
  822|    290|            gpsdata->set |= TIME_SET;
  ------------------
  |  | 2870|    290|#define TIME_SET        (1llu<<2)
  ------------------
  823|    290|        }
  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: 1, False: 467]
  ------------------
  828|      1|            gpsdata->set |= LATLON_SET;
  ------------------
  |  | 2872|      1|#define LATLON_SET      (1llu<<4)
  ------------------
  829|      1|        }
  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: 2, False: 463]
  ------------------
  834|      5|            gpsdata->set |= ALTITUDE_SET;
  ------------------
  |  | 2873|      5|#define ALTITUDE_SET    (1llu<<5)
  ------------------
  835|      5|        }
  836|    468|        if (0 != isfinite(gpsdata->fix.epx) &&
  ------------------
  |  Branch (836:13): [True: 2, False: 466]
  ------------------
  837|      2|            0 != isfinite(gpsdata->fix.epy)) {
  ------------------
  |  Branch (837:13): [True: 1, False: 1]
  ------------------
  838|      1|            gpsdata->set |= HERR_SET;
  ------------------
  |  | 2880|      1|#define HERR_SET        (1llu<<12)
  ------------------
  839|      1|        }
  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: 2, False: 466]
  ------------------
  860|      2|            gpsdata->set |= SPEEDERR_SET;
  ------------------
  |  | 2884|      2|#define SPEEDERR_SET    (1llu<<16)
  ------------------
  861|      2|        }
  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: 3, False: 465]
  ------------------
  892|      3|            (0 != isfinite(gpsdata->fix.ecef.vy)) &&
  ------------------
  |  Branch (892:13): [True: 2, False: 1]
  ------------------
  893|      2|            (0 != isfinite(gpsdata->fix.ecef.vz))) {
  ------------------
  |  Branch (893:13): [True: 1, False: 1]
  ------------------
  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|  2.00k|    if (str_starts_with(classtag, "\"class\":\"GST\"")) {
  ------------------
  |  Branch (899:9): [True: 316, False: 1.68k]
  ------------------
  900|    316|        status = json_noise_read(buf, gpsdata, end);
  901|    316|        if (PASS(status)) {
  ------------------
  |  |  800|    316|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    316|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    632|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 316]
  |  |  |  |  ------------------
  |  |  |  |  799|    316|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    316|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 315]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 294, False: 22]
  |  |  ------------------
  ------------------
  902|    294|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|    294|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|    294|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|    294|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|    294|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|    294|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|    294|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|    294|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|    294|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|    294|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|    294|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|    294|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|    294|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|    294|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|    294|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|    294|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|    294|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|    294|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  903|    294|            gpsdata->set |= GST_SET;
  ------------------
  |  | 2895|    294|#define GST_SET         (1llu<<27)
  ------------------
  904|    294|        }
  905|    316|        return FILTER(status);
  ------------------
  |  |  798|    316|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    632|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 316]
  |  |  ------------------
  |  |  799|    316|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    316|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 315]
  |  |  ------------------
  ------------------
  906|    316|    }
  907|  1.68k|    if (str_starts_with(classtag, "\"class\":\"SKY\"")) {
  ------------------
  |  Branch (907:9): [True: 175, False: 1.51k]
  ------------------
  908|    175|        status = json_sky_read(buf, gpsdata, end);
  909|    175|        return FILTER(status);
  ------------------
  |  |  798|    175|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    350|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 175]
  |  |  ------------------
  |  |  799|    175|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    175|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 174]
  |  |  ------------------
  ------------------
  910|    175|    }
  911|  1.51k|    if (str_starts_with(classtag, "\"class\":\"ATT\"")) {
  ------------------
  |  Branch (911:9): [True: 72, False: 1.43k]
  ------------------
  912|     72|        status = json_att_read(buf, gpsdata, end);
  913|     72|        if (PASS(status)) {
  ------------------
  |  |  800|     72|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     72|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    144|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 72]
  |  |  |  |  ------------------
  |  |  |  |  799|     72|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     72|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 71]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 35, False: 37]
  |  |  ------------------
  ------------------
  914|     35|            gpsdata->set |= ATTITUDE_SET;
  ------------------
  |  | 2882|     35|#define ATTITUDE_SET    (1llu<<14)
  ------------------
  915|     35|        }
  916|     72|        return FILTER(status);
  ------------------
  |  |  798|     72|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    144|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 72]
  |  |  ------------------
  |  |  799|     72|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     72|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 71]
  |  |  ------------------
  ------------------
  917|     72|    }
  918|  1.43k|    if (str_starts_with(classtag, "\"class\":\"IMU\"")) {
  ------------------
  |  Branch (918:9): [True: 48, False: 1.39k]
  ------------------
  919|     48|        status = json_imu_read(buf, gpsdata, end);
  920|     48|        if (PASS(status)) {
  ------------------
  |  |  800|     48|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     48|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     96|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 48]
  |  |  |  |  ------------------
  |  |  |  |  799|     48|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     48|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 2, False: 46]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 22, False: 26]
  |  |  ------------------
  ------------------
  921|     22|            gpsdata->set |= IMU_SET;
  ------------------
  |  | 2911|     22|#define IMU_SET         (1llu<<43)
  ------------------
  922|     22|        }
  923|     48|        return FILTER(status);
  ------------------
  |  |  798|     48|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     96|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 48]
  |  |  ------------------
  |  |  799|     48|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     48|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 2, False: 46]
  |  |  ------------------
  ------------------
  924|     48|    }
  925|  1.39k|    if (str_starts_with(classtag, "\"class\":\"DEVICES\"")) {
  ------------------
  |  Branch (925:9): [True: 78, False: 1.31k]
  ------------------
  926|     78|        status = json_devicelist_read(buf, gpsdata, end);
  927|     78|        if (PASS(status)) {
  ------------------
  |  |  800|     78|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     78|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    156|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 78]
  |  |  |  |  ------------------
  |  |  |  |  799|     78|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     78|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 77]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 6, False: 72]
  |  |  ------------------
  ------------------
  928|      6|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|      6|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|      6|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|      6|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|      6|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|      6|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|      6|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|      6|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|      6|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|      6|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|      6|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|      6|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|      6|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|      6|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|      6|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|      6|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|      6|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|      6|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  929|      6|            gpsdata->set |= DEVICELIST_SET;
  ------------------
  |  | 2888|      6|#define DEVICELIST_SET  (1llu<<20)
  ------------------
  930|      6|        }
  931|     78|        return FILTER(status);
  ------------------
  |  |  798|     78|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    156|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 78]
  |  |  ------------------
  |  |  799|     78|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     78|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 77]
  |  |  ------------------
  ------------------
  932|     78|    }
  933|  1.31k|    if (str_starts_with(classtag, "\"class\":\"DEVICE\"")) {
  ------------------
  |  Branch (933:9): [True: 18, False: 1.29k]
  ------------------
  934|     18|        status = json_device_read(buf, &gpsdata->dev, end);
  935|     18|        if (PASS(status))
  ------------------
  |  |  800|     18|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     18|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     36|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  |  |  799|     18|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     18|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 5, False: 13]
  |  |  ------------------
  ------------------
  936|      5|            gpsdata->set |= DEVICE_SET;
  ------------------
  |  | 2887|      5|#define DEVICE_SET      (1llu<<19)
  ------------------
  937|     18|        return FILTER(status);
  ------------------
  |  |  798|     18|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     36|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 18]
  |  |  ------------------
  |  |  799|     18|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     18|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 17]
  |  |  ------------------
  ------------------
  938|     18|    }
  939|  1.29k|    if (str_starts_with(classtag, "\"class\":\"WATCH\"")) {
  ------------------
  |  Branch (939:9): [True: 50, False: 1.24k]
  ------------------
  940|     50|        status = json_watch_read(buf, &gpsdata->policy, end);
  941|     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: 45, False: 5]
  |  |  ------------------
  ------------------
  942|     45|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     45|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     45|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     45|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     45|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     45|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     45|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     45|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     45|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     45|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     45|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     45|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     45|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     45|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     45|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     45|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     45|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     45|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  943|     45|            gpsdata->set |= POLICY_SET;
  ------------------
  |  | 2897|     45|#define POLICY_SET      (1llu<<29)
  ------------------
  944|     45|        }
  945|     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]
  |  |  ------------------
  ------------------
  946|     50|    }
  947|  1.24k|    if (str_starts_with(classtag, "\"class\":\"VERSION\"")) {
  ------------------
  |  Branch (947:9): [True: 16, False: 1.22k]
  ------------------
  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.22k|    if (str_starts_with(classtag, "\"class\":\"RTCM2\"")) {
  ------------------
  |  Branch (955:9): [True: 319, False: 910]
  ------------------
  956|    319|        status = json_rtcm2_read(buf,
  957|    319|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  958|    319|                                 &gpsdata->rtcm2, end);
  959|    319|        if (PASS(status)) {
  ------------------
  |  |  800|    319|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    319|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    638|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 37, False: 282]
  |  |  |  |  ------------------
  |  |  |  |  799|    319|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    282|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 281]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 133, False: 186]
  |  |  ------------------
  ------------------
  960|    133|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|    133|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|    133|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|    133|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|    133|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|    133|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|    133|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|    133|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|    133|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|    133|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|    133|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|    133|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|    133|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|    133|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|    133|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|    133|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|    133|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|    133|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  961|    133|            gpsdata->set |= RTCM2_SET;
  ------------------
  |  | 2890|    133|#define RTCM2_SET       (1llu<<22)
  ------------------
  962|    133|        }
  963|    319|        return FILTER(status);
  ------------------
  |  |  798|    319|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    638|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 37, False: 282]
  |  |  ------------------
  |  |  799|    319|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    282|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 281]
  |  |  ------------------
  ------------------
  964|    319|    }
  965|    910|    if (str_starts_with(classtag, "\"class\":\"RTCM3\"")) {
  ------------------
  |  Branch (965:9): [True: 127, False: 783]
  ------------------
  966|    127|        status = json_rtcm3_read(buf,
  967|    127|                                 gpsdata->dev.path, sizeof(gpsdata->dev.path),
  968|    127|                                 &gpsdata->rtcm3, end);
  969|    127|        if (PASS(status)) {
  ------------------
  |  |  800|    127|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    127|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    254|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 4, False: 123]
  |  |  |  |  ------------------
  |  |  |  |  799|    127|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    123|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 122]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 44, False: 83]
  |  |  ------------------
  ------------------
  970|     44|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     44|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     44|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     44|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     44|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     44|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     44|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     44|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     44|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     44|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     44|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     44|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     44|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     44|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     44|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     44|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     44|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     44|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  971|     44|            gpsdata->set |= RTCM3_SET;
  ------------------
  |  | 2891|     44|#define RTCM3_SET       (1llu<<23)
  ------------------
  972|     44|        }
  973|    127|        return FILTER(status);
  ------------------
  |  |  798|    127|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    254|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 4, False: 123]
  |  |  ------------------
  |  |  799|    127|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    123|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 122]
  |  |  ------------------
  ------------------
  974|    127|    }
  975|    783|#ifdef AIVDM_ENABLE
  976|    783|    if (str_starts_with(classtag, "\"class\":\"AIS\"")) {
  ------------------
  |  Branch (976:9): [True: 335, False: 448]
  ------------------
  977|    335|        status = json_ais_read(buf,
  978|    335|                               gpsdata->dev.path, sizeof(gpsdata->dev.path),
  979|    335|                               &gpsdata->ais, end);
  980|    335|        if (PASS(status)) {
  ------------------
  |  |  800|    335|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    335|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    670|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 41, False: 294]
  |  |  |  |  ------------------
  |  |  |  |  799|    335|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    294|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 2, False: 292]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 199, False: 136]
  |  |  ------------------
  ------------------
  981|    199|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|    199|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|    199|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|    199|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|    199|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|    199|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|    199|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|    199|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|    199|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|    199|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|    199|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|    199|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|    199|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|    199|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|    199|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|    199|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|    199|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|    199|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  982|    199|            gpsdata->set |= AIS_SET;
  ------------------
  |  | 2892|    199|#define AIS_SET         (1llu<<24)
  ------------------
  983|    199|        }
  984|    335|        return FILTER(status);
  ------------------
  |  |  798|    335|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    670|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 41, False: 294]
  |  |  ------------------
  |  |  799|    335|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    294|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 2, False: 292]
  |  |  ------------------
  ------------------
  985|    335|    }
  986|    448|#endif  // AIVDM_ENABLE
  987|    448|    if (str_starts_with(classtag, "\"class\":\"ERROR\"")) {
  ------------------
  |  Branch (987:9): [True: 10, False: 438]
  ------------------
  988|     10|        status = json_error_read(buf, gpsdata, end);
  989|     10|        if (PASS(status)) {
  ------------------
  |  |  800|     10|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     10|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     20|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  799|     10|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     10|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 3, False: 7]
  |  |  ------------------
  ------------------
  990|      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)
  |  |  ------------------
  ------------------
  991|      3|            gpsdata->set |= ERROR_SET;
  ------------------
  |  | 2899|      3|#define ERROR_SET       (1llu<<31)
  ------------------
  992|      3|        }
  993|     10|        return FILTER(status);
  ------------------
  |  |  798|     10|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     20|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 10]
  |  |  ------------------
  |  |  799|     10|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     10|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 9]
  |  |  ------------------
  ------------------
  994|     10|    }
  995|    438|    if (str_starts_with(classtag, "\"class\":\"TOFF\"")) {
  ------------------
  |  Branch (995:9): [True: 27, False: 411]
  ------------------
  996|     27|        status = json_toff_read(buf, gpsdata, end);
  997|     27|        if (PASS(status)) {
  ------------------
  |  |  800|     27|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     27|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     54|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 27]
  |  |  |  |  ------------------
  |  |  |  |  799|     27|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     27|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 26]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 15, False: 12]
  |  |  ------------------
  ------------------
  998|     15|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     15|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     15|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     15|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     15|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     15|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     15|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     15|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     15|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     15|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     15|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     15|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     15|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     15|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     15|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     15|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     15|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     15|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
  999|     15|            gpsdata->set |= TOFF_SET;
  ------------------
  |  | 2900|     15|#define TOFF_SET        (1llu<<32)      // not yet used
  ------------------
 1000|     15|        }
 1001|     27|        return FILTER(status);
  ------------------
  |  |  798|     27|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     54|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 27]
  |  |  ------------------
  |  |  799|     27|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     27|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 26]
  |  |  ------------------
  ------------------
 1002|     27|    }
 1003|    411|    if (str_starts_with(classtag, "\"class\":\"PPS\"")) {
  ------------------
  |  Branch (1003:9): [True: 39, False: 372]
  ------------------
 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: 24, False: 15]
  |  |  ------------------
  ------------------
 1006|     24|            gpsdata->set &= ~UNION_SET;
  ------------------
  |  | 2968|     24|#define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2892|     24|#define AIS_SET         (1llu<<24)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2899|     24|#define ERROR_SET       (1llu<<31)
  |  |  ------------------
  |  |               #define UNION_SET       (AIS_SET|ERROR_SET|GST_SET| \
  |  |  ------------------
  |  |  |  | 2895|     24|#define GST_SET         (1llu<<27)
  |  |  ------------------
  |  | 2969|     24|                         LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2898|     24|#define LOGMESSAGE_SET  (1llu<<30)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2903|     24|#define OSCILLATOR_SET  (1llu<<35)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2901|     24|#define PPS_SET         (1llu<<33)
  |  |  ------------------
  |  |                                        LOGMESSAGE_SET|OSCILLATOR_SET|PPS_SET|RAW_SET| \
  |  |  ------------------
  |  |  |  | 2907|     24|#define RAW_SET         (1llu<<39)
  |  |  ------------------
  |  | 2970|     24|                         RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2890|     24|#define RTCM2_SET       (1llu<<22)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2891|     24|#define RTCM3_SET       (1llu<<23)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2913|     24|#define SPARTN_SET      (1llu<<45)
  |  |  ------------------
  |  |                                        RTCM2_SET|RTCM3_SET|SPARTN_SET|SUBFRAME_SET| \
  |  |  ------------------
  |  |  |  | 2894|     24|#define SUBFRAME_SET    (1llu<<26)
  |  |  ------------------
  |  | 2971|     24|                         TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2900|     24|#define TOFF_SET        (1llu<<32)      // not yet used
  |  |  ------------------
  |  |                                        TOFF_SET|VERSION_SET)
  |  |  ------------------
  |  |  |  | 2896|     24|#define VERSION_SET     (1llu<<28)
  |  |  ------------------
  ------------------
 1007|     24|            gpsdata->set |= PPS_SET;
  ------------------
  |  | 2901|     24|#define PPS_SET         (1llu<<33)
  ------------------
 1008|     24|        }
 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|    372|    if (str_starts_with(classtag, "\"class\":\"OSC\"")) {
  ------------------
  |  Branch (1011:9): [True: 10, False: 362]
  ------------------
 1012|     10|        status = json_oscillator_read(buf, gpsdata, end);
 1013|     10|        if (PASS(status)) {
  ------------------
  |  |  800|     10|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|     10|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|     20|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 10]
  |  |  |  |  ------------------
  |  |  |  |  799|     10|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|     10|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 1, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 4, False: 6]
  |  |  ------------------
  ------------------
 1014|      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)
  |  |  ------------------
  ------------------
 1015|      4|            gpsdata->set |= OSCILLATOR_SET;
  ------------------
  |  | 2903|      4|#define OSCILLATOR_SET  (1llu<<35)
  ------------------
 1016|      4|        }
 1017|     10|        return FILTER(status);
  ------------------
  |  |  798|     10|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|     20|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 10]
  |  |  ------------------
  |  |  799|     10|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|     10|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 1, False: 9]
  |  |  ------------------
  ------------------
 1018|     10|    }
 1019|    362|    if (str_starts_with(classtag, "\"class\":\"RAW\"")) {
  ------------------
  |  Branch (1019:9): [True: 140, False: 222]
  ------------------
 1020|    140|        status = json_raw_read(buf, gpsdata, end);
 1021|    140|        if (PASS(status)) {
  ------------------
  |  |  800|    140|#define PASS(n) (0 == FILTER(n))
  |  |  ------------------
  |  |  |  |  798|    140|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|    280|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (798:21): [True: 0, False: 140]
  |  |  |  |  ------------------
  |  |  |  |  799|    140|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  |  |  ------------------
  |  |  |  |  |  |  156|    140|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (799:21): [True: 4, False: 136]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (800:17): [True: 25, False: 115]
  |  |  ------------------
  ------------------
 1022|     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)
  |  |  ------------------
  ------------------
 1023|     25|            gpsdata->set |= RAW_SET;
  ------------------
  |  | 2907|     25|#define RAW_SET         (1llu<<39)
  ------------------
 1024|     25|        }
 1025|    140|        return FILTER(status);
  ------------------
  |  |  798|    140|#define FILTER(n) (((n) == JSON_ERR_BADATTR ||   \
  |  |  ------------------
  |  |  |  |  154|    280|#define JSON_ERR_BADATTR        3      // unknown attribute name
  |  |  ------------------
  |  |  |  Branch (798:21): [True: 0, False: 140]
  |  |  ------------------
  |  |  799|    140|                    (n) == JSON_ERR_NOARRAY) ? 0 : n)
  |  |  ------------------
  |  |  |  |  156|    140|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  |  |  ------------------
  |  |  |  Branch (799:21): [True: 4, False: 136]
  |  |  ------------------
  ------------------
 1026|    140|    }
 1027|       |    // else, unknown class type
 1028|    222|    return -1;
 1029|    362|}
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|    316|{
  185|    316|    int ret;
  186|       |
  187|    316|    const struct json_attr_t json_attrs_1[] = {
  188|       |        // *INDENT-OFF*
  189|    316|        {"class",  t_check,   .dflt.check = "GST"},
  190|    316|        {"device", t_string,  .addr.string = gpsdata->dev.path,
  191|    316|                                 .len = sizeof(gpsdata->dev.path)},
  192|    316|        {"time",   t_time,    .addr.ts = &gpsdata->gst.utctime,
  193|    316|                                 .dflt.ts = {0, 0}},
  194|    316|        {"alt",    t_real,    .addr.real = &gpsdata->gst.alt_err_deviation,
  195|    316|                                 .dflt.real = NAN},
  196|    316|        {"lat",    t_real,    .addr.real = &gpsdata->gst.lat_err_deviation,
  197|    316|                                 .dflt.real = NAN},
  198|    316|        {"lon",    t_real,    .addr.real = &gpsdata->gst.lon_err_deviation,
  199|    316|                                 .dflt.real = NAN},
  200|    316|        {"major",  t_real,    .addr.real = &gpsdata->gst.smajor_deviation,
  201|    316|                                 .dflt.real = NAN},
  202|    316|        {"minor",  t_real,    .addr.real = &gpsdata->gst.sminor_deviation,
  203|    316|                                 .dflt.real = NAN},
  204|    316|        {"orient", t_real,    .addr.real = &gpsdata->gst.smajor_orientation,
  205|    316|                                 .dflt.real = NAN},
  206|    316|        {"rms",    t_real,    .addr.real = &gpsdata->gst.rms_deviation,
  207|    316|                                 .dflt.real = NAN},
  208|    316|        {"ve",     t_real,    .addr.real = &gpsdata->gst.ve_err_deviation,
  209|    316|                                 .dflt.real = NAN},
  210|    316|        {"vn",     t_real,    .addr.real = &gpsdata->gst.vn_err_deviation,
  211|    316|                                 .dflt.real = NAN},
  212|    316|        {"vu",     t_real,    .addr.real = &gpsdata->gst.vu_err_deviation,
  213|    316|                                 .dflt.real = NAN},
  214|       |        // ignore unknown keys, for cross-version compatibility
  215|    316|        {"", t_ignore},
  216|    316|        {NULL},
  217|       |        // *INDENT-ON*
  218|    316|    };
  219|       |
  220|    316|    ret = json_read_object(buf, json_attrs_1, endptr);
  221|       |
  222|    316|    return ret;
  223|    316|}
libgps_json.c:json_sky_read:
  300|    175|{
  301|       |
  302|    175|    const struct json_attr_t json_attrs_satellites[] = {
  303|       |        // *INDENT-OFF*
  304|    175|        {"PRN",    t_short,   STRUCTOBJECT(struct satellite_t, PRN)},
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  305|    175|        {"az",     t_real,    STRUCTOBJECT(struct satellite_t, azimuth),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  306|    175|                              .dflt.real = NAN},
  307|    175|        {"el",     t_real,    STRUCTOBJECT(struct satellite_t, elevation),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  308|    175|                              .dflt.real = NAN},
  309|    175|        {"freqid", t_byte,    STRUCTOBJECT(struct satellite_t, freqid),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  310|    175|                              .dflt.byte = -1},
  311|    175|        {"gnssid", t_ubyte,   STRUCTOBJECT(struct satellite_t, gnssid)},
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  312|    175|        {"health", t_ubyte,   STRUCTOBJECT(struct satellite_t, health),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  313|    175|                              .dflt.ubyte = SAT_HEALTH_UNK},
  ------------------
  |  | 2609|    175|#define SAT_HEALTH_UNK 0
  ------------------
  314|    175|        {"pr",     t_real,    STRUCTOBJECT(struct satellite_t, pr),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  315|    175|                              .dflt.real = NAN},
  316|    175|        {"prRate", t_real,    STRUCTOBJECT(struct satellite_t, prRate),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  317|    175|                              .dflt.real = NAN},
  318|    175|        {"prRes",  t_real,    STRUCTOBJECT(struct satellite_t, prRes),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  319|    175|                              .dflt.real = NAN},
  320|    175|        {"ss",     t_real,    STRUCTOBJECT(struct satellite_t, ss),
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  321|    175|                              .dflt.real = NAN},
  322|    175|        {"sigid",  t_ubyte,   STRUCTOBJECT(struct satellite_t, sigid)},
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  323|    175|        {"svid",   t_ubyte,   STRUCTOBJECT(struct satellite_t, svid)},
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  324|    175|        {"used",   t_boolean, STRUCTOBJECT(struct satellite_t, used)},
  ------------------
  |  |  188|    175|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  325|       |        // ignore unknown keys, for cross-version compatibility
  326|    175|        {"", t_ignore},
  327|       |        // *INDENT-ON*
  328|    175|        {NULL},
  329|    175|    };
  330|       |
  331|    175|    int nSat = -1;  // Use nSat only to know if sats are in SKY
  332|       |
  333|    175|    const struct json_attr_t json_attrs_2[] = {
  334|       |        // *INDENT-OFF*
  335|    175|        {"class",      t_check,   .dflt.check = "SKY"},
  336|    175|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  337|    175|                                     .len = sizeof(gpsdata->dev.path)},
  338|    175|        {"gdop",       t_real,    .addr.real    = &gpsdata->dop.gdop,
  339|    175|                                     .dflt.real = NAN},
  340|    175|        {"hdop",       t_real,    .addr.real    = &gpsdata->dop.hdop,
  341|    175|                                     .dflt.real = NAN},
  342|    175|        {"nSat",       t_integer, .addr.integer = &nSat,
  343|    175|                                     .dflt.integer = -1},
  344|    175|        {"pdop",       t_real,    .addr.real    = &gpsdata->dop.pdop,
  345|    175|                                     .dflt.real = NAN},
  346|    175|        {"tdop",       t_real,    .addr.real    = &gpsdata->dop.tdop,
  347|    175|                                     .dflt.real = NAN},
  348|    175|        {"vdop",       t_real,    .addr.real    = &gpsdata->dop.vdop,
  349|    175|                                     .dflt.real = NAN},
  350|    175|        {"xdop",       t_real,    .addr.real    = &gpsdata->dop.xdop,
  351|    175|                                     .dflt.real = NAN},
  352|    175|        {"ydop",       t_real,    .addr.real    = &gpsdata->dop.ydop,
  353|    175|                                     .dflt.real = NAN},
  354|    175|        {"satellites", t_array,
  355|    175|                                   STRUCTARRAY(gpsdata->skyview,
  ------------------
  |  |  190|    175|        .addr.array.element_type = t_structobject, \
  |  |  191|    175|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    175|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    175|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    175|        .addr.array.count = n, \
  |  |  195|    175|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    175|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    175|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    175|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    175|            struct { \
  |  |  |  |  |  |   71|    175|                int unused_int; \
  |  |  |  |  |  |   72|    175|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    175|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    175|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    175|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    175|            }; \
  |  |  |  |  |  |   77|    175|            1; \
  |  |  |  |  |  |   78|    175|        })) \
  |  |  |  |  |  |   79|    175|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  356|    175|                                         json_attrs_satellites,
  357|    175|                                         &gpsdata->satellites_visible)},
  358|    175|        {"time",       t_time,    .addr.ts = &gpsdata->skyview_time,
  359|    175|                                     .dflt.ts = {0, 0}},
  360|    175|        {"uSat",       t_integer, .addr.integer = &gpsdata->satellites_used,
  361|    175|                                     .dflt.integer = 0},
  362|       |        // ignore unknown keys, for cross-version compatibility
  363|    175|        {"", t_ignore},
  364|    175|        {NULL},
  365|       |        // *INDENT-ON*
  366|    175|    };
  367|    175|    int status, i;
  368|       |
  369|    175|    memset(&gpsdata->skyview, 0, sizeof(gpsdata->skyview));
  370|       |
  371|    175|    status = json_read_object(buf, json_attrs_2, endptr);
  372|    175|    if (0 != status) {
  ------------------
  |  Branch (372:9): [True: 65, False: 110]
  ------------------
  373|     65|        return status;
  374|     65|    }
  375|       |
  376|    110|    if (1 == isfinite(gpsdata->dop.hdop) ||
  ------------------
  |  Branch (376:9): [True: 1, False: 109]
  ------------------
  377|    109|        1 == isfinite(gpsdata->dop.xdop) ||
  ------------------
  |  Branch (377:9): [True: 1, False: 108]
  ------------------
  378|    108|        1 == isfinite(gpsdata->dop.ydop) ||
  ------------------
  |  Branch (378:9): [True: 1, False: 107]
  ------------------
  379|    107|        1 == isfinite(gpsdata->dop.vdop) ||
  ------------------
  |  Branch (379:9): [True: 1, False: 106]
  ------------------
  380|    106|        1 == isfinite(gpsdata->dop.tdop) ||
  ------------------
  |  Branch (380:9): [True: 1, False: 105]
  ------------------
  381|    105|        1 == isfinite(gpsdata->dop.pdop) ||
  ------------------
  |  Branch (381:9): [True: 1, False: 104]
  ------------------
  382|    104|        1 == isfinite(gpsdata->dop.gdop)) {
  ------------------
  |  Branch (382:9): [True: 1, False: 103]
  ------------------
  383|       |        // got at least one DOP
  384|      7|        gpsdata->set |= DOP_SET;
  ------------------
  |  | 2879|      7|#define DOP_SET         (1llu<<11)
  ------------------
  385|      7|    }
  386|       |
  387|    110|    gpsdata->satellites_visible = 0;
  388|       |
  389|    110|    if (-1 == nSat) {
  ------------------
  |  Branch (389:9): [True: 17, False: 93]
  ------------------
  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|     93|    gpsdata->satellites_used = 0;
  395|       |
  396|     93|    gpsdata->set |= SATELLITE_SET;
  ------------------
  |  | 2883|     93|#define SATELLITE_SET   (1llu<<15)
  ------------------
  397|       |    // recalculate used and visible, do not use nSat, uSat
  398|  21.4k|    for (i = 0; i < MAXCHANNELS; i++) {
  ------------------
  |  |  132|  21.4k|#define MAXCHANNELS     230
  ------------------
  |  Branch (398:17): [True: 21.3k, False: 93]
  ------------------
  399|  21.3k|        if (0 < gpsdata->skyview[i].PRN) {
  ------------------
  |  Branch (399:13): [True: 1.62k, False: 19.7k]
  ------------------
  400|  1.62k|            gpsdata->satellites_visible++;
  401|  1.62k|        }
  402|  21.3k|        if (gpsdata->skyview[i].used) {
  ------------------
  |  Branch (402:13): [True: 1.61k, False: 19.7k]
  ------------------
  403|  1.61k|            gpsdata->satellites_used++;
  404|  1.61k|        }
  405|  21.3k|    }
  406|       |
  407|     93|    return 0;
  408|    110|}
libgps_json.c:json_att_read:
  413|     72|{
  414|     72|    struct attitude_t *datap = &gpsdata->attitude;
  415|       |
  416|     72|    const struct json_attr_t json_attrs_1[] = {
  417|       |        // *INDENT-OFF*
  418|     72|        {"class",     t_check,     .dflt.check = "ATT"},
  419|     72|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  420|     72|         .len = sizeof(gpsdata->dev.path)},
  421|     72|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  422|     72|         .dflt.real = NAN},
  423|     72|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  424|     72|         .dflt.real = NAN},
  425|     72|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  426|     72|         .dflt.real = NAN},
  427|     72|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  428|     72|         .dflt.real = NAN},
  429|     72|        {"baseS",     t_integer,   .addr.integer = &datap->base.status,
  430|     72|         .dflt.integer = STATUS_UNK},     // aka zero
  ------------------
  |  |  226|     72|#define STATUS_UNK      0       // Unknown status
  ------------------
  431|     72|        {"baseE",     t_real,      .addr.real = &datap->base.east,
  432|     72|         .dflt.real = NAN},
  433|     72|        {"baseN",     t_real,      .addr.real = &datap->base.north,
  434|     72|         .dflt.real = NAN},
  435|     72|        {"baseU",     t_real,      .addr.real = &datap->base.up,
  436|     72|         .dflt.real = NAN},
  437|     72|        {"baseL",     t_real,      .addr.real = &datap->base.length,
  438|     72|         .dflt.real = NAN},
  439|     72|        {"baseC",     t_real,      .addr.real = &datap->base.course,
  440|     72|         .dflt.real = NAN},
  441|     72|        {"dgpsRatio", t_real, .addr.real = &datap->base.ratio,
  442|     72|         .dflt.real = NAN},
  443|     72|        {"depth",     t_real,      .addr.real = &datap->depth,
  444|     72|         .dflt.real = NAN},
  445|     72|        {"dip",       t_real,      .addr.real = &datap->dip,
  446|     72|         .dflt.real = NAN},
  447|     72|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_x,
  448|     72|         .dflt.real = NAN},
  449|     72|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  450|     72|         .dflt.real = NAN},
  451|     72|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  452|     72|         .dflt.real = NAN},
  453|     72|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  454|     72|         .dflt.real = NAN},
  455|     72|        {"heading",   t_real,      .addr.real = &datap->heading,
  456|     72|         .dflt.real = NAN},
  457|     72|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  458|     72|         .dflt.real = NAN},
  459|     72|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  460|     72|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  461|     72|         .dflt.real = NAN},
  462|     72|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  463|     72|         .dflt.real = NAN},
  464|     72|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  465|     72|         .dflt.real = NAN},
  466|     72|        {"mheading",   t_real,     .addr.real = &datap->mheading,
  467|     72|         .dflt.real = NAN},
  468|     72|        {"msg",       t_string,    .addr.string = datap->msg,
  469|     72|         .len = sizeof(datap->msg)},
  470|     72|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  471|     72|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  472|     72|         .dflt.real = NAN},
  473|     72|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  474|     72|        {"roll",      t_real,      .addr.real = &datap->roll,
  475|     72|         .dflt.real = NAN},
  476|     72|        {"temp",      t_real,      .addr.real = &datap->temp,
  477|     72|         .dflt.real = NAN},
  478|     72|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  479|     72|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  480|     72|         .dflt.ulongint = 0},
  481|     72|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  482|     72|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  483|       |
  484|       |        // ignore unknown keys, for cross-version compatibility
  485|     72|        {"", t_ignore},
  486|     72|        {NULL},
  487|       |        // *INDENT-ON*
  488|     72|    };
  489|       |
  490|     72|    return json_read_object(buf, json_attrs_1, endptr);
  491|     72|}
libgps_json.c:json_imu_read:
  496|     48|{
  497|       |    // the client only uses the first slot.
  498|     48|    struct attitude_t *datap = &gpsdata->imu[0];
  499|       |
  500|     48|    const struct json_attr_t json_attrs_1[] = {
  501|       |        // *INDENT-OFF*
  502|     48|        {"class",     t_check,     .dflt.check = "IMU"},
  503|     48|        {"device",    t_string,    .addr.string = gpsdata->dev.path,
  504|     48|         .len = sizeof(gpsdata->dev.path)},
  505|     48|        {"acc_len",   t_real,      .addr.real = &datap->acc_len,
  506|     48|         .dflt.real = NAN},
  507|     48|        {"acc_x",     t_real,      .addr.real = &datap->acc_x,
  508|     48|         .dflt.real = NAN},
  509|     48|        {"acc_y",     t_real,      .addr.real = &datap->acc_y,
  510|     48|         .dflt.real = NAN},
  511|     48|        {"acc_z",     t_real,      .addr.real = &datap->acc_z,
  512|     48|         .dflt.real = NAN},
  513|     48|        {"depth",     t_real,      .addr.real = &datap->depth,
  514|     48|         .dflt.real = NAN},
  515|     48|        {"dip",       t_real,      .addr.real = &datap->dip,
  516|     48|         .dflt.real = NAN},
  517|     48|        {"gyro_temp", t_real,      .addr.real = &datap->gyro_temp,
  518|     48|         .dflt.real = NAN},
  519|     48|        {"gyro_x",    t_real,      .addr.real = &datap->gyro_x,
  520|     48|         .dflt.real = NAN},
  521|     48|        {"gyro_y",    t_real,      .addr.real = &datap->gyro_y,
  522|     48|         .dflt.real = NAN},
  523|     48|        {"gyro_z",    t_real,      .addr.real = &datap->gyro_z,
  524|     48|         .dflt.real = NAN},
  525|     48|        {"heading",   t_real,      .addr.real = &datap->heading,
  526|     48|         .dflt.real = NAN},
  527|     48|        {"mag_len",   t_real,      .addr.real = &datap->mag_len,
  528|     48|         .dflt.real = NAN},
  529|     48|        {"mag_st",    t_character, .addr.character = &datap->mag_st},
  530|     48|        {"mag_x",     t_real,      .addr.real = &datap->mag_x,
  531|     48|         .dflt.real = NAN},
  532|     48|        {"mag_y",     t_real,      .addr.real = &datap->mag_y,
  533|     48|         .dflt.real = NAN},
  534|     48|        {"mag_z",     t_real,      .addr.real = &datap->mag_z,
  535|     48|         .dflt.real = NAN},
  536|     48|        {"msg",       t_string,    .addr.string = datap->msg,
  537|     48|         .len = sizeof(datap->msg)},
  538|     48|        {"pitch_st",  t_character, .addr.character = &datap->pitch_st},
  539|     48|        {"pitch",     t_real,      .addr.real = &datap->pitch,
  540|     48|         .dflt.real = NAN},
  541|     48|        {"roll_st",   t_character, .addr.character = &datap->roll_st},
  542|     48|        {"roll",      t_real,      .addr.real = &datap->roll,
  543|     48|         .dflt.real = NAN},
  544|     48|        {"temp",      t_real,      .addr.real = &datap->temp,
  545|     48|         .dflt.real = NAN},
  546|     48|        {"time",      t_time,      .addr.ts = &datap->mtime, .dflt.ts = {0, 0}},
  547|     48|        {"timeTag",   t_ulongint,  .addr.ulongint = &datap->timeTag,
  548|     48|         .dflt.ulongint = 0},
  549|     48|        {"yaw_st",    t_character, .addr.character = &datap->yaw_st},
  550|     48|        {"yaw",       t_real,      .addr.real = &datap->yaw, .dflt.real = NAN},
  551|       |
  552|       |        // ignore unknown keys, for cross-version compatibility
  553|     48|        {"", t_ignore},
  554|     48|        {NULL},
  555|       |        // *INDENT-ON*
  556|     48|    };
  557|       |
  558|     48|    return json_read_object(buf, json_attrs_1, endptr);
  559|     48|}
libgps_json.c:json_devicelist_read:
  563|     78|{
  564|     78|    const struct json_attr_t json_attrs_subdevices[] = {
  565|       |        // *INDENT-OFF*
  566|     78|        {"class",      t_check,      .dflt.check = "DEVICE"},
  567|     78|        {"path",       t_string,     STRUCTOBJECT(struct devconfig_t, path),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  568|     78|         .len = sizeof(gpsdata->devices.list[0].path)},
  569|     78|        {"activated",  t_time,
  570|     78|         STRUCTOBJECT(struct devconfig_t, activated)},
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  571|     78|        {"flags",      t_integer,    STRUCTOBJECT(struct devconfig_t, flags)},
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  572|     78|        {"driver",     t_string,     STRUCTOBJECT(struct devconfig_t, driver),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  573|     78|         .len = sizeof(gpsdata->devices.list[0].driver)},
  574|     78|        {"hexdata",    t_string,     STRUCTOBJECT(struct devconfig_t, hexdata),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  575|     78|         .len = sizeof(gpsdata->devices.list[0].hexdata)},
  576|     78|        {"sernum",     t_string,     STRUCTOBJECT(struct devconfig_t, sernum),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  577|     78|                            .len = sizeof(gpsdata->devices.list[0].sernum)},
  578|     78|        {"subtype",    t_string,     STRUCTOBJECT(struct devconfig_t, subtype),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  579|     78|                            .len = sizeof(gpsdata->devices.list[0].subtype)},
  580|     78|        {"subtype1",   t_string,     STRUCTOBJECT(struct devconfig_t, subtype1),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  581|     78|                            .len = sizeof(gpsdata->devices.list[0].subtype1)},
  582|     78|        {"native",     t_integer, STRUCTOBJECT(struct devconfig_t, driver_mode),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  583|     78|                                        .dflt.integer = -1},
  584|     78|        {"bps",        t_uinteger,   STRUCTOBJECT(struct devconfig_t, baudrate),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  585|     78|                                        .dflt.uinteger = DEVDEFAULT_BPS},
  ------------------
  |  |   51|     78|#define DEVDEFAULT_BPS          0
  ------------------
  586|     78|        {"parity",     t_character,  STRUCTOBJECT(struct devconfig_t, parity),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  587|     78|                                        .dflt.character = DEVDEFAULT_PARITY},
  ------------------
  |  |   52|     78|#define DEVDEFAULT_PARITY       'X'
  ------------------
  588|     78|        {"stopbits",   t_uinteger,   STRUCTOBJECT(struct devconfig_t, stopbits),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  589|     78|                                        .dflt.integer = DEVDEFAULT_STOPBITS},
  ------------------
  |  |   53|     78|#define DEVDEFAULT_STOPBITS     3
  ------------------
  590|     78|        {"cycle",      t_timespec,   STRUCTOBJECT(struct devconfig_t, cycle),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  591|     78|                                        .dflt.ts = {0,0}},
  592|     78|        {"mincycle",   t_timespec,   STRUCTOBJECT(struct devconfig_t, mincycle),
  ------------------
  |  |  188|     78|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  593|     78|                                        .dflt.ts = {0,0}},
  594|       |        // ignore unknown keys, for cross-version compatibility
  595|     78|        {"", t_ignore},
  596|     78|        {NULL},
  597|       |        // *INDENT-ON*
  598|     78|    };
  599|     78|    const struct json_attr_t json_attrs_devices[] = {
  600|     78|        {"class", t_check,.dflt.check = "DEVICES"},
  601|     78|        {"devices", t_array, STRUCTARRAY(gpsdata->devices.list,
  ------------------
  |  |  190|     78|        .addr.array.element_type = t_structobject, \
  |  |  191|     78|        .addr.array.arr.objects.subtype = e, \
  |  |  192|     78|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|     78|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|     78|        .addr.array.count = n, \
  |  |  195|     78|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|     78|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|     78|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|     78|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|     78|            struct { \
  |  |  |  |  |  |   71|     78|                int unused_int; \
  |  |  |  |  |  |   72|     78|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|     78|            } zero_init = {0}; \
  |  |  |  |  |  |   74|     78|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|     78|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|     78|            }; \
  |  |  |  |  |  |   77|     78|            1; \
  |  |  |  |  |  |   78|     78|        })) \
  |  |  |  |  |  |   79|     78|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  602|     78|                                         json_attrs_subdevices,
  603|     78|                                         &gpsdata->devices.ndevices)},
  604|       |        // ignore unknown keys, for cross-version compatibility
  605|     78|        {"", t_ignore},
  606|     78|        {NULL},
  607|     78|    };
  608|     78|    int status;
  609|       |
  610|     78|    memset(&gpsdata->devices, 0, sizeof(gpsdata->devices));
  611|     78|    status = json_read_object(buf, json_attrs_devices, endptr);
  612|     78|    if (status != 0) {
  ------------------
  |  Branch (612:9): [True: 73, False: 5]
  ------------------
  613|     73|        return status;
  614|     73|    }
  615|       |
  616|       |    // json.c should ensure this never happens
  617|     78|    assert(MAXUSERDEVS >= gpsdata->devices.ndevices);
  ------------------
  |  Branch (617:5): [True: 0, False: 5]
  |  Branch (617:5): [True: 5, False: 0]
  ------------------
  618|       |
  619|      5|    (void)clock_gettime(CLOCK_REALTIME, &gpsdata->devices.time);
  620|      5|    return 0;
  621|      5|}
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|     10|{
  655|     10|    const struct json_attr_t json_attrs_error[] = {
  656|       |        // *INDENT-OFF*
  657|     10|        {"class",     t_check,   .dflt.check = "ERROR"},
  658|     10|        {"message",   t_string,  .addr.string  = gpsdata->error,
  659|     10|                                    .len = sizeof(gpsdata->error)},
  660|       |        // ignore unknown keys, for cross-version compatibility
  661|     10|        {"", t_ignore},
  662|     10|        {NULL},
  663|       |        // *INDENT-ON*
  664|     10|    };
  665|     10|    int status;
  666|       |
  667|     10|    memset(&gpsdata->error, 0, sizeof(gpsdata->error));
  668|     10|    status = json_read_object(buf, json_attrs_error, endptr);
  669|     10|    if (status != 0)
  ------------------
  |  Branch (669:9): [True: 8, False: 2]
  ------------------
  670|      8|        return status;
  671|       |
  672|      2|    return status;
  673|     10|}
libgps_json.c:json_raw_read:
  228|    140|{
  229|    140|    unsigned measurements;
  230|       |    // initialized to shut up clang
  231|    140|    double mtime_s = 0.0, mtime_ns = 0.0;
  232|       |
  233|    140|    const struct json_attr_t json_attrs_meas[] = {
  234|       |        // *INDENT-OFF*
  235|    140|        {"gnssid",       t_ubyte,    STRUCTOBJECT(struct meas_t, gnssid)},
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  236|    140|        {"svid",         t_ubyte,    STRUCTOBJECT(struct meas_t, svid)},
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  237|    140|        {"sigid",        t_ubyte,    STRUCTOBJECT(struct meas_t, sigid),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  238|    140|                                     .dflt.ubyte = 0},
  239|    140|        {"snr",          t_ubyte,    STRUCTOBJECT(struct meas_t, snr)},
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  240|    140|        {"freqid",       t_ubyte,    STRUCTOBJECT(struct meas_t, freqid),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  241|    140|                                     .dflt.ubyte = 0},
  242|    140|        {"obs",          t_string,   STRUCTOBJECT(struct meas_t, obs_code),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  243|    140|                                .len = sizeof(gpsdata->raw.meas[0].obs_code)},
  244|    140|        {"lli",          t_ubyte,    STRUCTOBJECT(struct meas_t, lli),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  245|    140|                                     .dflt.ubyte = 0},
  246|    140|        {"locktime",     t_uinteger, STRUCTOBJECT(struct meas_t, locktime),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  247|    140|                                     .dflt.uinteger = 0},
  248|    140|        {"carrierphase", t_real,     STRUCTOBJECT(struct meas_t, carrierphase),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  249|    140|                                     .dflt.real = NAN},
  250|    140|        {"pseudorange",  t_real,     STRUCTOBJECT(struct meas_t, pseudorange),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  251|    140|                                     .dflt.real = NAN},
  252|    140|        {"doppler",      t_real,     STRUCTOBJECT(struct meas_t, doppler),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  253|    140|                                     .dflt.real = NAN},
  254|    140|        {"c2c",          t_real,     STRUCTOBJECT(struct meas_t, c2c),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  255|    140|                                    .dflt.real = NAN},
  256|    140|        {"l2c",          t_real,     STRUCTOBJECT(struct meas_t, l2c),
  ------------------
  |  |  188|    140|#define STRUCTOBJECT(s, f)      .addr.offset = offsetof(s, f)
  ------------------
  257|    140|                                    .dflt.real = NAN},
  258|       |        // ignore unknown keys, for cross-version compatibility
  259|    140|        {"", t_ignore},
  260|       |        // *INDENT-ON*
  261|    140|        {NULL},
  262|    140|    };
  263|    140|    const struct json_attr_t json_attrs_raw[] = {
  264|       |        // *INDENT-OFF*
  265|    140|        {"class",      t_check,   .dflt.check = "RAW"},
  266|    140|        {"device",     t_string,  .addr.string  = gpsdata->dev.path,
  267|    140|                                    .len = sizeof(gpsdata->dev.path)},
  268|    140|        {"time",       t_real,    .addr.real = &mtime_s,
  269|    140|                                 .dflt.real = NAN},
  270|    140|        {"nsec",       t_real,    .addr.real = &mtime_ns,
  271|    140|                                 .dflt.real = NAN},
  272|    140|        {"rawdata",    t_array,   STRUCTARRAY(gpsdata->raw.meas,
  ------------------
  |  |  190|    140|        .addr.array.element_type = t_structobject, \
  |  |  191|    140|        .addr.array.arr.objects.subtype = e, \
  |  |  192|    140|        .addr.array.arr.objects.base = (char*)a, \
  |  |  193|    140|        .addr.array.arr.objects.stride = sizeof(a[0]), \
  |  |  194|    140|        .addr.array.count = n, \
  |  |  195|    140|        .addr.array.maxlen = NITEMS(a)
  |  |  ------------------
  |  |  |  | 1212|    140|#define NITEMS(x) ((int) (sizeof(x) / sizeof(x[0]) + COMPILE_CHECK_IS_ARRAY(x)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   68|    140|    #define COMPILE_CHECK_IS_ARRAY(arr) ( \
  |  |  |  |  |  |   69|    140|        0 * (int) sizeof(({ \
  |  |  |  |  |  |   70|    140|            struct { \
  |  |  |  |  |  |   71|    140|                int unused_int; \
  |  |  |  |  |  |   72|    140|                __typeof__(arr) unused_arr; \
  |  |  |  |  |  |   73|    140|            } zero_init = {0}; \
  |  |  |  |  |  |   74|    140|            __typeof__(arr) arg_is_not_array UNUSED = { \
  |  |  |  |  |  |   75|    140|                zero_init.unused_arr[0], \
  |  |  |  |  |  |   76|    140|            }; \
  |  |  |  |  |  |   77|    140|            1; \
  |  |  |  |  |  |   78|    140|        })) \
  |  |  |  |  |  |   79|    140|    )
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|    140|                                     json_attrs_meas, &measurements)},
  274|       |        // ignore unknown keys, for cross-version compatibility
  275|    140|        {"", t_ignore},
  276|    140|        {NULL},
  277|       |        // *INDENT-ON*
  278|    140|    };
  279|    140|    int status;
  280|       |
  281|    140|    memset(&gpsdata->raw, 0, sizeof(gpsdata->raw));
  282|       |
  283|    140|    status = json_read_object(buf, json_attrs_raw, endptr);
  284|    140|    if (0 != status) {
  ------------------
  |  Branch (284:9): [True: 119, False: 21]
  ------------------
  285|    119|        return status;
  286|    119|    }
  287|     21|    gpsdata->set |= RAW_SET;
  ------------------
  |  | 2907|     21|#define RAW_SET         (1llu<<39)
  ------------------
  288|     21|    if (0 == isfinite(mtime_s) ||
  ------------------
  |  Branch (288:9): [True: 19, False: 2]
  ------------------
  289|     20|        0 == isfinite(mtime_ns)) {
  ------------------
  |  Branch (289:9): [True: 1, False: 1]
  ------------------
  290|     20|        return status;
  291|     20|    }
  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|     21|}

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: 862]
  ------------------
  279|    194|            memcpy(dst, src, siz - 1);
  280|    194|            dst[siz - 1] = '\0';
  281|    862|        } else {
  282|    862|            memcpy(dst, src, len + 1);
  283|    862|        }
  284|  1.05k|    }
  285|  1.05k|    return len;
  286|  1.05k|}

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

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

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

