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

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

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

safe_atof:
  294|  5.67k|{
  295|  5.67k|    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.67k|    static double powersOf10[] = {
  303|  5.67k|        10.,
  304|  5.67k|        100.,
  305|  5.67k|        1.0e4,
  306|  5.67k|        1.0e8,
  307|  5.67k|        1.0e16,
  308|  5.67k|        1.0e32,
  309|  5.67k|        1.0e64,
  310|  5.67k|        1.0e128,
  311|  5.67k|        1.0e256
  312|  5.67k|    };
  313|       |
  314|  5.67k|    bool sign = false, expSign = false;
  315|  5.67k|    double fraction, dblExp, *d;
  316|  5.67k|    const char *p;
  317|  5.67k|    unsigned char c;
  318|  5.67k|    int exp = 0;                // Exponent read from "EX" field.
  319|  5.67k|    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.67k|    int mantSize;               // Number of digits in mantissa.
  329|  5.67k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  330|       |                                 * point. */
  331|  5.67k|    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.67k|    p = string;
  341|  5.67k|    while (isspace((int)*p)) {
  ------------------
  |  Branch (341:12): [True: 0, False: 5.67k]
  ------------------
  342|      0|        p += 1;
  343|      0|    }
  344|  5.67k|    if (isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (344:9): [True: 2.75k, False: 2.92k]
  ------------------
  345|       |        // ignore
  346|  2.92k|    } else if ('-' == *p) {
  ------------------
  |  Branch (346:16): [True: 851, False: 2.06k]
  ------------------
  347|    851|        sign = true;
  348|    851|        p += 1;
  349|  2.06k|    } else if ('+' == *p) {
  ------------------
  |  Branch (349:16): [True: 202, False: 1.86k]
  ------------------
  350|    202|        p += 1;
  351|  1.86k|    } else if ('.' == *p) {
  ------------------
  |  Branch (351:16): [True: 1.22k, False: 640]
  ------------------
  352|       |        // ignore
  353|  1.22k|    } else {
  354|    640|        return NAN;
  355|    640|    }
  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|  5.03k|    decPt = -1;
  363|  22.0k|    for (mantSize = 0; ; mantSize += 1) {
  364|  22.0k|        c = *p;
  365|  22.0k|        if (!isdigit(c)) {
  ------------------
  |  Branch (365:13): [True: 6.59k, False: 15.4k]
  ------------------
  366|  6.59k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (366:17): [True: 4.80k, False: 1.78k]
  |  Branch (366:31): [True: 224, False: 1.56k]
  ------------------
  367|  5.03k|                break;
  368|  5.03k|            }
  369|  1.56k|            decPt = mantSize;
  370|  1.56k|        }
  371|  16.9k|        p += 1;
  372|  16.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|  5.03k|    pExp  = p;
  382|  5.03k|    p -= mantSize;
  383|  5.03k|    if (decPt < 0) {
  ------------------
  |  Branch (383:9): [True: 3.46k, False: 1.56k]
  ------------------
  384|  3.46k|        decPt = mantSize;
  385|  3.46k|    } else {
  386|  1.56k|        mantSize -= 1;                  // One of the digits was the point.
  387|  1.56k|    }
  388|  5.03k|    if (mantSize > 18) {
  ------------------
  |  Branch (388:9): [True: 228, False: 4.80k]
  ------------------
  389|    228|        fracExp = decPt - 18;
  390|    228|        mantSize = 18;
  391|  4.80k|    } else {
  392|  4.80k|        fracExp = decPt - mantSize;
  393|  4.80k|    }
  394|  5.03k|    if (mantSize == 0) {
  ------------------
  |  Branch (394:9): [True: 1.39k, False: 3.63k]
  ------------------
  395|  1.39k|        fraction = 0.0;
  396|       |        // p = string;
  397|  1.39k|        goto done;
  398|  3.63k|    } else {
  399|  3.63k|        int frac1, frac2;
  400|       |
  401|  3.63k|        frac1 = 0;
  402|  6.64k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (402:17): [True: 3.00k, False: 3.63k]
  ------------------
  403|  3.00k|            c = *p;
  404|  3.00k|            p += 1;
  405|  3.00k|            if ('.' == c) {
  ------------------
  |  Branch (405:17): [True: 222, False: 2.78k]
  ------------------
  406|    222|                c = *p;
  407|    222|                p += 1;
  408|    222|            }
  409|  3.00k|            frac1 = 10*frac1 + (c - '0');
  410|  3.00k|        }
  411|  3.63k|        frac2 = 0;
  412|  13.6k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (412:16): [True: 9.97k, False: 3.63k]
  ------------------
  413|  9.97k|            c = *p;
  414|  9.97k|            p += 1;
  415|  9.97k|            if ('.' == c) {
  ------------------
  |  Branch (415:17): [True: 269, False: 9.70k]
  ------------------
  416|    269|                c = *p;
  417|    269|                p += 1;
  418|    269|            }
  419|  9.97k|            frac2 = 10*frac2 + (c - '0');
  420|  9.97k|        }
  421|  3.63k|        fraction = (1.0e9 * frac1) + frac2;
  422|  3.63k|    }
  423|       |
  424|       |    /*
  425|       |     * Skim off the exponent.
  426|       |     */
  427|       |
  428|  3.63k|    p = pExp;
  429|  3.63k|    if (('E' == *p) ||
  ------------------
  |  Branch (429:9): [True: 1.15k, False: 2.48k]
  ------------------
  430|  2.48k|        ('e' == *p)) {
  ------------------
  |  Branch (430:9): [True: 983, False: 1.49k]
  ------------------
  431|  2.13k|        p += 1;
  432|  2.13k|        if ('-' == *p) {
  ------------------
  |  Branch (432:13): [True: 616, False: 1.52k]
  ------------------
  433|    616|            expSign = true;
  434|    616|            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.47k|        while (isdigit((unsigned char) *p)) {
  ------------------
  |  Branch (441:16): [True: 4.47k, False: 1.35k]
  ------------------
  442|  4.47k|            exp = exp * 10 + (*p - '0');
  443|  4.47k|            if (1024 < exp) {
  ------------------
  |  Branch (443:17): [True: 786, False: 3.69k]
  ------------------
  444|    786|                if (true == expSign) {
  ------------------
  |  Branch (444:21): [True: 388, False: 398]
  ------------------
  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|    398|                if (sign) {
  ------------------
  |  Branch (451:21): [True: 201, False: 197]
  ------------------
  452|    201|                    return -INFINITY;
  453|    201|                }
  454|    197|                return INFINITY;
  455|    398|            }
  456|  3.69k|            p += 1;
  457|  3.69k|        }
  458|  2.13k|    }
  459|  2.84k|    if (expSign) {
  ------------------
  |  Branch (459:9): [True: 228, False: 2.62k]
  ------------------
  460|    228|        exp = fracExp - exp;
  461|  2.62k|    } else {
  462|  2.62k|        exp = fracExp + exp;
  463|  2.62k|    }
  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.84k|    if (0 > exp) {
  ------------------
  |  Branch (472:9): [True: 499, False: 2.35k]
  ------------------
  473|    499|        expSign = true;
  474|    499|        exp = -exp;
  475|  2.35k|    } else {
  476|  2.35k|        expSign = false;
  477|  2.35k|    }
  478|  2.84k|    if (exp > maxExponent) {
  ------------------
  |  Branch (478:9): [True: 222, False: 2.62k]
  ------------------
  479|    222|        exp = maxExponent;
  480|    222|        errno = ERANGE;
  481|    222|    }
  482|  2.84k|    dblExp = 1.0;
  483|  7.63k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (483:26): [True: 4.79k, False: 2.84k]
  ------------------
  484|  4.79k|        if (exp & 01) {
  ------------------
  |  Branch (484:13): [True: 3.56k, False: 1.22k]
  ------------------
  485|  3.56k|            dblExp *= *d;
  486|  3.56k|        }
  487|  4.79k|    }
  488|  2.84k|    if (expSign) {
  ------------------
  |  Branch (488:9): [True: 499, False: 2.35k]
  ------------------
  489|    499|        fraction /= dblExp;
  490|  2.35k|    } else {
  491|  2.35k|        fraction *= dblExp;
  492|  2.35k|    }
  493|       |
  494|  4.24k|done:
  495|  4.24k|    if (sign) {
  ------------------
  |  Branch (495:9): [True: 456, False: 3.78k]
  ------------------
  496|    456|        return -fraction;
  497|    456|    }
  498|  3.78k|    return fraction;
  499|  4.24k|}
