LLVMFuzzerTestOneInput:
   27|  2.89k|{//gpsd/tests//test_json.c
   28|       |
   29|  2.89k|    if (Size < kMinInputLength || Size > kMaxInputLength){
  ------------------
  |  |   21|  5.78k|#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.89k|}

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: 1, False: 331]
  ------------------
   82|    332|        NULL != strstr(buf, "\"type\":2,") ||
  ------------------
  |  Branch (82:9): [True: 2, False: 329]
  ------------------
   83|    332|        NULL != strstr(buf, "\"type\":3,")) {
  ------------------
  |  Branch (83:9): [True: 3, False: 326]
  ------------------
   84|      6|        status = json_read_object(buf, json_ais1, endptr);
   85|    326|    } else if (NULL != strstr(buf, "\"type\":4,") ||
  ------------------
  |  Branch (85:16): [True: 5, False: 321]
  ------------------
   86|    326|               NULL != strstr(buf, "\"type\":11,")) {
  ------------------
  |  Branch (86:16): [True: 1, False: 320]
  ------------------
   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|    320|    } else if (strstr(buf, "\"type\":5,") != NULL) {
  ------------------
  |  Branch (106:16): [True: 14, False: 306]
  ------------------
  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|    306|    } else if (strstr(buf, "\"type\":6,") != NULL) {
  ------------------
  |  Branch (120:16): [True: 131, False: 175]
  ------------------
  121|    131|        bool structured = false;
  122|    131|        if (strstr(buf, "\"dac\":1,") != NULL) {
  ------------------
  |  Branch (122:13): [True: 32, False: 99]
  ------------------
  123|     32|            if (strstr(buf, "\"fid\":12,") != NULL) {
  ------------------
  |  Branch (123:17): [True: 5, False: 27]
  ------------------
  124|      5|                status = json_read_object(buf, json_ais6_fid12, endptr);
  125|      5|                if (status == 0) {
  ------------------
  |  Branch (125:21): [True: 1, False: 4]
  ------------------
  126|       |                    // no need to set zeros, again.
  127|       |                    // ais->type6.dac1fid12.lmonth = AIS_MONTH_NOT_AVAILABLE;
  128|       |                    // ais->type6.dac1fid12.lday = AIS_DAY_NOT_AVAILABLE;
  129|      1|                    ais->type6.dac1fid12.lhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  130|      1|                    ais->type6.dac1fid12.lminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  131|       |                    // ais->type6.dac1fid12.nmonth = AIS_MONTH_NOT_AVAILABLE;
  132|       |                    // ais->type6.dac1fid12.nday = AIS_DAY_NOT_AVAILABLE;
  133|      1|                    ais->type6.dac1fid12.nhour = AIS_HOUR_NOT_AVAILABLE;
  ------------------
  |  | 1576|      1|#define AIS_HOUR_NOT_AVAILABLE  24
  ------------------
  134|      1|                    ais->type6.dac1fid12.nminute = AIS_MINUTE_NOT_AVAILABLE;
  ------------------
  |  | 1578|      1|#define AIS_MINUTE_NOT_AVAILABLE        60
  ------------------
  135|      1|                    (void)sscanf(departure, "%02u-%02uT%02u:%02uZ",
  136|      1|                                 &ais->type6.dac1fid12.lmonth,
  137|      1|                                 &ais->type6.dac1fid12.lday,
  138|      1|                                 &ais->type6.dac1fid12.lhour,
  139|      1|                                 &ais->type6.dac1fid12.lminute);
  140|      1|                    (void)sscanf(eta, "%02u-%02uT%02u:%02uZ",
  141|      1|                                 &ais->type6.dac1fid12.nmonth,
  142|      1|                                 &ais->type6.dac1fid12.nday,
  143|      1|                                 &ais->type6.dac1fid12.nhour,
  144|      1|                                 &ais->type6.dac1fid12.nminute);
  145|      1|                }
  146|      5|                structured = true;
  147|      5|            }
  148|     27|            else if (strstr(buf, "\"fid\":15,") != NULL) {
  ------------------
  |  Branch (148:22): [True: 1, False: 26]
  ------------------
  149|      1|                status = json_read_object(buf, json_ais6_fid15, endptr);
  150|      1|                structured = true;
  151|      1|            }
  152|     26|            else if (strstr(buf, "\"fid\":16,") != NULL) {
  ------------------
  |  Branch (152:22): [True: 2, False: 24]
  ------------------
  153|      2|                status = json_read_object(buf, json_ais6_fid16, endptr);
  154|      2|                structured = true;
  155|      2|            }
  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|     32|        }
  218|     99|        else if (strstr(buf, "\"dac\":235,") != NULL ||
  ------------------
  |  Branch (218:18): [True: 2, False: 97]
  ------------------
  219|     97|                 strstr(buf, "\"dac\":250,") != NULL) {
  ------------------
  |  Branch (219:18): [True: 2, False: 95]
  ------------------
  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|     95|        else if (strstr(buf, "\"dac\":200,") != NULL) {
  ------------------
  |  Branch (225:18): [True: 11, False: 84]
  ------------------
  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|    131|        if (!structured) {
  ------------------
  |  Branch (263:13): [True: 88, False: 43]
  ------------------
  264|     88|            status = json_read_object(buf, json_ais6, endptr);
  265|     88|            if (status == 0)
  ------------------
  |  Branch (265:17): [True: 81, False: 7]
  ------------------
  266|     81|                lenhex_unpack(data, &ais->type6.bitcount,
  267|     81|                              ais->type6.bitdata, sizeof(ais->type6.bitdata));
  268|     88|        }
  269|    131|        ais->type6.structured = structured;
  270|    175|    } else if (strstr(buf, "\"type\":7,") != NULL
  ------------------
  |  Branch (270:16): [True: 2, False: 173]
  ------------------
  271|    173|               || strstr(buf, "\"type\":13,") != NULL) {
  ------------------
  |  Branch (271:19): [True: 1, False: 172]
  ------------------
  272|      3|        status = json_read_object(buf, json_ais7, endptr);
  273|    172|    } else if (strstr(buf, "\"type\":8,") != NULL) {
  ------------------
  |  Branch (273:16): [True: 106, False: 66]
  ------------------
  274|    106|        bool structured = false;
  275|    106|        if (strstr(buf, "\"dac\":1,") != NULL) {
  ------------------
  |  Branch (275:13): [True: 70, False: 36]
  ------------------
  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|     36|        else if (strstr(buf, "\"dac\":200,") != NULL &&
  ------------------
  |  Branch (404:18): [True: 7, False: 29]
  ------------------
  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|    106|        if (!structured) {
  ------------------
  |  Branch (415:13): [True: 75, False: 31]
  ------------------
  416|     75|            status = json_read_object(buf, json_ais8, endptr);
  417|     75|            if (status == 0)
  ------------------
  |  Branch (417:17): [True: 25, False: 50]
  ------------------
  418|     25|                lenhex_unpack(data, &ais->type8.bitcount,
  419|     25|                              ais->type8.bitdata, sizeof(ais->type8.bitdata));
  420|     75|        }
  421|    106|        ais->type8.structured = structured;
  422|    106|    } else if (strstr(buf, "\"type\":9,") != NULL) {
  ------------------
  |  Branch (422:16): [True: 2, False: 64]
  ------------------
  423|      2|        status = json_read_object(buf, json_ais9, endptr);
  424|     64|    } else if (strstr(buf, "\"type\":10,") != NULL) {
  ------------------
  |  Branch (424:16): [True: 1, False: 63]
  ------------------
  425|      1|        status = json_read_object(buf, json_ais10, endptr);
  426|     63|    } else if (strstr(buf, "\"type\":12,") != NULL) {
  ------------------
  |  Branch (426:16): [True: 2, False: 61]
  ------------------
  427|      2|        status = json_read_object(buf, json_ais12, endptr);
  428|     61|    } else if (strstr(buf, "\"type\":14,") != NULL) {
  ------------------
  |  Branch (428:16): [True: 2, False: 59]
  ------------------
  429|      2|        status = json_read_object(buf, json_ais14, endptr);
  430|     59|    } else if (strstr(buf, "\"type\":15,") != NULL) {
  ------------------
  |  Branch (430:16): [True: 1, False: 58]
  ------------------
  431|      1|        status = json_read_object(buf, json_ais15, endptr);
  432|     58|    } else if (strstr(buf, "\"type\":16,") != NULL) {
  ------------------
  |  Branch (432:16): [True: 1, False: 57]
  ------------------
  433|      1|        status = json_read_object(buf, json_ais16, endptr);
  434|     57|    } else if (strstr(buf, "\"type\":17,") != NULL) {
  ------------------
  |  Branch (434:16): [True: 3, False: 54]
  ------------------
  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|     54|    } else if (strstr(buf, "\"type\":18,") != NULL) {
  ------------------
  |  Branch (439:16): [True: 4, False: 50]
  ------------------
  440|      4|        status = json_read_object(buf, json_ais18, endptr);
  441|     50|    } else if (strstr(buf, "\"type\":19,") != NULL) {
  ------------------
  |  Branch (441:16): [True: 1, False: 49]
  ------------------
  442|      1|        status = json_read_object(buf, json_ais19, endptr);
  443|     49|    } else if (strstr(buf, "\"type\":20,") != NULL) {
  ------------------
  |  Branch (443:16): [True: 1, False: 48]
  ------------------
  444|      1|        status = json_read_object(buf, json_ais20, endptr);
  445|     48|    } else if (strstr(buf, "\"type\":21,") != NULL) {
  ------------------
  |  Branch (445:16): [True: 2, False: 46]
  ------------------
  446|      2|        status = json_read_object(buf, json_ais21, endptr);
  447|     46|    } else if (strstr(buf, "\"type\":22,") != NULL) {
  ------------------
  |  Branch (447:16): [True: 2, False: 44]
  ------------------
  448|      2|        status = json_read_object(buf, json_ais22, endptr);
  449|     44|    } else if (strstr(buf, "\"type\":23,") != NULL) {
  ------------------
  |  Branch (449:16): [True: 20, False: 24]
  ------------------
  450|     20|        status = json_read_object(buf, json_ais23, endptr);
  451|     24|    } else if (strstr(buf, "\"type\":24,") != NULL) {
  ------------------
  |  Branch (451:16): [True: 1, False: 23]
  ------------------
  452|      1|        status = json_read_object(buf, json_ais24, endptr);
  453|     23|    } else if (strstr(buf, "\"type\":25,") != NULL) {
  ------------------
  |  Branch (453:16): [True: 13, False: 10]
  ------------------
  454|     13|        status = json_read_object(buf, json_ais25, endptr);
  455|     13|        if (status == 0)
  ------------------
  |  Branch (455:13): [True: 11, False: 2]
  ------------------
  456|     11|            lenhex_unpack(data, &ais->type25.bitcount,
  457|     11|                          ais->type25.bitdata, sizeof(ais->type25.bitdata));
  458|     13|    } else if (strstr(buf, "\"type\":26,") != NULL) {
  ------------------
  |  Branch (458:16): [True: 8, False: 2]
  ------------------
  459|      8|        status = json_read_object(buf, json_ais26, endptr);
  460|      8|        if (status == 0)
  ------------------
  |  Branch (460:13): [True: 4, False: 4]
  ------------------
  461|      4|            lenhex_unpack(data, &ais->type26.bitcount,
  462|      4|                          ais->type26.bitdata, sizeof(ais->type26.bitdata));
  463|      8|    } else if (strstr(buf, "\"type\":27,") != NULL) {
  ------------------
  |  Branch (463:16): [True: 1, False: 1]
  ------------------
  464|      1|        status = json_read_object(buf, json_ais27, endptr);
  465|      1|    } else {
  466|      1|        if (NULL != endptr) {
  ------------------
  |  Branch (466:13): [True: 0, False: 1]
  ------------------
  467|      0|            *endptr = NULL;
  468|      0|        }
  469|      1|        return JSON_ERR_MISC;
  ------------------
  |  |  172|      1|#define JSON_ERR_MISC          21      // other data conversion error
  ------------------
  470|      1|    }
  471|    331|    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.78k|{
  295|  5.78k|    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.78k|    static double powersOf10[] = {
  303|  5.78k|        10.,
  304|  5.78k|        100.,
  305|  5.78k|        1.0e4,
  306|  5.78k|        1.0e8,
  307|  5.78k|        1.0e16,
  308|  5.78k|        1.0e32,
  309|  5.78k|        1.0e64,
  310|  5.78k|        1.0e128,
  311|  5.78k|        1.0e256
  312|  5.78k|    };
  313|       |
  314|  5.78k|    bool sign = false, expSign = false;
  315|  5.78k|    double fraction, dblExp, *d;
  316|  5.78k|    const char *p;
  317|  5.78k|    unsigned char c;
  318|  5.78k|    int exp = 0;                // Exponent read from "EX" field.
  319|  5.78k|    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.78k|    int mantSize;               // Number of digits in mantissa.
  329|  5.78k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  330|       |                                 * point. */
  331|  5.78k|    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.78k|    p = string;
  341|  5.78k|    while (isspace((int)*p)) {
  ------------------
  |  Branch (341:12): [True: 0, False: 5.78k]
  ------------------
  342|      0|        p += 1;
  343|      0|    }
  344|  5.78k|    if (isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (344:9): [True: 2.67k, False: 3.11k]
  ------------------
  345|       |        // ignore
  346|  3.11k|    } else if ('-' == *p) {
  ------------------
  |  Branch (346:16): [True: 852, False: 2.26k]
  ------------------
  347|    852|        sign = true;
  348|    852|        p += 1;
  349|  2.26k|    } else if ('+' == *p) {
  ------------------
  |  Branch (349:16): [True: 328, False: 1.93k]
  ------------------
  350|    328|        p += 1;
  351|  1.93k|    } else if ('.' == *p) {
  ------------------
  |  Branch (351:16): [True: 1.28k, False: 657]
  ------------------
  352|       |        // ignore
  353|  1.28k|    } else {
  354|    657|        return NAN;
  355|    657|    }
  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.13k|    decPt = -1;
  363|  21.0k|    for (mantSize = 0; ; mantSize += 1) {
  364|  21.0k|        c = *p;
  365|  21.0k|        if (!isdigit(c)) {
  ------------------
  |  Branch (365:13): [True: 6.62k, False: 14.4k]
  ------------------
  366|  6.62k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (366:17): [True: 4.89k, False: 1.72k]
  |  Branch (366:31): [True: 232, False: 1.49k]
  ------------------
  367|  5.13k|                break;
  368|  5.13k|            }
  369|  1.49k|            decPt = mantSize;
  370|  1.49k|        }
  371|  15.9k|        p += 1;
  372|  15.9k|    }
  373|       |
  374|       |    /*
  375|       |     * Now suck up the digits in the mantissa.  Use two integers to
  376|       |     * collect 9 digits each (this is faster than using floating-point).
  377|       |     * If the mantissa has more than 18 digits, ignore the extras, since
  378|       |     * they can't affect the value anyway.
  379|       |     */
  380|       |
  381|  5.13k|    pExp  = p;
  382|  5.13k|    p -= mantSize;
  383|  5.13k|    if (decPt < 0) {
  ------------------
  |  Branch (383:9): [True: 3.63k, False: 1.49k]
  ------------------
  384|  3.63k|        decPt = mantSize;
  385|  3.63k|    } else {
  386|  1.49k|        mantSize -= 1;                  // One of the digits was the point.
  387|  1.49k|    }
  388|  5.13k|    if (mantSize > 18) {
  ------------------
  |  Branch (388:9): [True: 208, False: 4.92k]
  ------------------
  389|    208|        fracExp = decPt - 18;
  390|    208|        mantSize = 18;
  391|  4.92k|    } else {
  392|  4.92k|        fracExp = decPt - mantSize;
  393|  4.92k|    }
  394|  5.13k|    if (mantSize == 0) {
  ------------------
  |  Branch (394:9): [True: 1.49k, False: 3.64k]
  ------------------
  395|  1.49k|        fraction = 0.0;
  396|       |        // p = string;
  397|  1.49k|        goto done;
  398|  3.64k|    } else {
  399|  3.64k|        int frac1, frac2;
  400|       |
  401|  3.64k|        frac1 = 0;
  402|  6.31k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (402:17): [True: 2.67k, False: 3.64k]
  ------------------
  403|  2.67k|            c = *p;
  404|  2.67k|            p += 1;
  405|  2.67k|            if ('.' == c) {
  ------------------
  |  Branch (405:17): [True: 194, False: 2.47k]
  ------------------
  406|    194|                c = *p;
  407|    194|                p += 1;
  408|    194|            }
  409|  2.67k|            frac1 = 10*frac1 + (c - '0');
  410|  2.67k|        }
  411|  3.64k|        frac2 = 0;
  412|  12.9k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (412:16): [True: 9.31k, False: 3.64k]
  ------------------
  413|  9.31k|            c = *p;
  414|  9.31k|            p += 1;
  415|  9.31k|            if ('.' == c) {
  ------------------
  |  Branch (415:17): [True: 316, False: 9.00k]
  ------------------
  416|    316|                c = *p;
  417|    316|                p += 1;
  418|    316|            }
  419|  9.31k|            frac2 = 10*frac2 + (c - '0');
  420|  9.31k|        }
  421|  3.64k|        fraction = (1.0e9 * frac1) + frac2;
  422|  3.64k|    }
  423|       |
  424|       |    /*
  425|       |     * Skim off the exponent.
  426|       |     */
  427|       |
  428|  3.64k|    p = pExp;
  429|  3.64k|    if (('E' == *p) ||
  ------------------
  |  Branch (429:9): [True: 1.22k, False: 2.41k]
  ------------------
  430|  2.41k|        ('e' == *p)) {
  ------------------
  |  Branch (430:9): [True: 937, False: 1.47k]
  ------------------
  431|  2.16k|        p += 1;
  432|  2.16k|        if ('-' == *p) {
  ------------------
  |  Branch (432:13): [True: 615, False: 1.54k]
  ------------------
  433|    615|            expSign = true;
  434|    615|            p += 1;
  435|  1.54k|        } else {
  436|  1.54k|            if ('+' == *p) {
  ------------------
  |  Branch (436:17): [True: 195, False: 1.35k]
  ------------------
  437|    195|                p += 1;
  438|    195|            }
  439|  1.54k|            expSign = false;
  440|  1.54k|        }
  441|  4.57k|        while (isdigit((unsigned char) *p)) {
  ------------------
  |  Branch (441:16): [True: 4.57k, False: 1.36k]
  ------------------
  442|  4.57k|            exp = exp * 10 + (*p - '0');
  443|  4.57k|            if (1024 < exp) {
  ------------------
  |  Branch (443:17): [True: 802, False: 3.77k]
  ------------------
  444|    802|                if (true == expSign) {
  ------------------
  |  Branch (444:21): [True: 389, False: 413]
  ------------------
  445|       |                    // exponent underflow!
  446|    389|                    if (sign) {
  ------------------
  |  Branch (446:25): [True: 195, False: 194]
  ------------------
  447|    195|                        return -0.0;
  448|    195|                    }
  449|    194|                    return 0.0;
  450|    389|                } // else  exponent overflow!
  451|    413|                if (sign) {
  ------------------
  |  Branch (451:21): [True: 194, False: 219]
  ------------------
  452|    194|                    return -INFINITY;
  453|    194|                }
  454|    219|                return INFINITY;
  455|    413|            }
  456|  3.77k|            p += 1;
  457|  3.77k|        }
  458|  2.16k|    }
  459|  2.83k|    if (expSign) {
  ------------------
  |  Branch (459:9): [True: 226, False: 2.61k]
  ------------------
  460|    226|        exp = fracExp - exp;
  461|  2.61k|    } else {
  462|  2.61k|        exp = fracExp + exp;
  463|  2.61k|    }
  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.83k|    if (0 > exp) {
  ------------------
  |  Branch (472:9): [True: 536, False: 2.30k]
  ------------------
  473|    536|        expSign = true;
  474|    536|        exp = -exp;
  475|  2.30k|    } else {
  476|  2.30k|        expSign = false;
  477|  2.30k|    }
  478|  2.83k|    if (exp > maxExponent) {
  ------------------
  |  Branch (478:9): [True: 237, False: 2.60k]
  ------------------
  479|    237|        exp = maxExponent;
  480|    237|        errno = ERANGE;
  481|    237|    }
  482|  2.83k|    dblExp = 1.0;
  483|  7.74k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (483:26): [True: 4.90k, False: 2.83k]
  ------------------
  484|  4.90k|        if (exp & 01) {
  ------------------
  |  Branch (484:13): [True: 3.69k, False: 1.21k]
  ------------------
  485|  3.69k|            dblExp *= *d;
  486|  3.69k|        }
  487|  4.90k|    }
  488|  2.83k|    if (expSign) {
  ------------------
  |  Branch (488:9): [True: 536, False: 2.30k]
  ------------------
  489|    536|        fraction /= dblExp;
  490|  2.30k|    } else {
  491|  2.30k|        fraction *= dblExp;
  492|  2.30k|    }
  493|       |
  494|  4.32k|done:
  495|  4.32k|    if (sign) {
  ------------------
  |  Branch (495:9): [True: 463, False: 3.86k]
  ------------------
  496|    463|        return -fraction;
  497|    463|    }
  498|  3.86k|    return fraction;
  499|  4.32k|}
