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

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

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

safe_atof:
  294|  4.98k|{
  295|  4.98k|    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|  4.98k|    static double powersOf10[] = {
  303|  4.98k|        10.,
  304|  4.98k|        100.,
  305|  4.98k|        1.0e4,
  306|  4.98k|        1.0e8,
  307|  4.98k|        1.0e16,
  308|  4.98k|        1.0e32,
  309|  4.98k|        1.0e64,
  310|  4.98k|        1.0e128,
  311|  4.98k|        1.0e256
  312|  4.98k|    };
  313|       |
  314|  4.98k|    bool sign = false, expSign = false;
  315|  4.98k|    double fraction, dblExp, *d;
  316|  4.98k|    const char *p;
  317|  4.98k|    unsigned char c;
  318|  4.98k|    int exp = 0;                // Exponent read from "EX" field.
  319|  4.98k|    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|  4.98k|    int mantSize;               // Number of digits in mantissa.
  329|  4.98k|    int decPt;                  /* Number of mantissa digits BEFORE decimal
  330|       |                                 * point. */
  331|  4.98k|    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|  4.98k|    p = string;
  341|  4.98k|    while (isspace((int)*p)) {
  ------------------
  |  Branch (341:12): [True: 0, False: 4.98k]
  ------------------
  342|      0|        p += 1;
  343|      0|    }
  344|  4.98k|    if (isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (344:9): [True: 2.53k, False: 2.45k]
  ------------------
  345|       |        // ignore
  346|  2.53k|    } else if ('-' == *p) {
  ------------------
  |  Branch (346:16): [True: 853, False: 1.60k]
  ------------------
  347|    853|        sign = true;
  348|    853|        p += 1;
  349|  1.60k|    } else if ('+' == *p) {
  ------------------
  |  Branch (349:16): [True: 234, False: 1.37k]
  ------------------
  350|    234|        p += 1;
  351|  1.37k|    } else if ('.' == *p) {
  ------------------
  |  Branch (351:16): [True: 841, False: 529]
  ------------------
  352|       |        // ignore
  353|    841|    } else {
  354|    529|        return NAN;
  355|    529|    }
  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.46k|    decPt = -1;
  363|  22.5k|    for (mantSize = 0; ; mantSize += 1) {
  364|  22.5k|        c = *p;
  365|  22.5k|        if (!isdigit(c)) {
  ------------------
  |  Branch (365:13): [True: 5.72k, False: 16.8k]
  ------------------
  366|  5.72k|            if ((c != '.') || (decPt >= 0)) {
  ------------------
  |  Branch (366:17): [True: 4.31k, False: 1.41k]
  |  Branch (366:31): [True: 149, False: 1.26k]
  ------------------
  367|  4.46k|                break;
  368|  4.46k|            }
  369|  1.26k|            decPt = mantSize;
  370|  1.26k|        }
  371|  18.0k|        p += 1;
  372|  18.0k|    }
  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.46k|    pExp  = p;
  382|  4.46k|    p -= mantSize;
  383|  4.46k|    if (decPt < 0) {
  ------------------
  |  Branch (383:9): [True: 3.19k, False: 1.26k]
  ------------------
  384|  3.19k|        decPt = mantSize;
  385|  3.19k|    } else {
  386|  1.26k|        mantSize -= 1;                  // One of the digits was the point.
  387|  1.26k|    }
  388|  4.46k|    if (mantSize > 18) {
  ------------------
  |  Branch (388:9): [True: 408, False: 4.05k]
  ------------------
  389|    408|        fracExp = decPt - 18;
  390|    408|        mantSize = 18;
  391|  4.05k|    } else {
  392|  4.05k|        fracExp = decPt - mantSize;
  393|  4.05k|    }
  394|  4.46k|    if (mantSize == 0) {
  ------------------
  |  Branch (394:9): [True: 799, False: 3.66k]
  ------------------
  395|    799|        fraction = 0.0;
  396|       |        // p = string;
  397|    799|        goto done;
  398|  3.66k|    } else {
  399|  3.66k|        int frac1, frac2;
  400|       |
  401|  3.66k|        frac1 = 0;
  402|  8.14k|        for ( ; mantSize > 9; mantSize -= 1) {
  ------------------
  |  Branch (402:17): [True: 4.48k, False: 3.66k]
  ------------------
  403|  4.48k|            c = *p;
  404|  4.48k|            p += 1;
  405|  4.48k|            if ('.' == c) {
  ------------------
  |  Branch (405:17): [True: 161, False: 4.31k]
  ------------------
  406|    161|                c = *p;
  407|    161|                p += 1;
  408|    161|            }
  409|  4.48k|            frac1 = 10*frac1 + (c - '0');
  410|  4.48k|        }
  411|  3.66k|        frac2 = 0;
  412|  14.1k|        for (; mantSize > 0; mantSize -= 1) {
  ------------------
  |  Branch (412:16): [True: 10.5k, False: 3.66k]
  ------------------
  413|  10.5k|            c = *p;
  414|  10.5k|            p += 1;
  415|  10.5k|            if ('.' == c) {
  ------------------
  |  Branch (415:17): [True: 342, False: 10.1k]
  ------------------
  416|    342|                c = *p;
  417|    342|                p += 1;
  418|    342|            }
  419|  10.5k|            frac2 = 10*frac2 + (c - '0');
  420|  10.5k|        }
  421|  3.66k|        fraction = (1.0e9 * frac1) + frac2;
  422|  3.66k|    }
  423|       |
  424|       |    /*
  425|       |     * Skim off the exponent.
  426|       |     */
  427|       |
  428|  3.66k|    p = pExp;
  429|  3.66k|    if (('E' == *p) ||
  ------------------
  |  Branch (429:9): [True: 1.14k, False: 2.51k]
  ------------------
  430|  2.51k|        ('e' == *p)) {
  ------------------
  |  Branch (430:9): [True: 723, False: 1.79k]
  ------------------
  431|  1.86k|        p += 1;
  432|  1.86k|        if ('-' == *p) {
  ------------------
  |  Branch (432:13): [True: 657, False: 1.21k]
  ------------------
  433|    657|            expSign = true;
  434|    657|            p += 1;
  435|  1.21k|        } else {
  436|  1.21k|            if ('+' == *p) {
  ------------------
  |  Branch (436:17): [True: 160, False: 1.05k]
  ------------------
  437|    160|                p += 1;
  438|    160|            }
  439|  1.21k|            expSign = false;
  440|  1.21k|        }
  441|  4.43k|        while (isdigit((unsigned char) *p)) {
  ------------------
  |  Branch (441:16): [True: 4.43k, False: 1.02k]
  ------------------
  442|  4.43k|            exp = exp * 10 + (*p - '0');
  443|  4.43k|            if (1024 < exp) {
  ------------------
  |  Branch (443:17): [True: 845, False: 3.58k]
  ------------------
  444|    845|                if (true == expSign) {
  ------------------
  |  Branch (444:21): [True: 437, False: 408]
  ------------------
  445|       |                    // exponent underflow!
  446|    437|                    if (sign) {
  ------------------
  |  Branch (446:25): [True: 377, False: 60]
  ------------------
  447|    377|                        return -0.0;
  448|    377|                    }
  449|     60|                    return 0.0;
  450|    437|                } // else  exponent overflow!
  451|    408|                if (sign) {
  ------------------
  |  Branch (451:21): [True: 204, False: 204]
  ------------------
  452|    204|                    return -INFINITY;
  453|    204|                }
  454|    204|                return INFINITY;
  455|    408|            }
  456|  3.58k|            p += 1;
  457|  3.58k|        }
  458|  1.86k|    }
  459|  2.81k|    if (expSign) {
  ------------------
  |  Branch (459:9): [True: 220, False: 2.59k]
  ------------------
  460|    220|        exp = fracExp - exp;
  461|  2.59k|    } else {
  462|  2.59k|        exp = fracExp + exp;
  463|  2.59k|    }
  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: 530, False: 2.28k]
  ------------------
  473|    530|        expSign = true;
  474|    530|        exp = -exp;
  475|  2.28k|    } else {
  476|  2.28k|        expSign = false;
  477|  2.28k|    }
  478|  2.81k|    if (exp > maxExponent) {
  ------------------
  |  Branch (478:9): [True: 178, False: 2.63k]
  ------------------
  479|    178|        exp = maxExponent;
  480|    178|        errno = ERANGE;
  481|    178|    }
  482|  2.81k|    dblExp = 1.0;
  483|  6.96k|    for (d = powersOf10; exp != 0; exp >>= 1, d += 1) {
  ------------------
  |  Branch (483:26): [True: 4.15k, False: 2.81k]
  ------------------
  484|  4.15k|        if (exp & 01) {
  ------------------
  |  Branch (484:13): [True: 3.18k, False: 964]
  ------------------
  485|  3.18k|            dblExp *= *d;
  486|  3.18k|        }
  487|  4.15k|    }
  488|  2.81k|    if (expSign) {
  ------------------
  |  Branch (488:9): [True: 530, False: 2.28k]
  ------------------
  489|    530|        fraction /= dblExp;
  490|  2.28k|    } else {
  491|  2.28k|        fraction *= dblExp;
  492|  2.28k|    }
  493|       |
  494|  3.61k|done:
  495|  3.61k|    if (sign) {
  ------------------
  |  Branch (495:9): [True: 272, False: 3.34k]
  ------------------
  496|    272|        return -fraction;
  497|    272|    }
  498|  3.34k|    return fraction;
  499|  3.61k|}