mkgmtime:
  845|  1.99k|{
  846|  1.99k|    int year;
  847|  1.99k|    time_t result;
  848|  1.99k|    static const int cumdays[MONTHSPERYEAR] =
  849|  1.99k|        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
  850|       |
  851|       |    // check ranges, ignore tm_isdst and max tm_year
  852|  1.99k|    if (0 > t->tm_sec ||
  ------------------
  |  Branch (852:9): [True: 0, False: 1.99k]
  ------------------
  853|  1.99k|        0 > t->tm_min ||
  ------------------
  |  Branch (853:9): [True: 0, False: 1.99k]
  ------------------
  854|  1.99k|        0 > t->tm_hour ||
  ------------------
  |  Branch (854:9): [True: 0, False: 1.99k]
  ------------------
  855|  1.99k|        1 > t->tm_mday ||
  ------------------
  |  Branch (855:9): [True: 213, False: 1.78k]
  ------------------
  856|  1.78k|        0 > t->tm_mon ||
  ------------------
  |  Branch (856:9): [True: 0, False: 1.78k]
  ------------------
  857|  1.78k|        0 > t->tm_year ||
  ------------------
  |  Branch (857:9): [True: 624, False: 1.15k]
  ------------------
  858|  1.15k|        0 > t->tm_wday ||
  ------------------
  |  Branch (858:9): [True: 0, False: 1.15k]
  ------------------
  859|  1.15k|        0 > t->tm_yday ||
  ------------------
  |  Branch (859:9): [True: 0, False: 1.15k]
  ------------------
  860|  1.15k|        61 < t->tm_sec ||
  ------------------
  |  Branch (860:9): [True: 0, False: 1.15k]
  ------------------
  861|  1.15k|        59 < t->tm_min ||
  ------------------
  |  Branch (861:9): [True: 0, False: 1.15k]
  ------------------
  862|  1.15k|        23 < t->tm_hour ||
  ------------------
  |  Branch (862:9): [True: 0, False: 1.15k]
  ------------------
  863|  1.15k|        31 < t->tm_mday ||
  ------------------
  |  Branch (863:9): [True: 0, False: 1.15k]
  ------------------
  864|  1.15k|        11 < t->tm_mon ||
  ------------------
  |  Branch (864:9): [True: 0, False: 1.15k]
  ------------------
  865|  1.15k|        6 < t->tm_wday ||
  ------------------
  |  Branch (865:9): [True: 0, False: 1.15k]
  ------------------
  866|  1.15k|        365 < t->tm_yday) {
  ------------------
  |  Branch (866:9): [True: 0, False: 1.15k]
  ------------------
  867|    837|        errno = EOVERFLOW;
  868|    837|        return -1;
  869|    837|    }
  870|  1.99k|    errno = 0;
  871|  1.15k|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  501|  1.15k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  872|  1.15k|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  501|  1.15k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  873|  1.15k|    result += (year - 1968) / 4;
  874|  1.15k|    result -= (year - 1900) / 100;
  875|  1.15k|    result += (year - 1600) / 400;
  876|  1.15k|    if (0 == (year % 4) &&
  ------------------
  |  Branch (876:9): [True: 629, False: 527]
  ------------------
  877|    629|        (0 != (year % 100) ||
  ------------------
  |  Branch (877:10): [True: 229, False: 400]
  ------------------
  878|    400|         0 == (year % 400)) &&
  ------------------
  |  Branch (878:10): [True: 202, False: 198]
  ------------------
  879|    431|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  501|    431|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (879:9): [True: 216, False: 215]
  ------------------
  880|    216|        result--;
  881|    216|    }
  882|  1.15k|    result += t->tm_mday - 1;
  883|  1.15k|    result *= 24;
  884|  1.15k|    result += t->tm_hour;
  885|  1.15k|    result *= 60;
  886|  1.15k|    result += t->tm_min;
  887|  1.15k|    result *= 60;
  888|  1.15k|    result += t->tm_sec;
  889|       |    /* this is UTC, no DST
  890|       |     * if (t->tm_isdst == 1)
  891|       |     * result -= 3600;
  892|       |     */
  893|  1.15k|    return result;
  894|  1.99k|}
iso8601_to_timespec:
  898|  1.99k|{
  899|  1.99k|    timespec_t ret = {0};
  900|       |
  901|       |#ifdef USE_QT
  902|       |  #ifndef __clang_analyzer__
  903|       |    double usec = 0;
  904|       |
  905|       |    QString t(isotime);
  906|       |    QDateTime d = QDateTime::fromString(isotime, Qt::ISODate);
  907|       |    QStringList sl = t.split(".");
  908|       |    if (1 < sl.size()) {
  909|       |        usec = sl[1].toInt() / pow(10., (double)sl[1].size());
  910|       |    }
  911|       |// toSecsSinceEpoch wasn't introduced until 5.8
  912|       |#if QT_VERSION < QT_VERSION_CHECK(5,8,0)
  913|       |    ret.tv_sec = d.toTime_t();
  914|       |#else
  915|       |    ret.tv_sec = d.toSecsSinceEpoch();
  916|       |#endif
  917|       |    ret.tv_nsec = usec * 1e9;
  918|       |  #endif  // __clang_analyzer__
  919|       |#else  // USE_QT
  920|  1.99k|    double usec = 0;
  921|  1.99k|    struct tm tm = {0};
  922|       |
  923|  1.99k|    {
  924|  1.99k|        char *dp = NULL;
  925|  1.99k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  926|  1.99k|        if (NULL != dp &&
  ------------------
  |  Branch (926:13): [True: 651, False: 1.34k]
  ------------------
  927|    651|            '.' == *dp) {
  ------------------
  |  Branch (927:13): [True: 194, False: 457]
  ------------------
  928|    194|            usec = strtod(dp, NULL);
  929|    194|        }
  930|  1.99k|    }
  931|       |
  932|       |    /*
  933|       |     * It would be nice if we could say mktime(&tm) - timezone + usec instead,
  934|       |     * but timezone is not available at all on some BSDs. Besides, when working
  935|       |     * with historical dates the value of timezone after an ordinary tzset(3)
  936|       |     * can be wrong; you have to do a redirect through the IANA historical
  937|       |     * timezone database to get it right.
  938|       |     */
  939|  1.99k|    ret.tv_sec = mkgmtime(&tm);
  940|  1.99k|    ret.tv_nsec = usec * 1e9;
  941|  1.99k|#endif  // USE_QT
  942|       |
  943|  1.99k|#if 4 < SIZEOF_TIME_T
  944|  1.99k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (944:9): [True: 226, False: 1.76k]
  ------------------
  945|       |        // enforce max "9999-12-31T23:59:59.999Z"
  946|    226|        ret.tv_sec = 253402300799LL;
  947|    226|    }
  948|  1.99k|#endif
  949|  1.99k|    return ret;
  950|  1.99k|}

gps_hexpack:
  119|    113|{
  120|    113|    ssize_t i, j;
  121|       |
  122|    113|    j = strnlen(src, BUFSIZ) / 2;
  123|    113|    if ((1 > j) ||
  ------------------
  |  Branch (123:9): [True: 2, False: 111]
  ------------------
  124|    111|        ((size_t)j > len)) {
  ------------------
  |  Branch (124:9): [True: 12, False: 99]
  ------------------
  125|     14|        return -2;
  126|     14|    }
  127|       |
  128|    494|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 455, False: 39]
  ------------------
  129|    455|        int k;
  130|    455|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 60, False: 395]
  ------------------
  131|     60|            return -1;
  132|     60|        }
  133|    395|        dst[i] = (char)(k & 0xff);
  134|    395|    }
  135|     39|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     39|    return j;
  137|     99|}
hex.c:hex2bin:
   82|    455|{
   83|    455|    int a, b;
   84|       |
   85|    455|    a = s[0] & 0xff;
   86|    455|    b = s[1] & 0xff;
   87|       |
   88|    455|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 110, False: 345]
  ------------------
   89|    110|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 103, False: 7]
  ------------------
   90|    103|        a = a + 10 - 'a';
   91|    352|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 193, False: 159]
  ------------------
   92|    193|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 178, False: 15]
  ------------------
   93|    178|        a = a + 10 - 'A';
   94|    178|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 165, False: 9]
  ------------------
   95|    165|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 145, False: 20]
  ------------------
   96|    145|        a -= '0';
   97|    145|    } else {
   98|     29|        return -1;
   99|     29|    }
  100|       |
  101|    426|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 97, False: 329]
  ------------------
  102|     97|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 88, False: 9]
  ------------------
  103|     88|        b = b + 10 - 'a';
  104|    338|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 185, False: 153]
  ------------------
  105|    185|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 167, False: 18]
  ------------------
  106|    167|        b = b + 10 - 'A';
  107|    171|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 162, False: 9]
  ------------------
  108|    162|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 140, False: 22]
  ------------------
  109|    140|        b -= '0';
  110|    140|    } else {
  111|     31|        return -1;
  112|     31|    }
  113|       |
  114|    395|    return ((a << 4) + b);
  115|    426|}

