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

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

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

safe_atof:
  294|  5.51k|{
  295|  5.51k|    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.51k|    static double powersOf10[] = {
  303|  5.51k|        10.,
  304|  5.51k|        100.,
  305|  5.51k|        1.0e4,
  306|  5.51k|        1.0e8,
  307|  5.51k|        1.0e16,
  308|  5.51k|        1.0e32,
  309|  5.51k|        1.0e64,
  310|  5.51k|        1.0e128,
  311|  5.51k|        1.0e256
  312|  5.51k|    };
  313|       |
  314|  5.51k|    bool sign = false, expSign = false;
  315|  5.51k|    double fraction, dblExp, *d;
  316|  5.51k|    const char *p;
  317|  5.51k|    unsigned char c;
  318|  5.51k|    int exp = 0;                // Exponent read from "EX" field.
  319|  5.51k|    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.51k|    int mantSize;               // Number of digits in mantissa.
  329|  5.51k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  330|       |                                 * point. */
  331|  5.51k|    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.51k|    p = string;
  341|  5.51k|    while (isspace((int)*p)) {
  ------------------
  |  Branch (341:12): [True: 0, False: 5.51k]
  ------------------
  342|      0|        p += 1;
  343|      0|    }
  344|  5.51k|    if (isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (344:9): [True: 2.70k, False: 2.80k]
  ------------------
  345|       |        // ignore
  346|  2.80k|    } else if ('-' == *p) {
  ------------------
  |  Branch (346:16): [True: 811, False: 1.99k]
  ------------------
  347|    811|        sign = true;
  348|    811|        p += 1;
  349|  1.99k|    } else if ('+' == *p) {
  ------------------
  |  Branch (349:16): [True: 221, False: 1.77k]
  ------------------
  350|    221|        p += 1;
  351|  1.77k|    } else if ('.' == *p) {
  ------------------
  |  Branch (351:16): [True: 1.12k, False: 647]
  ------------------
  352|       |        // ignore
  353|  1.12k|    } else {
  354|    647|        return NAN;
  355|    647|    }
  356|       |
  357|       |    /*
  358|       |     * Count the number of digits in the mantissa (including the decimal
  359|       |     * point), and also locate the decimal point.
  360|       |     */
  361|       |
  362|  4.86k|    decPt = -1;
  363|  20.7k|    for (mantSize = 0; ; mantSize += 1) {
  364|  20.7k|        c = *p;
  365|  20.7k|        if (!isdigit(c)) {
  ------------------
  |  Branch (365:13): [True: 6.28k, False: 14.4k]
  ------------------
  366|  6.28k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (366:17): [True: 4.66k, False: 1.61k]
  |  Branch (366:31): [True: 203, False: 1.41k]
  ------------------
  367|  4.86k|                break;
  368|  4.86k|            }
  369|  1.41k|            decPt = mantSize;
  370|  1.41k|        }
  371|  15.9k|        p += 1;
  372|  15.9k|    }
  373|       |
  374|       |    /*
  375|       |     * Now suck up the digits in the mantissa.  Use two integers to
  376|       |     * collect 9 digits each (this is faster than using floating-point).
  377|       |     * If the mantissa has more than 18 digits, ignore the extras, since
  378|       |     * they can't affect the value anyway.
  379|       |     */
  380|       |
  381|  4.86k|    pExp  = p;
  382|  4.86k|    p -= mantSize;
  383|  4.86k|    if (decPt < 0) {
  ------------------
  |  Branch (383:9): [True: 3.45k, False: 1.41k]
  ------------------
  384|  3.45k|        decPt = mantSize;
  385|  3.45k|    } else {
  386|  1.41k|        mantSize -= 1;                  // One of the digits was the point.
  387|  1.41k|    }
  388|  4.86k|    if (mantSize > 18) {
  ------------------
  |  Branch (388:9): [True: 208, False: 4.65k]
  ------------------
  389|    208|        fracExp = decPt - 18;
  390|    208|        mantSize = 18;
  391|  4.65k|    } else {
  392|  4.65k|        fracExp = decPt - mantSize;
  393|  4.65k|    }
  394|  4.86k|    if (mantSize == 0) {
  ------------------
  |  Branch (394:9): [True: 1.25k, False: 3.60k]
  ------------------
  395|  1.25k|        fraction = 0.0;
  396|       |        // p = string;
  397|  1.25k|        goto done;
  398|  3.60k|    } else {
  399|  3.60k|        int frac1, frac2;
  400|       |
  401|  3.60k|        frac1 = 0;
  402|  6.29k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (402:17): [True: 2.68k, False: 3.60k]
  ------------------
  403|  2.68k|            c = *p;
  404|  2.68k|            p += 1;
  405|  2.68k|            if ('.' == c) {
  ------------------
  |  Branch (405:17): [True: 194, False: 2.49k]
  ------------------
  406|    194|                c = *p;
  407|    194|                p += 1;
  408|    194|            }
  409|  2.68k|            frac1 = 10*frac1 + (c - '0');
  410|  2.68k|        }
  411|  3.60k|        frac2 = 0;
  412|  12.9k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (412:16): [True: 9.38k, False: 3.60k]
  ------------------
  413|  9.38k|            c = *p;
  414|  9.38k|            p += 1;
  415|  9.38k|            if ('.' == c) {
  ------------------
  |  Branch (415:17): [True: 264, False: 9.12k]
  ------------------
  416|    264|                c = *p;
  417|    264|                p += 1;
  418|    264|            }
  419|  9.38k|            frac2 = 10*frac2 + (c - '0');
  420|  9.38k|        }
  421|  3.60k|        fraction = (1.0e9 * frac1) + frac2;
  422|  3.60k|    }
  423|       |
  424|       |    /*
  425|       |     * Skim off the exponent.
  426|       |     */
  427|       |
  428|  3.60k|    p = pExp;
  429|  3.60k|    if (('E' == *p) ||
  ------------------
  |  Branch (429:9): [True: 1.11k, False: 2.49k]
  ------------------
  430|  2.49k|        ('e' == *p)) {
  ------------------
  |  Branch (430:9): [True: 1.01k, False: 1.47k]
  ------------------
  431|  2.13k|        p += 1;
  432|  2.13k|        if ('-' == *p) {
  ------------------
  |  Branch (432:13): [True: 594, False: 1.53k]
  ------------------
  433|    594|            expSign = true;
  434|    594|            p += 1;
  435|  1.53k|        } else {
  436|  1.53k|            if ('+' == *p) {
  ------------------
  |  Branch (436:17): [True: 194, False: 1.34k]
  ------------------
  437|    194|                p += 1;
  438|    194|            }
  439|  1.53k|            expSign = false;
  440|  1.53k|        }
  441|  4.48k|        while (isdigit((unsigned char) *p)) {
  ------------------
  |  Branch (441:16): [True: 4.48k, False: 1.33k]
  ------------------
  442|  4.48k|            exp = exp * 10 + (*p - '0');
  443|  4.48k|            if (1024 < exp) {
  ------------------
  |  Branch (443:17): [True: 794, False: 3.69k]
  ------------------
  444|    794|                if (true == expSign) {
  ------------------
  |  Branch (444:21): [True: 388, False: 406]
  ------------------
  445|       |                    // exponent underflow!
  446|    388|                    if (sign) {
  ------------------
  |  Branch (446:25): [True: 194, False: 194]
  ------------------
  447|    194|                        return -0.0;
  448|    194|                    }
  449|    194|                    return 0.0;
  450|    388|                } // else  exponent overflow!
  451|    406|                if (sign) {
  ------------------
  |  Branch (451:21): [True: 194, False: 212]
  ------------------
  452|    194|                    return -INFINITY;
  453|    194|                }
  454|    212|                return INFINITY;
  455|    406|            }
  456|  3.69k|            p += 1;
  457|  3.69k|        }
  458|  2.13k|    }
  459|  2.81k|    if (expSign) {
  ------------------
  |  Branch (459:9): [True: 206, False: 2.60k]
  ------------------
  460|    206|        exp = fracExp - exp;
  461|  2.60k|    } else {
  462|  2.60k|        exp = fracExp + exp;
  463|  2.60k|    }
  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.81k|    if (0 > exp) {
  ------------------
  |  Branch (472:9): [True: 432, False: 2.38k]
  ------------------
  473|    432|        expSign = true;
  474|    432|        exp = -exp;
  475|  2.38k|    } else {
  476|  2.38k|        expSign = false;
  477|  2.38k|    }
  478|  2.81k|    if (exp > maxExponent) {
  ------------------
  |  Branch (478:9): [True: 221, False: 2.59k]
  ------------------
  479|    221|        exp = maxExponent;
  480|    221|        errno = ERANGE;
  481|    221|    }
  482|  2.81k|    dblExp = 1.0;
  483|  7.27k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (483:26): [True: 4.46k, False: 2.81k]
  ------------------
  484|  4.46k|        if (exp & 01) {
  ------------------
  |  Branch (484:13): [True: 3.46k, False: 1.00k]
  ------------------
  485|  3.46k|            dblExp *= *d;
  486|  3.46k|        }
  487|  4.46k|    }
  488|  2.81k|    if (expSign) {
  ------------------
  |  Branch (488:9): [True: 432, False: 2.38k]
  ------------------
  489|    432|        fraction /= dblExp;
  490|  2.38k|    } else {
  491|  2.38k|        fraction *= dblExp;
  492|  2.38k|    }
  493|       |
  494|  4.07k|done:
  495|  4.07k|    if (sign) {
  ------------------
  |  Branch (495:9): [True: 423, False: 3.65k]
  ------------------
  496|    423|        return -fraction;
  497|    423|    }
  498|  3.65k|    return fraction;
  499|  4.07k|}