mkgmtime:
  845|  1.56k|{
  846|  1.56k|    int year;
  847|  1.56k|    time_t result;
  848|  1.56k|    static const int cumdays[MONTHSPERYEAR] =
  849|  1.56k|        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 };
  850|       |
  851|       |    // check ranges, ignore tm_isdst and max tm_year
  852|  1.56k|    if (0 > t->tm_sec ||
  ------------------
  |  Branch (852:9): [True: 0, False: 1.56k]
  ------------------
  853|  1.56k|        0 > t->tm_min ||
  ------------------
  |  Branch (853:9): [True: 0, False: 1.56k]
  ------------------
  854|  1.56k|        0 > t->tm_hour ||
  ------------------
  |  Branch (854:9): [True: 0, False: 1.56k]
  ------------------
  855|  1.56k|        1 > t->tm_mday ||
  ------------------
  |  Branch (855:9): [True: 332, False: 1.23k]
  ------------------
  856|  1.23k|        0 > t->tm_mon ||
  ------------------
  |  Branch (856:9): [True: 0, False: 1.23k]
  ------------------
  857|  1.23k|        0 > t->tm_year ||
  ------------------
  |  Branch (857:9): [True: 360, False: 877]
  ------------------
  858|    877|        0 > t->tm_wday ||
  ------------------
  |  Branch (858:9): [True: 0, False: 877]
  ------------------
  859|    877|        0 > t->tm_yday ||
  ------------------
  |  Branch (859:9): [True: 0, False: 877]
  ------------------
  860|    877|        61 < t->tm_sec ||
  ------------------
  |  Branch (860:9): [True: 0, False: 877]
  ------------------
  861|    877|        59 < t->tm_min ||
  ------------------
  |  Branch (861:9): [True: 0, False: 877]
  ------------------
  862|    877|        23 < t->tm_hour ||
  ------------------
  |  Branch (862:9): [True: 0, False: 877]
  ------------------
  863|    877|        31 < t->tm_mday ||
  ------------------
  |  Branch (863:9): [True: 0, False: 877]
  ------------------
  864|    877|        11 < t->tm_mon ||
  ------------------
  |  Branch (864:9): [True: 0, False: 877]
  ------------------
  865|    877|        6 < t->tm_wday ||
  ------------------
  |  Branch (865:9): [True: 0, False: 877]
  ------------------
  866|    877|        365 < t->tm_yday) {
  ------------------
  |  Branch (866:9): [True: 0, False: 877]
  ------------------
  867|    692|        errno = EOVERFLOW;
  868|    692|        return -1;
  869|    692|    }
  870|  1.56k|    errno = 0;
  871|    877|    year = 1900 + t->tm_year + t->tm_mon / MONTHSPERYEAR;
  ------------------
  |  |  501|    877|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  872|    877|    result = (year - 1970) * 365 + cumdays[t->tm_mon % MONTHSPERYEAR];
  ------------------
  |  |  501|    877|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  873|    877|    result += (year - 1968) / 4;
  874|    877|    result -= (year - 1900) / 100;
  875|    877|    result += (year - 1600) / 400;
  876|    877|    if (0 == (year % 4) &&
  ------------------
  |  Branch (876:9): [True: 286, False: 591]
  ------------------
  877|    286|        (0 != (year % 100) ||
  ------------------
  |  Branch (877:10): [True: 58, False: 228]
  ------------------
  878|    228|         0 == (year % 400)) &&
  ------------------
  |  Branch (878:10): [True: 63, False: 165]
  ------------------
  879|    121|        (2 > (t->tm_mon % MONTHSPERYEAR))) {
  ------------------
  |  |  501|    121|#define MONTHSPERYEAR   12      // months per calendar year
  ------------------
  |  Branch (879:9): [True: 63, False: 58]
  ------------------
  880|     63|        result--;
  881|     63|    }
  882|    877|    result += t->tm_mday - 1;
  883|    877|    result *= 24;
  884|    877|    result += t->tm_hour;
  885|    877|    result *= 60;
  886|    877|    result += t->tm_min;
  887|    877|    result *= 60;
  888|    877|    result += t->tm_sec;
  889|       |    /* this is UTC, no DST
  890|       |     * if (t->tm_isdst == 1)
  891|       |     * result -= 3600;
  892|       |     */
  893|    877|    return result;
  894|  1.56k|}
iso8601_to_timespec:
  898|  1.56k|{
  899|  1.56k|    timespec_t ret = {0};
  900|       |
  901|       |#ifdef USE_QT
  902|       |  #ifndef __clang_analyzer__
  903|       |    double usec = 0;
  904|       |
  905|       |    QString t(isotime);
  906|       |    QDateTime d = QDateTime::fromString(isotime, Qt::ISODate);
  907|       |    QStringList sl = t.split(".");
  908|       |    if (1 < sl.size()) {
  909|       |        usec = sl[1].toInt() / pow(10., (double)sl[1].size());
  910|       |    }
  911|       |// toSecsSinceEpoch wasn't introduced until 5.8
  912|       |#if QT_VERSION < QT_VERSION_CHECK(5,8,0)
  913|       |    ret.tv_sec = d.toTime_t();
  914|       |#else
  915|       |    ret.tv_sec = d.toSecsSinceEpoch();
  916|       |#endif
  917|       |    ret.tv_nsec = usec * 1e9;
  918|       |  #endif  // __clang_analyzer__
  919|       |#else  // USE_QT
  920|  1.56k|    double usec = 0;
  921|  1.56k|    struct tm tm = {0};
  922|       |
  923|  1.56k|    {
  924|  1.56k|        char *dp = NULL;
  925|  1.56k|        dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm);
  926|  1.56k|        if (NULL != dp &&
  ------------------
  |  Branch (926:13): [True: 733, False: 836]
  ------------------
  927|    733|            '.' == *dp) {
  ------------------
  |  Branch (927:13): [True: 146, False: 587]
  ------------------
  928|    146|            usec = strtod(dp, NULL);
  929|    146|        }
  930|  1.56k|    }
  931|       |
  932|       |    /*
  933|       |     * It would be nice if we could say mktime(&tm) - timezone + usec instead,
  934|       |     * but timezone is not available at all on some BSDs. Besides, when working
  935|       |     * with historical dates the value of timezone after an ordinary tzset(3)
  936|       |     * can be wrong; you have to do a redirect through the IANA historical
  937|       |     * timezone database to get it right.
  938|       |     */
  939|  1.56k|    ret.tv_sec = mkgmtime(&tm);
  940|  1.56k|    ret.tv_nsec = usec * 1e9;
  941|  1.56k|#endif  // USE_QT
  942|       |
  943|  1.56k|#if 4 < SIZEOF_TIME_T
  944|  1.56k|    if (253402300799LL < ret.tv_sec) {
  ------------------
  |  Branch (944:9): [True: 366, False: 1.20k]
  ------------------
  945|       |        // enforce max "9999-12-31T23:59:59.999Z"
  946|    366|        ret.tv_sec = 253402300799LL;
  947|    366|    }
  948|  1.56k|#endif
  949|  1.56k|    return ret;
  950|  1.56k|}

gps_hexpack:
  119|    103|{
  120|    103|    ssize_t i, j;
  121|       |
  122|    103|    j = strnlen(src, BUFSIZ) / 2;
  123|    103|    if ((1 > j) ||
  ------------------
  |  Branch (123:9): [True: 2, False: 101]
  ------------------
  124|    101|        ((size_t)j > len)) {
  ------------------
  |  Branch (124:9): [True: 7, False: 94]
  ------------------
  125|      9|        return -2;
  126|      9|    }
  127|       |
  128|    394|    for (i = 0; i < j; i++) {
  ------------------
  |  Branch (128:17): [True: 360, False: 34]
  ------------------
  129|    360|        int k;
  130|    360|        if (-1 == (k = hex2bin(src + i * 2))) {
  ------------------
  |  Branch (130:13): [True: 60, False: 300]
  ------------------
  131|     60|            return -1;
  132|     60|        }
  133|    300|        dst[i] = (char)(k & 0xff);
  134|    300|    }
  135|     34|    (void)memset(dst + i, '\0', (size_t)(len - i));
  136|     34|    return j;
  137|     94|}
hex.c:hex2bin:
   82|    360|{
   83|    360|    int a, b;
   84|       |
   85|    360|    a = s[0] & 0xff;
   86|    360|    b = s[1] & 0xff;
   87|       |
   88|    360|    if ((a >= 'a') &&
  ------------------
  |  Branch (88:9): [True: 113, False: 247]
  ------------------
   89|    113|        (a <= 'f')) {
  ------------------
  |  Branch (89:9): [True: 100, False: 13]
  ------------------
   90|    100|        a = a + 10 - 'a';
   91|    260|    } else if ((a >= 'A') &&
  ------------------
  |  Branch (91:16): [True: 104, False: 156]
  ------------------
   92|    104|               (a <= 'F')) {
  ------------------
  |  Branch (92:16): [True: 85, False: 19]
  ------------------
   93|     85|        a = a + 10 - 'A';
   94|    175|    } else if ((a >= '0') &&
  ------------------
  |  Branch (94:16): [True: 169, False: 6]
  ------------------
   95|    169|               (a <= '9')) {
  ------------------
  |  Branch (95:16): [True: 147, False: 22]
  ------------------
   96|    147|        a -= '0';
   97|    147|    } else {
   98|     28|        return -1;
   99|     28|    }
  100|       |
  101|    332|    if ((b >= 'a') &&
  ------------------
  |  Branch (101:9): [True: 108, False: 224]
  ------------------
  102|    108|        (b <= 'f')) {
  ------------------
  |  Branch (102:9): [True: 97, False: 11]
  ------------------
  103|     97|        b = b + 10 - 'a';
  104|    235|    } else if ((b >= 'A') &&
  ------------------
  |  Branch (104:16): [True: 89, False: 146]
  ------------------
  105|     89|               (b <= 'F')) {
  ------------------
  |  Branch (105:16): [True: 71, False: 18]
  ------------------
  106|     71|        b = b + 10 - 'A';
  107|    164|    } else if ((b >= '0') &&
  ------------------
  |  Branch (107:16): [True: 154, False: 10]
  ------------------
  108|    154|               (b <= '9')) {
  ------------------
  |  Branch (108:16): [True: 132, False: 22]
  ------------------
  109|    132|        b -= '0';
  110|    132|    } else {
  111|     32|        return -1;
  112|     32|    }
  113|       |
  114|    300|    return ((a << 4) + b);
  115|    332|}