json_read_array:
  802|    926|{
  803|    926|    int substatus, offset, arrcount;
  804|    926|    char *tp;
  805|       |
  806|    926|    if (NULL != end)
  ------------------
  |  Branch (806:9): [True: 926, False: 0]
  ------------------
  807|    926|        *end = NULL;    // give it a well-defined value on parse failure
  808|       |
  809|    926|    json_debug_trace(1, "json: %s", "Entered json_read_array()\n");
  ------------------
  |  |  108|    926|    do {                                              \
  |  |  109|    926|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    926|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 926]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 926]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    926|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    926|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 926]
  |  |  ------------------
  ------------------
  810|       |
  811|    926|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (811:12): [True: 0, False: 926]
  ------------------
  812|      0|        cp++;
  813|      0|    }
  814|    926|    if (*cp != '[') {
  ------------------
  |  Branch (814:9): [True: 0, False: 926]
  ------------------
  815|      0|        json_debug_trace(1, "json: %s", "Didn't find expected array start\n");
  ------------------
  |  |  108|      0|    do {                                              \
  |  |  109|      0|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      0|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  816|      0|        return JSON_ERR_ARRAYSTART;
  ------------------
  |  |  161|      0|#define JSON_ERR_ARRAYSTART    10      // didn't find expected array start
  ------------------
  817|      0|    }
  818|    926|    cp++;
  819|       |
  820|    926|    tp = arr->arr.strings.store;
  821|    926|    arrcount = 0;
  822|       |
  823|       |    // Check for empty array
  824|    926|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (824:12): [True: 194, False: 926]
  ------------------
  825|    194|        cp++;
  826|    194|    }
  827|    926|    if (*cp == ']') {
  ------------------
  |  Branch (827:9): [True: 215, False: 711]
  ------------------
  828|    215|        goto breakout;
  829|    215|    }
  830|       |
  831|  7.64k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (831:22): [True: 7.64k, False: 1]
  ------------------
  832|  7.64k|        char *ep = NULL;
  833|       |
  834|  7.64k|        json_debug_trace(1, "json: Looking at %s\n", cp);
  ------------------
  |  |  108|  7.64k|    do {                                              \
  |  |  109|  7.64k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  7.64k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 7.64k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 7.64k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  7.64k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  7.64k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 7.64k]
  |  |  ------------------
  ------------------
  835|  7.64k|        switch (arr->element_type) {
  ------------------
  |  Branch (835:17): [True: 7.64k, False: 0]
  ------------------
  836|  2.91k|        case t_string:
  ------------------
  |  Branch (836:9): [True: 2.91k, False: 4.72k]
  ------------------
  837|  2.91k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (837:17): [True: 194, False: 2.72k]
  ------------------
  838|    194|                cp++;
  839|    194|            }
  840|  2.91k|            if (*cp != '"') {
  ------------------
  |  Branch (840:17): [True: 15, False: 2.90k]
  ------------------
  841|     15|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     15|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  842|  2.90k|            } else {
  843|  2.90k|                ++cp;
  844|  2.90k|            }
  845|  2.90k|            arr->arr.strings.ptrs[offset] = tp;
  846|  13.3k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (846:20): [True: 13.3k, False: 3]
  ------------------
  847|  10.4k|                 tp++)
  848|  13.3k|                if (*cp == '"') {
  ------------------
  |  Branch (848:21): [True: 2.89k, False: 10.4k]
  ------------------
  849|  2.89k|                    ++cp;
  850|  2.89k|                    *tp++ = '\0';
  851|  2.89k|                    goto stringend;
  852|  10.4k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (852:28): [True: 1, False: 10.4k]
  ------------------
  853|      1|                    json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  854|      1|                                      "Bad string syntax in string list.\n");
  855|      1|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      1|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  856|  10.4k|                } else {
  857|  10.4k|                    *tp = *cp++;
  858|  10.4k|                }
  859|      3|            json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      3|    do {                                              \
  |  |  109|      3|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      3|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 3]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 3]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      3|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
  860|      3|                             "Bad string syntax in string list.\n");
  861|      3|            return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      3|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  862|  2.89k|          stringend:
  863|  2.89k|            break;
  864|      0|        case t_object:
  ------------------
  |  Branch (864:9): [True: 0, False: 7.64k]
  ------------------
  865|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  866|  4.72k|        case t_structobject:
  ------------------
  |  Branch (866:9): [True: 4.72k, False: 2.91k]
  ------------------
  867|  4.72k|            substatus =
  868|  4.72k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  869|  4.72k|                                          offset, &cp);
  870|  4.72k|            if (substatus != 0) {
  ------------------
  |  Branch (870:17): [True: 164, False: 4.56k]
  ------------------
  871|    164|                if (NULL != end) {
  ------------------
  |  Branch (871:21): [True: 164, False: 0]
  ------------------
  872|    164|                    *end = cp;
  873|    164|                }
  874|    164|                return substatus;
  875|    164|            }
  876|  4.56k|            break;
  877|  4.56k|        case t_integer:
  ------------------
  |  Branch (877:9): [True: 0, False: 7.64k]
  ------------------
  878|      0|            arr->arr.integers.store[offset] = (int)strtol(cp, &ep, 0);
  879|      0|            if (ep == cp) {
  ------------------
  |  Branch (879:17): [True: 0, False: 0]
  ------------------
  880|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  881|      0|            }
  882|      0|            cp = ep;
  883|      0|            break;
  884|      0|        case t_uinteger:
  ------------------
  |  Branch (884:9): [True: 0, False: 7.64k]
  ------------------
  885|      0|            arr->arr.uintegers.store[offset] = (unsigned int)strtoul(cp,
  886|      0|                                                                     &ep, 0);
  887|      0|            if (ep == cp) {
  ------------------
  |  Branch (887:17): [True: 0, False: 0]
  ------------------
  888|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  889|      0|            }
  890|      0|            cp = ep;
  891|      0|            break;
  892|      0|        case t_longint:
  ------------------
  |  Branch (892:9): [True: 0, False: 7.64k]
  ------------------
  893|      0|            arr->arr.longint.store[offset] = strtol(cp, &ep, 0);
  894|      0|            if (ep == cp) {
  ------------------
  |  Branch (894:17): [True: 0, False: 0]
  ------------------
  895|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  896|      0|            }
  897|      0|            cp = ep;
  898|      0|            break;
  899|      0|        case t_ulongint:
  ------------------
  |  Branch (899:9): [True: 0, False: 7.64k]
  ------------------
  900|      0|            arr->arr.ulongint.store[offset] = strtoul(cp, &ep, 0);
  901|      0|            if (ep == cp) {
  ------------------
  |  Branch (901:17): [True: 0, False: 0]
  ------------------
  902|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  903|      0|            }
  904|      0|            cp = ep;
  905|      0|            break;
  906|      0|        case t_byte:
  ------------------
  |  Branch (906:9): [True: 0, False: 7.64k]
  ------------------
  907|      0|            arr->arr.bytes.store[offset] = (char)strtol(cp, &ep, 0);
  908|      0|            if (ep == cp) {
  ------------------
  |  Branch (908:17): [True: 0, False: 0]
  ------------------
  909|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  910|      0|            }
  911|      0|            cp = ep;
  912|      0|            break;
  913|      0|        case t_ubyte:
  ------------------
  |  Branch (913:9): [True: 0, False: 7.64k]
  ------------------
  914|      0|            arr->arr.ubytes.store[offset] = (unsigned char)strtoul(cp,
  915|      0|                                                                   &ep, 0);
  916|      0|            if (ep == cp) {
  ------------------
  |  Branch (916:17): [True: 0, False: 0]
  ------------------
  917|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  918|      0|            }
  919|      0|            cp = ep;
  920|      0|            break;
  921|      0|        case t_short:
  ------------------
  |  Branch (921:9): [True: 0, False: 7.64k]
  ------------------
  922|      0|            arr->arr.shorts.store[offset] = (short)strtol(cp, &ep, 0);
  923|      0|            if (ep == cp) {
  ------------------
  |  Branch (923:17): [True: 0, False: 0]
  ------------------
  924|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  925|      0|            }
  926|      0|            cp = ep;
  927|      0|            break;
  928|      0|        case t_ushort:
  ------------------
  |  Branch (928:9): [True: 0, False: 7.64k]
  ------------------
  929|      0|            arr->arr.ushorts.store[offset] = (unsigned short)strtoul(cp,
  930|      0|                                                                     &ep, 0);
  931|      0|            if (ep == cp) {
  ------------------
  |  Branch (931:17): [True: 0, False: 0]
  ------------------
  932|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  933|      0|            }
  934|      0|            cp = ep;
  935|      0|            break;
  936|      0|        case t_time:
  ------------------
  |  Branch (936:9): [True: 0, False: 7.64k]
  ------------------
  937|      0|            {
  938|      0|                timespec_t ts_tmp;
  939|      0|                if (*cp != '"') {
  ------------------
  |  Branch (939:21): [True: 0, False: 0]
  ------------------
  940|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  941|      0|                } else {
  942|      0|                    ++cp;
  943|      0|                }
  944|      0|                ts_tmp = iso8601_to_timespec(cp);
  945|      0|                arr->arr.timespecs.store[offset] = ts_tmp;
  946|      0|                while (*cp &&
  ------------------
  |  Branch (946:24): [True: 0, False: 0]
  ------------------
  947|      0|                       *cp != '"') {
  ------------------
  |  Branch (947:24): [True: 0, False: 0]
  ------------------
  948|      0|                    cp++;
  949|      0|                }
  950|      0|                if (*cp != '"') {
  ------------------
  |  Branch (950:21): [True: 0, False: 0]
  ------------------
  951|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  952|      0|                }
  953|      0|                ++cp;
  954|      0|            }
  955|      0|            break;
  956|      0|        case t_timespec:
  ------------------
  |  Branch (956:9): [True: 0, False: 7.64k]
  ------------------
  957|       |            // TODO not sure how to implement this
  958|      0|            return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  959|      0|            break;
  960|      0|        case t_real:
  ------------------
  |  Branch (960:9): [True: 0, False: 7.64k]
  ------------------
  961|      0|            arr->arr.reals.store[offset] = strtod(cp, &ep);
  962|      0|            if (ep == cp) {
  ------------------
  |  Branch (962:17): [True: 0, False: 0]
  ------------------
  963|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  964|      0|            }
  965|      0|            cp = ep;
  966|      0|            break;
  967|      0|        case t_boolean:
  ------------------
  |  Branch (967:9): [True: 0, False: 7.64k]
  ------------------
  968|      0|            if (str_starts_with(cp, "true")) {
  ------------------
  |  Branch (968:17): [True: 0, False: 0]
  ------------------
  969|      0|                arr->arr.booleans.store[offset] = true;
  970|      0|                cp += 4;
  971|      0|            } else if (str_starts_with(cp, "false")) {
  ------------------
  |  Branch (971:24): [True: 0, False: 0]
  ------------------
  972|      0|                arr->arr.booleans.store[offset] = false;
  973|      0|                cp += 5;
  974|      0|            }
  975|      0|            break;
  976|      0|        case t_character:
  ------------------
  |  Branch (976:9): [True: 0, False: 7.64k]
  ------------------
  977|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  978|      0|        case t_array:
  ------------------
  |  Branch (978:9): [True: 0, False: 7.64k]
  ------------------
  979|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  980|      0|        case t_check:
  ------------------
  |  Branch (980:9): [True: 0, False: 7.64k]
  ------------------
  981|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  982|      0|        case t_ignore:
  ------------------
  |  Branch (982:9): [True: 0, False: 7.64k]
  ------------------
  983|      0|            json_debug_trace(1, "json: %s", "Invalid array subtype.\n");
  ------------------
  |  |  108|      0|    do {                                              \
  |  |  109|      0|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      0|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  984|      0|            return JSON_ERR_SUBTYPE;
  ------------------
  |  |  165|      0|#define JSON_ERR_SUBTYPE       14      // unsupported array element type
  ------------------
  985|  7.64k|        }
  986|  7.46k|        arrcount++;
  987|  7.46k|        if (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (987:13): [True: 194, False: 7.26k]
  ------------------
  988|    194|            cp++;
  989|    194|        }
  990|  7.46k|        if (*cp == ']') {
  ------------------
  |  Branch (990:13): [True: 384, False: 7.07k]
  ------------------
  991|    384|            json_debug_trace(1, "json: %s", "End of array found.\n");
  ------------------
  |  |  108|    384|    do {                                              \
  |  |  109|    384|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    384|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 384]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 384]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    384|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    384|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 384]
  |  |  ------------------
  ------------------
  992|    384|            goto breakout;
  993|    384|        }
  994|  7.07k|        if (*cp == ',') {
  ------------------
  |  Branch (994:13): [True: 6.93k, False: 143]
  ------------------
  995|  6.93k|            cp++;
  996|  6.93k|        } else {
  997|    143|            json_debug_trace(1, "json: %s", "Bad trailing syntax on array.\n");
  ------------------
  |  |  108|    143|    do {                                              \
  |  |  109|    143|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    143|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 143]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 143]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    143|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    143|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 143]
  |  |  ------------------
  ------------------
  998|    143|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    143|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
  999|    143|        }
 1000|  7.07k|    }
 1001|      1|    json_debug_trace(1, "json: %s", "Too many elements in array.\n");
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1002|      1|    if (NULL != end) {
  ------------------
  |  Branch (1002:9): [True: 1, False: 0]
  ------------------
 1003|      1|        *end = cp;
 1004|      1|    }
 1005|      1|    return JSON_ERR_SUBTOOLONG;
  ------------------
  |  |  163|      1|#define JSON_ERR_SUBTOOLONG    12      // too many array elements
  ------------------
 1006|    599|  breakout:
 1007|    599|    if (NULL != arr->count) {
  ------------------
  |  Branch (1007:9): [True: 599, False: 0]
  ------------------
 1008|    599|        *(arr->count) = arrcount;
 1009|    599|    }
 1010|    599|    if (NULL != end) {
  ------------------
  |  Branch (1010:9): [True: 599, False: 0]
  ------------------
 1011|    599|        *end = cp;
 1012|    599|    }
 1013|    599|    json_debug_trace(1, "json: leaving json_read_array() with %d elements\n",
  ------------------
  |  |  108|    599|    do {                                              \
  |  |  109|    599|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    599|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 599]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 599]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    599|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    599|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 599]
  |  |  ------------------
  ------------------
 1014|    599|                      arrcount);
 1015|    599|    return 0;
 1016|    711|}