mkgmtime:
  845|  2.09k|{
  846|  2.09k|    int year;
  847|  2.09k|    time_t result;
  848|  2.09k|    static const int cumdays[MONTHSPERYEAR] =
  849|  2.09k|        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
  850|       |
  851|       |    // check ranges, ignore tm_isdst and max tm_year
  852|  2.09k|    if (0 > t->tm_sec ||
  ------------------
  |  Branch (852:9): [True: 0, False: 2.09k]
  ------------------
  853|  2.09k|        0 > t->tm_min ||
  ------------------
  |  Branch (853:9): [True: 0, False: 2.09k]
  ------------------
  854|  2.09k|        0 > t->tm_hour ||
  ------------------
  |  Branch (854:9): [True: 0, False: 2.09k]
  ------------------
  855|  2.09k|        1 > t->tm_mday ||
  ------------------
  |  Branch (855:9): [True: 228, False: 1.86k]
  ------------------
  856|  1.86k|        0 > t->tm_mon ||
  ------------------
  |  Branch (856:9): [True: 0, False: 1.86k]
  ------------------
  857|  1.86k|        0 > t->tm_year ||
  ------------------
  |  Branch (857:9): [True: 698, False: 1.16k]
  ------------------
  858|  1.16k|        0 > t->tm_wday ||
  ------------------
  |  Branch (858:9): [True: 0, False: 1.16k]
  ------------------
  859|  1.16k|        0 > t->tm_yday ||
  ------------------
  |  Branch (859:9): [True: 0, False: 1.16k]
  ------------------
  860|  1.16k|        61 < t->tm_sec ||
  ------------------
  |  Branch (860:9): [True: 0, False: 1.16k]
  ------------------
  861|  1.16k|        59 < t->tm_min ||
  ------------------
  |  Branch (861:9): [True: 0, False: 1.16k]
  ------------------
  862|  1.16k|        23 < t->tm_hour ||
  ------------------
  |  Branch (862:9): [True: 0, False: 1.16k]
  ------------------
  863|  1.16k|        31 < t->tm_mday ||
  ------------------
  |  Branch (863:9): [True: 0, False: 1.16k]
  ------------------
  864|  1.16k|        11 < t->tm_mon ||
  ------------------
  |  Branch (864:9): [True: 0, False: 1.16k]
  ------------------
  865|  1.16k|        6 < t->tm_wday ||
  ------------------
  |  Branch (865:9): [True: 0, False: 1.16k]
  ------------------
  866|  1.16k|        365 < t->tm_yday) {
  ------------------
  |  Branch (866:9): [True: 0, False: 1.16k]
  ------------------
  867|    926|        errno = EOVERFLOW;
  868|    926|        return -1;
  869|    926|    }
  870|  2.09k|    errno = 0;
  871|  1.16k|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  501|  1.16k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  872|  1.16k|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  501|  1.16k|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  873|  1.16k|    result += (year - 1968) / 4;
  874|  1.16k|    result -= (year - 1900) / 100;
  875|  1.16k|    result += (year - 1600) / 400;
  876|  1.16k|    if (0 == (year % 4) &&
  ------------------
  |  Branch (876:9): [True: 692, False: 474]
  ------------------
  877|    692|        (0 != (year % 100) ||
  ------------------
  |  Branch (877:10): [True: 290, False: 402]
  ------------------
  878|    402|         0 == (year % 400)) &&
  ------------------
  |  Branch (878:10): [True: 206, False: 196]
  ------------------
  879|    496|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  501|    496|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (879:9): [True: 207, False: 289]
  ------------------
  880|    207|        result--;
  881|    207|    }
  882|  1.16k|    result += t->tm_mday - 1;
  883|  1.16k|    result *= 24;
  884|  1.16k|    result += t->tm_hour;
  885|  1.16k|    result *= 60;
  886|  1.16k|    result += t->tm_min;
  887|  1.16k|    result *= 60;
  888|  1.16k|    result += t->tm_sec;
  889|       |    /* this is UTC, no DST
  890|       |     * if (t->tm_isdst == 1)
  891|       |     * result -= 3600;
  892|       |     */
  893|  1.16k|    return result;
  894|  2.09k|}
iso8601_to_timespec:
  898|  2.09k|{
  899|  2.09k|    timespec_t ret = {0};
  900|       |
  901|       |#ifdef USE_QT
  902|       |  #ifndef __clang_analyzer__
  903|       |    double usec = 0;
  904|       |
  905|       |    QString t(isotime);
  906|       |    QDateTime d = QDateTime::fromString(isotime, Qt::ISODate);
  907|       |    QStringList sl = t.split(".");
  908|       |    if (1 < sl.size()) {
  909|       |        usec = sl[1].toInt() / pow(10., (double)sl[1].size());
  910|       |    }
  911|       |// toSecsSinceEpoch wasn't introduced until 5.8
  912|       |#if QT_VERSION < QT_VERSION_CHECK(5,8,0)
  913|       |    ret.tv_sec = d.toTime_t();
  914|       |#else
  915|       |    ret.tv_sec = d.toSecsSinceEpoch();
  916|       |#endif
  917|       |    ret.tv_nsec = usec * 1e9;
  918|       |  #endif  // __clang_analyzer__
  919|       |#else  // USE_QT
  920|  2.09k|    double usec = 0;
  921|  2.09k|    struct tm tm = {0};
  922|       |
  923|  2.09k|    {
  924|  2.09k|        char *dp = NULL;
  925|  2.09k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  926|  2.09k|        if (NULL != dp &&
  ------------------
  |  Branch (926:13): [True: 692, False: 1.40k]
  ------------------
  927|    692|            '.' == *dp) {
  ------------------
  |  Branch (927:13): [True: 266, False: 426]
  ------------------
  928|    266|            usec = strtod(dp, NULL);
  929|    266|        }
  930|  2.09k|    }
  931|       |
  932|       |    /*
  933|       |     * It would be nice if we could say mktime(&tm) - timezone + usec instead,
  934|       |     * but timezone is not available at all on some BSDs. Besides, when working
  935|       |     * with historical dates the value of timezone after an ordinary tzset(3)
  936|       |     * can be wrong; you have to do a redirect through the IANA historical
  937|       |     * timezone database to get it right.
  938|       |     */
  939|  2.09k|    ret.tv_sec = mkgmtime(&tm);
  940|  2.09k|    ret.tv_nsec = usec * 1e9;
  941|  2.09k|#endif  // USE_QT
  942|       |
  943|  2.09k|#if 4 < SIZEOF_TIME_T
  944|  2.09k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (944:9): [True: 194, False: 1.89k]
  ------------------
  945|       |        // enforce max "9999-12-31T23:59:59.999Z"
  946|    194|        ret.tv_sec = 253402300799LL;
  947|    194|    }
  948|  2.09k|#endif
  949|  2.09k|    return ret;
  950|  2.09k|}

gps_hexpack:
  119|    114|{
  120|    114|    ssize_t i, j;
  121|       |
  122|    114|    j = strnlen(src, BUFSIZ) / 2;
  123|    114|    if ((1 > j) ||
  ------------------
  |  Branch (123:9): [True: 2, False: 112]
  ------------------
  124|    112|        ((size_t)j > len)) {
  ------------------
  |  Branch (124:9): [True: 11, False: 101]
  ------------------
  125|     13|        return -2;
  126|     13|    }
  127|       |
  128|    506|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 466, False: 40]
  ------------------
  129|    466|        int k;
  130|    466|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 61, False: 405]
  ------------------
  131|     61|            return -1;
  132|     61|        }
  133|    405|        dst[i] = (char)(k & 0xff);
  134|    405|    }
  135|     40|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     40|    return j;
  137|    101|}
hex.c:hex2bin:
   82|    466|{
   83|    466|    int a, b;
   84|       |
   85|    466|    a = s[0] & 0xff;
   86|    466|    b = s[1] & 0xff;
   87|       |
   88|    466|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 107, False: 359]
  ------------------
   89|    107|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 101, False: 6]
  ------------------
   90|    101|        a = a + 10 - 'a';
   91|    365|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 151, False: 214]
  ------------------
   92|    151|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 140, False: 11]
  ------------------
   93|    140|        a = a + 10 - 'A';
   94|    225|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 217, False: 8]
  ------------------
   95|    217|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 202, False: 15]
  ------------------
   96|    202|        a -= '0';
   97|    202|    } else {
   98|     23|        return -1;
   99|     23|    }
  100|       |
  101|    443|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 104, False: 339]
  ------------------
  102|    104|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 92, False: 12]
  ------------------
  103|     92|        b = b + 10 - 'a';
  104|    351|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 152, False: 199]
  ------------------
  105|    152|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 129, False: 23]
  ------------------
  106|    129|        b = b + 10 - 'A';
  107|    222|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 211, False: 11]
  ------------------
  108|    211|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 184, False: 27]
  ------------------
  109|    184|        b -= '0';
  110|    184|    } else {
  111|     38|        return -1;
  112|     38|    }
  113|       |
  114|    405|    return ((a << 4) + b);
  115|    443|}