json_read_array:
  802|    753|{
  803|    753|    int substatus;
  804|    753|    unsigned offset, arrcount;
  805|    753|    char *tp;
  806|       |
  807|    753|    if (NULL != end) {
  ------------------
  |  Branch (807:9): [True: 753, False: 0]
  ------------------
  808|    753|        *end = NULL;    // give it a well-defined value on parse failure
  809|    753|    }
  810|       |
  811|    753|    json_debug_trace(1, "json: %s", "Entered json_read_array()\n");
  ------------------
  |  |  108|    753|    do {                                              \
  |  |  109|    753|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    753|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 753]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 753]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    753|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    753|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 753]
  |  |  ------------------
  ------------------
  812|       |
  813|    753|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (813:12): [True: 0, False: 753]
  ------------------
  814|      0|        cp++;
  815|      0|    }
  816|    753|    if (*cp != '[') {
  ------------------
  |  Branch (816:9): [True: 0, False: 753]
  ------------------
  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|    753|    cp++;
  821|       |
  822|    753|    tp = arr->arr.strings.store;
  823|    753|    arrcount = 0;
  824|       |
  825|       |    // Check for empty array
  826|    753|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (826:12): [True: 194, False: 753]
  ------------------
  827|    194|        cp++;
  828|    194|    }
  829|    753|    if (*cp == ']') {
  ------------------
  |  Branch (829:9): [True: 171, False: 582]
  ------------------
  830|    171|        goto breakout;
  831|    171|    }
  832|       |
  833|  6.30k|    for (offset = 0; offset < arr->maxlen; offset++) {
  ------------------
  |  Branch (833:22): [True: 6.30k, False: 1]
  ------------------
  834|  6.30k|        char *ep = NULL;
  835|       |
  836|  6.30k|        json_debug_trace(1, "json: Looking at %s\n", cp);
  ------------------
  |  |  108|  6.30k|    do {                                              \
  |  |  109|  6.30k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  6.30k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 6.30k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 6.30k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  6.30k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  6.30k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 6.30k]
  |  |  ------------------
  ------------------
  837|  6.30k|        switch (arr->element_type) {
  ------------------
  |  Branch (837:17): [True: 6.30k, False: 0]
  ------------------
  838|  1.66k|        case t_string:
  ------------------
  |  Branch (838:9): [True: 1.66k, False: 4.64k]
  ------------------
  839|  1.66k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (839:17): [True: 197, False: 1.46k]
  ------------------
  840|    197|                cp++;
  841|    197|            }
  842|  1.66k|            if (*cp != '"') {
  ------------------
  |  Branch (842:17): [True: 13, False: 1.64k]
  ------------------
  843|     13|                return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     13|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  844|  1.64k|            } else {
  845|  1.64k|                ++cp;
  846|  1.64k|            }
  847|  1.64k|            arr->arr.strings.ptrs[offset] = tp;
  848|  7.35k|            for (; tp - arr->arr.strings.store < arr->arr.strings.storelen;
  ------------------
  |  Branch (848:20): [True: 7.35k, False: 3]
  ------------------
  849|  5.70k|                 tp++)
  850|  7.35k|                if (*cp == '"') {
  ------------------
  |  Branch (850:21): [True: 1.64k, False: 5.70k]
  ------------------
  851|  1.64k|                    ++cp;
  852|  1.64k|                    *tp++ = '\0';
  853|  1.64k|                    goto stringend;
  854|  5.70k|                } else if (*cp == '\0') {
  ------------------
  |  Branch (854:28): [True: 1, False: 5.70k]
  ------------------
  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|  5.70k|                } else {
  859|  5.70k|                    *tp = *cp++;
  860|  5.70k|                }
  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|  1.64k|          stringend:
  865|  1.64k|            break;
  866|      0|        case t_object:
  ------------------
  |  Branch (866:9): [True: 0, False: 6.30k]
  ------------------
  867|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  868|  4.64k|        case t_structobject:
  ------------------
  |  Branch (868:9): [True: 4.64k, False: 1.66k]
  ------------------
  869|  4.64k|            substatus =
  870|  4.64k|                json_internal_read_object(cp, arr->arr.objects.subtype, arr,
  871|  4.64k|                                          offset, &cp);
  872|  4.64k|            if (substatus != 0) {
  ------------------
  |  Branch (872:17): [True: 123, False: 4.52k]
  ------------------
  873|    123|                if (NULL != end) {
  ------------------
  |  Branch (873:21): [True: 123, False: 0]
  ------------------
  874|    123|                    *end = cp;
  875|    123|                }
  876|    123|                return substatus;
  877|    123|            }
  878|  4.52k|            break;
  879|  4.52k|        case t_integer:
  ------------------
  |  Branch (879:9): [True: 0, False: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  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: 6.30k]
  ------------------
  979|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  980|      0|        case t_array:
  ------------------
  |  Branch (980:9): [True: 0, False: 6.30k]
  ------------------
  981|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  982|      0|        case t_check:
  ------------------
  |  Branch (982:9): [True: 0, False: 6.30k]
  ------------------
  983|      0|            FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  984|      0|        case t_ignore:
  ------------------
  |  Branch (984:9): [True: 0, False: 6.30k]
  ------------------
  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|  6.30k|        }
  988|  6.16k|        arrcount++;
  989|  6.16k|        if (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (989:13): [True: 195, False: 5.97k]
  ------------------
  990|    195|            cp++;
  991|    195|        }
  992|  6.16k|        if (*cp == ']') {
  ------------------
  |  Branch (992:13): [True: 338, False: 5.82k]
  ------------------
  993|    338|            json_debug_trace(1, "json: %s", "End of array found.\n");
  ------------------
  |  |  108|    338|    do {                                              \
  |  |  109|    338|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    338|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 338]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 338]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    338|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    338|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 338]
  |  |  ------------------
  ------------------
  994|    338|            goto breakout;
  995|    338|        }
  996|  5.82k|        if (*cp == ',') {
  ------------------
  |  Branch (996:13): [True: 5.72k, False: 103]
  ------------------
  997|  5.72k|            cp++;
  998|  5.72k|        } else {
  999|    103|            json_debug_trace(1, "json: %s", "Bad trailing syntax on array.\n");
  ------------------
  |  |  108|    103|    do {                                              \
  |  |  109|    103|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    103|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 103]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 103]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    103|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    103|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 103]
  |  |  ------------------
  ------------------
 1000|    103|            return JSON_ERR_BADSUBTRAIL;
  ------------------
  |  |  164|    103|#define JSON_ERR_BADSUBTRAIL   13      // garbage while expecting array comma
  ------------------
 1001|    103|        }
 1002|  5.82k|    }
 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|    509|  breakout:
 1009|    509|    if (NULL != arr->count) {
  ------------------
  |  Branch (1009:9): [True: 509, False: 0]
  ------------------
 1010|    509|        *(arr->count) = arrcount;
 1011|    509|    }
 1012|    509|    if (NULL != end) {
  ------------------
  |  Branch (1012:9): [True: 509, False: 0]
  ------------------
 1013|    509|        *end = cp;
 1014|    509|    }
 1015|    509|    json_debug_trace(1, "json: leaving json_read_array() with %d elements\n",
  ------------------
  |  |  108|    509|    do {                                              \
  |  |  109|    509|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    509|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 509]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 509]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    509|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    509|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 509]
  |  |  ------------------
  ------------------
 1016|    509|                      arrcount);
 1017|    509|    return 0;
 1018|    582|}
json_read_object:
 1022|  4.14k|{
 1023|  4.14k|    int st;
 1024|       |
 1025|  4.14k|    json_debug_trace(1, "json: json_read_object() sees '%s'\n", cp);
  ------------------
  |  |  108|  4.14k|    do {                                              \
  |  |  109|  4.14k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  4.14k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 4.14k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 4.14k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  4.14k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  4.14k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 4.14k]
  |  |  ------------------
  ------------------
 1026|       |    st = json_internal_read_object(cp, attrs, NULL, 0, end);
 1027|  4.14k|    return st;
 1028|  4.14k|}