mkgmtime:
  845|  1.94k|{
  846|  1.94k|    int year;
  847|  1.94k|    time_t result;
  848|  1.94k|    static const int cumdays[MONTHSPERYEAR] =
  849|  1.94k|        { 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.94k|    if (0 > t->tm_sec ||
  ------------------
  |  Branch (852:9): [True: 0, False: 1.94k]
  ------------------
  853|  1.94k|        0 > t->tm_min ||
  ------------------
  |  Branch (853:9): [True: 0, False: 1.94k]
  ------------------
  854|  1.94k|        0 > t->tm_hour ||
  ------------------
  |  Branch (854:9): [True: 0, False: 1.94k]
  ------------------
  855|  1.94k|        1 > t->tm_mday ||
  ------------------
  |  Branch (855:9): [True: 197, False: 1.75k]
  ------------------
  856|  1.75k|        0 > t->tm_mon ||
  ------------------
  |  Branch (856:9): [True: 0, False: 1.75k]
  ------------------
  857|  1.75k|        0 > t->tm_year ||
  ------------------
  |  Branch (857:9): [True: 655, False: 1.09k]
  ------------------
  858|  1.09k|        0 > t->tm_wday ||
  ------------------
  |  Branch (858:9): [True: 0, False: 1.09k]
  ------------------
  859|  1.09k|        0 > t->tm_yday ||
  ------------------
  |  Branch (859:9): [True: 0, False: 1.09k]
  ------------------
  860|  1.09k|        61 < t->tm_sec ||
  ------------------
  |  Branch (860:9): [True: 0, False: 1.09k]
  ------------------
  861|  1.09k|        59 < t->tm_min ||
  ------------------
  |  Branch (861:9): [True: 0, False: 1.09k]
  ------------------
  862|  1.09k|        23 < t->tm_hour ||
  ------------------
  |  Branch (862:9): [True: 0, False: 1.09k]
  ------------------
  863|  1.09k|        31 < t->tm_mday ||
  ------------------
  |  Branch (863:9): [True: 0, False: 1.09k]
  ------------------
  864|  1.09k|        11 < t->tm_mon ||
  ------------------
  |  Branch (864:9): [True: 0, False: 1.09k]
  ------------------
  865|  1.09k|        6 < t->tm_wday ||
  ------------------
  |  Branch (865:9): [True: 0, False: 1.09k]
  ------------------
  866|  1.09k|        365 < t->tm_yday) {
  ------------------
  |  Branch (866:9): [True: 0, False: 1.09k]
  ------------------
  867|    852|        errno = EOVERFLOW;
  868|    852|        return -1;
  869|    852|    }
  870|  1.94k|    errno = 0;
  871|  1.09k|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  501|  1.09k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  872|  1.09k|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  501|  1.09k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  873|  1.09k|    result += (year - 1968) / 4;
  874|  1.09k|    result -= (year - 1900) / 100;
  875|  1.09k|    result += (year - 1600) / 400;
  876|  1.09k|    if (0 == (year % 4) &&
  ------------------
  |  Branch (876:9): [True: 620, False: 476]
  ------------------
  877|    620|        (0 != (year % 100) ||
  ------------------
  |  Branch (877:10): [True: 223, False: 397]
  ------------------
  878|    397|         0 == (year % 400)) &&
  ------------------
  |  Branch (878:10): [True: 198, False: 199]
  ------------------
  879|    421|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  501|    421|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (879:9): [True: 208, False: 213]
  ------------------
  880|    208|        result--;
  881|    208|    }
  882|  1.09k|    result += t->tm_mday - 1;
  883|  1.09k|    result *= 24;
  884|  1.09k|    result += t->tm_hour;
  885|  1.09k|    result *= 60;
  886|  1.09k|    result += t->tm_min;
  887|  1.09k|    result *= 60;
  888|  1.09k|    result += t->tm_sec;
  889|       |    /* this is UTC, no DST
  890|       |     * if (t->tm_isdst == 1)
  891|       |     * result -= 3600;
  892|       |     */
  893|  1.09k|    return result;
  894|  1.94k|}
iso8601_to_timespec:
  898|  1.94k|{
  899|  1.94k|    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.94k|    double usec = 0;
  921|  1.94k|    struct tm tm = {0};
  922|       |
  923|  1.94k|    {
  924|  1.94k|        char *dp = NULL;
  925|  1.94k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  926|  1.94k|        if (NULL != dp &&
  ------------------
  |  Branch (926:13): [True: 624, False: 1.32k]
  ------------------
  927|    624|            '.' == *dp) {
  ------------------
  |  Branch (927:13): [True: 194, False: 430]
  ------------------
  928|    194|            usec = strtod(dp, NULL);
  929|    194|        }
  930|  1.94k|    }
  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.94k|    ret.tv_sec = mkgmtime(&tm);
  940|  1.94k|    ret.tv_nsec = usec * 1e9;
  941|  1.94k|#endif  // USE_QT
  942|       |
  943|  1.94k|#if 4 < SIZEOF_TIME_T
  944|  1.94k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (944:9): [True: 198, False: 1.75k]
  ------------------
  945|       |        // enforce max "9999-12-31T23:59:59.999Z"
  946|    198|        ret.tv_sec = 253402300799LL;
  947|    198|    }
  948|  1.94k|#endif
  949|  1.94k|    return ret;
  950|  1.94k|}

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: 11, False: 100]
  ------------------
  125|     13|        return -2;
  126|     13|    }
  127|       |
  128|    398|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 362, False: 36]
  ------------------
  129|    362|        int k;
  130|    362|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 64, False: 298]
  ------------------
  131|     64|            return -1;
  132|     64|        }
  133|    298|        dst[i] = (char)(k & 0xff);
  134|    298|    }
  135|     36|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     36|    return j;
  137|    100|}