json_read_array:
  802|    906|{
  803|    906|    int substatus;
  804|    906|    unsigned offset, arrcount;
  805|    906|    char *tp;
  806|       |
  807|    906|    if (NULL != end) {
  ------------------
  |  Branch (807:9): [True: 906, False: 0]
  ------------------
  808|    906|        *end = NULL;    // give it a well-defined value on parse failure
  809|    906|    }
  810|       |
  811|    906|    json_debug_trace(1, "json: %s", "Entered json_read_array()\n");
  ------------------
  |  |  108|    906|    do {                                              \
  |  |  109|    906|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    906|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 906]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 906]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    906|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    906|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 906]
  |  |  ------------------
  ------------------
  812|       |
  813|    906|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (813:12): [True: 0, False: 906]
  ------------------
  814|      0|        cp++;
  815|      0|    }
  816|    906|    if (*cp != '[') {
  ------------------
  |  Branch (816:9): [True: 0, False: 906]
  ------------------
  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|    906|    cp++;
  821|       |
  822|    906|    tp = arr->arr.strings.store;
  823|    906|    arrcount = 0;
  824|       |
  825|       |    // Check for empty array
  826|    906|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (826:12): [True: 197, False: 906]
  ------------------
  827|    197|        cp++;
  828|    197|    }
  829|    906|    if (*cp == ']') {
  ------------------
  |  Branch (829:9): [True: 212, False: 694]
  ------------------
  830|    212|        goto breakout;
  831|    212|    }
  832|       |
  833|  8.50k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (833:22): [True: 8.49k, False: 1]
  ------------------
  834|  8.49k|        char *ep = NULL;
  835|       |
  836|  8.49k|        json_debug_trace(1, "json: Looking at %s\n", cp);
  ------------------
  |  |  108|  8.49k|    do {                                              \
  |  |  109|  8.49k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.49k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.49k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.49k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.49k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.49k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.49k]
  |  |  ------------------
  ------------------
  837|  8.49k|        switch (arr->element_type) {
  ------------------
  |  Branch (837:17): [True: 8.49k, False: 0]
  ------------------
  838|  3.10k|        case t_string:
  ------------------
  |  Branch (838:9): [True: 3.10k, False: 5.39k]
  ------------------
  839|  3.10k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (839:17): [True: 194, False: 2.91k]
  ------------------
  840|    194|                cp++;
  841|    194|            }
  842|  3.10k|            if (*cp != '"') {
  ------------------
  |  Branch (842:17): [True: 16, False: 3.08k]
  ------------------
  843|     16|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     16|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  844|  3.08k|            } else {
  845|  3.08k|                ++cp;
  846|  3.08k|            }
  847|  3.08k|            arr->arr.strings.ptrs[offset] = tp;
  848|  14.0k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (848:20): [True: 14.0k, False: 3]
  ------------------
  849|  10.9k|                 tp++)
  850|  14.0k|                if (*cp == '"') {
  ------------------
  |  Branch (850:21): [True: 3.08k, False: 10.9k]
  ------------------
  851|  3.08k|                    ++cp;
  852|  3.08k|                    *tp++ = '\0';
  853|  3.08k|                    goto stringend;
  854|  10.9k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (854:28): [True: 1, False: 10.9k]
  ------------------
  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.9k|                } else {
  859|  10.9k|                    *tp = *cp++;
  860|  10.9k|                }
  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|  3.08k|          stringend:
  865|  3.08k|            break;
  866|      0|        case t_object:
  ------------------
  |  Branch (866:9): [True: 0, False: 8.49k]
  ------------------
  867|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  868|  5.39k|        case t_structobject:
  ------------------
  |  Branch (868:9): [True: 5.39k, False: 3.10k]
  ------------------
  869|  5.39k|            substatus =
  870|  5.39k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  871|  5.39k|                                          offset, &cp);
  872|  5.39k|            if (substatus != 0) {
  ------------------
  |  Branch (872:17): [True: 149, False: 5.24k]
  ------------------
  873|    149|                if (NULL != end) {
  ------------------
  |  Branch (873:21): [True: 149, False: 0]
  ------------------
  874|    149|                    *end = cp;
  875|    149|                }
  876|    149|                return substatus;
  877|    149|            }
  878|  5.24k|            break;
  879|  5.24k|        case t_integer:
  ------------------
  |  Branch (879:9): [True: 0, False: 8.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  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.49k]
  ------------------
  979|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  980|      0|        case t_array:
  ------------------
  |  Branch (980:9): [True: 0, False: 8.49k]
  ------------------
  981|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  982|      0|        case t_check:
  ------------------
  |  Branch (982:9): [True: 0, False: 8.49k]
  ------------------
  983|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  984|      0|        case t_ignore:
  ------------------
  |  Branch (984:9): [True: 0, False: 8.49k]
  ------------------
  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.49k|        }
  988|  8.33k|        arrcount++;
  989|  8.33k|        if (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (989:13): [True: 196, False: 8.13k]
  ------------------
  990|    196|            cp++;
  991|    196|        }
  992|  8.33k|        if (*cp == ']') {
  ------------------
  |  Branch (992:13): [True: 376, False: 7.95k]
  ------------------
  993|    376|            json_debug_trace(1, "json: %s", "End of array found.\n");
  ------------------
  |  |  108|    376|    do {                                              \
  |  |  109|    376|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    376|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 376]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 376]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    376|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    376|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 376]
  |  |  ------------------
  ------------------
  994|    376|            goto breakout;
  995|    376|        }
  996|  7.95k|        if (*cp == ',') {
  ------------------
  |  Branch (996:13): [True: 7.80k, False: 148]
  ------------------
  997|  7.80k|            cp++;
  998|  7.80k|        } else {
  999|    148|            json_debug_trace(1, "json: %s", "Bad trailing syntax on array.\n");
  ------------------
  |  |  108|    148|    do {                                              \
  |  |  109|    148|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    148|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 148]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 148]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    148|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    148|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 148]
  |  |  ------------------
  ------------------
 1000|    148|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    148|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
 1001|    148|        }
 1002|  7.95k|    }
 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|    588|  breakout:
 1009|    588|    if (NULL != arr->count) {
  ------------------
  |  Branch (1009:9): [True: 588, False: 0]
  ------------------
 1010|    588|        *(arr->count) = arrcount;
 1011|    588|    }
 1012|    588|    if (NULL != end) {
  ------------------
  |  Branch (1012:9): [True: 588, False: 0]
  ------------------
 1013|    588|        *end = cp;
 1014|    588|    }
 1015|    588|    json_debug_trace(1, "json: leaving json_read_array() with %d elements\n",
  ------------------
  |  |  108|    588|    do {                                              \
  |  |  109|    588|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    588|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 588]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 588]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    588|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    588|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 588]
  |  |  ------------------
  ------------------
 1016|    588|                      arrcount);
 1017|    588|    return 0;
 1018|    694|}
json_read_object:
 1022|  5.22k|{
 1023|  5.22k|    int st;
 1024|       |
 1025|  5.22k|    json_debug_trace(1, "json: json_read_object() sees '%s'\n", cp);
  ------------------
  |  |  108|  5.22k|    do {                                              \
  |  |  109|  5.22k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  5.22k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 5.22k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 5.22k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  5.22k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  5.22k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 5.22k]
  |  |  ------------------
  ------------------
 1026|       |    st = json_internal_read_object(cp, attrs, NULL, 0, end);
 1027|  5.22k|    return st;
 1028|  5.22k|}