json.c:json_internal_read_object:
  199|  8.79k|{
  200|  8.79k|    enum
  201|  8.79k|    { init, await_attr, in_attr, await_value, in_val_string,
  202|  8.79k|        in_escape, in_val_token, post_val, post_element, in_ignore_array
  203|  8.79k|    } state = 0;
  204|  8.79k|    char *statenames[] = {
  205|  8.79k|        "init", "await_attr", "in_attr", "await_value", "in_val_string",
  206|  8.79k|        "in_escape", "in_val_token", "post_val", "post_element",
  207|  8.79k|        "in_ignore_array"
  208|  8.79k|    };
  209|  8.79k|    char attrbuf[JSON_ATTR_MAX + 1], *pattr = NULL;
  210|  8.79k|    char valbuf[JSON_VAL_MAX + 1], *pval = NULL;
  211|  8.79k|    bool value_quoted = false;
  212|  8.79k|    char uescape[5];            // enough space for 4 hex digits and a NUL
  213|  8.79k|    const struct json_attr_t *cursor;
  214|  8.79k|    int substatus, maxlen = 0;
  215|  8.79k|    unsigned int u;
  216|  8.79k|    const struct json_enum_t *mp;
  217|  8.79k|    char *lptr;
  218|       |
  219|  8.79k|    if (NULL != end) {
  ------------------
  |  Branch (219:9): [True: 4.64k, False: 4.14k]
  ------------------
  220|  4.64k|        *end = NULL;    // give it a well-defined value on parse failure
  221|  4.64k|    }
  222|  8.79k|    memset(valbuf, 0, sizeof(valbuf));
  223|       |
  224|       |    // stuff fields with defaults in case they're omitted in the JSON input
  225|   132k|    for (cursor = attrs; cursor->attribute != NULL; cursor++)
  ------------------
  |  Branch (225:26): [True: 123k, False: 8.79k]
  ------------------
  226|   123k|        if (!cursor->nodefault) {
  ------------------
  |  Branch (226:13): [True: 123k, False: 108]
  ------------------
  227|   123k|            lptr = json_target_address(cursor, parent, offset);
  228|   123k|            if (NULL != lptr)
  ------------------
  |  Branch (228:17): [True: 115k, False: 8.33k]
  ------------------
  229|   115k|                switch (cursor->type) {
  ------------------
  |  Branch (229:25): [True: 115k, False: 0]
  ------------------
  230|  3.40k|                case t_byte:
  ------------------
  |  Branch (230:17): [True: 3.40k, False: 111k]
  ------------------
  231|  3.40k|                    lptr[0] = cursor->dflt.byte;
  232|  3.40k|                    break;
  233|  18.1k|                case t_ubyte:
  ------------------
  |  Branch (233:17): [True: 18.1k, False: 97.0k]
  ------------------
  234|  18.1k|                    lptr[0] = cursor->dflt.ubyte;
  235|  18.1k|                    break;
  236|  13.9k|                case t_integer:
  ------------------
  |  Branch (236:17): [True: 13.9k, False: 101k]
  ------------------
  237|  13.9k|                    memcpy(lptr, &cursor->dflt.integer, sizeof(int));
  238|  13.9k|                    break;
  239|  6.42k|                case t_uinteger:
  ------------------
  |  Branch (239:17): [True: 6.42k, False: 108k]
  ------------------
  240|  6.42k|                    memcpy(lptr, &cursor->dflt.uinteger, sizeof(unsigned int));
  241|  6.42k|                    break;
  242|    648|                case t_longint:
  ------------------
  |  Branch (242:17): [True: 648, False: 114k]
  ------------------
  243|    648|                    memcpy(lptr, &cursor->dflt.longint, sizeof(long));
  244|    648|                    break;
  245|    119|                case t_ulongint:
  ------------------
  |  Branch (245:17): [True: 119, False: 115k]
  ------------------
  246|    119|                    memcpy(lptr, &cursor->dflt.ulongint,
  247|    119|                           sizeof(unsigned long));
  248|    119|                    break;
  249|  3.40k|                case t_short:
  ------------------
  |  Branch (249:17): [True: 3.40k, False: 111k]
  ------------------
  250|  3.40k|                    memcpy(lptr, &cursor->dflt.shortint, sizeof(short));
  251|  3.40k|                    break;
  252|      0|                case t_ushort:
  ------------------
  |  Branch (252:17): [True: 0, False: 115k]
  ------------------
  253|      0|                    memcpy(lptr, &cursor->dflt.ushortint,
  254|      0|                           sizeof(unsigned short));
  255|      0|                    break;
  256|  1.30k|                case t_time:
  ------------------
  |  Branch (256:17): [True: 1.30k, False: 113k]
  ------------------
  257|  1.30k|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  258|  1.30k|                    break;
  259|    950|                case t_timespec:
  ------------------
  |  Branch (259:17): [True: 950, False: 114k]
  ------------------
  260|    950|                    memcpy(lptr, &cursor->dflt.ts, sizeof(timespec_t));
  261|    950|                    break;
  262|  47.5k|                case t_real:
  ------------------
  |  Branch (262:17): [True: 47.5k, False: 67.6k]
  ------------------
  263|  47.5k|                    memcpy(lptr, &cursor->dflt.real, sizeof(double));
  264|  47.5k|                    break;
  265|  8.79k|                case t_string:
  ------------------
  |  Branch (265:17): [True: 8.79k, False: 106k]
  ------------------
  266|  8.79k|                    if (parent != NULL
  ------------------
  |  Branch (266:25): [True: 3.59k, False: 5.19k]
  ------------------
  267|  3.59k|                        && parent->element_type != t_structobject
  ------------------
  |  Branch (267:28): [True: 0, False: 3.59k]
  ------------------
  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|  8.79k|                    lptr[0] = '\0';
  271|  8.79k|                    break;
  272|  4.40k|                case t_boolean:
  ------------------
  |  Branch (272:17): [True: 4.40k, False: 110k]
  ------------------
  273|  4.40k|                    memcpy(lptr, &cursor->dflt.boolean, sizeof(bool));
  274|  4.40k|                    break;
  275|    970|                case t_character:
  ------------------
  |  Branch (275:17): [True: 970, False: 114k]
  ------------------
  276|    970|                    lptr[0] = cursor->dflt.character;
  277|    970|                    break;
  278|      0|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (278:17): [True: 0, False: 115k]
  ------------------
  279|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  280|      0|                case t_structobject:
  ------------------
  |  Branch (280:17): [True: 0, False: 115k]
  ------------------
  281|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  282|      0|                case t_array:
  ------------------
  |  Branch (282:17): [True: 0, False: 115k]
  ------------------
  283|      0|                    FALLTHROUGH
  ------------------
  |  |   55|      0|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  284|    475|                case t_check:
  ------------------
  |  Branch (284:17): [True: 475, False: 114k]
  ------------------
  285|    475|                    FALLTHROUGH
  ------------------
  |  |   55|    475|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  286|  5.10k|                case t_ignore:
  ------------------
  |  Branch (286:17): [True: 4.62k, False: 110k]
  ------------------
  287|  5.10k|                    break;
  288|   115k|                }
  289|   123k|        }
  290|       |
  291|  8.79k|    json_debug_trace(1, "json: JSON parse of '%s' begins.\n", cp);
  ------------------
  |  |  108|  8.79k|    do {                                              \
  |  |  109|  8.79k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  8.79k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 8.79k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 8.79k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  8.79k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  8.79k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 8.79k]
  |  |  ------------------
  ------------------
  292|       |
  293|       |    // parse input JSON
  294|   537k|    for (; *cp != '\0'; cp++) {
  ------------------
  |  Branch (294:12): [True: 535k, False: 2.35k]
  ------------------
  295|   535k|        json_debug_trace(2, "json: State %-14s, looking at '%c' (%p)\n",
  ------------------
  |  |  108|   535k|    do {                                              \
  |  |  109|   535k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   535k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 535k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 535k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   535k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   535k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 535k]
  |  |  ------------------
  ------------------
  296|   535k|                          statenames[state], *cp, cp);
  297|   535k|        switch (state) {
  ------------------
  |  Branch (297:17): [True: 535k, False: 0]
  ------------------
  298|  9.28k|        case init:
  ------------------
  |  Branch (298:9): [True: 9.28k, False: 526k]
  ------------------
  299|  9.28k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (299:17): [True: 526, False: 8.76k]
  ------------------
  300|    526|                continue;
  301|    526|            }
  302|  8.76k|            if (*cp == '{') {
  ------------------
  |  Branch (302:17): [True: 8.73k, False: 30]
  ------------------
  303|  8.73k|                state = await_attr;
  304|  8.73k|            } else {
  305|     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]
  |  |  ------------------
  ------------------
  306|     30|                                  "Non-WS when expecting object start.\n");
  307|     30|                if (NULL != end) {
  ------------------
  |  Branch (307:21): [True: 30, False: 0]
  ------------------
  308|     30|                    *end = cp;
  309|     30|                }
  310|     30|                return JSON_ERR_OBSTART;
  ------------------
  |  |  152|     30|#define JSON_ERR_OBSTART        1      // non-WS when expecting object start
  ------------------
  311|     30|            }
  312|  8.73k|            break;
  313|  34.8k|        case await_attr:
  ------------------
  |  Branch (313:9): [True: 34.8k, False: 500k]
  ------------------
  314|  34.8k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (314:17): [True: 230, False: 34.6k]
  ------------------
  315|    230|                continue;
  316|    230|            }
  317|  34.6k|            if (*cp == '"') {
  ------------------
  |  Branch (317:17): [True: 34.3k, False: 305]
  ------------------
  318|  34.3k|                state = in_attr;
  319|  34.3k|                pattr = attrbuf;
  320|  34.3k|                if (NULL != end) {
  ------------------
  |  Branch (320:21): [True: 5.91k, False: 28.4k]
  ------------------
  321|  5.91k|                    *end = cp;
  322|  5.91k|                }
  323|  34.3k|            } else if (*cp == '}') {
  ------------------
  |  Branch (323:24): [True: 208, False: 97]
  ------------------
  324|    208|                break;
  325|    208|            } else {
  326|     97|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     97|    do {                                              \
  |  |  109|     97|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     97|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 97]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 97]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     97|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     97|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 97]
  |  |  ------------------
  ------------------
  327|     97|                          "Non-WS when expecting attribute.\n");
  328|     97|                if (NULL != end) {
  ------------------
  |  Branch (328:21): [True: 4, False: 93]
  ------------------
  329|      4|                    *end = cp;
  330|      4|                }
  331|     97|                return JSON_ERR_ATTRSTART;
  ------------------
  |  |  153|     97|#define JSON_ERR_ATTRSTART      2      // non-WS when expecting attrib start
  ------------------
  332|     97|            }
  333|  34.3k|            break;
  334|   149k|        case in_attr:
  ------------------
  |  Branch (334:9): [True: 149k, False: 385k]
  ------------------
  335|   149k|            if (NULL == pattr) {
  ------------------
  |  Branch (335:17): [True: 0, False: 149k]
  ------------------
  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|   149k|            if (*cp == '"') {
  ------------------
  |  Branch (339:17): [True: 34.2k, False: 115k]
  ------------------
  340|  34.2k|                *pattr++ = '\0';
  341|  34.2k|                json_debug_trace(1, "json: Collected attribute name %s\n",
  ------------------
  |  |  108|  34.2k|    do {                                              \
  |  |  109|  34.2k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  34.2k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 34.2k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 34.2k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  34.2k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  34.2k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 34.2k]
  |  |  ------------------
  ------------------
  342|  34.2k|                                  attrbuf);
  343|   377k|                for (cursor = attrs; cursor->attribute != NULL; cursor++) {
  ------------------
  |  Branch (343:38): [True: 377k, False: 89]
  ------------------
  344|   377k|                    json_debug_trace(2, "json: Checking against %s\n",
  ------------------
  |  |  108|   377k|    do {                                              \
  |  |  109|   377k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   377k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 377k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 377k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   377k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   377k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 377k]
  |  |  ------------------
  ------------------
  345|   377k|                                      cursor->attribute);
  346|   377k|                    if (strcmp(cursor->attribute, attrbuf) == 0) {
  ------------------
  |  Branch (346:25): [True: 21.9k, False: 355k]
  ------------------
  347|  21.9k|                        break;
  348|  21.9k|                    }
  349|   355k|                    if (cursor->type == t_ignore &&
  ------------------
  |  Branch (349:25): [True: 12.4k, False: 343k]
  ------------------
  350|  12.4k|                        strncmp(cursor->attribute, "", 1) == 0) {
  ------------------
  |  Branch (350:25): [True: 12.2k, False: 232]
  ------------------
  351|  12.2k|                        break;
  352|  12.2k|                    }
  353|   355k|                }
  354|  34.2k|                if (NULL == cursor->attribute) {
  ------------------
  |  Branch (354:21): [True: 89, False: 34.1k]
  ------------------
  355|     89|                    json_debug_trace(1,
  ------------------
  |  |  108|     89|    do {                                              \
  |  |  109|     89|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     89|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 89]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 89]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     89|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     89|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 89]
  |  |  ------------------
  ------------------
  356|     89|                                      "json: Unknown attribute name '%s'"
  357|     89|                                      " (attributes begin with '%s').\n",
  358|     89|                                      attrbuf, attrs->attribute);
  359|       |                    // don't update end here, leave at attribute start
  360|     89|                    return JSON_ERR_BADATTR;
  ------------------
  |  |  154|     89|#define JSON_ERR_BADATTR        3      // unknown attribute name
  ------------------
  361|     89|                }
  362|  34.1k|                state = await_value;
  363|  34.1k|                if (cursor->type == t_string) {
  ------------------
  |  Branch (363:21): [True: 1.09k, False: 33.0k]
  ------------------
  364|  1.09k|                    maxlen = (int)cursor->len - 1;
  365|  33.0k|                } else if (cursor->type == t_check) {
  ------------------
  |  Branch (365:28): [True: 1.72k, False: 31.3k]
  ------------------
  366|  1.72k|                    maxlen = (int)strnlen(cursor->dflt.check, JSON_VAL_MAX);
  ------------------
  |  |  135|  1.72k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  367|  31.3k|                } else if (cursor->type == t_time ||
  ------------------
  |  Branch (367:28): [True: 1.95k, False: 29.4k]
  ------------------
  368|  29.4k|                           cursor->type == t_ignore) {
  ------------------
  |  Branch (368:28): [True: 15.7k, False: 13.6k]
  ------------------
  369|  17.6k|                    maxlen = JSON_VAL_MAX;
  ------------------
  |  |  135|  17.6k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  370|  17.6k|                } else if (NULL != cursor->map) {
  ------------------
  |  Branch (370:28): [True: 433, False: 13.2k]
  ------------------
  371|    433|                    maxlen = (int)sizeof(valbuf) - 1;
  372|    433|                }
  373|  34.1k|                pval = valbuf;
  374|   115k|            } else if (pattr >= attrbuf + JSON_ATTR_MAX - 1) {
  ------------------
  |  |  134|   115k|#define JSON_ATTR_MAX   31      // max chars in JSON attribute name
  ------------------
  |  Branch (374:24): [True: 26, False: 115k]
  ------------------
  375|     26|                json_debug_trace(1, "json: %s","Attribute name too long.\n");
  ------------------
  |  |  108|     26|    do {                                              \
  |  |  109|     26|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     26|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 26]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 26]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     26|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     26|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 26]
  |  |  ------------------
  ------------------
  376|       |                // don't update end here, leave at attribute start
  377|     26|                return JSON_ERR_ATTRLEN;
  ------------------
  |  |  155|     26|#define JSON_ERR_ATTRLEN        4      // attribute name too long
  ------------------
  378|   115k|            } else {
  379|   115k|                *pattr++ = *cp;
  380|   115k|            }
  381|   149k|            break;
  382|   149k|        case await_value:
  ------------------
  |  Branch (382:9): [True: 36.2k, False: 499k]
  ------------------
  383|  36.2k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (383:17): [True: 202, False: 36.0k]
  ------------------
  384|  36.0k|                *cp == ':') {
  ------------------
  |  Branch (384:17): [True: 1.93k, False: 34.1k]
  ------------------
  385|  2.13k|                continue;
  386|  2.13k|            }
  387|  34.1k|            if (*cp == '[') {
  ------------------
  |  Branch (387:17): [True: 2.01k, False: 32.1k]
  ------------------
  388|  2.01k|                if (cursor->type == t_ignore) {
  ------------------
  |  Branch (388:21): [True: 1.23k, False: 785]
  ------------------
  389|       |                    /* skip to terminating ], not being fooled by
  390|       |                     * sub arrays, etc.
  391|       |                     * FIXME:  someday  */
  392|  1.23k|                    state = in_ignore_array;;
  393|  1.23k|                    value_quoted = false;
  394|  1.23k|                    break;
  395|  1.23k|                }
  396|    785|                if (cursor->type != t_array) {
  ------------------
  |  Branch (396:21): [True: 32, False: 753]
  ------------------
  397|     32|                    json_debug_trace(1,"json: %s",
  ------------------
  |  |  108|     32|    do {                                              \
  |  |  109|     32|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     32|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 32]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 32]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     32|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     32|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 32]
  |  |  ------------------
  ------------------
  398|     32|                                      "Saw [ when not expecting array.\n");
  399|     32|                    if (NULL != end) {
  ------------------
  |  Branch (399:25): [True: 5, False: 27]
  ------------------
  400|      5|                        *end = cp;
  401|      5|                    }
  402|     32|                    return JSON_ERR_NOARRAY;
  ------------------
  |  |  156|     32|#define JSON_ERR_NOARRAY        5      // saw [ when not expecting array
  ------------------
  403|     32|                }
  404|    753|                substatus = json_read_array(cp, &cursor->addr.array, &cp);
  405|    753|                if (substatus != 0) {
  ------------------
  |  Branch (405:21): [True: 244, False: 509]
  ------------------
  406|    244|                    return substatus;
  407|    244|                }
  408|    509|                state = post_element;
  409|  32.1k|            } else if (cursor->type == t_array) {
  ------------------
  |  Branch (409:24): [True: 1, False: 32.1k]
  ------------------
  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|  32.1k|            } else if (*cp == '"') {
  ------------------
  |  Branch (416:24): [True: 7.92k, False: 24.1k]
  ------------------
  417|  7.92k|                value_quoted = true;
  418|  7.92k|                state = in_val_string;
  419|  7.92k|                pval = valbuf;
  420|  24.1k|            } else {
  421|  24.1k|                value_quoted = false;
  422|  24.1k|                state = in_val_token;
  423|  24.1k|                pval = valbuf;
  424|  24.1k|                *pval++ = *cp;
  425|  24.1k|            }
  426|  32.6k|            break;
  427|  81.2k|        case in_ignore_array:
  ------------------
  |  Branch (427:9): [True: 81.2k, False: 454k]
  ------------------
  428|  81.2k|            if (*cp == '"') {
  ------------------
  |  Branch (428:17): [True: 18.7k, False: 62.5k]
  ------------------
  429|  18.7k|                if (value_quoted == false) {
  ------------------
  |  Branch (429:21): [True: 9.42k, False: 9.31k]
  ------------------
  430|       |                    // now in quotes
  431|  9.42k|                    value_quoted = true;
  432|  9.42k|                } else {
  433|  9.31k|                    value_quoted = false;
  434|  9.31k|                }
  435|  62.5k|            } else if (*cp == ']') {
  ------------------
  |  Branch (435:24): [True: 1.17k, False: 61.3k]
  ------------------
  436|       |                // FIXME: does not handle sub arrays, etc.
  437|  1.17k|                if (value_quoted == false) {
  ------------------
  |  Branch (437:21): [True: 924, False: 247]
  ------------------
  438|    924|                    state = post_val;
  439|    924|                }
  440|       |                // else in quotes, ignore it.
  441|  1.17k|            }
  442|  81.2k|            break;
  443|  61.4k|        case in_val_string:
  ------------------
  |  Branch (443:9): [True: 61.4k, False: 473k]
  ------------------
  444|  61.4k|            if (NULL == pval) {
  ------------------
  |  Branch (444:17): [True: 0, False: 61.4k]
  ------------------
  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|  61.4k|            if (*cp == '\\') {
  ------------------
  |  Branch (448:17): [True: 1.57k, False: 59.8k]
  ------------------
  449|  1.57k|                state = in_escape;
  450|  59.8k|            } else if (*cp == '"') {
  ------------------
  |  Branch (450:24): [True: 7.49k, False: 52.3k]
  ------------------
  451|  7.49k|                *pval++ = '\0';
  452|  7.49k|                json_debug_trace(1, "json: Collected string value %s\n", valbuf);
  ------------------
  |  |  108|  7.49k|    do {                                              \
  |  |  109|  7.49k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  7.49k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 7.49k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 7.49k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  7.49k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  7.49k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 7.49k]
  |  |  ------------------
  ------------------
  453|  7.49k|                state = post_val;
  454|  52.3k|            } else if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  52.3k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (454:24): [True: 2, False: 52.3k]
  ------------------
  455|  52.3k|                       pval > valbuf + maxlen - 1) {
  ------------------
  |  Branch (455:24): [True: 112, False: 52.2k]
  ------------------
  456|    114|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|    114|    do {                                              \
  |  |  109|    114|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    114|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 114]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 114]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    114|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    114|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 114]
  |  |  ------------------
  ------------------
  457|       |                // don't update end here, leave at value start
  458|    114|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|    114|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  459|  52.2k|            } else {
  460|  52.2k|                *pval++ = *cp;
  461|  52.2k|            }
  462|  61.3k|            break;
  463|  61.3k|        case in_escape:
  ------------------
  |  Branch (463:9): [True: 1.56k, False: 533k]
  ------------------
  464|  1.56k|            if (NULL == pval) {
  ------------------
  |  Branch (464:17): [True: 0, False: 1.56k]
  ------------------
  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.56k|            if (pval > valbuf + JSON_VAL_MAX - 1 ||
  ------------------
  |  |  135|  1.56k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (468:17): [True: 3, False: 1.56k]
  ------------------
  469|  1.56k|                pval > valbuf + maxlen) {
  ------------------
  |  Branch (469:17): [True: 12, False: 1.55k]
  ------------------
  470|     15|                json_debug_trace(1, "json: %s",  "String value too long.\n");
  ------------------
  |  |  108|     15|    do {                                              \
  |  |  109|     15|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     15|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 15]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 15]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     15|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     15|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 15]
  |  |  ------------------
  ------------------
  471|       |                // don't update end here, leave at value start
  472|     15|                return JSON_ERR_STRLONG;
  ------------------
  |  |  158|     15|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  473|     15|            }
  474|  1.55k|            switch (*cp) {
  475|    199|            case 'b':
  ------------------
  |  Branch (475:13): [True: 199, False: 1.35k]
  ------------------
  476|    199|                *pval++ = '\b';
  477|    199|                break;
  478|    194|            case 'f':
  ------------------
  |  Branch (478:13): [True: 194, False: 1.35k]
  ------------------
  479|    194|                *pval++ = '\f';
  480|    194|                break;
  481|    204|            case 'n':
  ------------------
  |  Branch (481:13): [True: 204, False: 1.34k]
  ------------------
  482|    204|                *pval++ = '\n';
  483|    204|                break;
  484|    179|            case 'r':
  ------------------
  |  Branch (484:13): [True: 179, False: 1.37k]
  ------------------
  485|    179|                *pval++ = '\r';
  486|    179|                break;
  487|    382|            case 't':
  ------------------
  |  Branch (487:13): [True: 382, False: 1.16k]
  ------------------
  488|    382|                *pval++ = '\t';
  489|    382|                break;
  490|    287|            case 'u':
  ------------------
  |  Branch (490:13): [True: 287, False: 1.26k]
  ------------------
  491|    287|                {
  492|    287|                    unsigned n;
  493|       |
  494|    287|                    cp++;                   // skip the 'u'
  495|       |                    // NetBSD 6 wants the cast
  496|  1.13k|                    for (n = 0; n < 4 && isxdigit((int)*cp); n++) {
  ------------------
  |  Branch (496:33): [True: 943, False: 195]
  |  Branch (496:42): [True: 851, False: 92]
  ------------------
  497|    851|                        uescape[n] = *cp++;
  498|    851|                    }
  499|    287|                    uescape[n] = '\0';      // terminate
  500|    287|                    --cp;
  501|       |                    // ECMA-404 says JSON \u must have 4 hex digits
  502|    287|                    if ((4 != n) ||
  ------------------
  |  Branch (502:25): [True: 92, False: 195]
  ------------------
  503|    195|                        (1 != sscanf(uescape, "%4x", &u))) {
  ------------------
  |  Branch (503:25): [True: 0, False: 195]
  ------------------
  504|     92|                        return JSON_ERR_BADSTRING;
  ------------------
  |  |  166|     92|#define JSON_ERR_BADSTRING     15      // error while string parsing
  ------------------
  505|     92|                    }
  506|       |                    // truncate values above 0xff
  507|    195|                    *pval++ = (unsigned char)u;
  508|    195|                }
  509|      0|                break;
  510|    106|            default:            // handles double quote and solidus
  ------------------
  |  Branch (510:13): [True: 106, False: 1.44k]
  ------------------
  511|    106|                *pval++ = *cp;
  512|    106|                break;
  513|  1.55k|            }
  514|  1.45k|            state = in_val_string;
  515|  1.45k|            break;
  516|   128k|        case in_val_token:
  ------------------
  |  Branch (516:9): [True: 128k, False: 406k]
  ------------------
  517|   128k|            if (NULL == pval) {
  ------------------
  |  Branch (517:17): [True: 0, False: 128k]
  ------------------
  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|   128k|            if (isspace((unsigned char) *cp) ||
  ------------------
  |  Branch (521:17): [True: 184, False: 128k]
  ------------------
  522|   128k|                *cp == ',' ||
  ------------------
  |  Branch (522:17): [True: 19.2k, False: 109k]
  ------------------
  523|   109k|                *cp == '}') {
  ------------------
  |  Branch (523:17): [True: 4.59k, False: 104k]
  ------------------
  524|  24.0k|                *pval = '\0';
  525|  24.0k|                json_debug_trace(1, "json: Collected token valuen %s\n",
  ------------------
  |  |  108|  24.0k|    do {                                              \
  |  |  109|  24.0k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  24.0k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 24.0k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 24.0k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  24.0k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  24.0k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 24.0k]
  |  |  ------------------
  ------------------
  526|  24.0k|                                 valbuf);
  527|  24.0k|                state = post_val;
  528|  24.0k|                if (*cp == '}' ||
  ------------------
  |  Branch (528:21): [True: 4.59k, False: 19.4k]
  ------------------
  529|  23.8k|                    *cp == ',') {
  ------------------
  |  Branch (529:21): [True: 19.2k, False: 184]
  ------------------
  530|  23.8k|                    --cp;
  531|  23.8k|                }
  532|   104k|            } else if (pval > valbuf + JSON_VAL_MAX - 1) {
  ------------------
  |  |  135|   104k|#define JSON_VAL_MAX    512     // max chars in JSON value part
  ------------------
  |  Branch (532:24): [True: 9, False: 104k]
  ------------------
  533|      9|                json_debug_trace(1, "json: %s", "Token value too long.\n");
  ------------------
  |  |  108|      9|    do {                                              \
  |  |  109|      9|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|      9|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 9]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 9]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|      9|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|      9|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 9]
  |  |  ------------------
  ------------------
  534|       |                // don't update end here, leave at value start
  535|      9|                return JSON_ERR_TOKLONG;
  ------------------
  |  |  159|      9|#define JSON_ERR_TOKLONG        8      // token value too long
  ------------------
  536|   104k|            } else {
  537|   104k|                *pval++ = *cp;
  538|   104k|            }
  539|   128k|            break;
  540|       |            // coverity[unterminated_case]
  541|   128k|        case post_val:
  ------------------
  |  Branch (541:9): [True: 31.6k, False: 503k]
  ------------------
  542|       |            // Ignore whitespace after either string or token values.
  543|  31.6k|	  if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (543:8): [True: 260, False: 31.3k]
  ------------------
  544|  1.03k|                while (*cp != '\0' && isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (544:24): [True: 1.01k, False: 20]
  |  Branch (544:39): [True: 774, False: 240]
  ------------------
  545|    774|                    ++cp;
  546|    774|                }
  547|    260|                json_debug_trace(1,
  ------------------
  |  |  108|    260|    do {                                              \
  |  |  109|    260|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    260|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 260]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 260]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    260|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    260|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 260]
  |  |  ------------------
  ------------------
  548|    260|                    "json: Skipped trailing whitespace: value \"%s\"\n", valbuf);
  549|    260|            }
  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|  31.6k|            for (;;) {
  559|  31.6k|                int seeking = cursor->type;
  560|       |
  561|  31.6k|                if (value_quoted &&
  ------------------
  |  Branch (561:21): [True: 6.75k, False: 24.8k]
  ------------------
  562|  6.75k|                    (cursor->type == t_string ||
  ------------------
  |  Branch (562:22): [True: 1.06k, False: 5.69k]
  ------------------
  563|  5.69k|                     cursor->type == t_time)) {
  ------------------
  |  Branch (563:22): [True: 1.56k, False: 4.12k]
  ------------------
  564|  2.63k|                    break;
  565|  2.63k|                }
  566|  28.9k|                if ((strcmp(valbuf, "true") == 0 ||
  ------------------
  |  Branch (566:22): [True: 2.36k, False: 26.6k]
  ------------------
  567|  26.6k|                     strcmp(valbuf, "false") == 0) &&
  ------------------
  |  Branch (567:22): [True: 83, False: 26.5k]
  ------------------
  568|  2.44k|                    seeking == t_boolean) {
  ------------------
  |  Branch (568:21): [True: 2.05k, False: 392]
  ------------------
  569|  2.05k|                    break;
  570|  2.05k|                }
  571|  26.9k|                if (isdigit((unsigned char) valbuf[0])) {
  ------------------
  |  Branch (571:21): [True: 14.1k, False: 12.7k]
  ------------------
  572|  14.1k|                    bool decimal = strchr(valbuf, '.') != NULL;
  573|       |
  574|  14.1k|                    if (decimal &&
  ------------------
  |  Branch (574:25): [True: 1.08k, False: 13.0k]
  ------------------
  575|  1.08k|                        seeking == t_real) {
  ------------------
  |  Branch (575:25): [True: 361, False: 723]
  ------------------
  576|    361|                        break;
  577|    361|                    }
  578|  13.7k|                    if (!decimal && (seeking == t_byte ||
  ------------------
  |  Branch (578:25): [True: 13.0k, False: 723]
  |  Branch (578:38): [True: 188, False: 12.8k]
  ------------------
  579|  12.8k|                                     seeking == t_ubyte ||
  ------------------
  |  Branch (579:38): [True: 270, False: 12.6k]
  ------------------
  580|  12.6k|                                     seeking == t_integer ||
  ------------------
  |  Branch (580:38): [True: 621, False: 11.9k]
  ------------------
  581|  11.9k|                                     seeking == t_uinteger ||
  ------------------
  |  Branch (581:38): [True: 704, False: 11.2k]
  ------------------
  582|  11.2k|                                     seeking == t_longint ||
  ------------------
  |  Branch (582:38): [True: 656, False: 10.6k]
  ------------------
  583|  10.6k|                                     seeking == t_ulongint ||
  ------------------
  |  Branch (583:38): [True: 177, False: 10.4k]
  ------------------
  584|  10.4k|                                     seeking == t_time ||
  ------------------
  |  Branch (584:38): [True: 108, False: 10.3k]
  ------------------
  585|  10.3k|                                     seeking == t_short ||
  ------------------
  |  Branch (585:38): [True: 1.41k, False: 8.93k]
  ------------------
  586|  8.93k|                                     seeking == t_ushort))
  ------------------
  |  Branch (586:38): [True: 0, False: 8.93k]
  ------------------
  587|  4.13k|                        break;
  588|  13.7k|                }
  589|  22.4k|                if (NULL == cursor[1].attribute) {  // out of possibilities
  ------------------
  |  Branch (589:21): [True: 15.1k, False: 7.28k]
  ------------------
  590|  15.1k|                    break;
  591|  15.1k|                }
  592|  7.28k|                if (0 != strcmp(cursor[1].attribute, attrbuf)) {
  ------------------
  |  Branch (592:21): [True: 7.28k, False: 0]
  ------------------
  593|  7.28k|                    break;
  594|  7.28k|                }
  595|      0|                ++cursor;
  596|      0|            }
  597|  31.6k|            if (value_quoted &&
  ------------------
  |  Branch (597:17): [True: 6.75k, False: 24.8k]
  ------------------
  598|  6.75k|                (cursor->type != t_string &&
  ------------------
  |  Branch (598:18): [True: 5.69k, False: 1.06k]
  ------------------
  599|  5.69k|                 cursor->type != t_character &&
  ------------------
  |  Branch (599:18): [True: 5.49k, False: 198]
  ------------------
  600|  5.49k|                 cursor->type != t_check &&
  ------------------
  |  Branch (600:18): [True: 4.81k, False: 676]
  ------------------
  601|  4.81k|                 cursor->type != t_time &&
  ------------------
  |  Branch (601:18): [True: 3.24k, False: 1.56k]
  ------------------
  602|  3.24k|                 cursor->type != t_ignore &&
  ------------------
  |  Branch (602:18): [True: 447, False: 2.80k]
  ------------------
  603|    447|                 cursor->map == 0)) {
  ------------------
  |  Branch (603:18): [True: 21, False: 426]
  ------------------
  604|     21|                json_debug_trace(1, "json: %s", "Saw quoted value when expecting"
  ------------------
  |  |  108|     21|    do {                                              \
  |  |  109|     21|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     21|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 21]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 21]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     21|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     21|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 21]
  |  |  ------------------
  ------------------
  605|     21|                                  " non-string.\n");
  606|     21|                return JSON_ERR_QNONSTRING;
  ------------------
  |  |  170|     21|#define JSON_ERR_QNONSTRING    19      // quoted value when expecting nonstring
  ------------------
  607|     21|            }
  608|  31.6k|            if (!value_quoted &&
  ------------------
  |  Branch (608:17): [True: 24.8k, False: 6.73k]
  ------------------
  609|  24.8k|                (cursor->type == t_string ||
  ------------------
  |  Branch (609:18): [True: 19, False: 24.8k]
  ------------------
  610|  24.8k|                 cursor->type == t_check ||
  ------------------
  |  Branch (610:18): [True: 30, False: 24.8k]
  ------------------
  611|  24.8k|                 cursor->map != 0)) {
  ------------------
  |  Branch (611:18): [True: 6, False: 24.8k]
  ------------------
  612|     55|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|     55|    do {                                              \
  |  |  109|     55|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     55|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 55]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 55]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     55|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     55|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 55]
  |  |  ------------------
  ------------------
  613|     55|                                 "Didn't see quoted value when expecting"
  614|     55|                                 " string.\n");
  615|     55|                return JSON_ERR_NONQSTRING;
  ------------------
  |  |  171|     55|#define JSON_ERR_NONQSTRING    20      // no quoted value when expecting string
  ------------------
  616|     55|            }
  617|  31.5k|            if (cursor->map != 0) {
  ------------------
  |  Branch (617:17): [True: 426, False: 31.1k]
  ------------------
  618|    847|                for (mp = cursor->map; mp->name != NULL; mp++)
  ------------------
  |  Branch (618:40): [True: 787, False: 60]
  ------------------
  619|    787|                    if (strcmp(mp->name, valbuf) == 0) {
  ------------------
  |  Branch (619:25): [True: 366, False: 421]
  ------------------
  620|    366|                        goto foundit;
  621|    366|                    }
  622|     60|                json_debug_trace(1,
  ------------------
  |  |  108|     60|    do {                                              \
  |  |  109|     60|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     60|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 60]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 60]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     60|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     60|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 60]
  |  |  ------------------
  ------------------
  623|     60|                                 "json: Invalid enumerated value string %s.\n",
  624|     60|                                  valbuf);
  625|     60|                return JSON_ERR_BADENUM;
  ------------------
  |  |  169|     60|#define JSON_ERR_BADENUM       18      // invalid enumerated value
  ------------------
  626|    366|              foundit:
  627|    366|                (void)snprintf(valbuf, sizeof(valbuf), "%d", mp->value);
  628|    366|            }
  629|  31.4k|            if (cursor->type == t_check) {
  ------------------
  |  Branch (629:17): [True: 676, False: 30.8k]
  ------------------
  630|    676|                lptr = cursor->dflt.check;
  631|  30.8k|            } else {
  632|  30.8k|                lptr = json_target_address(cursor, parent, offset);
  633|  30.8k|            }
  634|  31.4k|            if (NULL != lptr) {
  ------------------
  |  Branch (634:17): [True: 17.9k, False: 13.5k]
  ------------------
  635|  17.9k|                switch (cursor->type) {
  ------------------
  |  Branch (635:25): [True: 17.9k, False: 0]
  ------------------
  636|    207|                case t_byte:
  ------------------
  |  Branch (636:17): [True: 207, False: 17.7k]
  ------------------
  637|    207|                    {
  638|    207|                        int tmp = atoi(valbuf);
  639|    207|                        lptr[0] = (char)tmp;
  640|    207|                    }
  641|    207|                    break;
  642|    502|                case t_ubyte:
  ------------------
  |  Branch (642:17): [True: 502, False: 17.4k]
  ------------------
  643|    502|                    {
  644|    502|                        int tmp = atoi(valbuf);
  645|    502|                        lptr[0] = (unsigned char)tmp;
  646|    502|                    }
  647|    502|                    break;
  648|  1.15k|                case t_integer:
  ------------------
  |  Branch (648:17): [True: 1.15k, False: 16.8k]
  ------------------
  649|  1.15k|                    {
  650|  1.15k|                        int tmp = atoi(valbuf);
  651|  1.15k|                        memcpy(lptr, &tmp, sizeof(int));
  652|  1.15k|                    }
  653|  1.15k|                    break;
  654|    996|                case t_uinteger:
  ------------------
  |  Branch (654:17): [True: 996, False: 16.9k]
  ------------------
  655|    996|                    {
  656|    996|                        unsigned int tmp = (unsigned int)atol(valbuf);
  657|    996|                        memcpy(lptr, &tmp, sizeof(unsigned int));
  658|    996|                    }
  659|    996|                    break;
  660|    691|                case t_longint:
  ------------------
  |  Branch (660:17): [True: 691, False: 17.2k]
  ------------------
  661|    691|                    {
  662|    691|                        long tmp = atol(valbuf);
  663|    691|                        memcpy(lptr, &tmp, sizeof(long));
  664|    691|                    }
  665|    691|                    break;
  666|    194|                case t_ulongint:
  ------------------
  |  Branch (666:17): [True: 194, False: 17.7k]
  ------------------
  667|    194|                    {
  668|    194|                        unsigned long tmp = (unsigned long)atoll(valbuf);
  669|    194|                        memcpy(lptr, &tmp, sizeof(unsigned long));
  670|    194|                    }
  671|    194|                    break;
  672|  1.44k|                case t_short:
  ------------------
  |  Branch (672:17): [True: 1.44k, False: 16.5k]
  ------------------
  673|  1.44k|                    {
  674|  1.44k|                        short tmp = atoi(valbuf);
  675|  1.44k|                        memcpy(lptr, &tmp, sizeof(short));
  676|  1.44k|                    }
  677|  1.44k|                    break;
  678|      0|                case t_ushort:
  ------------------
  |  Branch (678:17): [True: 0, False: 17.9k]
  ------------------
  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|  1.94k|                case t_time:
  ------------------
  |  Branch (684:17): [True: 1.94k, False: 16.0k]
  ------------------
  685|  1.94k|                    {
  686|  1.94k|                        timespec_t ts_tmp = {0, 0};
  687|       |
  688|  1.94k|                        if (value_quoted) {
  ------------------
  |  Branch (688:29): [True: 1.56k, False: 377]
  ------------------
  689|  1.56k|                            ts_tmp = iso8601_to_timespec(valbuf);
  690|  1.56k|                        } else if (NULL == strchr(valbuf, '.')) {
  ------------------
  |  Branch (690:36): [True: 177, False: 200]
  ------------------
  691|       |                            // integer
  692|    177|                            ts_tmp.tv_sec = (time_t)atoll(valbuf);
  693|    200|                        } else {
  694|       |                            // real
  695|    200|                            double sec_tmp = safe_atof(valbuf);
  696|    200|                            if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (696:33): [True: 118, False: 82]
  ------------------
  697|    118|                                DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    118|    do { \
  |  |  145|    118|        double int_part; \
  |  |  146|    118|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    118|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    118|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 118]
  |  |  ------------------
  ------------------
  698|    118|                            }  // else, leave at default
  699|    200|                        }
  700|  1.94k|                        memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  701|  1.94k|                    }
  702|  1.94k|                    break;
  703|    399|                case t_timespec:
  ------------------
  |  Branch (703:17): [True: 399, False: 17.5k]
  ------------------
  704|    399|                    {
  705|    399|                        double sec_tmp = safe_atof(valbuf);
  706|    399|                        timespec_t ts_tmp;
  707|    399|                        if (0 != isfinite(sec_tmp)) {
  ------------------
  |  Branch (707:29): [True: 204, False: 195]
  ------------------
  708|    204|                            DTOTS(&ts_tmp, sec_tmp);
  ------------------
  |  |  144|    204|    do { \
  |  |  145|    204|        double int_part; \
  |  |  146|    204|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|    204|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|    204|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 204]
  |  |  ------------------
  ------------------
  709|    204|                            memcpy(lptr, &ts_tmp, sizeof(timespec_t));
  710|    204|                        } // else leave at .dflt
  711|    399|                    }
  712|    399|                    break;
  713|  4.39k|                case t_real:
  ------------------
  |  Branch (713:17): [True: 4.39k, False: 13.5k]
  ------------------
  714|  4.39k|                    {
  715|  4.39k|                        double tmp = safe_atof(valbuf);
  716|  4.39k|                        if (0 != isfinite(tmp)) {
  ------------------
  |  Branch (716:29): [True: 3.52k, False: 861]
  ------------------
  717|  3.52k|                            memcpy(lptr, &tmp, sizeof(double));
  718|  3.52k|                        } // else leave at .dflt
  719|  4.39k|                    }
  720|  4.39k|                    break;
  721|  1.06k|                case t_string:
  ------------------
  |  Branch (721:17): [True: 1.06k, False: 16.9k]
  ------------------
  722|  1.06k|                    if (NULL != parent &&
  ------------------
  |  Branch (722:25): [True: 384, False: 681]
  ------------------
  723|    384|                        parent->element_type != t_structobject &&
  ------------------
  |  Branch (723:25): [True: 0, False: 384]
  ------------------
  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.06k|                    (void)strlcpy(lptr, valbuf, cursor->len);
  728|  1.06k|                    break;
  729|  2.32k|                case t_boolean:
  ------------------
  |  Branch (729:17): [True: 2.32k, False: 15.6k]
  ------------------
  730|  2.32k|                    {
  731|  2.32k|                        bool tmp = (strcmp(valbuf, "true") == 0);
  732|  2.32k|                        memcpy(lptr, &tmp, sizeof(bool));
  733|  2.32k|                    }
  734|  2.32k|                    break;
  735|    446|                case t_character:
  ------------------
  |  Branch (735:17): [True: 446, False: 17.5k]
  ------------------
  736|    446|                    if (strnlen(valbuf, 2) > 1) {
  ------------------
  |  Branch (736:25): [True: 7, False: 439]
  ------------------
  737|       |                        // don't update end here, leave at value start
  738|      7|                        return JSON_ERR_STRLONG;
  ------------------
  |  |  158|      7|#define JSON_ERR_STRLONG        7      // string value too long
  ------------------
  739|    439|                    } else {
  740|    439|                        lptr[0] = valbuf[0];
  741|    439|                    }
  742|    439|                    break;
  743|  1.53k|                case t_ignore:  // silences a compiler warning
  ------------------
  |  Branch (743:17): [True: 1.53k, False: 16.4k]
  ------------------
  744|  1.53k|                    FALLTHROUGH
  ------------------
  |  |   55|  1.53k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  745|  1.53k|                case t_object:  // silences a compiler warning
  ------------------
  |  Branch (745:17): [True: 0, False: 17.9k]
  ------------------
  746|  1.53k|                    FALLTHROUGH
  ------------------
  |  |   55|  1.53k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  747|  1.53k|                case t_structobject:
  ------------------
  |  Branch (747:17): [True: 0, False: 17.9k]
  ------------------
  748|  1.53k|                    FALLTHROUGH
  ------------------
  |  |   55|  1.53k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  749|  1.53k|                case t_array:
  ------------------
  |  Branch (749:17): [True: 0, False: 17.9k]
  ------------------
  750|  1.53k|                    break;
  751|    676|                case t_check:
  ------------------
  |  Branch (751:17): [True: 676, False: 17.2k]
  ------------------
  752|    676|                    if (strcmp(cursor->dflt.check, valbuf) != 0) {
  ------------------
  |  Branch (752:25): [True: 152, False: 524]
  ------------------
  753|    152|                        json_debug_trace(1, "json: Required attribute value %s"
  ------------------
  |  |  108|    152|    do {                                              \
  |  |  109|    152|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    152|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 152]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 152]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    152|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    152|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 152]
  |  |  ------------------
  ------------------
  754|    152|                                          " not present.\n",
  755|    152|                                          cursor->dflt.check);
  756|       |                        // don't update end here, leave at start of attribute
  757|    152|                        return JSON_ERR_CHECKFAIL;
  ------------------
  |  |  167|    152|#define JSON_ERR_CHECKFAIL     16      // check attribute not matched
  ------------------
  758|    152|                    }
  759|    524|                    break;
  760|  17.9k|                }
  761|  17.9k|            }
  762|  31.3k|            FALLTHROUGH
  ------------------
  |  |   55|  31.3k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  763|  32.1k|        case post_element:
  ------------------
  |  Branch (763:9): [True: 788, False: 534k]
  ------------------
  764|  32.1k|            if (isspace((unsigned char) *cp)) {
  ------------------
  |  Branch (764:17): [True: 331, False: 31.7k]
  ------------------
  765|    331|                continue;
  766|    331|            }
  767|  31.7k|            if (*cp == ',') {
  ------------------
  |  Branch (767:17): [True: 26.4k, False: 5.39k]
  ------------------
  768|  26.4k|                state = await_attr;
  769|  26.4k|            } else if (*cp == '}') {
  ------------------
  |  Branch (769:24): [True: 4.90k, False: 485]
  ------------------
  770|  4.90k|                ++cp;
  771|  4.90k|                goto good_parse;
  772|  4.90k|            } else {
  773|    485|                json_debug_trace(1, "json: %s",
  ------------------
  |  |  108|    485|    do {                                              \
  |  |  109|    485|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|    485|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 485]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 485]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|    485|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|    485|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 485]
  |  |  ------------------
  ------------------
  774|    485|                                "Garbage while expecting comma or }\n");
  775|    485|                if (NULL != end) {
  ------------------
  |  Branch (775:21): [True: 28, False: 457]
  ------------------
  776|     28|                    *end = cp;
  777|     28|                }
  778|    485|                return JSON_ERR_BADTRAIL;
  ------------------
  |  |  160|    485|#define JSON_ERR_BADTRAIL       9      // garbage expecting comma or } or ]
  ------------------
  779|    485|            }
  780|  26.4k|            break;
  781|   535k|        }
  782|   535k|    }
  783|  2.35k|    if (state == init) {
  ------------------
  |  Branch (783:9): [True: 29, False: 2.32k]
  ------------------
  784|     29|        json_debug_trace(1, "json: %s", "Input was empty or white-space only\n");
  ------------------
  |  |  108|     29|    do {                                              \
  |  |  109|     29|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|     29|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 29]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 29]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|     29|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|     29|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 29]
  |  |  ------------------
  ------------------
  785|     29|        return JSON_ERR_EMPTY;
  ------------------
  |  |  176|     29|#define JSON_ERR_EMPTY         25      // input was empty or white-space only
  ------------------
  786|     29|    }
  787|       |
  788|  7.23k|  good_parse:
  789|       |    // in case there's another object following, consume trailing WS
  790|  7.23k|    while (isspace((unsigned char)*cp)) {
  ------------------
  |  Branch (790:12): [True: 37, False: 7.23k]
  ------------------
  791|     37|        ++cp;
  792|     37|    }
  793|  7.23k|    if (NULL != end) {
  ------------------
  |  Branch (793:9): [True: 4.52k, False: 2.71k]
  ------------------
  794|  4.52k|        *end = cp;
  795|  4.52k|    }
  796|  7.23k|    json_debug_trace(1, "%s", "json: JSON parse ends.\n");
  ------------------
  |  |  108|  7.23k|    do {                                              \
  |  |  109|  7.23k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|  7.23k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 7.23k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 7.23k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|  7.23k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|  7.23k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 7.23k]
  |  |  ------------------
  ------------------
  797|  7.23k|    return 0;
  798|  2.35k|}