hex.c:hex2bin:
   82|    362|{
   83|    362|    int a, b;
   84|       |
   85|    362|    a = s[0] & 0xff;
   86|    362|    b = s[1] & 0xff;
   87|       |
   88|    362|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 115, False: 247]
  ------------------
   89|    115|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 110, False: 5]
  ------------------
   90|    110|        a = a + 10 - 'a';
   91|    252|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 96, False: 156]
  ------------------
   92|     96|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 81, False: 15]
  ------------------
   93|     81|        a = a + 10 - 'A';
   94|    171|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 161, False: 10]
  ------------------
   95|    161|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 141, False: 20]
  ------------------
   96|    141|        a -= '0';
   97|    141|    } else {
   98|     30|        return -1;
   99|     30|    }
  100|       |
  101|    332|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 105, False: 227]
  ------------------
  102|    105|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 94, False: 11]
  ------------------
  103|     94|        b = b + 10 - 'a';
  104|    238|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 91, False: 147]
  ------------------
  105|     91|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 71, False: 20]
  ------------------
  106|     71|        b = b + 10 - 'A';
  107|    167|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 160, False: 7]
  ------------------
  108|    160|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 133, False: 27]
  ------------------
  109|    133|        b -= '0';
  110|    133|    } else {
  111|     34|        return -1;
  112|     34|    }
  113|       |
  114|    298|    return ((a << 4) + b);
  115|    332|}