json_read_object:
 1020|  5.15k|{
 1021|  5.15k|    int st;
 1022|       |
 1023|  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]
  |  |  ------------------
  ------------------
 1024|       |    st = json_internal_read_object(cp, attrs, NULL, 0, end);
 1025|  5.15k|    return st;
 1026|  5.15k|}
json.c:json_internal_read_object:
  199|  9.88k|{
  200|  9.88k|    enum
  201|  9.88k|    { init, await_attr, in_attr, await_value, in_val_string,
  202|  9.88k|        in_escape, in_val_token, post_val, post_element, in_ignore_array
  203|  9.88k|    } state = 0;
  204|  9.88k|    char *statenames[] = {
  205|  9.88k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  206|  9.88k|        "in_escape", "in_val_token", "post_val", "post_element",
  207|  9.88k|        "in_ignore_array"
  208|  9.88k|    };
  209|  9.88k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  210|  9.88k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  211|  9.88k|    bool value_quoted = false;
  212|  9.88k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  213|  9.88k|    const struct json_attr_t *cursor;
  214|  9.88k|    int substatus, maxlen = 0;
  215|  9.88k|    unsigned int u;
  216|  9.88k|    const struct json_enum_t *mp;
  217|  9.88k|    char *lptr;
  218|       |
  219|  9.88k|    if (NULL != end) {
  ------------------
  |  Branch (219:9): [True: 4.72k, False: 5.15k]
  ------------------
  220|  4.72k|        *end = NULL;    // give it a well-defined value on parse failure
  221|  4.72k|    }
  222|  9.88k|    memset(valbuf, 0, sizeof(valbuf));
  223|       |
  224|       |    // stuff fields with defaults in case they're omitted in the JSON input
  225|   152k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (225:26): [True: 142k, False: 9.88k]
  ------------------
  226|   142k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (226:13): [True: 141k, False: 150]
  ------------------
  227|   141k|            lptr = json_target_address(cursor, parent, offset);
  228|   141k|            if (NULL != lptr)
  ------------------
  |  Branch (228:17): [True: 131k, False: 10.3k]
  ------------------
  229|   131k|                switch (cursor->type) {
  ------------------
  |  Branch (229:25): [True: 131k, False: 0]
  ------------------
  230|  2.97k|                case t_byte:
  ------------------
  |  Branch (230:17): [True: 2.97k, False: 128k]
  ------------------
  231|  2.97k|                    lptr[0] = cursor->dflt.byte;
  232|  2.97k|                    break;
  233|  18.0k|                case t_ubyte:
  ------------------
  |  Branch (233:17): [True: 18.0k, False: 113k]
  ------------------
  234|  18.0k|                    lptr[0] = cursor->dflt.ubyte;
  235|  18.0k|                    break;
  236|  17.9k|                case t_integer:
  ------------------
  |  Branch (236:17): [True: 17.9k, False: 113k]
  ------------------
  237|  17.9k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  238|  17.9k|                    break;
  239|  7.59k|                case t_uinteger:
  ------------------
  |  Branch (239:17): [True: 7.59k, False: 124k]
  ------------------
  240|  7.59k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  241|  7.59k|                    break;
  242|    938|                case t_longint:
  ------------------
  |  Branch (242:17): [True: 938, False: 130k]
  ------------------
  243|    938|                    memcpy(lptr, &cursor->dflt.longint, sizeof(long));
  244|    938|                    break;
  245|    126|                case t_ulongint:
  ------------------
  |  Branch (245:17): [True: 126, False: 131k]
  ------------------
  246|    126|                    memcpy(lptr, &cursor->dflt.ulongint,
  247|    126|                           sizeof(unsigned long));
  248|    126|                    break;
  249|  2.97k|                case t_short:
  ------------------
  |  Branch (249:17): [True: 2.97k, False: 128k]
  ------------------
  250|  2.97k|                    memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
  251|  2.97k|                    break;
  252|      0|                case t_ushort:
  ------------------
  |  Branch (252:17): [True: 0, False: 131k]
  ------------------
  253|      0|                    memcpy(lptr, &cursor->dflt.ushortint,
  254|      0|                           sizeof(unsigned short));
  255|      0|                    break;
  256|  1.81k|                case t_time:
  ------------------
  |  Branch (256:17): [True: 1.81k, False: 129k]
  ------------------
  257|  1.81k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  258|  1.81k|                    break;
  259|  1.42k|                case t_timespec:
  ------------------
  |  Branch (259:17): [True: 1.42k, False: 130k]
  ------------------
  260|  1.42k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  261|  1.42k|                    break;
  262|  55.3k|                case t_real:
  ------------------
  |  Branch (262:17): [True: 55.3k, False: 76.2k]
  ------------------
  263|  55.3k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  264|  55.3k|                    break;
  265|  11.6k|                case t_string:
  ------------------
  |  Branch (265:17): [True: 11.6k, False: 119k]
  ------------------
  266|  11.6k|                    if (parent != NULL
  ------------------
  |  Branch (266:25): [True: 5.28k, False: 6.35k]
  ------------------
  267|  5.28k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (267:28): [True: 0, False: 5.28k]
  ------------------
  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|  11.6k|                    lptr[0] = '\0';
  271|  11.6k|                    break;
  272|  4.07k|                case t_boolean:
  ------------------
  |  Branch (272:17): [True: 4.07k, False: 127k]
  ------------------
  273|  4.07k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  274|  4.07k|                    break;
  275|  1.23k|                case t_character:
  ------------------
  |  Branch (275:17): [True: 1.23k, False: 130k]
  ------------------
  276|  1.23k|                    lptr[0] = cursor->dflt.character;
  277|  1.23k|                    break;
  278|      0|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (278:17): [True: 0, False: 131k]
  ------------------
  279|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  280|      0|                case t_structobject:
  ------------------
  |  Branch (280:17): [True: 0, False: 131k]
  ------------------
  281|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  282|      0|                case t_array:
  ------------------
  |  Branch (282:17): [True: 0, False: 131k]
  ------------------
  283|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  284|    710|                case t_check:
  ------------------
  |  Branch (284:17): [True: 710, False: 130k]
  ------------------
  285|    710|                    FALLTHROUGH
  ------------------
  |  |   55|    710|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  286|  5.42k|                case t_ignore:
  ------------------
  |  Branch (286:17): [True: 4.71k, False: 126k]
  ------------------
  287|  5.42k|                    break;
  288|   131k|                }
  289|   141k|        }
  290|       |
  291|  9.88k|    json_debug_trace(1, "json: JSON parse of '%s' begins.\n", cp);
  ------------------
  |  |  108|  9.88k|    do {                                              \
  |  |  109|  9.88k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  9.88k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9.88k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9.88k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  9.88k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  9.88k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9.88k]
  |  |  ------------------
  ------------------
  292|       |
  293|       |    // parse input JSON
  294|   578k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (294:12): [True: 575k, False: 3.19k]
  ------------------
  295|   575k|        json_debug_trace(2, "json: State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  108|   575k|    do {                                              \
  |  |  109|   575k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   575k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 575k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 575k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   575k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   575k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 575k]
  |  |  ------------------
  ------------------
  296|   575k|                          statenames[state], *cp, cp);
  297|   575k|        switch (state) {
  ------------------
  |  Branch (297:17): [True: 575k, False: 0]
  ------------------
  298|  10.4k|        case init:
  ------------------
  |  Branch (298:9): [True: 10.4k, False: 564k]
  ------------------
  299|  10.4k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (299:17): [True: 600, False: 9.83k]
  ------------------
  300|    600|                continue;
  301|    600|            }
  302|  9.83k|            if (*cp == '{') {
  ------------------
  |  Branch (302:17): [True: 9.79k, False: 44]
  ------------------
  303|  9.79k|                state = await_attr;
  304|  9.79k|            } else {
  305|     44|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     44|    do {                                              \
  |  |  109|     44|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     44|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     44|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     44|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 44]
  |  |  ------------------
  ------------------
  306|     44|                                  "Non-WS when expecting object start.\n");
  307|     44|                if (NULL != end) {
  ------------------
  |  Branch (307:21): [True: 44, False: 0]
  ------------------
  308|     44|                    *end = cp;
  309|     44|                }
  310|     44|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     44|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  311|     44|            }
  312|  9.79k|            break;
  313|  40.8k|        case await_attr:
  ------------------
  |  Branch (313:9): [True: 40.8k, False: 534k]
  ------------------
  314|  40.8k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (314:17): [True: 205, False: 40.6k]
  ------------------
  315|    205|                continue;
  316|    205|            }
  317|  40.6k|            if (*cp == '"') {
  ------------------
  |  Branch (317:17): [True: 40.3k, False: 294]
  ------------------
  318|  40.3k|                state = in_attr;
  319|  40.3k|                pattr = attrbuf;
  320|  40.3k|                if (NULL != end) {
  ------------------
  |  Branch (320:21): [True: 6.12k, False: 34.2k]
  ------------------
  321|  6.12k|                    *end = cp;
  322|  6.12k|                }
  323|  40.3k|            } else if (*cp == '}') {
  ------------------
  |  Branch (323:24): [True: 202, False: 92]
  ------------------
  324|    202|                break;
  325|    202|            } else {
  326|     92|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     92|    do {                                              \
  |  |  109|     92|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     92|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 92]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 92]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     92|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     92|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 92]
  |  |  ------------------
  ------------------
  327|     92|                          "Non-WS when expecting attribute.\n");
  328|     92|                if (NULL != end) {
  ------------------
  |  Branch (328:21): [True: 3, False: 89]
  ------------------
  329|      3|                    *end = cp;
  330|      3|                }
  331|     92|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|     92|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  332|     92|            }
  333|  40.3k|            break;
  334|   175k|        case in_attr:
  ------------------
  |  Branch (334:9): [True: 175k, False: 400k]
  ------------------
  335|   175k|            if (NULL == pattr) {
  ------------------
  |  Branch (335:17): [True: 0, False: 175k]
  ------------------
  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|   175k|            if (*cp == '"') {
  ------------------
  |  Branch (339:17): [True: 40.3k, False: 134k]
  ------------------
  340|  40.3k|                *pattr++ = '\0';
  341|  40.3k|                json_debug_trace(1, "json: Collected attribute name %s\n",
  ------------------
  |  |  108|  40.3k|    do {                                              \
  |  |  109|  40.3k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  40.3k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 40.3k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 40.3k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  40.3k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  40.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 40.3k]
  |  |  ------------------
  ------------------
  342|  40.3k|                                  attrbuf);
  343|   455k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (343:38): [True: 455k, False: 98]
  ------------------
  344|   455k|                    json_debug_trace(2, "json: Checking against %s\n",
  ------------------
  |  |  108|   455k|    do {                                              \
  |  |  109|   455k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   455k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 455k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 455k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   455k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   455k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 455k]
  |  |  ------------------
  ------------------
  345|   455k|                                      cursor->attribute);
  346|   455k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (346:25): [True: 26.4k, False: 429k]
  ------------------
  347|  26.4k|                        break;
  348|  26.4k|                    }
  349|   429k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (349:25): [True: 14.0k, False: 415k]
  ------------------
  350|  14.0k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (350:25): [True: 13.8k, False: 239]
  ------------------
  351|  13.8k|                        break;
  352|  13.8k|                    }
  353|   429k|                }
  354|  40.3k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (354:21): [True: 98, False: 40.2k]
  ------------------
  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|  40.2k|                state = await_value;
  363|  40.2k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (363:21): [True: 1.21k, False: 39.0k]
  ------------------
  364|  1.21k|                    maxlen = (int)cursor->len - 1;
  365|  39.0k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (365:28): [True: 2.18k, False: 36.8k]
  ------------------
  366|  2.18k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  2.18k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  367|  36.8k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (367:28): [True: 2.98k, False: 33.8k]
  ------------------
  368|  33.8k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (368:28): [True: 19.1k, False: 14.6k]
  ------------------
  369|  22.1k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  22.1k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  370|  22.1k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (370:28): [True: 447, False: 14.2k]
  ------------------
  371|    447|                    maxlen = (int)sizeof(valbuf) - 1;
  372|    447|                }
  373|  40.2k|                pval = valbuf;
  374|   134k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   134k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (374:24): [True: 23, False: 134k]
  ------------------
  375|     23|                json_debug_trace(1, "json: %s","Attribute name too long.\n");
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  376|       |                // don't update end here, leave at attribute start
  377|     23|                return JSON_ERR_ATTRLEN;
  ------------------
  |  |  155|     23|#define JSON_ERR_ATTRLEN        4      // attribute name too long
  ------------------
  378|   134k|            } else {
  379|   134k|                *pattr++ = *cp;
  380|   134k|            }
  381|   174k|            break;
  382|   174k|        case await_value:
  ------------------
  |  Branch (382:9): [True: 43.1k, False: 532k]
  ------------------
  383|  43.1k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (383:17): [True: 203, False: 42.9k]
  ------------------
  384|  42.9k|                *cp == ':') {
  ------------------
  |  Branch (384:17): [True: 2.77k, False: 40.1k]
  ------------------
  385|  2.98k|                continue;
  386|  2.98k|            }
  387|  40.1k|            if (*cp == '[') {
  ------------------
  |  Branch (387:17): [True: 2.53k, False: 37.5k]
  ------------------
  388|  2.53k|                if (cursor->type == t_ignore) {
  ------------------
  |  Branch (388:21): [True: 1.58k, False: 951]
  ------------------
  389|       |                    /* skip to terminating ], not being fooled by
  390|       |                     * sub arrays, etc.
  391|       |                     * FIXME:  someday  */
  392|  1.58k|                    state = in_ignore_array;;
  393|  1.58k|                    value_quoted = false;
  394|  1.58k|                    break;
  395|  1.58k|                }
  396|    951|                if (cursor->type != t_array) {
  ------------------
  |  Branch (396:21): [True: 25, False: 926]
  ------------------
  397|     25|                    json_debug_trace(1,"json: %s",
  ------------------
  |  |  108|     25|    do {                                              \
  |  |  109|     25|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     25|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 25]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 25]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     25|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     25|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 25]
  |  |  ------------------
  ------------------
  398|     25|                                      "Saw [ when not expecting array.\n");
  399|     25|                    if (NULL != end) {
  ------------------
  |  Branch (399:25): [True: 2, False: 23]
  ------------------
  400|      2|                        *end = cp;
  401|      2|                    }
  402|     25|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|     25|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  403|     25|                }
  404|    926|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  405|    926|                if (substatus != 0) {
  ------------------
  |  Branch (405:21): [True: 327, False: 599]
  ------------------
  406|    327|                    return substatus;
  407|    327|                }
  408|    599|                state = post_element;
  409|  37.5k|            } else if (cursor->type == t_array) {
  ------------------
  |  Branch (409:24): [True: 1, False: 37.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|  37.5k|            } else if (*cp == '"') {
  ------------------
  |  Branch (416:24): [True: 9.41k, False: 28.1k]
  ------------------
  417|  9.41k|                value_quoted = true;
  418|  9.41k|                state = in_val_string;
  419|  9.41k|                pval = valbuf;
  420|  28.1k|            } else {
  421|  28.1k|                value_quoted = false;
  422|  28.1k|                state = in_val_token;
  423|  28.1k|                pval = valbuf;
  424|  28.1k|                *pval++ = *cp;
  425|  28.1k|            }
  426|  38.1k|            break;
  427|  84.9k|        case in_ignore_array:
  ------------------
  |  Branch (427:9): [True: 84.9k, False: 490k]
  ------------------
  428|  84.9k|            if (*cp == '"') {
  ------------------
  |  Branch (428:17): [True: 21.0k, False: 63.8k]
  ------------------
  429|  21.0k|                if (value_quoted == false) {
  ------------------
  |  Branch (429:21): [True: 10.6k, False: 10.4k]
  ------------------
  430|       |                    // now in quotes
  431|  10.6k|                    value_quoted = true;
  432|  10.6k|                } else {
  433|  10.4k|                    value_quoted = false;
  434|  10.4k|                }
  435|  63.8k|            } else if (*cp == ']') {
  ------------------
  |  Branch (435:24): [True: 1.43k, False: 62.4k]
  ------------------
  436|       |                // FIXME: does not handle sub arrays, etc.
  437|  1.43k|                if (value_quoted == false) {
  ------------------
  |  Branch (437:21): [True: 1.18k, False: 250]
  ------------------
  438|  1.18k|                    state = post_val;
  439|  1.18k|                }
  440|       |                // else in quotes, ignore it.
  441|  1.43k|            }
  442|  84.9k|            break;
  443|  70.3k|        case in_val_string:
  ------------------
  |  Branch (443:9): [True: 70.3k, False: 504k]
  ------------------
  444|  70.3k|            if (NULL == pval) {
  ------------------
  |  Branch (444:17): [True: 0, False: 70.3k]
  ------------------
  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|  70.3k|            if (*cp == '\\') {
  ------------------
  |  Branch (448:17): [True: 1.70k, False: 68.6k]
  ------------------
  449|  1.70k|                state = in_escape;
  450|  68.6k|            } else if (*cp == '"') {
  ------------------
  |  Branch (450:24): [True: 8.98k, False: 59.6k]
  ------------------
  451|  8.98k|                *pval++ = '\0';
  452|  8.98k|                json_debug_trace(1, "json: Collected string value %s\n", valbuf);
  ------------------
  |  |  108|  8.98k|    do {                                              \
  |  |  109|  8.98k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.98k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.98k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.98k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.98k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.98k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.98k]
  |  |  ------------------
  ------------------
  453|  8.98k|                state = post_val;
  454|  59.6k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  59.6k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (454:24): [True: 3, False: 59.6k]
  ------------------
  455|  59.6k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (455:24): [True: 109, False: 59.5k]
  ------------------
  456|    112|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|    112|    do {                                              \
  |  |  109|    112|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    112|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 112]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 112]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    112|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    112|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 112]
  |  |  ------------------
  ------------------
  457|       |                // don't update end here, leave at value start
  458|    112|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|    112|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  459|  59.5k|            } else {
  460|  59.5k|                *pval++ = *cp;
  461|  59.5k|            }
  462|  70.2k|            break;
  463|  70.2k|        case in_escape:
  ------------------
  |  Branch (463:9): [True: 1.70k, False: 573k]
  ------------------
  464|  1.70k|            if (NULL == pval) {
  ------------------
  |  Branch (464:17): [True: 0, False: 1.70k]
  ------------------
  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.70k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  1.70k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (468:17): [True: 3, False: 1.70k]
  ------------------
  469|  1.70k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (469:17): [True: 6, False: 1.69k]
  ------------------
  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.69k|            switch (*cp) {
  475|    200|            case 'b':
  ------------------
  |  Branch (475:13): [True: 200, False: 1.49k]
  ------------------
  476|    200|                *pval++ = '\b';
  477|    200|                break;
  478|    195|            case 'f':
  ------------------
  |  Branch (478:13): [True: 195, False: 1.50k]
  ------------------
  479|    195|                *pval++ = '\f';
  480|    195|                break;
  481|    210|            case 'n':
  ------------------
  |  Branch (481:13): [True: 210, False: 1.48k]
  ------------------
  482|    210|                *pval++ = '\n';
  483|    210|                break;
  484|    201|            case 'r':
  ------------------
  |  Branch (484:13): [True: 201, False: 1.49k]
  ------------------
  485|    201|                *pval++ = '\r';
  486|    201|                break;
  487|    400|            case 't':
  ------------------
  |  Branch (487:13): [True: 400, False: 1.29k]
  ------------------
  488|    400|                *pval++ = '\t';
  489|    400|                break;
  490|    277|            case 'u':
  ------------------
  |  Branch (490:13): [True: 277, False: 1.41k]
  ------------------
  491|    277|                {
  492|    277|                    unsigned n;
  493|       |
  494|    277|                    cp++;                   // skip the 'u'
  495|       |                    // NetBSD 6 wants the cast
  496|  1.14k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (496:33): [True: 949, False: 194]
  |  Branch (496:42): [True: 866, False: 83]
  ------------------
  497|    866|                        uescape[n] = *cp++;
  498|    866|                    }
  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|    212|            default:            // handles double quote and solidus
  ------------------
  |  Branch (510:13): [True: 212, False: 1.48k]
  ------------------
  511|    212|                *pval++ = *cp;
  512|    212|                break;
  513|  1.69k|            }
  514|  1.61k|            state = in_val_string;
  515|  1.61k|            break;
  516|   110k|        case in_val_token:
  ------------------
  |  Branch (516:9): [True: 110k, False: 464k]
  ------------------
  517|   110k|            if (NULL == pval) {
  ------------------
  |  Branch (517:17): [True: 0, False: 110k]
  ------------------
  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|   110k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (521:17): [True: 340, False: 110k]
  ------------------
  522|   110k|                *cp == ',' ||
  ------------------
  |  Branch (522:17): [True: 22.9k, False: 87.7k]
  ------------------
  523|  87.7k|                *cp == '}') {
  ------------------
  |  Branch (523:17): [True: 4.66k, False: 83.0k]
  ------------------
  524|  27.9k|                *pval = '\0';
  525|  27.9k|                json_debug_trace(1, "json: Collected token valuen %s\n",
  ------------------
  |  |  108|  27.9k|    do {                                              \
  |  |  109|  27.9k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  27.9k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 27.9k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 27.9k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  27.9k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  27.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 27.9k]
  |  |  ------------------
  ------------------
  526|  27.9k|                                 valbuf);
  527|  27.9k|                state = post_val;
  528|  27.9k|                if (*cp == '}' ||
  ------------------
  |  Branch (528:21): [True: 4.66k, False: 23.2k]
  ------------------
  529|  27.6k|                    *cp == ',') {
  ------------------
  |  Branch (529:21): [True: 22.9k, False: 340]
  ------------------
  530|  27.6k|                    --cp;
  531|  27.6k|                }
  532|  83.0k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|  83.0k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (532:24): [True: 6, False: 83.0k]
  ------------------
  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|  83.0k|            } else {
  537|  83.0k|                *pval++ = *cp;
  538|  83.0k|            }
  539|   110k|            break;
  540|       |            // coverity[unterminated_case]
  541|   110k|        case post_val:
  ------------------
  |  Branch (541:9): [True: 36.9k, False: 538k]
  ------------------
  542|       |            // Ignore whitespace after either string or token values.
  543|  36.9k|	  if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (543:8): [True: 243, False: 36.6k]
  ------------------
  544|  1.01k|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (544:24): [True: 997, False: 17]
  |  Branch (544:39): [True: 771, False: 226]
  ------------------
  545|    771|                    ++cp;
  546|    771|                }
  547|    243|                json_debug_trace(1,
  ------------------
  |  |  108|    243|    do {                                              \
  |  |  109|    243|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    243|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 243]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 243]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    243|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    243|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 243]
  |  |  ------------------
  ------------------
  548|    243|                    "json: Skipped trailing whitespace: value \"%s\"\n", valbuf);
  549|    243|            }
  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|  36.9k|            for (;;) {
  559|  36.9k|                int seeking = cursor->type;
  560|       |
  561|  36.9k|                if (value_quoted &&
  ------------------
  |  Branch (561:21): [True: 7.84k, False: 29.0k]
  ------------------
  562|  7.84k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (562:22): [True: 1.18k, False: 6.66k]
  ------------------
  563|  6.66k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (563:22): [True: 1.99k, False: 4.67k]
  ------------------
  564|  3.17k|                    break;
  565|  3.17k|                }
  566|  33.7k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (566:22): [True: 1.91k, False: 31.8k]
  ------------------
  567|  31.8k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (567:22): [True: 194, False: 31.6k]
  ------------------
  568|  2.11k|                    seeking == t_boolean) {
  ------------------
  |  Branch (568:21): [True: 1.61k, False: 500]
  ------------------
  569|  1.61k|                    break;
  570|  1.61k|                }
  571|  32.1k|                if (isdigit((unsigned char) valbuf[0])) {
  ------------------
  |  Branch (571:21): [True: 17.1k, False: 14.9k]
  ------------------
  572|  17.1k|                    bool decimal = strchr(valbuf, '.') != NULL;
  573|       |
  574|  17.1k|                    if (decimal &&
  ------------------
  |  Branch (574:25): [True: 1.17k, False: 16.0k]
  ------------------
  575|  1.17k|                        seeking == t_real) {
  ------------------
  |  Branch (575:25): [True: 264, False: 909]
  ------------------
  576|    264|                        break;
  577|    264|                    }
  578|  16.9k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (578:25): [True: 16.0k, False: 909]
  |  Branch (578:38): [True: 194, False: 15.8k]
  ------------------
  579|  15.8k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (579:38): [True: 372, False: 15.4k]
  ------------------
  580|  15.4k|                                     seeking == t_integer ||
  ------------------
  |  Branch (580:38): [True: 1.12k, False: 14.3k]
  ------------------
  581|  14.3k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (581:38): [True: 729, False: 13.5k]
  ------------------
  582|  13.5k|                                     seeking == t_longint ||
  ------------------
  |  Branch (582:38): [True: 612, False: 12.9k]
  ------------------
  583|  12.9k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (583:38): [True: 399, False: 12.5k]
  ------------------
  584|  12.5k|                                     seeking == t_time ||
  ------------------
  |  Branch (584:38): [True: 233, False: 12.3k]
  ------------------
  585|  12.3k|                                     seeking == t_short ||
  ------------------
  |  Branch (585:38): [True: 1.38k, False: 10.9k]
  ------------------
  586|  10.9k|                                     seeking == t_ushort))
  ------------------
  |  Branch (586:38): [True: 0, False: 10.9k]
  ------------------
  587|  5.04k|                        break;
  588|  16.9k|                }
  589|  26.8k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (589:21): [True: 18.3k, False: 8.43k]
  ------------------
  590|  18.3k|                    break;
  591|  18.3k|                }
  592|  8.43k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (592:21): [True: 8.43k, False: 0]
  ------------------
  593|  8.43k|                    break;
  594|  8.43k|                }
  595|      0|                ++cursor;
  596|      0|            }
  597|  36.9k|            if (value_quoted &&
  ------------------
  |  Branch (597:17): [True: 7.84k, False: 29.0k]
  ------------------
  598|  7.84k|                (cursor->type != t_string &&
  ------------------
  |  Branch (598:18): [True: 6.66k, False: 1.18k]
  ------------------
  599|  6.66k|                 cursor->type != t_character &&
  ------------------
  |  Branch (599:18): [True: 6.46k, False: 200]
  ------------------
  600|  6.46k|                 cursor->type != t_check &&
  ------------------
  |  Branch (600:18): [True: 5.73k, False: 727]
  ------------------
  601|  5.73k|                 cursor->type != t_time &&
  ------------------
  |  Branch (601:18): [True: 3.74k, False: 1.99k]
  ------------------
  602|  3.74k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (602:18): [True: 464, False: 3.28k]
  ------------------
  603|    464|                 cursor->map == 0)) {
  ------------------
  |  Branch (603:18): [True: 25, False: 439]
  ------------------
  604|     25|                json_debug_trace(1, "json: %s", "Saw quoted value when expecting"
  ------------------
  |  |  108|     25|    do {                                              \
  |  |  109|     25|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     25|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 25]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 25]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     25|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     25|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 25]
  |  |  ------------------
  ------------------
  605|     25|                                  " non-string.\n");
  606|     25|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     25|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  607|     25|            }
  608|  36.8k|            if (!value_quoted &&
  ------------------
  |  Branch (608:17): [True: 29.0k, False: 7.82k]
  ------------------
  609|  29.0k|                (cursor->type == t_string ||
  ------------------
  |  Branch (609:18): [True: 20, False: 29.0k]
  ------------------
  610|  29.0k|                 cursor->type == t_check ||
  ------------------
  |  Branch (610:18): [True: 31, False: 29.0k]
  ------------------
  611|  29.0k|                 cursor->map != 0)) {
  ------------------
  |  Branch (611:18): [True: 7, False: 29.0k]
  ------------------
  612|     58|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     58|    do {                                              \
  |  |  109|     58|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     58|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 58]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 58]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     58|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     58|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 58]
  |  |  ------------------
  ------------------
  613|     58|                                 "Didn't see quoted value when expecting"
  614|     58|                                 " string.\n");
  615|     58|                return JSON_ERR_NONQSTRING;
  ------------------
  |  |  171|     58|#define JSON_ERR_NONQSTRING    20      // no quoted value when expecting string
  ------------------
  616|     58|            }
  617|  36.8k|            if (cursor->map != 0) {
  ------------------
  |  Branch (617:17): [True: 439, False: 36.3k]
  ------------------
  618|    882|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (618:40): [True: 817, False: 65]
  ------------------
  619|    817|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (619:25): [True: 374, False: 443]
  ------------------
  620|    374|                        goto foundit;
  621|    374|                    }
  622|     65|                json_debug_trace(1,
  ------------------
  |  |  108|     65|    do {                                              \
  |  |  109|     65|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     65|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 65]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 65]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     65|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     65|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 65]
  |  |  ------------------
  ------------------
  623|     65|                                 "json: Invalid enumerated value string %s.\n",
  624|     65|                                  valbuf);
  625|     65|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     65|#define JSON_ERR_BADENUM       18      // invalid enumerated value
  ------------------
  626|    374|              foundit:
  627|    374|                (void)snprintf(valbuf, sizeof(valbuf), "%d", mp->value);
  628|    374|            }
  629|  36.7k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (629:17): [True: 727, False: 36.0k]
  ------------------
  630|    727|                lptr = cursor->dflt.check;
  631|  36.0k|            } else {
  632|  36.0k|                lptr = json_target_address(cursor, parent, offset);
  633|  36.0k|            }
  634|  36.7k|            if (NULL != lptr) {
  ------------------
  |  Branch (634:17): [True: 20.7k, False: 16.0k]
  ------------------
  635|  20.7k|                switch (cursor->type) {
  ------------------
  |  Branch (635:25): [True: 20.7k, False: 0]
  ------------------
  636|    220|                case t_byte:
  ------------------
  |  Branch (636:17): [True: 220, False: 20.5k]
  ------------------
  637|    220|                    {
  638|    220|                        int tmp = atoi(valbuf);
  639|    220|                        lptr[0] = (char)tmp;
  640|    220|                    }
  641|    220|                    break;
  642|    820|                case t_ubyte:
  ------------------
  |  Branch (642:17): [True: 820, False: 19.9k]
  ------------------
  643|    820|                    {
  644|    820|                        int tmp = atoi(valbuf);
  645|    820|                        lptr[0] = (unsigned char)tmp;
  646|    820|                    }
  647|    820|                    break;
  648|  1.66k|                case t_integer:
  ------------------
  |  Branch (648:17): [True: 1.66k, False: 19.0k]
  ------------------
  649|  1.66k|                    {
  650|  1.66k|                        int tmp = atoi(valbuf);
  651|  1.66k|                        memcpy(lptr, &tmp, sizeof(int));
  652|  1.66k|                    }
  653|  1.66k|                    break;
  654|  1.04k|                case t_uinteger:
  ------------------
  |  Branch (654:17): [True: 1.04k, False: 19.6k]
  ------------------
  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|    628|                case t_longint:
  ------------------
  |  Branch (660:17): [True: 628, False: 20.0k]
  ------------------
  661|    628|                    {
  662|    628|                        long tmp = atol(valbuf);
  663|    628|                        memcpy(lptr, &tmp, sizeof(long));
  664|    628|                    }
  665|    628|                    break;
  666|    420|                case t_ulongint:
  ------------------
  |  Branch (666:17): [True: 420, False: 20.3k]
  ------------------
  667|    420|                    {
  668|    420|                        unsigned long tmp = (unsigned long)atoll(valbuf);
  669|    420|                        memcpy(lptr, &tmp, sizeof(unsigned long));
  670|    420|                    }
  671|    420|                    break;
  672|  1.40k|                case t_short:
  ------------------
  |  Branch (672:17): [True: 1.40k, False: 19.3k]
  ------------------
  673|  1.40k|                    {
  674|  1.40k|                        short tmp = atoi(valbuf);
  675|  1.40k|                        memcpy(lptr, &tmp, sizeof(short));
  676|  1.40k|                    }
  677|  1.40k|                    break;
  678|      0|                case t_ushort:
  ------------------
  |  Branch (678:17): [True: 0, False: 20.7k]
  ------------------
  679|      0|                    {
  680|      0|                        unsigned short tmp = (unsigned int)atoi(valbuf);
  681|      0|                        memcpy(lptr, &tmp, sizeof(unsigned short));
  682|      0|                    }
  683|      0|                    break;
  684|  2.98k|                case t_time:
  ------------------
  |  Branch (684:17): [True: 2.98k, False: 17.7k]
  ------------------
  685|  2.98k|                    {
  686|  2.98k|                        timespec_t ts_tmp = {0, 0};
  687|       |
  688|  2.98k|                        if (value_quoted) {
  ------------------
  |  Branch (688:29): [True: 1.99k, False: 992]
  ------------------
  689|  1.99k|                            ts_tmp = iso8601_to_timespec(valbuf);
  690|  1.99k|                        } else if (NULL == strchr(valbuf, '.')) {
  ------------------
  |  Branch (690:36): [True: 298, False: 694]
  ------------------
  691|       |                            // integer
  692|    298|                            ts_tmp.tv_sec = (time_t)atoll(valbuf);
  693|    694|                        } else {
  694|       |                            // real
  695|    694|                            double sec_tmp = safe_atof(valbuf);
  696|    694|                            if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (696:33): [True: 499, False: 195]
  ------------------
  697|    499|                                DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    499|    do { \
  |  |  145|    499|        double int_part; \
  |  |  146|    499|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    499|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    499|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 499]
  |  |  ------------------
  ------------------
  698|    499|                            }  // else, leave at default
  699|    694|                        }
  700|  2.98k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  701|  2.98k|                    }
  702|  2.98k|                    break;
  703|    389|                case t_timespec:
  ------------------
  |  Branch (703:17): [True: 389, False: 20.3k]
  ------------------
  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.58k|                case t_real:
  ------------------
  |  Branch (713:17): [True: 4.58k, False: 16.1k]
  ------------------
  714|  4.58k|                    {
  715|  4.58k|                        double tmp = safe_atof(valbuf);
  716|  4.58k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (716:29): [True: 3.69k, False: 890]
  ------------------
  717|  3.69k|                            memcpy(lptr, &tmp, sizeof(double));
  718|  3.69k|                        } // else leave at .dflt
  719|  4.58k|                    }
  720|  4.58k|                    break;
  721|  1.18k|                case t_string:
  ------------------
  |  Branch (721:17): [True: 1.18k, False: 19.5k]
  ------------------
  722|  1.18k|                    if (NULL != parent &&
  ------------------
  |  Branch (722:25): [True: 388, False: 792]
  ------------------
  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.18k|                    (void)strlcpy(lptr, valbuf, cursor->len);
  728|  1.18k|                    break;
  729|  1.87k|                case t_boolean:
  ------------------
  |  Branch (729:17): [True: 1.87k, False: 18.8k]
  ------------------
  730|  1.87k|                    {
  731|  1.87k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  732|  1.87k|                        memcpy(lptr, &tmp, sizeof(bool));
  733|  1.87k|                    }
  734|  1.87k|                    break;
  735|    558|                case t_character:
  ------------------
  |  Branch (735:17): [True: 558, False: 20.1k]
  ------------------
  736|    558|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (736:25): [True: 7, False: 551]
  ------------------
  737|       |                        // don't update end here, leave at value start
  738|      7|                        return JSON_ERR_STRLONG;
  ------------------
  |  |  158|      7|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  739|    551|                    } else {
  740|    551|                        lptr[0] = valbuf[0];
  741|    551|                    }
  742|    551|                    break;
  743|  2.23k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (743:17): [True: 2.23k, False: 18.4k]
  ------------------
  744|  2.23k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.23k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  745|  2.23k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (745:17): [True: 0, False: 20.7k]
  ------------------
  746|  2.23k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.23k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  747|  2.23k|                case t_structobject:
  ------------------
  |  Branch (747:17): [True: 0, False: 20.7k]
  ------------------
  748|  2.23k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.23k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  749|  2.23k|                case t_array:
  ------------------
  |  Branch (749:17): [True: 0, False: 20.7k]
  ------------------
  750|  2.23k|                    break;
  751|    727|                case t_check:
  ------------------
  |  Branch (751:17): [True: 727, False: 19.9k]
  ------------------
  752|    727|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (752:25): [True: 168, False: 559]
  ------------------
  753|    168|                        json_debug_trace(1, "json: Required attribute value %s"
  ------------------
  |  |  108|    168|    do {                                              \
  |  |  109|    168|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    168|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 168]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 168]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    168|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    168|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 168]
  |  |  ------------------
  ------------------
  754|    168|                                          " not present.\n",
  755|    168|                                          cursor->dflt.check);
  756|       |                        // don't update end here, leave at start of attribute
  757|    168|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    168|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  758|    168|                    }
  759|    559|                    break;
  760|  20.7k|                }
  761|  20.7k|            }
  762|  36.5k|            FALLTHROUGH
  ------------------
  |  |   55|  36.5k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  763|  37.4k|        case post_element:
  ------------------
  |  Branch (763:9): [True: 897, False: 574k]
  ------------------
  764|  37.4k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (764:17): [True: 343, False: 37.1k]
  ------------------
  765|    343|                continue;
  766|    343|            }
  767|  37.1k|            if (*cp == ',') {
  ------------------
  |  Branch (767:17): [True: 31.6k, False: 5.54k]
  ------------------
  768|  31.6k|                state = await_attr;
  769|  31.6k|            } else if (*cp == '}') {
  ------------------
  |  Branch (769:24): [True: 5.02k, False: 525]
  ------------------
  770|  5.02k|                ++cp;
  771|  5.02k|                goto good_parse;
  772|  5.02k|            } else {
  773|    525|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|    525|    do {                                              \
  |  |  109|    525|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    525|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 525]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 525]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    525|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    525|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 525]
  |  |  ------------------
  ------------------
  774|    525|                                "Garbage while expecting comma or }\n");
  775|    525|                if (NULL != end) {
  ------------------
  |  Branch (775:21): [True: 28, False: 497]
  ------------------
  776|     28|                    *end = cp;
  777|     28|                }
  778|    525|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    525|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  779|    525|            }
  780|  31.6k|            break;
  781|   575k|        }
  782|   575k|    }
  783|  3.19k|    if (state == init) {
  ------------------
  |  Branch (783:9): [True: 44, False: 3.15k]
  ------------------
  784|     44|        json_debug_trace(1, "json: %s", "Input was empty or white-space only\n");
  ------------------
  |  |  108|     44|    do {                                              \
  |  |  109|     44|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     44|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     44|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     44|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 44]
  |  |  ------------------
  ------------------
  785|     44|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     44|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  786|     44|    }
  787|       |
  788|  8.17k|  good_parse:
  789|       |    // in case there's another object following, consume trailing WS
  790|  8.17k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (790:12): [True: 200, False: 8.17k]
  ------------------
  791|    200|        ++cp;
  792|    200|    }
  793|  8.17k|    if (NULL != end) {
  ------------------
  |  Branch (793:9): [True: 4.56k, False: 3.60k]
  ------------------
  794|  4.56k|        *end = cp;
  795|  4.56k|    }
  796|  8.17k|    json_debug_trace(1, "%s", "json: JSON parse ends.\n");
  ------------------
  |  |  108|  8.17k|    do {                                              \
  |  |  109|  8.17k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.17k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.17k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.17k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.17k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.17k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.17k]
  |  |  ------------------
  ------------------
  797|  8.17k|    return 0;
  798|  3.19k|}