json.c:json_target_address:
  119|   154k|{
  120|   154k|    char *targetaddr = NULL;
  121|   154k|    if (NULL == parent ||
  ------------------
  |  Branch (121:9): [True: 82.6k, False: 71.7k]
  ------------------
  122|  82.6k|        parent->element_type != t_structobject) {
  ------------------
  |  Branch (122:9): [True: 0, False: 71.7k]
  ------------------
  123|       |        // ordinary case - use the address in the cursor structure
  124|  82.6k|        switch (cursor->type) {
  125|      0|        case t_byte:
  ------------------
  |  Branch (125:9): [True: 0, False: 82.6k]
  ------------------
  126|      0|            targetaddr = (char *)&cursor->addr.byte[offset];
  127|      0|            break;
  128|    525|        case t_ubyte:
  ------------------
  |  Branch (128:9): [True: 525, False: 82.1k]
  ------------------
  129|    525|            targetaddr = (char *)&cursor->addr.ubyte[offset];
  130|    525|            break;
  131|  17.1k|        case t_ignore:
  ------------------
  |  Branch (131:9): [True: 17.1k, False: 65.4k]
  ------------------
  132|  17.1k|            targetaddr = NULL;
  133|  17.1k|            break;
  134|  14.1k|        case t_integer:
  ------------------
  |  Branch (134:9): [True: 14.1k, False: 68.4k]
  ------------------
  135|  14.1k|            targetaddr = (char *)&cursor->addr.integer[offset];
  136|  14.1k|            break;
  137|  5.66k|        case t_uinteger:
  ------------------
  |  Branch (137:9): [True: 5.66k, False: 76.9k]
  ------------------
  138|  5.66k|            targetaddr = (char *)&cursor->addr.uinteger[offset];
  139|  5.66k|            break;
  140|  1.33k|        case t_longint:
  ------------------
  |  Branch (140:9): [True: 1.33k, False: 81.2k]
  ------------------
  141|  1.33k|            targetaddr = (char *)&cursor->addr.longint[offset];
  142|  1.33k|            break;
  143|    313|        case t_ulongint:
  ------------------
  |  Branch (143:9): [True: 313, False: 82.3k]
  ------------------
  144|    313|            targetaddr = (char *)&cursor->addr.ulongint[offset];
  145|    313|            break;
  146|      0|        case t_short:
  ------------------
  |  Branch (146:9): [True: 0, False: 82.6k]
  ------------------
  147|      0|            targetaddr = (char *)&cursor->addr.shortint[offset];
  148|      0|            break;
  149|      0|        case t_ushort:
  ------------------
  |  Branch (149:9): [True: 0, False: 82.6k]
  ------------------
  150|      0|            targetaddr = (char *)&cursor->addr.ushortint[offset];
  151|      0|            break;
  152|  2.77k|        case t_time:
  ------------------
  |  Branch (152:9): [True: 2.77k, False: 79.8k]
  ------------------
  153|  2.77k|            targetaddr = (char *)&cursor->addr.ts[offset];
  154|  2.77k|            break;
  155|      0|        case t_timespec:
  ------------------
  |  Branch (155:9): [True: 0, False: 82.6k]
  ------------------
  156|      0|            targetaddr = (char *)&cursor->addr.ts[offset];
  157|      0|            break;
  158|  27.8k|        case t_real:
  ------------------
  |  Branch (158:9): [True: 27.8k, False: 54.8k]
  ------------------
  159|  27.8k|            targetaddr = (char *)&cursor->addr.real[offset];
  160|  27.8k|            break;
  161|  5.87k|        case t_string:
  ------------------
  |  Branch (161:9): [True: 5.87k, False: 76.7k]
  ------------------
  162|  5.87k|            targetaddr = cursor->addr.string;
  163|  5.87k|            break;
  164|  1.38k|        case t_boolean:
  ------------------
  |  Branch (164:9): [True: 1.38k, False: 81.2k]
  ------------------
  165|  1.38k|            targetaddr = (char *)&cursor->addr.boolean[offset];
  166|  1.38k|            break;
  167|    940|        case t_character:
  ------------------
  |  Branch (167:9): [True: 940, False: 81.6k]
  ------------------
  168|    940|            targetaddr = (char *)&cursor->addr.character[offset];
  169|    940|            break;
  170|    520|        case t_array:
  ------------------
  |  Branch (170:9): [True: 520, False: 82.1k]
  ------------------
  171|    520|            FALLTHROUGH
  ------------------
  |  |   55|    520|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  172|  4.66k|        case t_check:
  ------------------
  |  Branch (172:9): [True: 4.14k, False: 78.4k]
  ------------------
  173|  4.66k|            FALLTHROUGH
  ------------------
  |  |   55|  4.66k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  174|  4.66k|        case t_object:
  ------------------
  |  Branch (174:9): [True: 0, False: 82.6k]
  ------------------
  175|  4.66k|            FALLTHROUGH
  ------------------
  |  |   55|  4.66k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  176|  4.66k|        case t_structobject:
  ------------------
  |  Branch (176:9): [True: 0, False: 82.6k]
  ------------------
  177|  4.66k|            FALLTHROUGH
  ------------------
  |  |   55|  4.66k|        #define FALLTHROUGH __attribute__((fallthrough));
  ------------------
  178|  4.66k|        default:
  ------------------
  |  Branch (178:9): [True: 0, False: 82.6k]
  ------------------
  179|  4.66k|            targetaddr = NULL;
  180|  4.66k|            break;
  181|  82.6k|        }
  182|  82.6k|    } else {
  183|       |        // tricky case - hacking a member in an array of structures
  184|  71.7k|        targetaddr =
  185|  71.7k|            parent->arr.objects.base + (offset * parent->arr.objects.stride) +
  186|  71.7k|            cursor->addr.offset;
  187|  71.7k|    }
  188|   154k|    json_debug_trace(1, "json: Target address for %s (offset %d) is %p\n",
  ------------------
  |  |  108|   154k|    do {                                              \
  |  |  109|   154k|        if (unlikely((lvl) <= debuglevel &&           \
  |  |  ------------------
  |  |  |  |  136|   154k|    #define unlikely(x)     __builtin_expect(!!(x), 0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (136:29): [True: 0, False: 154k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 154k]
  |  |  |  |  |  Branch (136:49): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  110|   154k|                      NULL != debugjsfp) ) {            \
  |  |  111|      0|            json_trace(fmt, __VA_ARGS__);              \
  |  |  112|      0|        }                                             \
  |  |  113|   154k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (113:14): [Folded, False: 154k]
  |  |  ------------------
  ------------------
  189|   154k|                      cursor->attribute, offset, targetaddr);
  190|   154k|    return targetaddr;
  191|   154k|}

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

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

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

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

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: 15, False: 4]
  ------------------
   76|     15|        return status;
   77|     15|    }
   78|       |
   79|      4|    if (0 == isfinite(d_cycle)) {
  ------------------
  |  Branch (79:9): [True: 2, False: 2]
  ------------------
   80|      2|        dev->cycle.tv_sec = 0;
   81|      2|        dev->cycle.tv_nsec = 0;
   82|      2|    } else {
   83|      2|        DTOTS(&dev->cycle, d_cycle);
  ------------------
  |  |  144|      2|    do { \
  |  |  145|      2|        double int_part; \
  |  |  146|      2|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      2|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      2|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 2]
  |  |  ------------------
  ------------------
   84|      2|    }
   85|      4|    if (0 == isfinite(d_mincycle)) {
  ------------------
  |  Branch (85:9): [True: 3, False: 1]
  ------------------
   86|      3|        dev->mincycle.tv_sec = 0;
   87|      3|        dev->mincycle.tv_nsec = 0;
   88|      3|    } else {
   89|      1|        DTOTS(&dev->mincycle, d_mincycle);
  ------------------
  |  |  144|      1|    do { \
  |  |  145|      1|        double int_part; \
  |  |  146|      1|        (ts)->tv_nsec = (long)(modf(d, &int_part) * 1e9); \
  |  |  147|      1|        (ts)->tv_sec = (time_t)int_part; \
  |  |  148|      1|    } while (0)
  |  |  ------------------
  |  |  |  Branch (148:14): [Folded, False: 1]
  |  |  ------------------
  ------------------
   90|      1|    }
   91|       |
   92|      4|    return 0;
   93|     19|}