json_read_array:
  802|  1.04k|{
  803|  1.04k|    int substatus;
  804|  1.04k|    unsigned offset, arrcount;
  805|  1.04k|    char *tp;
  806|       |
  807|  1.04k|    if (NULL != end) {
  ------------------
  |  Branch (807:9): [True: 1.04k, False: 0]
  ------------------
  808|  1.04k|        *end = NULL;    // give it a well-defined value on parse failure
  809|  1.04k|    }
  810|       |
  811|  1.04k|    json_debug_trace(1, "json: %s", "Entered json_read_array()\n");
  ------------------
  |  |  108|  1.04k|    do {                                              \
  |  |  109|  1.04k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  1.04k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1.04k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1.04k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  1.04k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  1.04k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  812|       |
  813|  1.04k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (813:12): [True: 0, False: 1.04k]
  ------------------
  814|      0|        cp++;
  815|      0|    }
  816|  1.04k|    if (*cp != '[') {
  ------------------
  |  Branch (816:9): [True: 0, False: 1.04k]
  ------------------
  817|      0|        json_debug_trace(1, "json: %s", "Didn't find expected array start\n");
  ------------------
  |  |  108|      0|    do {                                              \
  |  |  109|      0|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      0|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  818|      0|        return JSON_ERR_ARRAYSTART;
  ------------------
  |  |  161|      0|#define JSON_ERR_ARRAYSTART    10      // didn't find expected array start
  ------------------
  819|      0|    }
  820|  1.04k|    cp++;
  821|       |
  822|  1.04k|    tp = arr->arr.strings.store;
  823|  1.04k|    arrcount = 0;
  824|       |
  825|       |    // Check for empty array
  826|  1.04k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (826:12): [True: 194, False: 1.04k]
  ------------------
  827|    194|        cp++;
  828|    194|    }
  829|  1.04k|    if (*cp == ']') {
  ------------------
  |  Branch (829:9): [True: 214, False: 828]
  ------------------
  830|    214|        goto breakout;
  831|    214|    }
  832|       |
  833|  8.14k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (833:22): [True: 8.14k, False: 1]
  ------------------
  834|  8.14k|        char *ep = NULL;
  835|       |
  836|  8.14k|        json_debug_trace(1, "json: Looking at %s\n", cp);
  ------------------
  |  |  108|  8.14k|    do {                                              \
  |  |  109|  8.14k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.14k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.14k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.14k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.14k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.14k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.14k]
  |  |  ------------------
  ------------------
  837|  8.14k|        switch (arr->element_type) {
  ------------------
  |  Branch (837:17): [True: 8.14k, False: 0]
  ------------------
  838|  2.91k|        case t_string:
  ------------------
  |  Branch (838:9): [True: 2.91k, False: 5.22k]
  ------------------
  839|  2.91k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (839:17): [True: 195, False: 2.72k]
  ------------------
  840|    195|                cp++;
  841|    195|            }
  842|  2.91k|            if (*cp != '"') {
  ------------------
  |  Branch (842:17): [True: 16, False: 2.90k]
  ------------------
  843|     16|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     16|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  844|  2.90k|            } else {
  845|  2.90k|                ++cp;
  846|  2.90k|            }
  847|  2.90k|            arr->arr.strings.ptrs[offset] = tp;
  848|  13.3k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (848:20): [True: 13.3k, False: 3]
  ------------------
  849|  10.4k|                 tp++)
  850|  13.3k|                if (*cp == '"') {
  ------------------
  |  Branch (850:21): [True: 2.89k, False: 10.4k]
  ------------------
  851|  2.89k|                    ++cp;
  852|  2.89k|                    *tp++ = '\0';
  853|  2.89k|                    goto stringend;
  854|  10.4k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (854:28): [True: 1, False: 10.4k]
  ------------------
  855|      1|                    json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  856|      1|                                      "Bad string syntax in string list.\n");
  857|      1|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      1|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  858|  10.4k|                } else {
  859|  10.4k|                    *tp = *cp++;
  860|  10.4k|                }
  861|      3|            json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      3|    do {                                              \
  |  |  109|      3|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      3|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 3]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 3]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      3|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      3|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 3]
  |  |  ------------------
  ------------------
  862|      3|                             "Bad string syntax in string list.\n");
  863|      3|            return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      3|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  864|  2.89k|          stringend:
  865|  2.89k|            break;
  866|      0|        case t_object:
  ------------------
  |  Branch (866:9): [True: 0, False: 8.14k]
  ------------------
  867|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  868|  5.22k|        case t_structobject:
  ------------------
  |  Branch (868:9): [True: 5.22k, False: 2.91k]
  ------------------
  869|  5.22k|            substatus =
  870|  5.22k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  871|  5.22k|                                          offset, &cp);
  872|  5.22k|            if (substatus != 0) {
  ------------------
  |  Branch (872:17): [True: 167, False: 5.05k]
  ------------------
  873|    167|                if (NULL != end) {
  ------------------
  |  Branch (873:21): [True: 167, False: 0]
  ------------------
  874|    167|                    *end = cp;
  875|    167|                }
  876|    167|                return substatus;
  877|    167|            }
  878|  5.05k|            break;
  879|  5.05k|        case t_integer:
  ------------------
  |  Branch (879:9): [True: 0, False: 8.14k]
  ------------------
  880|      0|            arr->arr.integers.store[offset] = (int)strtol(cp, &ep, 0);
  881|      0|            if (ep == cp) {
  ------------------
  |  Branch (881:17): [True: 0, False: 0]
  ------------------
  882|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  883|      0|            }
  884|      0|            cp = ep;
  885|      0|            break;
  886|      0|        case t_uinteger:
  ------------------
  |  Branch (886:9): [True: 0, False: 8.14k]
  ------------------
  887|      0|            arr->arr.uintegers.store[offset] = (unsigned int)strtoul(cp,
  888|      0|                                                                     &ep, 0);
  889|      0|            if (ep == cp) {
  ------------------
  |  Branch (889:17): [True: 0, False: 0]
  ------------------
  890|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  891|      0|            }
  892|      0|            cp = ep;
  893|      0|            break;
  894|      0|        case t_longint:
  ------------------
  |  Branch (894:9): [True: 0, False: 8.14k]
  ------------------
  895|      0|            arr->arr.longint.store[offset] = strtol(cp, &ep, 0);
  896|      0|            if (ep == cp) {
  ------------------
  |  Branch (896:17): [True: 0, False: 0]
  ------------------
  897|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  898|      0|            }
  899|      0|            cp = ep;
  900|      0|            break;
  901|      0|        case t_ulongint:
  ------------------
  |  Branch (901:9): [True: 0, False: 8.14k]
  ------------------
  902|      0|            arr->arr.ulongint.store[offset] = strtoul(cp, &ep, 0);
  903|      0|            if (ep == cp) {
  ------------------
  |  Branch (903:17): [True: 0, False: 0]
  ------------------
  904|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  905|      0|            }
  906|      0|            cp = ep;
  907|      0|            break;
  908|      0|        case t_byte:
  ------------------
  |  Branch (908:9): [True: 0, False: 8.14k]
  ------------------
  909|      0|            arr->arr.bytes.store[offset] = (char)strtol(cp, &ep, 0);
  910|      0|            if (ep == cp) {
  ------------------
  |  Branch (910:17): [True: 0, False: 0]
  ------------------
  911|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  912|      0|            }
  913|      0|            cp = ep;
  914|      0|            break;
  915|      0|        case t_ubyte:
  ------------------
  |  Branch (915:9): [True: 0, False: 8.14k]
  ------------------
  916|      0|            arr->arr.ubytes.store[offset] = (unsigned char)strtoul(cp,
  917|      0|                                                                   &ep, 0);
  918|      0|            if (ep == cp) {
  ------------------
  |  Branch (918:17): [True: 0, False: 0]
  ------------------
  919|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  920|      0|            }
  921|      0|            cp = ep;
  922|      0|            break;
  923|      0|        case t_short:
  ------------------
  |  Branch (923:9): [True: 0, False: 8.14k]
  ------------------
  924|      0|            arr->arr.shorts.store[offset] = (short)strtol(cp, &ep, 0);
  925|      0|            if (ep == cp) {
  ------------------
  |  Branch (925:17): [True: 0, False: 0]
  ------------------
  926|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  927|      0|            }
  928|      0|            cp = ep;
  929|      0|            break;
  930|      0|        case t_ushort:
  ------------------
  |  Branch (930:9): [True: 0, False: 8.14k]
  ------------------
  931|      0|            arr->arr.ushorts.store[offset] = (unsigned short)strtoul(cp,
  932|      0|                                                                     &ep, 0);
  933|      0|            if (ep == cp) {
  ------------------
  |  Branch (933:17): [True: 0, False: 0]
  ------------------
  934|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  935|      0|            }
  936|      0|            cp = ep;
  937|      0|            break;
  938|      0|        case t_time:
  ------------------
  |  Branch (938:9): [True: 0, False: 8.14k]
  ------------------
  939|      0|            {
  940|      0|                timespec_t ts_tmp;
  941|      0|                if (*cp != '"') {
  ------------------
  |  Branch (941:21): [True: 0, False: 0]
  ------------------
  942|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  943|      0|                } else {
  944|      0|                    ++cp;
  945|      0|                }
  946|      0|                ts_tmp = iso8601_to_timespec(cp);
  947|      0|                arr->arr.timespecs.store[offset] = ts_tmp;
  948|      0|                while (*cp &&
  ------------------
  |  Branch (948:24): [True: 0, False: 0]
  ------------------
  949|      0|                       *cp != '"') {
  ------------------
  |  Branch (949:24): [True: 0, False: 0]
  ------------------
  950|      0|                    cp++;
  951|      0|                }
  952|      0|                if (*cp != '"') {
  ------------------
  |  Branch (952:21): [True: 0, False: 0]
  ------------------
  953|      0|                    return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|      0|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  954|      0|                }
  955|      0|                ++cp;
  956|      0|            }
  957|      0|            break;
  958|      0|        case t_timespec:
  ------------------
  |  Branch (958:9): [True: 0, False: 8.14k]
  ------------------
  959|       |            // TODO not sure how to implement this
  960|      0|            return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  961|      0|            break;
  962|      0|        case t_real:
  ------------------
  |  Branch (962:9): [True: 0, False: 8.14k]
  ------------------
  963|      0|            arr->arr.reals.store[offset] = strtod(cp, &ep);
  964|      0|            if (ep == cp) {
  ------------------
  |  Branch (964:17): [True: 0, False: 0]
  ------------------
  965|      0|                return JSON_ERR_BADNUM;
  ------------------
  |  |  173|      0|#define JSON_ERR_BADNUM        22      // error parsing a numerical argument
  ------------------
  966|      0|            }
  967|      0|            cp = ep;
  968|      0|            break;
  969|      0|        case t_boolean:
  ------------------
  |  Branch (969:9): [True: 0, False: 8.14k]
  ------------------
  970|      0|            if (str_starts_with(cp, "true")) {
  ------------------
  |  Branch (970:17): [True: 0, False: 0]
  ------------------
  971|      0|                arr->arr.booleans.store[offset] = true;
  972|      0|                cp += 4;
  973|      0|            } else if (str_starts_with(cp, "false")) {
  ------------------
  |  Branch (973:24): [True: 0, False: 0]
  ------------------
  974|      0|                arr->arr.booleans.store[offset] = false;
  975|      0|                cp += 5;
  976|      0|            }
  977|      0|            break;
  978|      0|        case t_character:
  ------------------
  |  Branch (978:9): [True: 0, False: 8.14k]
  ------------------
  979|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  980|      0|        case t_array:
  ------------------
  |  Branch (980:9): [True: 0, False: 8.14k]
  ------------------
  981|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  982|      0|        case t_check:
  ------------------
  |  Branch (982:9): [True: 0, False: 8.14k]
  ------------------
  983|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  984|      0|        case t_ignore:
  ------------------
  |  Branch (984:9): [True: 0, False: 8.14k]
  ------------------
  985|      0|            json_debug_trace(1, "json: %s", "Invalid array subtype.\n");
  ------------------
  |  |  108|      0|    do {                                              \
  |  |  109|      0|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      0|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      0|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
  986|      0|            return JSON_ERR_SUBTYPE;
  ------------------
  |  |  165|      0|#define JSON_ERR_SUBTYPE       14      // unsupported array element type
  ------------------
  987|  8.14k|        }
  988|  7.95k|        arrcount++;
  989|  7.95k|        if (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (989:13): [True: 194, False: 7.76k]
  ------------------
  990|    194|            cp++;
  991|    194|        }
  992|  7.95k|        if (*cp == ']') {
  ------------------
  |  Branch (992:13): [True: 495, False: 7.46k]
  ------------------
  993|    495|            json_debug_trace(1, "json: %s", "End of array found.\n");
  ------------------
  |  |  108|    495|    do {                                              \
  |  |  109|    495|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    495|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 495]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 495]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    495|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    495|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 495]
  |  |  ------------------
  ------------------
  994|    495|            goto breakout;
  995|    495|        }
  996|  7.46k|        if (*cp == ',') {
  ------------------
  |  Branch (996:13): [True: 7.31k, False: 145]
  ------------------
  997|  7.31k|            cp++;
  998|  7.31k|        } else {
  999|    145|            json_debug_trace(1, "json: %s", "Bad trailing syntax on array.\n");
  ------------------
  |  |  108|    145|    do {                                              \
  |  |  109|    145|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    145|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 145]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 145]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    145|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    145|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 145]
  |  |  ------------------
  ------------------
 1000|    145|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    145|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
 1001|    145|        }
 1002|  7.46k|    }
 1003|      1|    json_debug_trace(1, "json: %s", "Too many elements in array.\n");
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
 1004|      1|    if (NULL != end) {
  ------------------
  |  Branch (1004:9): [True: 1, False: 0]
  ------------------
 1005|      1|        *end = cp;
 1006|      1|    }
 1007|      1|    return JSON_ERR_SUBTOOLONG;
  ------------------
  |  |  163|      1|#define JSON_ERR_SUBTOOLONG    12      // too many array elements
  ------------------
 1008|    709|  breakout:
 1009|    709|    if (NULL != arr->count) {
  ------------------
  |  Branch (1009:9): [True: 709, False: 0]
  ------------------
 1010|    709|        *(arr->count) = arrcount;
 1011|    709|    }
 1012|    709|    if (NULL != end) {
  ------------------
  |  Branch (1012:9): [True: 709, False: 0]
  ------------------
 1013|    709|        *end = cp;
 1014|    709|    }
 1015|    709|    json_debug_trace(1, "json: leaving json_read_array() with %d elements\n",
  ------------------
  |  |  108|    709|    do {                                              \
  |  |  109|    709|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    709|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 709]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 709]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    709|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    709|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 709]
  |  |  ------------------
  ------------------
 1016|    709|                      arrcount);
 1017|    709|    return 0;
 1018|    828|}
json_read_object:
 1022|  5.16k|{
 1023|  5.16k|    int st;
 1024|       |
 1025|  5.16k|    json_debug_trace(1, "json: json_read_object() sees '%s'\n", cp);
  ------------------
  |  |  108|  5.16k|    do {                                              \
  |  |  109|  5.16k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  5.16k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 5.16k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 5.16k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  5.16k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  5.16k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 5.16k]
  |  |  ------------------
  ------------------
 1026|       |    st = json_internal_read_object(cp, attrs, NULL, 0, end);
 1027|  5.16k|    return st;
 1028|  5.16k|}