json.c:json_target_address:
  119|   178k|{
  120|   178k|    char *targetaddr = NULL;
  121|   178k|    if (NULL == parent ||
  ------------------
  |  Branch (121:9): [True: 104k, False: 73.5k]
  ------------------
  122|   104k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (122:9): [True: 0, False: 73.5k]
  ------------------
  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|    865|        case t_ubyte:
  ------------------
  |  Branch (128:9): [True: 865, False: 103k]
  ------------------
  129|    865|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  130|    865|            break;
  131|  20.6k|        case t_ignore:
  ------------------
  |  Branch (131:9): [True: 20.6k, False: 83.8k]
  ------------------
  132|  20.6k|            targetaddr = NULL;
  133|  20.6k|            break;
  134|  18.2k|        case t_integer:
  ------------------
  |  Branch (134:9): [True: 18.2k, False: 86.2k]
  ------------------
  135|  18.2k|            targetaddr = (char *)&cursor->addr.integer[offset];
  136|  18.2k|            break;
  137|  6.13k|        case t_uinteger:
  ------------------
  |  Branch (137:9): [True: 6.13k, False: 98.3k]
  ------------------
  138|  6.13k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  139|  6.13k|            break;
  140|  1.56k|        case t_longint:
  ------------------
  |  Branch (140:9): [True: 1.56k, False: 102k]
  ------------------
  141|  1.56k|            targetaddr = (char *)&cursor->addr.longint[offset];
  142|  1.56k|            break;
  143|    546|        case t_ulongint:
  ------------------
  |  Branch (143:9): [True: 546, False: 103k]
  ------------------
  144|    546|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  145|    546|            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.08k|        case t_time:
  ------------------
  |  Branch (152:9): [True: 4.08k, False: 100k]
  ------------------
  153|  4.08k|            targetaddr = (char *)&cursor->addr.ts[offset];
  154|  4.08k|            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.9k|        case t_real:
  ------------------
  |  Branch (158:9): [True: 36.9k, False: 67.5k]
  ------------------
  159|  36.9k|            targetaddr = (char *)&cursor->addr.real[offset];
  160|  36.9k|            break;
  161|  7.14k|        case t_string:
  ------------------
  |  Branch (161:9): [True: 7.14k, False: 97.3k]
  ------------------
  162|  7.14k|            targetaddr = cursor->addr.string;
  163|  7.14k|            break;
  164|  1.48k|        case t_boolean:
  ------------------
  |  Branch (164:9): [True: 1.48k, False: 102k]
  ------------------
  165|  1.48k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  166|  1.48k|            break;
  167|  1.07k|        case t_character:
  ------------------
  |  Branch (167:9): [True: 1.07k, False: 103k]
  ------------------
  168|  1.07k|            targetaddr = (char *)&cursor->addr.character[offset];
  169|  1.07k|            break;
  170|    644|        case t_array:
  ------------------
  |  Branch (170:9): [True: 644, False: 103k]
  ------------------
  171|    644|            FALLTHROUGH
  ------------------
  |  |   55|    644|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  172|  5.79k|        case t_check:
  ------------------
  |  Branch (172:9): [True: 5.15k, False: 99.3k]
  ------------------
  173|  5.79k|            FALLTHROUGH
  ------------------
  |  |   55|  5.79k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  174|  5.79k|        case t_object:
  ------------------
  |  Branch (174:9): [True: 0, False: 104k]
  ------------------
  175|  5.79k|            FALLTHROUGH
  ------------------
  |  |   55|  5.79k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  176|  5.79k|        case t_structobject:
  ------------------
  |  Branch (176:9): [True: 0, False: 104k]
  ------------------
  177|  5.79k|            FALLTHROUGH
  ------------------
  |  |   55|  5.79k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  178|  5.79k|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 104k]
  ------------------
  179|  5.79k|            targetaddr = NULL;
  180|  5.79k|            break;
  181|   104k|        }
  182|   104k|    } else {
  183|       |        // tricky case - hacking a member in an array of structures
  184|  73.5k|        targetaddr =
  185|  73.5k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  186|  73.5k|            cursor->addr.offset;
  187|  73.5k|    }
  188|   178k|    json_debug_trace(1, "json: Target address for %s (offset %d) is %p\n",
  ------------------
  |  |  108|   178k|    do {                                              \
  |  |  109|   178k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   178k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 178k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 178k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   178k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   178k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 178k]
  |  |  ------------------
  ------------------
  189|   178k|                      cursor->attribute, offset, targetaddr);
  190|   178k|    return targetaddr;
  191|   178k|}

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

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

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

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