json.c:json_internal_read_object:
  199|  10.6k|{
  200|  10.6k|    enum
  201|  10.6k|    { init, await_attr, in_attr, await_value, in_val_string,
  202|  10.6k|        in_escape, in_val_token, post_val, post_element, in_ignore_array
  203|  10.6k|    } state = 0;
  204|  10.6k|    char *statenames[] = {
  205|  10.6k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  206|  10.6k|        "in_escape", "in_val_token", "post_val", "post_element",
  207|  10.6k|        "in_ignore_array"
  208|  10.6k|    };
  209|  10.6k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  210|  10.6k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  211|  10.6k|    bool value_quoted = false;
  212|  10.6k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  213|  10.6k|    const struct json_attr_t *cursor;
  214|  10.6k|    int substatus, maxlen = 0;
  215|  10.6k|    unsigned int u;
  216|  10.6k|    const struct json_enum_t *mp;
  217|  10.6k|    char *lptr;
  218|       |
  219|  10.6k|    if (NULL != end) {
  ------------------
  |  Branch (219:9): [True: 5.39k, False: 5.22k]
  ------------------
  220|  5.39k|        *end = NULL;    // give it a well-defined value on parse failure
  221|  5.39k|    }
  222|  10.6k|    memset(valbuf, 0, sizeof(valbuf));
  223|       |
  224|       |    // stuff fields with defaults in case they're omitted in the JSON input
  225|   162k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (225:26): [True: 152k, False: 10.6k]
  ------------------
  226|   152k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (226:13): [True: 151k, False: 162]
  ------------------
  227|   151k|            lptr = json_target_address(cursor, parent, offset);
  228|   151k|            if (NULL != lptr)
  ------------------
  |  Branch (228:17): [True: 141k, False: 10.5k]
  ------------------
  229|   141k|                switch (cursor->type) {
  ------------------
  |  Branch (229:25): [True: 141k, False: 0]
  ------------------
  230|  3.66k|                case t_byte:
  ------------------
  |  Branch (230:17): [True: 3.66k, False: 137k]
  ------------------
  231|  3.66k|                    lptr[0] = cursor->dflt.byte;
  232|  3.66k|                    break;
  233|  21.5k|                case t_ubyte:
  ------------------
  |  Branch (233:17): [True: 21.5k, False: 119k]
  ------------------
  234|  21.5k|                    lptr[0] = cursor->dflt.ubyte;
  235|  21.5k|                    break;
  236|  17.8k|                case t_integer:
  ------------------
  |  Branch (236:17): [True: 17.8k, False: 123k]
  ------------------
  237|  17.8k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  238|  17.8k|                    break;
  239|  7.44k|                case t_uinteger:
  ------------------
  |  Branch (239:17): [True: 7.44k, False: 133k]
  ------------------
  240|  7.44k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  241|  7.44k|                    break;
  242|    940|                case t_longint:
  ------------------
  |  Branch (242:17): [True: 940, False: 140k]
  ------------------
  243|    940|                    memcpy(lptr, &cursor->dflt.longint, sizeof(long));
  244|    940|                    break;
  245|    138|                case t_ulongint:
  ------------------
  |  Branch (245:17): [True: 138, False: 141k]
  ------------------
  246|    138|                    memcpy(lptr, &cursor->dflt.ulongint,
  247|    138|                           sizeof(unsigned long));
  248|    138|                    break;
  249|  3.66k|                case t_short:
  ------------------
  |  Branch (249:17): [True: 3.66k, False: 137k]
  ------------------
  250|  3.66k|                    memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
  251|  3.66k|                    break;
  252|      0|                case t_ushort:
  ------------------
  |  Branch (252:17): [True: 0, False: 141k]
  ------------------
  253|      0|                    memcpy(lptr, &cursor->dflt.ushortint,
  254|      0|                           sizeof(unsigned short));
  255|      0|                    break;
  256|  1.68k|                case t_time:
  ------------------
  |  Branch (256:17): [True: 1.68k, False: 139k]
  ------------------
  257|  1.68k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  258|  1.68k|                    break;
  259|  1.12k|                case t_timespec:
  ------------------
  |  Branch (259:17): [True: 1.12k, False: 140k]
  ------------------
  260|  1.12k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  261|  1.12k|                    break;
  262|  60.3k|                case t_real:
  ------------------
  |  Branch (262:17): [True: 60.3k, False: 80.9k]
  ------------------
  263|  60.3k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  264|  60.3k|                    break;
  265|  11.0k|                case t_string:
  ------------------
  |  Branch (265:17): [True: 11.0k, False: 130k]
  ------------------
  266|  11.0k|                    if (parent != NULL
  ------------------
  |  Branch (266:25): [True: 4.52k, False: 6.47k]
  ------------------
  267|  4.52k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (267:28): [True: 0, False: 4.52k]
  ------------------
  268|      0|                        && offset > 0)
  ------------------
  |  Branch (268:28): [True: 0, False: 0]
  ------------------
  269|      0|                        return JSON_ERR_NOPARSTR;
  ------------------
  |  |  168|      0|#define JSON_ERR_NOPARSTR      17      // no strings in parallel arrays
  ------------------
  270|  11.0k|                    lptr[0] = '\0';
  271|  11.0k|                    break;
  272|  4.80k|                case t_boolean:
  ------------------
  |  Branch (272:17): [True: 4.80k, False: 136k]
  ------------------
  273|  4.80k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  274|  4.80k|                    break;
  275|  1.13k|                case t_character:
  ------------------
  |  Branch (275:17): [True: 1.13k, False: 140k]
  ------------------
  276|  1.13k|                    lptr[0] = cursor->dflt.character;
  277|  1.13k|                    break;
  278|      0|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (278:17): [True: 0, False: 141k]
  ------------------
  279|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  280|      0|                case t_structobject:
  ------------------
  |  Branch (280:17): [True: 0, False: 141k]
  ------------------
  281|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  282|      0|                case t_array:
  ------------------
  |  Branch (282:17): [True: 0, False: 141k]
  ------------------
  283|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  284|    564|                case t_check:
  ------------------
  |  Branch (284:17): [True: 564, False: 140k]
  ------------------
  285|    564|                    FALLTHROUGH
  ------------------
  |  |   55|    564|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  286|  5.94k|                case t_ignore:
  ------------------
  |  Branch (286:17): [True: 5.37k, False: 135k]
  ------------------
  287|  5.94k|                    break;
  288|   141k|                }
  289|   151k|        }
  290|       |
  291|  10.6k|    json_debug_trace(1, "json: JSON parse of '%s' begins.\n", cp);
  ------------------
  |  |  108|  10.6k|    do {                                              \
  |  |  109|  10.6k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  10.6k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 10.6k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 10.6k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  10.6k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  10.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
  292|       |
  293|       |    // parse input JSON
  294|   598k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (294:12): [True: 595k, False: 3.12k]
  ------------------
  295|   595k|        json_debug_trace(2, "json: State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  108|   595k|    do {                                              \
  |  |  109|   595k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   595k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 595k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 595k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   595k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   595k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 595k]
  |  |  ------------------
  ------------------
  296|   595k|                          statenames[state], *cp, cp);
  297|   595k|        switch (state) {
  ------------------
  |  Branch (297:17): [True: 595k, False: 0]
  ------------------
  298|  11.1k|        case init:
  ------------------
  |  Branch (298:9): [True: 11.1k, False: 584k]
  ------------------
  299|  11.1k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (299:17): [True: 595, False: 10.5k]
  ------------------
  300|    595|                continue;
  301|    595|            }
  302|  10.5k|            if (*cp == '{') {
  ------------------
  |  Branch (302:17): [True: 10.5k, False: 43]
  ------------------
  303|  10.5k|                state = await_attr;
  304|  10.5k|            } else {
  305|     43|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  306|     43|                                  "Non-WS when expecting object start.\n");
  307|     43|                if (NULL != end) {
  ------------------
  |  Branch (307:21): [True: 43, False: 0]
  ------------------
  308|     43|                    *end = cp;
  309|     43|                }
  310|     43|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     43|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  311|     43|            }
  312|  10.5k|            break;
  313|  42.1k|        case await_attr:
  ------------------
  |  Branch (313:9): [True: 42.1k, False: 553k]
  ------------------
  314|  42.1k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (314:17): [True: 228, False: 41.8k]
  ------------------
  315|    228|                continue;
  316|    228|            }
  317|  41.8k|            if (*cp == '"') {
  ------------------
  |  Branch (317:17): [True: 41.5k, False: 296]
  ------------------
  318|  41.5k|                state = in_attr;
  319|  41.5k|                pattr = attrbuf;
  320|  41.5k|                if (NULL != end) {
  ------------------
  |  Branch (320:21): [True: 6.81k, False: 34.7k]
  ------------------
  321|  6.81k|                    *end = cp;
  322|  6.81k|                }
  323|  41.5k|            } else if (*cp == '}') {
  ------------------
  |  Branch (323:24): [True: 200, False: 96]
  ------------------
  324|    200|                break;
  325|    200|            } else {
  326|     96|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     96|    do {                                              \
  |  |  109|     96|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     96|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 96]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 96]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     96|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     96|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 96]
  |  |  ------------------
  ------------------
  327|     96|                          "Non-WS when expecting attribute.\n");
  328|     96|                if (NULL != end) {
  ------------------
  |  Branch (328:21): [True: 2, False: 94]
  ------------------
  329|      2|                    *end = cp;
  330|      2|                }
  331|     96|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|     96|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  332|     96|            }
  333|  41.5k|            break;
  334|   182k|        case in_attr:
  ------------------
  |  Branch (334:9): [True: 182k, False: 412k]
  ------------------
  335|   182k|            if (NULL == pattr) {
  ------------------
  |  Branch (335:17): [True: 0, False: 182k]
  ------------------
  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|   182k|            if (*cp == '"') {
  ------------------
  |  Branch (339:17): [True: 41.5k, False: 141k]
  ------------------
  340|  41.5k|                *pattr++ = '\0';
  341|  41.5k|                json_debug_trace(1, "json: Collected attribute name %s\n",
  ------------------
  |  |  108|  41.5k|    do {                                              \
  |  |  109|  41.5k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  41.5k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 41.5k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 41.5k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  41.5k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  41.5k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 41.5k]
  |  |  ------------------
  ------------------
  342|  41.5k|                                  attrbuf);
  343|   482k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (343:38): [True: 482k, False: 96]
  ------------------
  344|   482k|                    json_debug_trace(2, "json: Checking against %s\n",
  ------------------
  |  |  108|   482k|    do {                                              \
  |  |  109|   482k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   482k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 482k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 482k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   482k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   482k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 482k]
  |  |  ------------------
  ------------------
  345|   482k|                                      cursor->attribute);
  346|   482k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (346:25): [True: 27.4k, False: 454k]
  ------------------
  347|  27.4k|                        break;
  348|  27.4k|                    }
  349|   454k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (349:25): [True: 14.2k, False: 440k]
  ------------------
  350|  14.2k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (350:25): [True: 14.0k, False: 236]
  ------------------
  351|  14.0k|                        break;
  352|  14.0k|                    }
  353|   454k|                }
  354|  41.5k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (354:21): [True: 96, False: 41.4k]
  ------------------
  355|     96|                    json_debug_trace(1,
  ------------------
  |  |  108|     96|    do {                                              \
  |  |  109|     96|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     96|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 96]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 96]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     96|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     96|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 96]
  |  |  ------------------
  ------------------
  356|     96|                                      "json: Unknown attribute name '%s'"
  357|     96|                                      " (attributes begin with '%s').\n",
  358|     96|                                      attrbuf, attrs->attribute);
  359|       |                    // don't update end here, leave at attribute start
  360|     96|                    return JSON_ERR_BADATTR;
  ------------------
  |  |  154|     96|#define JSON_ERR_BADATTR        3      // unknown attribute name
  ------------------
  361|     96|                }
  362|  41.4k|                state = await_value;
  363|  41.4k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (363:21): [True: 1.09k, False: 40.3k]
  ------------------
  364|  1.09k|                    maxlen = (int)cursor->len - 1;
  365|  40.3k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (365:28): [True: 2.13k, False: 38.1k]
  ------------------
  366|  2.13k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  2.13k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  367|  38.1k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (367:28): [True: 2.94k, False: 35.2k]
  ------------------
  368|  35.2k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (368:28): [True: 19.5k, False: 15.6k]
  ------------------
  369|  22.4k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  22.4k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  370|  22.4k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (370:28): [True: 447, False: 15.2k]
  ------------------
  371|    447|                    maxlen = (int)sizeof(valbuf) - 1;
  372|    447|                }
  373|  41.4k|                pval = valbuf;
  374|   141k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   141k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (374:24): [True: 22, False: 141k]
  ------------------
  375|     22|                json_debug_trace(1, "json: %s","Attribute name too long.\n");
  ------------------
  |  |  108|     22|    do {                                              \
  |  |  109|     22|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     22|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 22]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 22]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     22|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     22|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 22]
  |  |  ------------------
  ------------------
  376|       |                // don't update end here, leave at attribute start
  377|     22|                return JSON_ERR_ATTRLEN;
  ------------------
  |  |  155|     22|#define JSON_ERR_ATTRLEN        4      // attribute name too long
  ------------------
  378|   141k|            } else {
  379|   141k|                *pattr++ = *cp;
  380|   141k|            }
  381|   182k|            break;
  382|   182k|        case await_value:
  ------------------
  |  Branch (382:9): [True: 43.9k, False: 551k]
  ------------------
  383|  43.9k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (383:17): [True: 197, False: 43.7k]
  ------------------
  384|  43.7k|                *cp == ':') {
  ------------------
  |  Branch (384:17): [True: 2.40k, False: 41.3k]
  ------------------
  385|  2.59k|                continue;
  386|  2.59k|            }
  387|  41.3k|            if (*cp == '[') {
  ------------------
  |  Branch (387:17): [True: 2.58k, False: 38.7k]
  ------------------
  388|  2.58k|                if (cursor->type == t_ignore) {
  ------------------
  |  Branch (388:21): [True: 1.64k, False: 936]
  ------------------
  389|       |                    /* skip to terminating ], not being fooled by
  390|       |                     * sub arrays, etc.
  391|       |                     * FIXME:  someday  */
  392|  1.64k|                    state = in_ignore_array;;
  393|  1.64k|                    value_quoted = false;
  394|  1.64k|                    break;
  395|  1.64k|                }
  396|    936|                if (cursor->type != t_array) {
  ------------------
  |  Branch (396:21): [True: 30, False: 906]
  ------------------
  397|     30|                    json_debug_trace(1,"json: %s",
  ------------------
  |  |  108|     30|    do {                                              \
  |  |  109|     30|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     30|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 30]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 30]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     30|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     30|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 30]
  |  |  ------------------
  ------------------
  398|     30|                                      "Saw [ when not expecting array.\n");
  399|     30|                    if (NULL != end) {
  ------------------
  |  Branch (399:25): [True: 2, False: 28]
  ------------------
  400|      2|                        *end = cp;
  401|      2|                    }
  402|     30|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|     30|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  403|     30|                }
  404|    906|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  405|    906|                if (substatus != 0) {
  ------------------
  |  Branch (405:21): [True: 318, False: 588]
  ------------------
  406|    318|                    return substatus;
  407|    318|                }
  408|    588|                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.53k, False: 29.1k]
  ------------------
  417|  9.53k|                value_quoted = true;
  418|  9.53k|                state = in_val_string;
  419|  9.53k|                pval = valbuf;
  420|  29.1k|            } else {
  421|  29.1k|                value_quoted = false;
  422|  29.1k|                state = in_val_token;
  423|  29.1k|                pval = valbuf;
  424|  29.1k|                *pval++ = *cp;
  425|  29.1k|            }
  426|  39.3k|            break;
  427|  90.9k|        case in_ignore_array:
  ------------------
  |  Branch (427:9): [True: 90.9k, False: 504k]
  ------------------
  428|  90.9k|            if (*cp == '"') {
  ------------------
  |  Branch (428:17): [True: 22.2k, False: 68.6k]
  ------------------
  429|  22.2k|                if (value_quoted == false) {
  ------------------
  |  Branch (429:21): [True: 11.1k, False: 11.0k]
  ------------------
  430|       |                    // now in quotes
  431|  11.1k|                    value_quoted = true;
  432|  11.1k|                } else {
  433|  11.0k|                    value_quoted = false;
  434|  11.0k|                }
  435|  68.6k|            } else if (*cp == ']') {
  ------------------
  |  Branch (435:24): [True: 1.47k, False: 67.2k]
  ------------------
  436|       |                // FIXME: does not handle sub arrays, etc.
  437|  1.47k|                if (value_quoted == false) {
  ------------------
  |  Branch (437:21): [True: 1.26k, False: 209]
  ------------------
  438|  1.26k|                    state = post_val;
  439|  1.26k|                }
  440|       |                // else in quotes, ignore it.
  441|  1.47k|            }
  442|  90.9k|            break;
  443|  70.9k|        case in_val_string:
  ------------------
  |  Branch (443:9): [True: 70.9k, False: 524k]
  ------------------
  444|  70.9k|            if (NULL == pval) {
  ------------------
  |  Branch (444:17): [True: 0, False: 70.9k]
  ------------------
  445|       |                // don't update end here, leave at value start
  446|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  447|      0|            }
  448|  70.9k|            if (*cp == '\\') {
  ------------------
  |  Branch (448:17): [True: 1.70k, False: 69.2k]
  ------------------
  449|  1.70k|                state = in_escape;
  450|  69.2k|            } else if (*cp == '"') {
  ------------------
  |  Branch (450:24): [True: 9.08k, False: 60.1k]
  ------------------
  451|  9.08k|                *pval++ = '\0';
  452|  9.08k|                json_debug_trace(1, "json: Collected string value %s\n", valbuf);
  ------------------
  |  |  108|  9.08k|    do {                                              \
  |  |  109|  9.08k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  9.08k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9.08k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9.08k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  9.08k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  9.08k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9.08k]
  |  |  ------------------
  ------------------
  453|  9.08k|                state = post_val;
  454|  60.1k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  60.1k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (454:24): [True: 3, False: 60.1k]
  ------------------
  455|  60.1k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (455:24): [True: 123, False: 60.0k]
  ------------------
  456|    126|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|    126|    do {                                              \
  |  |  109|    126|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    126|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 126]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 126]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    126|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    126|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 126]
  |  |  ------------------
  ------------------
  457|       |                // don't update end here, leave at value start
  458|    126|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|    126|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  459|  60.0k|            } else {
  460|  60.0k|                *pval++ = *cp;
  461|  60.0k|            }
  462|  70.8k|            break;
  463|  70.8k|        case in_escape:
  ------------------
  |  Branch (463:9): [True: 1.69k, False: 593k]
  ------------------
  464|  1.69k|            if (NULL == pval) {
  ------------------
  |  Branch (464:17): [True: 0, False: 1.69k]
  ------------------
  465|       |                /* don't update end here, leave at value start */
  466|      0|                return JSON_ERR_NULLPTR;
  ------------------
  |  |  174|      0|#define JSON_ERR_NULLPTR       23      // unexpected null value or attribute
  ------------------
  467|      0|            }
  468|  1.69k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  1.69k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (468:17): [True: 3, False: 1.69k]
  ------------------
  469|  1.69k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (469:17): [True: 7, False: 1.68k]
  ------------------
  470|     10|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|     10|    do {                                              \
  |  |  109|     10|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     10|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 10]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 10]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     10|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     10|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 10]
  |  |  ------------------
  ------------------
  471|       |                // don't update end here, leave at value start
  472|     10|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|     10|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  473|     10|            }
  474|  1.68k|            switch (*cp) {
  475|    201|            case 'b':
  ------------------
  |  Branch (475:13): [True: 201, False: 1.48k]
  ------------------
  476|    201|                *pval++ = '\b';
  477|    201|                break;
  478|    198|            case 'f':
  ------------------
  |  Branch (478:13): [True: 198, False: 1.49k]
  ------------------
  479|    198|                *pval++ = '\f';
  480|    198|                break;
  481|    197|            case 'n':
  ------------------
  |  Branch (481:13): [True: 197, False: 1.49k]
  ------------------
  482|    197|                *pval++ = '\n';
  483|    197|                break;
  484|    195|            case 'r':
  ------------------
  |  Branch (484:13): [True: 195, False: 1.49k]
  ------------------
  485|    195|                *pval++ = '\r';
  486|    195|                break;
  487|    373|            case 't':
  ------------------
  |  Branch (487:13): [True: 373, False: 1.31k]
  ------------------
  488|    373|                *pval++ = '\t';
  489|    373|                break;
  490|    283|            case 'u':
  ------------------
  |  Branch (490:13): [True: 283, False: 1.40k]
  ------------------
  491|    283|                {
  492|    283|                    unsigned n;
  493|       |
  494|    283|                    cp++;                   // skip the 'u'
  495|       |                    // NetBSD 6 wants the cast
  496|  1.11k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (496:33): [True: 925, False: 194]
  |  Branch (496:42): [True: 836, False: 89]
  ------------------
  497|    836|                        uescape[n] = *cp++;
  498|    836|                    }
  499|    283|                    uescape[n] = '\0';      // terminate
  500|    283|                    --cp;
  501|       |                    // ECMA-404 says JSON \u must have 4 hex digits
  502|    283|                    if ((4 != n) ||
  ------------------
  |  Branch (502:25): [True: 89, False: 194]
  ------------------
  503|    194|                        (1 != sscanf(uescape, "%4x", &u))) {
  ------------------
  |  Branch (503:25): [True: 0, False: 194]
  ------------------
  504|     89|                        return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     89|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  505|     89|                    }
  506|       |                    // truncate values above 0xff
  507|    194|                    *pval++ = (unsigned char)u;
  508|    194|                }
  509|      0|                break;
  510|    241|            default:            // handles double quote and solidus
  ------------------
  |  Branch (510:13): [True: 241, False: 1.44k]
  ------------------
  511|    241|                *pval++ = *cp;
  512|    241|                break;
  513|  1.68k|            }
  514|  1.59k|            state = in_val_string;
  515|  1.59k|            break;
  516|   112k|        case in_val_token:
  ------------------
  |  Branch (516:9): [True: 112k, False: 482k]
  ------------------
  517|   112k|            if (NULL == pval) {
  ------------------
  |  Branch (517:17): [True: 0, False: 112k]
  ------------------
  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|   112k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (521:17): [True: 340, False: 112k]
  ------------------
  522|   112k|                *cp == ',' ||
  ------------------
  |  Branch (522:17): [True: 23.2k, False: 89.2k]
  ------------------
  523|  89.2k|                *cp == '}') {
  ------------------
  |  Branch (523:17): [True: 5.38k, False: 83.8k]
  ------------------
  524|  28.9k|                *pval = '\0';
  525|  28.9k|                json_debug_trace(1, "json: Collected token valuen %s\n",
  ------------------
  |  |  108|  28.9k|    do {                                              \
  |  |  109|  28.9k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  28.9k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 28.9k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 28.9k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  28.9k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  28.9k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 28.9k]
  |  |  ------------------
  ------------------
  526|  28.9k|                                 valbuf);
  527|  28.9k|                state = post_val;
  528|  28.9k|                if (*cp == '}' ||
  ------------------
  |  Branch (528:21): [True: 5.38k, False: 23.5k]
  ------------------
  529|  28.6k|                    *cp == ',') {
  ------------------
  |  Branch (529:21): [True: 23.2k, False: 340]
  ------------------
  530|  28.6k|                    --cp;
  531|  28.6k|                }
  532|  83.8k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|  83.8k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (532:24): [True: 6, False: 83.8k]
  ------------------
  533|      6|                json_debug_trace(1, "json: %s", "Token value too long.\n");
  ------------------
  |  |  108|      6|    do {                                              \
  |  |  109|      6|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      6|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 6]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 6]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      6|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      6|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 6]
  |  |  ------------------
  ------------------
  534|       |                // don't update end here, leave at value start
  535|      6|                return JSON_ERR_TOKLONG;
  ------------------
  |  |  159|      6|#define JSON_ERR_TOKLONG        8      // token value too long
  ------------------
  536|  83.8k|            } else {
  537|  83.8k|                *pval++ = *cp;
  538|  83.8k|            }
  539|   112k|            break;
  540|       |            // coverity[unterminated_case]
  541|   112k|        case post_val:
  ------------------
  |  Branch (541:9): [True: 38.1k, False: 557k]
  ------------------
  542|       |            // Ignore whitespace after either string or token values.
  543|  38.1k|	  if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (543:8): [True: 244, False: 37.9k]
  ------------------
  544|  1.04k|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (544:24): [True: 1.02k, False: 19]
  |  Branch (544:39): [True: 803, False: 225]
  ------------------
  545|    803|                    ++cp;
  546|    803|                }
  547|    244|                json_debug_trace(1,
  ------------------
  |  |  108|    244|    do {                                              \
  |  |  109|    244|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    244|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 244]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 244]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    244|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    244|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 244]
  |  |  ------------------
  ------------------
  548|    244|                    "json: Skipped trailing whitespace: value \"%s\"\n", valbuf);
  549|    244|            }
  550|       |            /*
  551|       |             * We know that cursor points at the first spec matching
  552|       |             * the current attribute.  We don't know that it's *the*
  553|       |             * correct spec; our dialect allows there to be any number
  554|       |             * of adjacent ones with the same attrname but different
  555|       |             * types.  Here's where we try to seek forward for a
  556|       |             * matching type/attr pair if we're not looking at one.
  557|       |             */
  558|  38.1k|            for (;;) {
  559|  38.1k|                int seeking = cursor->type;
  560|       |
  561|  38.1k|                if (value_quoted &&
  ------------------
  |  Branch (561:21): [True: 8.01k, False: 30.1k]
  ------------------
  562|  8.01k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (562:22): [True: 1.05k, False: 6.95k]
  ------------------
  563|  6.95k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (563:22): [True: 2.09k, False: 4.86k]
  ------------------
  564|  3.14k|                    break;
  565|  3.14k|                }
  566|  35.0k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (566:22): [True: 2.20k, False: 32.8k]
  ------------------
  567|  32.8k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (567:22): [True: 195, False: 32.6k]
  ------------------
  568|  2.39k|                    seeking == t_boolean) {
  ------------------
  |  Branch (568:21): [True: 1.90k, False: 494]
  ------------------
  569|  1.90k|                    break;
  570|  1.90k|                }
  571|  33.1k|                if (isdigit((unsigned char) valbuf[0])) {
  ------------------
  |  Branch (571:21): [True: 17.7k, False: 15.3k]
  ------------------
  572|  17.7k|                    bool decimal = strchr(valbuf, '.') != NULL;
  573|       |
  574|  17.7k|                    if (decimal &&
  ------------------
  |  Branch (574:25): [True: 964, False: 16.7k]
  ------------------
  575|    964|                        seeking == t_real) {
  ------------------
  |  Branch (575:25): [True: 211, False: 753]
  ------------------
  576|    211|                        break;
  577|    211|                    }
  578|  17.5k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (578:25): [True: 16.7k, False: 753]
  |  Branch (578:38): [True: 237, False: 16.5k]
  ------------------
  579|  16.5k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (579:38): [True: 619, False: 15.9k]
  ------------------
  580|  15.9k|                                     seeking == t_integer ||
  ------------------
  |  Branch (580:38): [True: 1.16k, False: 14.7k]
  ------------------
  581|  14.7k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (581:38): [True: 757, False: 14.0k]
  ------------------
  582|  14.0k|                                     seeking == t_longint ||
  ------------------
  |  Branch (582:38): [True: 820, False: 13.1k]
  ------------------
  583|  13.1k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (583:38): [True: 244, False: 12.9k]
  ------------------
  584|  12.9k|                                     seeking == t_time ||
  ------------------
  |  Branch (584:38): [True: 218, False: 12.7k]
  ------------------
  585|  12.7k|                                     seeking == t_short ||
  ------------------
  |  Branch (585:38): [True: 1.83k, False: 10.8k]
  ------------------
  586|  10.8k|                                     seeking == t_ushort))
  ------------------
  |  Branch (586:38): [True: 0, False: 10.8k]
  ------------------
  587|  5.89k|                        break;
  588|  17.5k|                }
  589|  27.0k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (589:21): [True: 18.8k, False: 8.22k]
  ------------------
  590|  18.8k|                    break;
  591|  18.8k|                }
  592|  8.22k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (592:21): [True: 8.22k, False: 0]
  ------------------
  593|  8.22k|                    break;
  594|  8.22k|                }
  595|      0|                ++cursor;
  596|      0|            }
  597|  38.1k|            if (value_quoted &&
  ------------------
  |  Branch (597:17): [True: 8.01k, False: 30.1k]
  ------------------
  598|  8.01k|                (cursor->type != t_string &&
  ------------------
  |  Branch (598:18): [True: 6.95k, False: 1.05k]
  ------------------
  599|  6.95k|                 cursor->type != t_character &&
  ------------------
  |  Branch (599:18): [True: 6.75k, False: 200]
  ------------------
  600|  6.75k|                 cursor->type != t_check &&
  ------------------
  |  Branch (600:18): [True: 6.02k, False: 737]
  ------------------
  601|  6.02k|                 cursor->type != t_time &&
  ------------------
  |  Branch (601:18): [True: 3.92k, False: 2.09k]
  ------------------
  602|  3.92k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (602:18): [True: 463, False: 3.46k]
  ------------------
  603|    463|                 cursor->map == 0)) {
  ------------------
  |  Branch (603:18): [True: 24, False: 439]
  ------------------
  604|     24|                json_debug_trace(1, "json: %s", "Saw quoted value when expecting"
  ------------------
  |  |  108|     24|    do {                                              \
  |  |  109|     24|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     24|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 24]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 24]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     24|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     24|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 24]
  |  |  ------------------
  ------------------
  605|     24|                                  " non-string.\n");
  606|     24|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     24|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  607|     24|            }
  608|  38.1k|            if (!value_quoted &&
  ------------------
  |  Branch (608:17): [True: 30.1k, False: 7.98k]
  ------------------
  609|  30.1k|                (cursor->type == t_string ||
  ------------------
  |  Branch (609:18): [True: 21, False: 30.1k]
  ------------------
  610|  30.1k|                 cursor->type == t_check ||
  ------------------
  |  Branch (610:18): [True: 30, False: 30.1k]
  ------------------
  611|  30.1k|                 cursor->map != 0)) {
  ------------------
  |  Branch (611:18): [True: 7, False: 30.1k]
  ------------------
  612|     58|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     58|    do {                                              \
  |  |  109|     58|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     58|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 58]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 58]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     58|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     58|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 58]
  |  |  ------------------
  ------------------
  613|     58|                                 "Didn't see quoted value when expecting"
  614|     58|                                 " string.\n");
  615|     58|                return JSON_ERR_NONQSTRING;
  ------------------
  |  |  171|     58|#define JSON_ERR_NONQSTRING    20      // no quoted value when expecting string
  ------------------
  616|     58|            }
  617|  38.1k|            if (cursor->map != 0) {
  ------------------
  |  Branch (617:17): [True: 439, False: 37.6k]
  ------------------
  618|    882|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (618:40): [True: 817, False: 65]
  ------------------
  619|    817|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (619:25): [True: 374, False: 443]
  ------------------
  620|    374|                        goto foundit;
  621|    374|                    }
  622|     65|                json_debug_trace(1,
  ------------------
  |  |  108|     65|    do {                                              \
  |  |  109|     65|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     65|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 65]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 65]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     65|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     65|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 65]
  |  |  ------------------
  ------------------
  623|     65|                                 "json: Invalid enumerated value string %s.\n",
  624|     65|                                  valbuf);
  625|     65|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     65|#define JSON_ERR_BADENUM       18      // invalid enumerated value
  ------------------
  626|    374|              foundit:
  627|    374|                (void)snprintf(valbuf, sizeof(valbuf), "%d", mp->value);
  628|    374|            }
  629|  38.0k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (629:17): [True: 737, False: 37.3k]
  ------------------
  630|    737|                lptr = cursor->dflt.check;
  631|  37.3k|            } else {
  632|  37.3k|                lptr = json_target_address(cursor, parent, offset);
  633|  37.3k|            }
  634|  38.0k|            if (NULL != lptr) {
  ------------------
  |  Branch (634:17): [True: 21.4k, False: 16.5k]
  ------------------
  635|  21.4k|                switch (cursor->type) {
  ------------------
  |  Branch (635:25): [True: 21.4k, False: 0]
  ------------------
  636|    259|                case t_byte:
  ------------------
  |  Branch (636:17): [True: 259, False: 21.1k]
  ------------------
  637|    259|                    {
  638|    259|                        int tmp = atoi(valbuf);
  639|    259|                        lptr[0] = (char)tmp;
  640|    259|                    }
  641|    259|                    break;
  642|    706|                case t_ubyte:
  ------------------
  |  Branch (642:17): [True: 706, False: 20.7k]
  ------------------
  643|    706|                    {
  644|    706|                        int tmp = atoi(valbuf);
  645|    706|                        lptr[0] = (unsigned char)tmp;
  646|    706|                    }
  647|    706|                    break;
  648|  1.72k|                case t_integer:
  ------------------
  |  Branch (648:17): [True: 1.72k, False: 19.7k]
  ------------------
  649|  1.72k|                    {
  650|  1.72k|                        int tmp = atoi(valbuf);
  651|  1.72k|                        memcpy(lptr, &tmp, sizeof(int));
  652|  1.72k|                    }
  653|  1.72k|                    break;
  654|  1.05k|                case t_uinteger:
  ------------------
  |  Branch (654:17): [True: 1.05k, False: 20.3k]
  ------------------
  655|  1.05k|                    {
  656|  1.05k|                        unsigned int tmp = (unsigned int)atol(valbuf);
  657|  1.05k|                        memcpy(lptr, &tmp, sizeof(unsigned int));
  658|  1.05k|                    }
  659|  1.05k|                    break;
  660|    882|                case t_longint:
  ------------------
  |  Branch (660:17): [True: 882, False: 20.5k]
  ------------------
  661|    882|                    {
  662|    882|                        long tmp = atol(valbuf);
  663|    882|                        memcpy(lptr, &tmp, sizeof(long));
  664|    882|                    }
  665|    882|                    break;
  666|    281|                case t_ulongint:
  ------------------
  |  Branch (666:17): [True: 281, False: 21.1k]
  ------------------
  667|    281|                    {
  668|    281|                        unsigned long tmp = (unsigned long)atoll(valbuf);
  669|    281|                        memcpy(lptr, &tmp, sizeof(unsigned long));
  670|    281|                    }
  671|    281|                    break;
  672|  1.87k|                case t_short:
  ------------------
  |  Branch (672:17): [True: 1.87k, False: 19.5k]
  ------------------
  673|  1.87k|                    {
  674|  1.87k|                        short tmp = atoi(valbuf);
  675|  1.87k|                        memcpy(lptr, &tmp, sizeof(short));
  676|  1.87k|                    }
  677|  1.87k|                    break;
  678|      0|                case t_ushort:
  ------------------
  |  Branch (678:17): [True: 0, False: 21.4k]
  ------------------
  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.93k|                case t_time:
  ------------------
  |  Branch (684:17): [True: 2.93k, False: 18.5k]
  ------------------
  685|  2.93k|                    {
  686|  2.93k|                        timespec_t ts_tmp = {0, 0};
  687|       |
  688|  2.93k|                        if (value_quoted) {
  ------------------
  |  Branch (688:29): [True: 2.09k, False: 842]
  ------------------
  689|  2.09k|                            ts_tmp = iso8601_to_timespec(valbuf);
  690|  2.09k|                        } else if (NULL == strchr(valbuf, '.')) {
  ------------------
  |  Branch (690:36): [True: 314, False: 528]
  ------------------
  691|       |                            // integer
  692|    314|                            ts_tmp.tv_sec = (time_t)atoll(valbuf);
  693|    528|                        } else {
  694|       |                            // real
  695|    528|                            double sec_tmp = safe_atof(valbuf);
  696|    528|                            if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (696:33): [True: 329, False: 199]
  ------------------
  697|    329|                                DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    329|    do { \
  |  |  145|    329|        double int_part; \
  |  |  146|    329|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    329|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    329|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 329]
  |  |  ------------------
  ------------------
  698|    329|                            }  // else, leave at default
  699|    528|                        }
  700|  2.93k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  701|  2.93k|                    }
  702|  2.93k|                    break;
  703|    389|                case t_timespec:
  ------------------
  |  Branch (703:17): [True: 389, False: 21.0k]
  ------------------
  704|    389|                    {
  705|    389|                        double sec_tmp = safe_atof(valbuf);
  706|    389|                        timespec_t ts_tmp;
  707|    389|                        if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (707:29): [True: 194, False: 195]
  ------------------
  708|    194|                            DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    194|    do { \
  |  |  145|    194|        double int_part; \
  |  |  146|    194|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    194|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    194|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 194]
  |  |  ------------------
  ------------------
  709|    194|                            memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  710|    194|                        } // else leave at .dflt
  711|    389|                    }
  712|    389|                    break;
  713|  4.59k|                case t_real:
  ------------------
  |  Branch (713:17): [True: 4.59k, False: 16.8k]
  ------------------
  714|  4.59k|                    {
  715|  4.59k|                        double tmp = safe_atof(valbuf);
  716|  4.59k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (716:29): [True: 3.70k, False: 896]
  ------------------
  717|  3.70k|                            memcpy(lptr, &tmp, sizeof(double));
  718|  3.70k|                        } // else leave at .dflt
  719|  4.59k|                    }
  720|  4.59k|                    break;
  721|  1.05k|                case t_string:
  ------------------
  |  Branch (721:17): [True: 1.05k, False: 20.3k]
  ------------------
  722|  1.05k|                    if (NULL != parent &&
  ------------------
  |  Branch (722:25): [True: 388, False: 668]
  ------------------
  723|    388|                        parent->element_type != t_structobject &&
  ------------------
  |  Branch (723:25): [True: 0, False: 388]
  ------------------
  724|      0|                        offset > 0) {
  ------------------
  |  Branch (724:25): [True: 0, False: 0]
  ------------------
  725|      0|                        return JSON_ERR_NOPARSTR;
  ------------------
  |  |  168|      0|#define JSON_ERR_NOPARSTR      17      // no strings in parallel arrays
  ------------------
  726|      0|                    }
  727|  1.05k|                    (void)strlcpy(lptr, valbuf, cursor->len);
  728|  1.05k|                    break;
  729|  2.29k|                case t_boolean:
  ------------------
  |  Branch (729:17): [True: 2.29k, False: 19.1k]
  ------------------
  730|  2.29k|                    {
  731|  2.29k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  732|  2.29k|                        memcpy(lptr, &tmp, sizeof(bool));
  733|  2.29k|                    }
  734|  2.29k|                    break;
  735|    561|                case t_character:
  ------------------
  |  Branch (735:17): [True: 561, False: 20.8k]
  ------------------
  736|    561|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (736:25): [True: 6, False: 555]
  ------------------
  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|    555|                    } else {
  740|    555|                        lptr[0] = valbuf[0];
  741|    555|                    }
  742|    555|                    break;
  743|  2.10k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (743:17): [True: 2.10k, False: 19.3k]
  ------------------
  744|  2.10k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.10k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  745|  2.10k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (745:17): [True: 0, False: 21.4k]
  ------------------
  746|  2.10k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.10k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  747|  2.10k|                case t_structobject:
  ------------------
  |  Branch (747:17): [True: 0, False: 21.4k]
  ------------------
  748|  2.10k|                    FALLTHROUGH
  ------------------
  |  |   55|  2.10k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  749|  2.10k|                case t_array:
  ------------------
  |  Branch (749:17): [True: 0, False: 21.4k]
  ------------------
  750|  2.10k|                    break;
  751|    737|                case t_check:
  ------------------
  |  Branch (751:17): [True: 737, False: 20.7k]
  ------------------
  752|    737|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (752:25): [True: 173, False: 564]
  ------------------
  753|    173|                        json_debug_trace(1, "json: Required attribute value %s"
  ------------------
  |  |  108|    173|    do {                                              \
  |  |  109|    173|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    173|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 173]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 173]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    173|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    173|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 173]
  |  |  ------------------
  ------------------
  754|    173|                                          " not present.\n",
  755|    173|                                          cursor->dflt.check);
  756|       |                        // don't update end here, leave at start of attribute
  757|    173|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    173|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  758|    173|                    }
  759|    564|                    break;
  760|  21.4k|                }
  761|  21.4k|            }
  762|  37.8k|            FALLTHROUGH
  ------------------
  |  |   55|  37.8k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  763|  38.7k|        case post_element:
  ------------------
  |  Branch (763:9): [True: 910, False: 594k]
  ------------------
  764|  38.7k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (764:17): [True: 374, False: 38.4k]
  ------------------
  765|    374|                continue;
  766|    374|            }
  767|  38.4k|            if (*cp == ',') {
  ------------------
  |  Branch (767:17): [True: 32.0k, False: 6.33k]
  ------------------
  768|  32.0k|                state = await_attr;
  769|  32.0k|            } else if (*cp == '}') {
  ------------------
  |  Branch (769:24): [True: 5.76k, False: 570]
  ------------------
  770|  5.76k|                ++cp;
  771|  5.76k|                goto good_parse;
  772|  5.76k|            } else {
  773|    570|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|    570|    do {                                              \
  |  |  109|    570|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    570|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 570]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 570]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    570|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    570|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 570]
  |  |  ------------------
  ------------------
  774|    570|                                "Garbage while expecting comma or }\n");
  775|    570|                if (NULL != end) {
  ------------------
  |  Branch (775:21): [True: 27, False: 543]
  ------------------
  776|     27|                    *end = cp;
  777|     27|                }
  778|    570|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    570|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  779|    570|            }
  780|  32.0k|            break;
  781|   595k|        }
  782|   595k|    }
  783|  3.12k|    if (state == init) {
  ------------------
  |  Branch (783:9): [True: 44, False: 3.07k]
  ------------------
  784|     44|        json_debug_trace(1, "json: %s", "Input was empty or white-space only\n");
  ------------------
  |  |  108|     44|    do {                                              \
  |  |  109|     44|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     44|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 44]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     44|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     44|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 44]
  |  |  ------------------
  ------------------
  785|     44|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     44|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  786|     44|    }
  787|       |
  788|  8.84k|  good_parse:
  789|       |    // in case there's another object following, consume trailing WS
  790|  8.84k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (790:12): [True: 201, False: 8.84k]
  ------------------
  791|    201|        ++cp;
  792|    201|    }
  793|  8.84k|    if (NULL != end) {
  ------------------
  |  Branch (793:9): [True: 5.24k, False: 3.59k]
  ------------------
  794|  5.24k|        *end = cp;
  795|  5.24k|    }
  796|  8.84k|    json_debug_trace(1, "%s", "json: JSON parse ends.\n");
  ------------------
  |  |  108|  8.84k|    do {                                              \
  |  |  109|  8.84k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.84k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.84k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.84k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.84k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.84k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.84k]
  |  |  ------------------
  ------------------
  797|  8.84k|    return 0;
  798|  3.12k|}