json.c:json_internal_read_object:
  199|  10.3k|{
  200|  10.3k|    enum
  201|  10.3k|    { init, await_attr, in_attr, await_value, in_val_string,
  202|  10.3k|        in_escape, in_val_token, post_val, post_element, in_ignore_array
  203|  10.3k|    } state = 0;
  204|  10.3k|    char *statenames[] = {
  205|  10.3k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  206|  10.3k|        "in_escape", "in_val_token", "post_val", "post_element",
  207|  10.3k|        "in_ignore_array"
  208|  10.3k|    };
  209|  10.3k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  210|  10.3k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  211|  10.3k|    bool value_quoted = false;
  212|  10.3k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  213|  10.3k|    const struct json_attr_t *cursor;
  214|  10.3k|    int substatus, maxlen = 0;
  215|  10.3k|    unsigned int u;
  216|  10.3k|    const struct json_enum_t *mp;
  217|  10.3k|    char *lptr;
  218|       |
  219|  10.3k|    if (NULL != end) {
  ------------------
  |  Branch (219:9): [True: 5.22k, False: 5.16k]
  ------------------
  220|  5.22k|        *end = NULL;    // give it a well-defined value on parse failure
  221|  5.22k|    }
  222|  10.3k|    memset(valbuf, 0, sizeof(valbuf));
  223|       |
  224|       |    // stuff fields with defaults in case they're omitted in the JSON input
  225|   160k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (225:26): [True: 150k, False: 10.3k]
  ------------------
  226|   150k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (226:13): [True: 150k, False: 159]
  ------------------
  227|   150k|            lptr = json_target_address(cursor, parent, offset);
  228|   150k|            if (NULL != lptr)
  ------------------
  |  Branch (228:17): [True: 139k, False: 10.3k]
  ------------------
  229|   139k|                switch (cursor->type) {
  ------------------
  |  Branch (229:25): [True: 139k, False: 0]
  ------------------
  230|  3.03k|                case t_byte:
  ------------------
  |  Branch (230:17): [True: 3.03k, False: 136k]
  ------------------
  231|  3.03k|                    lptr[0] = cursor->dflt.byte;
  232|  3.03k|                    break;
  233|  18.2k|                case t_ubyte:
  ------------------
  |  Branch (233:17): [True: 18.2k, False: 121k]
  ------------------
  234|  18.2k|                    lptr[0] = cursor->dflt.ubyte;
  235|  18.2k|                    break;
  236|  18.9k|                case t_integer:
  ------------------
  |  Branch (236:17): [True: 18.9k, False: 120k]
  ------------------
  237|  18.9k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  238|  18.9k|                    break;
  239|  8.49k|                case t_uinteger:
  ------------------
  |  Branch (239:17): [True: 8.49k, False: 131k]
  ------------------
  240|  8.49k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  241|  8.49k|                    break;
  242|    952|                case t_longint:
  ------------------
  |  Branch (242:17): [True: 952, False: 138k]
  ------------------
  243|    952|                    memcpy(lptr, &cursor->dflt.longint, sizeof(long));
  244|    952|                    break;
  245|    122|                case t_ulongint:
  ------------------
  |  Branch (245:17): [True: 122, False: 139k]
  ------------------
  246|    122|                    memcpy(lptr, &cursor->dflt.ulongint,
  247|    122|                           sizeof(unsigned long));
  248|    122|                    break;
  249|  3.03k|                case t_short:
  ------------------
  |  Branch (249:17): [True: 3.03k, False: 136k]
  ------------------
  250|  3.03k|                    memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
  251|  3.03k|                    break;
  252|      0|                case t_ushort:
  ------------------
  |  Branch (252:17): [True: 0, False: 139k]
  ------------------
  253|      0|                    memcpy(lptr, &cursor->dflt.ushortint,
  254|      0|                           sizeof(unsigned short));
  255|      0|                    break;
  256|  2.25k|                case t_time:
  ------------------
  |  Branch (256:17): [True: 2.25k, False: 137k]
  ------------------
  257|  2.25k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  258|  2.25k|                    break;
  259|  2.31k|                case t_timespec:
  ------------------
  |  Branch (259:17): [True: 2.31k, False: 137k]
  ------------------
  260|  2.31k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  261|  2.31k|                    break;
  262|  55.8k|                case t_real:
  ------------------
  |  Branch (262:17): [True: 55.8k, False: 83.9k]
  ------------------
  263|  55.8k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  264|  55.8k|                    break;
  265|  14.3k|                case t_string:
  ------------------
  |  Branch (265:17): [True: 14.3k, False: 125k]
  ------------------
  266|  14.3k|                    if (parent != NULL
  ------------------
  |  Branch (266:25): [True: 7.95k, False: 6.36k]
  ------------------
  267|  7.95k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (267:28): [True: 0, False: 7.95k]
  ------------------
  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|  14.3k|                    lptr[0] = '\0';
  271|  14.3k|                    break;
  272|  4.15k|                case t_boolean:
  ------------------
  |  Branch (272:17): [True: 4.15k, False: 135k]
  ------------------
  273|  4.15k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  274|  4.15k|                    break;
  275|  1.66k|                case t_character:
  ------------------
  |  Branch (275:17): [True: 1.66k, False: 138k]
  ------------------
  276|  1.66k|                    lptr[0] = cursor->dflt.character;
  277|  1.66k|                    break;
  278|      0|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (278:17): [True: 0, False: 139k]
  ------------------
  279|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  280|      0|                case t_structobject:
  ------------------
  |  Branch (280:17): [True: 0, False: 139k]
  ------------------
  281|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  282|      0|                case t_array:
  ------------------
  |  Branch (282:17): [True: 0, False: 139k]
  ------------------
  283|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  284|  1.15k|                case t_check:
  ------------------
  |  Branch (284:17): [True: 1.15k, False: 138k]
  ------------------
  285|  1.15k|                    FALLTHROUGH
  ------------------
  |  |   55|  1.15k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  286|  6.36k|                case t_ignore:
  ------------------
  |  Branch (286:17): [True: 5.20k, False: 134k]
  ------------------
  287|  6.36k|                    break;
  288|   139k|                }
  289|   150k|        }
  290|       |
  291|  10.3k|    json_debug_trace(1, "json: JSON parse of '%s' begins.\n", cp);
  ------------------
  |  |  108|  10.3k|    do {                                              \
  |  |  109|  10.3k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  10.3k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 10.3k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 10.3k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  10.3k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  10.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 10.3k]
  |  |  ------------------
  ------------------
  292|       |
  293|       |    // parse input JSON
  294|   593k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (294:12): [True: 590k, False: 3.22k]
  ------------------
  295|   590k|        json_debug_trace(2, "json: State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  108|   590k|    do {                                              \
  |  |  109|   590k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   590k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 590k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 590k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   590k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   590k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 590k]
  |  |  ------------------
  ------------------
  296|   590k|                          statenames[state], *cp, cp);
  297|   590k|        switch (state) {
  ------------------
  |  Branch (297:17): [True: 590k, False: 0]
  ------------------
  298|  10.9k|        case init:
  ------------------
  |  Branch (298:9): [True: 10.9k, False: 579k]
  ------------------
  299|  10.9k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (299:17): [True: 599, False: 10.3k]
  ------------------
  300|    599|                continue;
  301|    599|            }
  302|  10.3k|            if (*cp == '{') {
  ------------------
  |  Branch (302:17): [True: 10.2k, False: 46]
  ------------------
  303|  10.2k|                state = await_attr;
  304|  10.2k|            } else {
  305|     46|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     46|    do {                                              \
  |  |  109|     46|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     46|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 46]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 46]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     46|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     46|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 46]
  |  |  ------------------
  ------------------
  306|     46|                                  "Non-WS when expecting object start.\n");
  307|     46|                if (NULL != end) {
  ------------------
  |  Branch (307:21): [True: 46, False: 0]
  ------------------
  308|     46|                    *end = cp;
  309|     46|                }
  310|     46|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     46|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  311|     46|            }
  312|  10.2k|            break;
  313|  42.3k|        case await_attr:
  ------------------
  |  Branch (313:9): [True: 42.3k, False: 547k]
  ------------------
  314|  42.3k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (314:17): [True: 204, False: 42.1k]
  ------------------
  315|    204|                continue;
  316|    204|            }
  317|  42.1k|            if (*cp == '"') {
  ------------------
  |  Branch (317:17): [True: 41.8k, False: 288]
  ------------------
  318|  41.8k|                state = in_attr;
  319|  41.8k|                pattr = attrbuf;
  320|  41.8k|                if (NULL != end) {
  ------------------
  |  Branch (320:21): [True: 6.64k, False: 35.2k]
  ------------------
  321|  6.64k|                    *end = cp;
  322|  6.64k|                }
  323|  41.8k|            } else if (*cp == '}') {
  ------------------
  |  Branch (323:24): [True: 197, False: 91]
  ------------------
  324|    197|                break;
  325|    197|            } else {
  326|     91|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     91|    do {                                              \
  |  |  109|     91|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     91|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 91]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 91]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     91|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     91|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 91]
  |  |  ------------------
  ------------------
  327|     91|                          "Non-WS when expecting attribute.\n");
  328|     91|                if (NULL != end) {
  ------------------
  |  Branch (328:21): [True: 4, False: 87]
  ------------------
  329|      4|                    *end = cp;
  330|      4|                }
  331|     91|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|     91|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  332|     91|            }
  333|  41.8k|            break;
  334|   178k|        case in_attr:
  ------------------
  |  Branch (334:9): [True: 178k, False: 411k]
  ------------------
  335|   178k|            if (NULL == pattr) {
  ------------------
  |  Branch (335:17): [True: 0, False: 178k]
  ------------------
  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|   178k|            if (*cp == '"') {
  ------------------
  |  Branch (339:17): [True: 41.8k, False: 136k]
  ------------------
  340|  41.8k|                *pattr++ = '\0';
  341|  41.8k|                json_debug_trace(1, "json: Collected attribute name %s\n",
  ------------------
  |  |  108|  41.8k|    do {                                              \
  |  |  109|  41.8k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  41.8k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 41.8k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 41.8k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  41.8k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  41.8k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 41.8k]
  |  |  ------------------
  ------------------
  342|  41.8k|                                  attrbuf);
  343|   487k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (343:38): [True: 487k, False: 100]
  ------------------
  344|   487k|                    json_debug_trace(2, "json: Checking against %s\n",
  ------------------
  |  |  108|   487k|    do {                                              \
  |  |  109|   487k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   487k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 487k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 487k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   487k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   487k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 487k]
  |  |  ------------------
  ------------------
  345|   487k|                                      cursor->attribute);
  346|   487k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (346:25): [True: 27.0k, False: 460k]
  ------------------
  347|  27.0k|                        break;
  348|  27.0k|                    }
  349|   460k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (349:25): [True: 14.8k, False: 445k]
  ------------------
  350|  14.8k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (350:25): [True: 14.6k, False: 239]
  ------------------
  351|  14.6k|                        break;
  352|  14.6k|                    }
  353|   460k|                }
  354|  41.8k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (354:21): [True: 100, False: 41.7k]
  ------------------
  355|    100|                    json_debug_trace(1,
  ------------------
  |  |  108|    100|    do {                                              \
  |  |  109|    100|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    100|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 100]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 100]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    100|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    100|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 100]
  |  |  ------------------
  ------------------
  356|    100|                                      "json: Unknown attribute name '%s'"
  357|    100|                                      " (attributes begin with '%s').\n",
  358|    100|                                      attrbuf, attrs->attribute);
  359|       |                    // don't update end here, leave at attribute start
  360|    100|                    return JSON_ERR_BADATTR;
  ------------------
  |  |  154|    100|#define JSON_ERR_BADATTR        3      // unknown attribute name
  ------------------
  361|    100|                }
  362|  41.7k|                state = await_value;
  363|  41.7k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (363:21): [True: 1.09k, False: 40.6k]
  ------------------
  364|  1.09k|                    maxlen = (int)cursor->len - 1;
  365|  40.6k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (365:28): [True: 2.22k, False: 38.4k]
  ------------------
  366|  2.22k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  2.22k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  367|  38.4k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (367:28): [True: 2.82k, False: 35.5k]
  ------------------
  368|  35.5k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (368:28): [True: 20.4k, False: 15.0k]
  ------------------
  369|  23.3k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  23.3k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  370|  23.3k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (370:28): [True: 446, False: 14.6k]
  ------------------
  371|    446|                    maxlen = (int)sizeof(valbuf) - 1;
  372|    446|                }
  373|  41.7k|                pval = valbuf;
  374|   136k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   136k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (374:24): [True: 23, False: 136k]
  ------------------
  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|   136k|            } else {
  379|   136k|                *pattr++ = *cp;
  380|   136k|            }
  381|   178k|            break;
  382|   178k|        case await_value:
  ------------------
  |  Branch (382:9): [True: 44.3k, False: 545k]
  ------------------
  383|  44.3k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (383:17): [True: 205, False: 44.1k]
  ------------------
  384|  44.1k|                *cp == ':') {
  ------------------
  |  Branch (384:17): [True: 2.53k, False: 41.6k]
  ------------------
  385|  2.73k|                continue;
  386|  2.73k|            }
  387|  41.6k|            if (*cp == '[') {
  ------------------
  |  Branch (387:17): [True: 2.86k, False: 38.7k]
  ------------------
  388|  2.86k|                if (cursor->type == t_ignore) {
  ------------------
  |  Branch (388:21): [True: 1.79k, False: 1.06k]
  ------------------
  389|       |                    /* skip to terminating ], not being fooled by
  390|       |                     * sub arrays, etc.
  391|       |                     * FIXME:  someday  */
  392|  1.79k|                    state = in_ignore_array;;
  393|  1.79k|                    value_quoted = false;
  394|  1.79k|                    break;
  395|  1.79k|                }
  396|  1.06k|                if (cursor->type != t_array) {
  ------------------
  |  Branch (396:21): [True: 27, False: 1.04k]
  ------------------
  397|     27|                    json_debug_trace(1,"json: %s",
  ------------------
  |  |  108|     27|    do {                                              \
  |  |  109|     27|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     27|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 27]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 27]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     27|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     27|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 27]
  |  |  ------------------
  ------------------
  398|     27|                                      "Saw [ when not expecting array.\n");
  399|     27|                    if (NULL != end) {
  ------------------
  |  Branch (399:25): [True: 3, False: 24]
  ------------------
  400|      3|                        *end = cp;
  401|      3|                    }
  402|     27|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|     27|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  403|     27|                }
  404|  1.04k|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  405|  1.04k|                if (substatus != 0) {
  ------------------
  |  Branch (405:21): [True: 333, False: 709]
  ------------------
  406|    333|                    return substatus;
  407|    333|                }
  408|    709|                state = post_element;
  409|  38.7k|            } else if (cursor->type == t_array) {
  ------------------
  |  Branch (409:24): [True: 1, False: 38.7k]
  ------------------
  410|      1|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|      1|    do {                                              \
  |  |  109|      1|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      1|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 1]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      1|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
  411|      1|                                  "Array element was specified, but no [.\n");
  412|      1|                if (NULL != end) {
  ------------------
  |  Branch (412:21): [True: 0, False: 1]
  ------------------
  413|      0|                    *end = cp;
  414|      0|                }
  415|      1|                return JSON_ERR_NOBRAK;
  ------------------
  |  |  157|      1|#define JSON_ERR_NOBRAK         6      // array element specified, but no [
  ------------------
  416|  38.7k|            } else if (*cp == '"') {
  ------------------
  |  Branch (416:24): [True: 9.23k, False: 29.5k]
  ------------------
  417|  9.23k|                value_quoted = true;
  418|  9.23k|                state = in_val_string;
  419|  9.23k|                pval = valbuf;
  420|  29.5k|            } else {
  421|  29.5k|                value_quoted = false;
  422|  29.5k|                state = in_val_token;
  423|  29.5k|                pval = valbuf;
  424|  29.5k|                *pval++ = *cp;
  425|  29.5k|            }
  426|  39.4k|            break;
  427|  91.9k|        case in_ignore_array:
  ------------------
  |  Branch (427:9): [True: 91.9k, False: 498k]
  ------------------
  428|  91.9k|            if (*cp == '"') {
  ------------------
  |  Branch (428:17): [True: 22.6k, False: 69.3k]
  ------------------
  429|  22.6k|                if (value_quoted == false) {
  ------------------
  |  Branch (429:21): [True: 11.4k, False: 11.2k]
  ------------------
  430|       |                    // now in quotes
  431|  11.4k|                    value_quoted = true;
  432|  11.4k|                } else {
  433|  11.2k|                    value_quoted = false;
  434|  11.2k|                }
  435|  69.3k|            } else if (*cp == ']') {
  ------------------
  |  Branch (435:24): [True: 1.67k, False: 67.6k]
  ------------------
  436|       |                // FIXME: does not handle sub arrays, etc.
  437|  1.67k|                if (value_quoted == false) {
  ------------------
  |  Branch (437:21): [True: 1.38k, False: 286]
  ------------------
  438|  1.38k|                    state = post_val;
  439|  1.38k|                }
  440|       |                // else in quotes, ignore it.
  441|  1.67k|            }
  442|  91.9k|            break;
  443|  67.2k|        case in_val_string:
  ------------------
  |  Branch (443:9): [True: 67.2k, False: 522k]
  ------------------
  444|  67.2k|            if (NULL == pval) {
  ------------------
  |  Branch (444:17): [True: 0, False: 67.2k]
  ------------------
  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|  67.2k|            if (*cp == '\\') {
  ------------------
  |  Branch (448:17): [True: 1.72k, False: 65.4k]
  ------------------
  449|  1.72k|                state = in_escape;
  450|  65.4k|            } else if (*cp == '"') {
  ------------------
  |  Branch (450:24): [True: 8.80k, False: 56.6k]
  ------------------
  451|  8.80k|                *pval++ = '\0';
  452|  8.80k|                json_debug_trace(1, "json: Collected string value %s\n", valbuf);
  ------------------
  |  |  108|  8.80k|    do {                                              \
  |  |  109|  8.80k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.80k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.80k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.80k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.80k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.80k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.80k]
  |  |  ------------------
  ------------------
  453|  8.80k|                state = post_val;
  454|  56.6k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  56.6k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (454:24): [True: 3, False: 56.6k]
  ------------------
  455|  56.6k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (455:24): [True: 109, False: 56.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|  56.5k|            } else {
  460|  56.5k|                *pval++ = *cp;
  461|  56.5k|            }
  462|  67.1k|            break;
  463|  67.1k|        case in_escape:
  ------------------
  |  Branch (463:9): [True: 1.72k, False: 588k]
  ------------------
  464|  1.72k|            if (NULL == pval) {
  ------------------
  |  Branch (464:17): [True: 0, False: 1.72k]
  ------------------
  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.72k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  1.72k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (468:17): [True: 3, False: 1.71k]
  ------------------
  469|  1.71k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (469:17): [True: 6, False: 1.71k]
  ------------------
  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.71k|            switch (*cp) {
  475|    200|            case 'b':
  ------------------
  |  Branch (475:13): [True: 200, False: 1.51k]
  ------------------
  476|    200|                *pval++ = '\b';
  477|    200|                break;
  478|    194|            case 'f':
  ------------------
  |  Branch (478:13): [True: 194, False: 1.51k]
  ------------------
  479|    194|                *pval++ = '\f';
  480|    194|                break;
  481|    196|            case 'n':
  ------------------
  |  Branch (481:13): [True: 196, False: 1.51k]
  ------------------
  482|    196|                *pval++ = '\n';
  483|    196|                break;
  484|    199|            case 'r':
  ------------------
  |  Branch (484:13): [True: 199, False: 1.51k]
  ------------------
  485|    199|                *pval++ = '\r';
  486|    199|                break;
  487|    394|            case 't':
  ------------------
  |  Branch (487:13): [True: 394, False: 1.31k]
  ------------------
  488|    394|                *pval++ = '\t';
  489|    394|                break;
  490|    277|            case 'u':
  ------------------
  |  Branch (490:13): [True: 277, False: 1.43k]
  ------------------
  491|    277|                {
  492|    277|                    unsigned n;
  493|       |
  494|    277|                    cp++;                   // skip the 'u'
  495|       |                    // NetBSD 6 wants the cast
  496|  1.13k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (496:33): [True: 945, False: 194]
  |  Branch (496:42): [True: 862, False: 83]
  ------------------
  497|    862|                        uescape[n] = *cp++;
  498|    862|                    }
  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|    251|            default:            // handles double quote and solidus
  ------------------
  |  Branch (510:13): [True: 251, False: 1.46k]
  ------------------
  511|    251|                *pval++ = *cp;
  512|    251|                break;
  513|  1.71k|            }
  514|  1.62k|            state = in_val_string;
  515|  1.62k|            break;
  516|   114k|        case in_val_token:
  ------------------
  |  Branch (516:9): [True: 114k, False: 476k]
  ------------------
  517|   114k|            if (NULL == pval) {
  ------------------
  |  Branch (517:17): [True: 0, False: 114k]
  ------------------
  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|   114k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (521:17): [True: 339, False: 113k]
  ------------------
  522|   113k|                *cp == ',' ||
  ------------------
  |  Branch (522:17): [True: 23.8k, False: 89.8k]
  ------------------
  523|  89.8k|                *cp == '}') {
  ------------------
  |  Branch (523:17): [True: 5.14k, False: 84.7k]
  ------------------
  524|  29.3k|                *pval = '\0';
  525|  29.3k|                json_debug_trace(1, "json: Collected token valuen %s\n",
  ------------------
  |  |  108|  29.3k|    do {                                              \
  |  |  109|  29.3k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  29.3k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 29.3k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 29.3k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  29.3k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  29.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 29.3k]
  |  |  ------------------
  ------------------
  526|  29.3k|                                 valbuf);
  527|  29.3k|                state = post_val;
  528|  29.3k|                if (*cp == '}' ||
  ------------------
  |  Branch (528:21): [True: 5.14k, False: 24.1k]
  ------------------
  529|  28.9k|                    *cp == ',') {
  ------------------
  |  Branch (529:21): [True: 23.8k, False: 339]
  ------------------
  530|  28.9k|                    --cp;
  531|  28.9k|                }
  532|  84.7k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|  84.7k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (532:24): [True: 6, False: 84.6k]
  ------------------
  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|  84.6k|            } else {
  537|  84.6k|                *pval++ = *cp;
  538|  84.6k|            }
  539|   113k|            break;
  540|       |            // coverity[unterminated_case]
  541|   113k|        case post_val:
  ------------------
  |  Branch (541:9): [True: 38.2k, False: 551k]
  ------------------
  542|       |            // Ignore whitespace after either string or token values.
  543|  38.2k|	  if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (543:8): [True: 236, False: 38.0k]
  ------------------
  544|    870|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (544:24): [True: 856, False: 14]
  |  Branch (544:39): [True: 634, False: 222]
  ------------------
  545|    634|                    ++cp;
  546|    634|                }
  547|    236|                json_debug_trace(1,
  ------------------
  |  |  108|    236|    do {                                              \
  |  |  109|    236|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    236|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 236]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 236]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    236|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    236|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 236]
  |  |  ------------------
  ------------------
  548|    236|                    "json: Skipped trailing whitespace: value \"%s\"\n", valbuf);
  549|    236|            }
  550|       |            /*
  551|       |             * We know that cursor points at the first spec matching
  552|       |             * the current attribute.  We don't know that it's *the*
  553|       |             * correct spec; our dialect allows there to be any number
  554|       |             * of adjacent ones with the same attrname but different
  555|       |             * types.  Here's where we try to seek forward for a
  556|       |             * matching type/attr pair if we're not looking at one.
  557|       |             */
  558|  38.2k|            for (;;) {
  559|  38.2k|                int seeking = cursor->type;
  560|       |
  561|  38.2k|                if (value_quoted &&
  ------------------
  |  Branch (561:21): [True: 7.62k, False: 30.6k]
  ------------------
  562|  7.62k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (562:22): [True: 1.05k, False: 6.57k]
  ------------------
  563|  6.57k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (563:22): [True: 1.94k, False: 4.62k]
  ------------------
  564|  3.00k|                    break;
  565|  3.00k|                }
  566|  35.2k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (566:22): [True: 1.90k, False: 33.3k]
  ------------------
  567|  33.3k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (567:22): [True: 194, False: 33.1k]
  ------------------
  568|  2.09k|                    seeking == t_boolean) {
  ------------------
  |  Branch (568:21): [True: 1.59k, False: 501]
  ------------------
  569|  1.59k|                    break;
  570|  1.59k|                }
  571|  33.6k|                if (isdigit((unsigned char) valbuf[0])) {
  ------------------
  |  Branch (571:21): [True: 17.3k, False: 16.2k]
  ------------------
  572|  17.3k|                    bool decimal = strchr(valbuf, '.') != NULL;
  573|       |
  574|  17.3k|                    if (decimal &&
  ------------------
  |  Branch (574:25): [True: 1.00k, False: 16.3k]
  ------------------
  575|  1.00k|                        seeking == t_real) {
  ------------------
  |  Branch (575:25): [True: 211, False: 796]
  ------------------
  576|    211|                        break;
  577|    211|                    }
  578|  17.1k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (578:25): [True: 16.3k, False: 796]
  |  Branch (578:38): [True: 226, False: 16.1k]
  ------------------
  579|  16.1k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (579:38): [True: 370, False: 15.7k]
  ------------------
  580|  15.7k|                                     seeking == t_integer ||
  ------------------
  |  Branch (580:38): [True: 1.12k, False: 14.6k]
  ------------------
  581|  14.6k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (581:38): [True: 729, False: 13.9k]
  ------------------
  582|  13.9k|                                     seeking == t_longint ||
  ------------------
  |  Branch (582:38): [True: 611, False: 13.3k]
  ------------------
  583|  13.3k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (583:38): [True: 401, False: 12.9k]
  ------------------
  584|  12.9k|                                     seeking == t_time ||
  ------------------
  |  Branch (584:38): [True: 225, False: 12.6k]
  ------------------
  585|  12.6k|                                     seeking == t_short ||
  ------------------
  |  Branch (585:38): [True: 1.40k, False: 11.2k]
  ------------------
  586|  11.2k|                                     seeking == t_ushort))
  ------------------
  |  Branch (586:38): [True: 0, False: 11.2k]
  ------------------
  587|  5.08k|                        break;
  588|  17.1k|                }
  589|  28.3k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (589:21): [True: 19.7k, False: 8.61k]
  ------------------
  590|  19.7k|                    break;
  591|  19.7k|                }
  592|  8.61k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (592:21): [True: 8.61k, False: 0]
  ------------------
  593|  8.61k|                    break;
  594|  8.61k|                }
  595|      0|                ++cursor;
  596|      0|            }
  597|  38.2k|            if (value_quoted &&
  ------------------
  |  Branch (597:17): [True: 7.62k, False: 30.6k]
  ------------------
  598|  7.62k|                (cursor->type != t_string &&
  ------------------
  |  Branch (598:18): [True: 6.57k, False: 1.05k]
  ------------------
  599|  6.57k|                 cursor->type != t_character &&
  ------------------
  |  Branch (599:18): [True: 6.37k, False: 200]
  ------------------
  600|  6.37k|                 cursor->type != t_check &&
  ------------------
  |  Branch (600:18): [True: 5.64k, False: 730]
  ------------------
  601|  5.64k|                 cursor->type != t_time &&
  ------------------
  |  Branch (601:18): [True: 3.69k, False: 1.94k]
  ------------------
  602|  3.69k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (602:18): [True: 464, False: 3.23k]
  ------------------
  603|    464|                 cursor->map == 0)) {
  ------------------
  |  Branch (603:18): [True: 26, False: 438]
  ------------------
  604|     26|                json_debug_trace(1, "json: %s", "Saw quoted value when expecting"
  ------------------
  |  |  108|     26|    do {                                              \
  |  |  109|     26|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     26|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 26]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 26]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     26|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 26]
  |  |  ------------------
  ------------------
  605|     26|                                  " non-string.\n");
  606|     26|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     26|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  607|     26|            }
  608|  38.2k|            if (!value_quoted &&
  ------------------
  |  Branch (608:17): [True: 30.6k, False: 7.60k]
  ------------------
  609|  30.6k|                (cursor->type == t_string ||
  ------------------
  |  Branch (609:18): [True: 20, False: 30.6k]
  ------------------
  610|  30.6k|                 cursor->type == t_check ||
  ------------------
  |  Branch (610:18): [True: 29, False: 30.5k]
  ------------------
  611|  30.5k|                 cursor->map != 0)) {
  ------------------
  |  Branch (611:18): [True: 7, False: 30.5k]
  ------------------
  612|     56|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     56|    do {                                              \
  |  |  109|     56|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     56|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 56]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 56]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     56|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     56|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 56]
  |  |  ------------------
  ------------------
  613|     56|                                 "Didn't see quoted value when expecting"
  614|     56|                                 " string.\n");
  615|     56|                return JSON_ERR_NONQSTRING;
  ------------------
  |  |  171|     56|#define JSON_ERR_NONQSTRING    20      // no quoted value when expecting string
  ------------------
  616|     56|            }
  617|  38.1k|            if (cursor->map != 0) {
  ------------------
  |  Branch (617:17): [True: 438, False: 37.7k]
  ------------------
  618|    877|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (618:40): [True: 813, False: 64]
  ------------------
  619|    813|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (619:25): [True: 374, False: 439]
  ------------------
  620|    374|                        goto foundit;
  621|    374|                    }
  622|     64|                json_debug_trace(1,
  ------------------
  |  |  108|     64|    do {                                              \
  |  |  109|     64|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     64|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 64]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 64]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     64|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     64|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 64]
  |  |  ------------------
  ------------------
  623|     64|                                 "json: Invalid enumerated value string %s.\n",
  624|     64|                                  valbuf);
  625|     64|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     64|#define JSON_ERR_BADENUM       18      // invalid enumerated value
  ------------------
  626|    374|              foundit:
  627|    374|                (void)snprintf(valbuf, sizeof(valbuf), "%d", mp->value);
  628|    374|            }
  629|  38.1k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (629:17): [True: 730, False: 37.3k]
  ------------------
  630|    730|                lptr = cursor->dflt.check;
  631|  37.3k|            } else {
  632|  37.3k|                lptr = json_target_address(cursor, parent, offset);
  633|  37.3k|            }
  634|  38.1k|            if (NULL != lptr) {
  ------------------
  |  Branch (634:17): [True: 21.1k, False: 16.9k]
  ------------------
  635|  21.1k|                switch (cursor->type) {
  ------------------
  |  Branch (635:25): [True: 21.1k, False: 0]
  ------------------
  636|    274|                case t_byte:
  ------------------
  |  Branch (636:17): [True: 274, False: 20.8k]
  ------------------
  637|    274|                    {
  638|    274|                        int tmp = atoi(valbuf);
  639|    274|                        lptr[0] = (char)tmp;
  640|    274|                    }
  641|    274|                    break;
  642|    820|                case t_ubyte:
  ------------------
  |  Branch (642:17): [True: 820, False: 20.3k]
  ------------------
  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.5k]
  ------------------
  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: 20.1k]
  ------------------
  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.5k]
  ------------------
  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.7k]
  ------------------
  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.42k|                case t_short:
  ------------------
  |  Branch (672:17): [True: 1.42k, False: 19.7k]
  ------------------
  673|  1.42k|                    {
  674|  1.42k|                        short tmp = atoi(valbuf);
  675|  1.42k|                        memcpy(lptr, &tmp, sizeof(short));
  676|  1.42k|                    }
  677|  1.42k|                    break;
  678|      0|                case t_ushort:
  ------------------
  |  Branch (678:17): [True: 0, False: 21.1k]
  ------------------
  679|      0|                    {
  680|      0|                        unsigned short tmp = (unsigned int)atoi(valbuf);
  681|      0|                        memcpy(lptr, &tmp, sizeof(unsigned short));
  682|      0|                    }
  683|      0|                    break;
  684|  2.82k|                case t_time:
  ------------------
  |  Branch (684:17): [True: 2.82k, False: 18.3k]
  ------------------
  685|  2.82k|                    {
  686|  2.82k|                        timespec_t ts_tmp = {0, 0};
  687|       |
  688|  2.82k|                        if (value_quoted) {
  ------------------
  |  Branch (688:29): [True: 1.94k, False: 872]
  ------------------
  689|  1.94k|                            ts_tmp = iso8601_to_timespec(valbuf);
  690|  1.94k|                        } else if (NULL == strchr(valbuf, '.')) {
  ------------------
  |  Branch (690:36): [True: 282, False: 590]
  ------------------
  691|       |                            // integer
  692|    282|                            ts_tmp.tv_sec = (time_t)atoll(valbuf);
  693|    590|                        } else {
  694|       |                            // real
  695|    590|                            double sec_tmp = safe_atof(valbuf);
  696|    590|                            if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (696:33): [True: 395, False: 195]
  ------------------
  697|    395|                                DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    395|    do { \
  |  |  145|    395|        double int_part; \
  |  |  146|    395|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    395|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    395|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 395]
  |  |  ------------------
  ------------------
  698|    395|                            }  // else, leave at default
  699|    590|                        }
  700|  2.82k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  701|  2.82k|                    }
  702|  2.82k|                    break;
  703|    390|                case t_timespec:
  ------------------
  |  Branch (703:17): [True: 390, False: 20.7k]
  ------------------
  704|    390|                    {
  705|    390|                        double sec_tmp = safe_atof(valbuf);
  706|    390|                        timespec_t ts_tmp;
  707|    390|                        if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (707:29): [True: 195, False: 195]
  ------------------
  708|    195|                            DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    195|    do { \
  |  |  145|    195|        double int_part; \
  |  |  146|    195|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    195|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    195|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 195]
  |  |  ------------------
  ------------------
  709|    195|                            memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  710|    195|                        } // else leave at .dflt
  711|    390|                    }
  712|    390|                    break;
  713|  4.80k|                case t_real:
  ------------------
  |  Branch (713:17): [True: 4.80k, False: 16.3k]
  ------------------
  714|  4.80k|                    {
  715|  4.80k|                        double tmp = safe_atof(valbuf);
  716|  4.80k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (716:29): [True: 3.88k, False: 921]
  ------------------
  717|  3.88k|                            memcpy(lptr, &tmp, sizeof(double));
  718|  3.88k|                        } // else leave at .dflt
  719|  4.80k|                    }
  720|  4.80k|                    break;
  721|  1.05k|                case t_string:
  ------------------
  |  Branch (721:17): [True: 1.05k, False: 20.1k]
  ------------------
  722|  1.05k|                    if (NULL != parent &&
  ------------------
  |  Branch (722:25): [True: 388, False: 664]
  ------------------
  723|    388|                        parent->element_type != t_structobject &&
  ------------------
  |  Branch (723:25): [True: 0, False: 388]
  ------------------
  724|      0|                        offset > 0) {
  ------------------
  |  Branch (724:25): [True: 0, False: 0]
  ------------------
  725|      0|                        return JSON_ERR_NOPARSTR;
  ------------------
  |  |  168|      0|#define JSON_ERR_NOPARSTR      17      // no strings in parallel arrays
  ------------------
  726|      0|                    }
  727|  1.05k|                    (void)strlcpy(lptr, valbuf, cursor->len);
  728|  1.05k|                    break;
  729|  1.84k|                case t_boolean:
  ------------------
  |  Branch (729:17): [True: 1.84k, False: 19.3k]
  ------------------
  730|  1.84k|                    {
  731|  1.84k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  732|  1.84k|                        memcpy(lptr, &tmp, sizeof(bool));
  733|  1.84k|                    }
  734|  1.84k|                    break;
  735|    557|                case t_character:
  ------------------
  |  Branch (735:17): [True: 557, False: 20.6k]
  ------------------
  736|    557|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (736:25): [True: 6, False: 551]
  ------------------
  737|       |                        // don't update end here, leave at value start
  738|      6|                        return JSON_ERR_STRLONG;
  ------------------
  |  |  158|      6|#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.69k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (743:17): [True: 2.69k, False: 18.4k]
  ------------------
  744|  2.69k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.69k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  745|  2.69k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (745:17): [True: 0, False: 21.1k]
  ------------------
  746|  2.69k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.69k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  747|  2.69k|                case t_structobject:
  ------------------
  |  Branch (747:17): [True: 0, False: 21.1k]
  ------------------
  748|  2.69k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.69k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  749|  2.69k|                case t_array:
  ------------------
  |  Branch (749:17): [True: 0, False: 21.1k]
  ------------------
  750|  2.69k|                    break;
  751|    730|                case t_check:
  ------------------
  |  Branch (751:17): [True: 730, False: 20.4k]
  ------------------
  752|    730|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (752:25): [True: 167, False: 563]
  ------------------
  753|    167|                        json_debug_trace(1, "json: Required attribute value %s"
  ------------------
  |  |  108|    167|    do {                                              \
  |  |  109|    167|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    167|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 167]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 167]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    167|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    167|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 167]
  |  |  ------------------
  ------------------
  754|    167|                                          " not present.\n",
  755|    167|                                          cursor->dflt.check);
  756|       |                        // don't update end here, leave at start of attribute
  757|    167|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    167|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  758|    167|                    }
  759|    563|                    break;
  760|  21.1k|                }
  761|  21.1k|            }
  762|  37.9k|            FALLTHROUGH
  ------------------
  |  |   55|  37.9k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  763|  38.8k|        case post_element:
  ------------------
  |  Branch (763:9): [True: 881, False: 589k]
  ------------------
  764|  38.8k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (764:17): [True: 216, False: 38.6k]
  ------------------
  765|    216|                continue;
  766|    216|            }
  767|  38.6k|            if (*cp == ',') {
  ------------------
  |  Branch (767:17): [True: 32.5k, False: 6.01k]
  ------------------
  768|  32.5k|                state = await_attr;
  769|  32.5k|            } else if (*cp == '}') {
  ------------------
  |  Branch (769:24): [True: 5.50k, False: 513]
  ------------------
  770|  5.50k|                ++cp;
  771|  5.50k|                goto good_parse;
  772|  5.50k|            } else {
  773|    513|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|    513|    do {                                              \
  |  |  109|    513|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    513|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 513]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 513]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    513|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    513|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 513]
  |  |  ------------------
  ------------------
  774|    513|                                "Garbage while expecting comma or }\n");
  775|    513|                if (NULL != end) {
  ------------------
  |  Branch (775:21): [True: 27, False: 486]
  ------------------
  776|     27|                    *end = cp;
  777|     27|                }
  778|    513|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    513|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  779|    513|            }
  780|  32.5k|            break;
  781|   590k|        }
  782|   590k|    }
  783|  3.22k|    if (state == init) {
  ------------------
  |  Branch (783:9): [True: 43, False: 3.17k]
  ------------------
  784|     43|        json_debug_trace(1, "json: %s", "Input was empty or white-space only\n");
  ------------------
  |  |  108|     43|    do {                                              \
  |  |  109|     43|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     43|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 43]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 43]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     43|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     43|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 43]
  |  |  ------------------
  ------------------
  785|     43|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     43|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  786|     43|    }
  787|       |
  788|  8.68k|  good_parse:
  789|       |    // in case there's another object following, consume trailing WS
  790|  8.68k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (790:12): [True: 201, False: 8.68k]
  ------------------
  791|    201|        ++cp;
  792|    201|    }
  793|  8.68k|    if (NULL != end) {
  ------------------
  |  Branch (793:9): [True: 5.05k, False: 3.62k]
  ------------------
  794|  5.05k|        *end = cp;
  795|  5.05k|    }
  796|  8.68k|    json_debug_trace(1, "%s", "json: JSON parse ends.\n");
  ------------------
  |  |  108|  8.68k|    do {                                              \
  |  |  109|  8.68k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.68k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.68k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.68k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.68k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.68k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.68k]
  |  |  ------------------
  ------------------
  797|  8.68k|    return 0;
  798|  3.22k|}