json_watch_read:
   98|     36|{
   99|       |    // *INDENT-OFF*
  100|     36|    struct json_attr_t chanconfig_attrs[] = {
  101|     36|        {"class",          t_check,    .dflt.check = "WATCH"},
  102|       |
  103|     36|        {"device",         t_string,   .addr.string = ccp->devpath,
  104|     36|                                          .len = sizeof(ccp->devpath)},
  105|     36|        {"enable",         t_boolean,  .addr.boolean = &ccp->watcher,
  106|     36|                                          .dflt.boolean = true},
  107|     36|        {"json",           t_boolean,  .addr.boolean = &ccp->json,
  108|     36|                                          .nodefault = true},
  109|     36|        {"nmea",           t_boolean,  .addr.boolean = &ccp->nmea,
  110|     36|                                          .nodefault = true},
  111|     36|        {"pps",            t_boolean,  .addr.boolean = &ccp->pps},
  112|     36|        {"raw",            t_integer,  .addr.integer = &ccp->raw,
  113|     36|                                          .nodefault = true},
  114|     36|        {"remote",         t_string,   .addr.string = ccp->remote,
  115|     36|                                          .len = sizeof(ccp->remote)},
  116|     36|        {"scaled",         t_boolean,  .addr.boolean = &ccp->scaled},
  117|     36|        {"split24",        t_boolean,  .addr.boolean = &ccp->split24},
  118|     36|        {"timing",         t_boolean,  .addr.boolean = &ccp->timing},
  119|       |        // ignore unknown keys, for cross-version compatibility
  120|     36|        {"", t_ignore},
  121|     36|        {NULL},
  122|     36|    };
  123|       |    // *INDENT-ON*
  124|     36|    int status;
  125|       |
  126|     36|    status = json_read_object(buf, chanconfig_attrs, endptr);
  127|     36|    return status;
  128|     36|}