json.c:json_target_address:
  119|   189k|{
  120|   189k|    char *targetaddr = NULL;
  121|   189k|    if (NULL == parent ||
  ------------------
  |  Branch (121:9): [True: 105k, False: 83.2k]
  ------------------
  122|   105k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (122:9): [True: 0, False: 83.2k]
  ------------------
  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|    735|        case t_ubyte:
  ------------------
  |  Branch (128:9): [True: 735, False: 105k]
  ------------------
  129|    735|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  130|    735|            break;
  131|  21.2k|        case t_ignore:
  ------------------
  |  Branch (131:9): [True: 21.2k, False: 84.6k]
  ------------------
  132|  21.2k|            targetaddr = NULL;
  133|  21.2k|            break;
  134|  18.4k|        case t_integer:
  ------------------
  |  Branch (134:9): [True: 18.4k, False: 87.4k]
  ------------------
  135|  18.4k|            targetaddr = (char *)&cursor->addr.integer[offset];
  136|  18.4k|            break;
  137|  6.16k|        case t_uinteger:
  ------------------
  |  Branch (137:9): [True: 6.16k, False: 99.7k]
  ------------------
  138|  6.16k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  139|  6.16k|            break;
  140|  1.82k|        case t_longint:
  ------------------
  |  Branch (140:9): [True: 1.82k, False: 104k]
  ------------------
  141|  1.82k|            targetaddr = (char *)&cursor->addr.longint[offset];
  142|  1.82k|            break;
  143|    419|        case t_ulongint:
  ------------------
  |  Branch (143:9): [True: 419, False: 105k]
  ------------------
  144|    419|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  145|    419|            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|  4.05k|        case t_time:
  ------------------
  |  Branch (152:9): [True: 4.05k, False: 101k]
  ------------------
  153|  4.05k|            targetaddr = (char *)&cursor->addr.ts[offset];
  154|  4.05k|            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.2k|        case t_real:
  ------------------
  |  Branch (158:9): [True: 37.2k, False: 68.6k]
  ------------------
  159|  37.2k|            targetaddr = (char *)&cursor->addr.real[offset];
  160|  37.2k|            break;
  161|  7.14k|        case t_string:
  ------------------
  |  Branch (161:9): [True: 7.14k, False: 98.7k]
  ------------------
  162|  7.14k|            targetaddr = cursor->addr.string;
  163|  7.14k|            break;
  164|  1.66k|        case t_boolean:
  ------------------
  |  Branch (164:9): [True: 1.66k, False: 104k]
  ------------------
  165|  1.66k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  166|  1.66k|            break;
  167|  1.13k|        case t_character:
  ------------------
  |  Branch (167:9): [True: 1.13k, False: 104k]
  ------------------
  168|  1.13k|            targetaddr = (char *)&cursor->addr.character[offset];
  169|  1.13k|            break;
  170|    659|        case t_array:
  ------------------
  |  Branch (170:9): [True: 659, False: 105k]
  ------------------
  171|    659|            FALLTHROUGH
  ------------------
  |  |   55|    659|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  172|  5.88k|        case t_check:
  ------------------
  |  Branch (172:9): [True: 5.22k, False: 100k]
  ------------------
  173|  5.88k|            FALLTHROUGH
  ------------------
  |  |   55|  5.88k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  174|  5.88k|        case t_object:
  ------------------
  |  Branch (174:9): [True: 0, False: 105k]
  ------------------
  175|  5.88k|            FALLTHROUGH
  ------------------
  |  |   55|  5.88k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  176|  5.88k|        case t_structobject:
  ------------------
  |  Branch (176:9): [True: 0, False: 105k]
  ------------------
  177|  5.88k|            FALLTHROUGH
  ------------------
  |  |   55|  5.88k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  178|  5.88k|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 105k]
  ------------------
  179|  5.88k|            targetaddr = NULL;
  180|  5.88k|            break;
  181|   105k|        }
  182|   105k|    } else {
  183|       |        // tricky case - hacking a member in an array of structures
  184|  83.2k|        targetaddr =
  185|  83.2k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  186|  83.2k|            cursor->addr.offset;
  187|  83.2k|    }
  188|   189k|    json_debug_trace(1, "json: Target address for %s (offset %d) is %p\n",
  ------------------
  |  |  108|   189k|    do {                                              \
  |  |  109|   189k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   189k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 189k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 189k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   189k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   189k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 189k]
  |  |  ------------------
  ------------------
  189|   189k|                      cursor->attribute, offset, targetaddr);
  190|   189k|    return targetaddr;
  191|   189k|}

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

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

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

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

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