json.c:json_target_address:
  119|   187k|{
  120|   187k|    char *targetaddr = NULL;
  121|   187k|    if (NULL == parent ||
  ------------------
  |  Branch (121:9): [True: 105k, False: 81.9k]
  ------------------
  122|   105k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (122:9): [True: 0, False: 81.9k]
  ------------------
  123|       |        // ordinary case - use the address in the cursor structure
  124|   105k|        switch (cursor->type) {
  125|      0|        case t_byte:
  ------------------
  |  Branch (125:9): [True: 0, False: 105k]
  ------------------
  126|      0|            targetaddr = (char *)&cursor->addr.byte[offset];
  127|      0|            break;
  128|    865|        case t_ubyte:
  ------------------
  |  Branch (128:9): [True: 865, False: 104k]
  ------------------
  129|    865|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  130|    865|            break;
  131|  21.5k|        case t_ignore:
  ------------------
  |  Branch (131:9): [True: 21.5k, False: 84.0k]
  ------------------
  132|  21.5k|            targetaddr = NULL;
  133|  21.5k|            break;
  134|  18.2k|        case t_integer:
  ------------------
  |  Branch (134:9): [True: 18.2k, False: 87.3k]
  ------------------
  135|  18.2k|            targetaddr = (char *)&cursor->addr.integer[offset];
  136|  18.2k|            break;
  137|  6.15k|        case t_uinteger:
  ------------------
  |  Branch (137:9): [True: 6.15k, False: 99.4k]
  ------------------
  138|  6.15k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  139|  6.15k|            break;
  140|  1.58k|        case t_longint:
  ------------------
  |  Branch (140:9): [True: 1.58k, False: 104k]
  ------------------
  141|  1.58k|            targetaddr = (char *)&cursor->addr.longint[offset];
  142|  1.58k|            break;
  143|    542|        case t_ulongint:
  ------------------
  |  Branch (143:9): [True: 542, False: 105k]
  ------------------
  144|    542|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  145|    542|            break;
  146|      0|        case t_short:
  ------------------
  |  Branch (146:9): [True: 0, False: 105k]
  ------------------
  147|      0|            targetaddr = (char *)&cursor->addr.shortint[offset];
  148|      0|            break;
  149|      0|        case t_ushort:
  ------------------
  |  Branch (149:9): [True: 0, False: 105k]
  ------------------
  150|      0|            targetaddr = (char *)&cursor->addr.ushortint[offset];
  151|      0|            break;
  152|  3.91k|        case t_time:
  ------------------
  |  Branch (152:9): [True: 3.91k, False: 101k]
  ------------------
  153|  3.91k|            targetaddr = (char *)&cursor->addr.ts[offset];
  154|  3.91k|            break;
  155|      0|        case t_timespec:
  ------------------
  |  Branch (155:9): [True: 0, False: 105k]
  ------------------
  156|      0|            targetaddr = (char *)&cursor->addr.ts[offset];
  157|      0|            break;
  158|  37.3k|        case t_real:
  ------------------
  |  Branch (158:9): [True: 37.3k, False: 68.2k]
  ------------------
  159|  37.3k|            targetaddr = (char *)&cursor->addr.real[offset];
  160|  37.3k|            break;
  161|  7.02k|        case t_string:
  ------------------
  |  Branch (161:9): [True: 7.02k, False: 98.5k]
  ------------------
  162|  7.02k|            targetaddr = cursor->addr.string;
  163|  7.02k|            break;
  164|  1.51k|        case t_boolean:
  ------------------
  |  Branch (164:9): [True: 1.51k, False: 104k]
  ------------------
  165|  1.51k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  166|  1.51k|            break;
  167|  1.06k|        case t_character:
  ------------------
  |  Branch (167:9): [True: 1.06k, False: 104k]
  ------------------
  168|  1.06k|            targetaddr = (char *)&cursor->addr.character[offset];
  169|  1.06k|            break;
  170|    643|        case t_array:
  ------------------
  |  Branch (170:9): [True: 643, False: 104k]
  ------------------
  171|    643|            FALLTHROUGH
  ------------------
  |  |   55|    643|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  172|  5.80k|        case t_check:
  ------------------
  |  Branch (172:9): [True: 5.16k, False: 100k]
  ------------------
  173|  5.80k|            FALLTHROUGH
  ------------------
  |  |   55|  5.80k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  174|  5.80k|        case t_object:
  ------------------
  |  Branch (174:9): [True: 0, False: 105k]
  ------------------
  175|  5.80k|            FALLTHROUGH
  ------------------
  |  |   55|  5.80k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  176|  5.80k|        case t_structobject:
  ------------------
  |  Branch (176:9): [True: 0, False: 105k]
  ------------------
  177|  5.80k|            FALLTHROUGH
  ------------------
  |  |   55|  5.80k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  178|  5.80k|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 105k]
  ------------------
  179|  5.80k|            targetaddr = NULL;
  180|  5.80k|            break;
  181|   105k|        }
  182|   105k|    } else {
  183|       |        // tricky case - hacking a member in an array of structures
  184|  81.9k|        targetaddr =
  185|  81.9k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  186|  81.9k|            cursor->addr.offset;
  187|  81.9k|    }
  188|   187k|    json_debug_trace(1, "json: Target address for %s (offset %d) is %p\n",
  ------------------
  |  |  108|   187k|    do {                                              \
  |  |  109|   187k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   187k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 187k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 187k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   187k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   187k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 187k]
  |  |  ------------------
  ------------------
  189|   187k|                      cursor->attribute, offset, targetaddr);
  190|   187k|    return targetaddr;
  191|   187k|}

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

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

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

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|     53|{
   99|       |    // *INDENT-OFF*
  100|     53|    struct json_attr_t chanconfig_attrs[] = {
  101|     53|        {"class",          t_check,    .dflt.check = "WATCH"},
  102|       |
  103|     53|        {"device",         t_string,   .addr.string = ccp->devpath,
  104|     53|                                          .len = sizeof(ccp->devpath)},
  105|     53|        {"enable",         t_boolean,  .addr.boolean = &ccp->watcher,
  106|     53|                                          .dflt.boolean = true},
  107|     53|        {"json",           t_boolean,  .addr.boolean = &ccp->json,
  108|     53|                                          .nodefault = true},
  109|     53|        {"nmea",           t_boolean,  .addr.boolean = &ccp->nmea,
  110|     53|                                          .nodefault = true},
  111|     53|        {"pps",            t_boolean,  .addr.boolean = &ccp->pps},
  112|     53|        {"raw",            t_integer,  .addr.integer = &ccp->raw,
  113|     53|                                          .nodefault = true},
  114|     53|        {"remote",         t_string,   .addr.string = ccp->remote,
  115|     53|                                          .len = sizeof(ccp->remote)},
  116|     53|        {"scaled",         t_boolean,  .addr.boolean = &ccp->scaled},
  117|     53|        {"split24",        t_boolean,  .addr.boolean = &ccp->split24},
  118|     53|        {"timing",         t_boolean,  .addr.boolean = &ccp->timing},
  119|       |        // ignore unknown keys, for cross-version compatibility
  120|     53|        {"", t_ignore},
  121|     53|        {NULL},
  122|     53|    };
  123|       |    // *INDENT-ON*
  124|     53|    int status;
  125|       |
  126|     53|    status = json_read_object(buf, chanconfig_attrs, endptr);
  127|     53|    return status;
  128|     53|}