json_device_read:
   31|     17|{
   32|       |    // initialized to shut up clang
   33|     17|    double d_cycle = 0.0, d_mincycle = 0.0;
   34|       |
   35|       |    // *INDENT-OFF*
   36|     17|    const struct json_attr_t json_attrs_device[] = {
   37|     17|        {"class",      t_check,      .dflt.check = "DEVICE"},
   38|       |
   39|     17|        {"path",       t_string,     .addr.string  = dev->path,
   40|     17|                                        .len = sizeof(dev->path)},
   41|       |        // odd, device->gpsdata.online is sent, but put in dev->activated?
   42|     17|        {"activated",  t_time,       .addr.ts = &dev->activated,
   43|     17|                                        .dflt.ts = {0, 0}},
   44|     17|        {"flags",      t_integer,    .addr.integer = &dev->flags},
   45|     17|        {"driver",     t_string,     .addr.string  = dev->driver,
   46|     17|                                        .len = sizeof(dev->driver)},
   47|     17|        {"sernum",     t_string,     .addr.string  = dev->sernum,
   48|     17|                                        .len = sizeof(dev->sernum)},
   49|     17|        {"subtype",    t_string,     .addr.string  = dev->subtype,
   50|     17|                                        .len = sizeof(dev->subtype)},
   51|     17|        {"subtype1",   t_string,     .addr.string  = dev->subtype1,
   52|     17|                                        .len = sizeof(dev->subtype1)},
   53|     17|        {"hexdata",    t_string,     .addr.string  = dev->hexdata,
   54|     17|                                        .len = sizeof(dev->hexdata)},
   55|     17|        {"native",     t_integer,    .addr.integer = &dev->driver_mode,
   56|     17|                                        .dflt.integer = DEVDEFAULT_NATIVE},
  ------------------
  |  |   54|     17|#define DEVDEFAULT_NATIVE       -1
  ------------------
   57|     17|        {"bps",        t_uinteger,   .addr.uinteger = &dev->baudrate,
   58|     17|                                        .dflt.uinteger = DEVDEFAULT_BPS},
  ------------------
  |  |   51|     17|#define DEVDEFAULT_BPS          0
  ------------------
   59|     17|        {"parity",     t_character,  .addr.character = &dev->parity,
   60|     17|                                        .dflt.character = DEVDEFAULT_PARITY},
  ------------------
  |  |   52|     17|#define DEVDEFAULT_PARITY       'X'
  ------------------
   61|     17|        {"stopbits",   t_uinteger,   .addr.uinteger = &dev->stopbits,
   62|     17|                                        .dflt.uinteger = DEVDEFAULT_STOPBITS},
  ------------------
  |  |   53|     17|#define DEVDEFAULT_STOPBITS     3
  ------------------
   63|     17|        {"cycle",      t_real,       .addr.real = &d_cycle,
   64|     17|                                        .dflt.real = NAN},
   65|     17|        {"mincycle",   t_real,       .addr.real = &d_mincycle,
   66|     17|                                        .dflt.real = NAN},
   67|       |        // ignore unknown keys, for cross-version compatibility
   68|     17|        {"", t_ignore},
   69|     17|        {NULL},
   70|     17|    };
   71|       |    // *INDENT-ON*
   72|     17|    int status;
   73|       |
   74|     17|    status = json_read_object(buf, json_attrs_device, endptr);
   75|     17|    if (0 != status) {
  ------------------
  |  Branch (75:9): [True: 14, False: 3]
  ------------------
   76|     14|        return status;
   77|     14|    }
   78|       |
   79|      3|    if (0 == isfinite(d_cycle)) {
  ------------------
  |  Branch (79:9): [True: 2, False: 1]
  ------------------
   80|      2|        dev->cycle.tv_sec = 0;
   81|      2|        dev->cycle.tv_nsec = 0;
   82|      2|    } else {
   83|      1|        DTOTS(&dev->cycle, d_cycle);
  ------------------
  |  |  144|      1|    do { \
  |  |  145|      1|        double int_part; \
  |  |  146|      1|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      1|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   84|      1|    }
   85|      3|    if (0 == isfinite(d_mincycle)) {
  ------------------
  |  Branch (85:9): [True: 2, False: 1]
  ------------------
   86|      2|        dev->mincycle.tv_sec = 0;
   87|      2|        dev->mincycle.tv_nsec = 0;
   88|      2|    } else {
   89|      1|        DTOTS(&dev->mincycle, d_mincycle);
  ------------------
  |  |  144|      1|    do { \
  |  |  145|      1|        double int_part; \
  |  |  146|      1|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      1|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   90|      1|    }
   91|       |
   92|      3|    return 0;
   93|     17|}
json_watch_read:
   98|     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|}

