bit_read_CRC (Bit_Chain *dat)
{
  uint16_t result;
  long unsigned int start_address;
  loglevel = dat->opts & DWG_OPTS_LOGLEVEL;

  if (dat->bit > 0)
    {
      dat->byte++;
      dat->bit = 0;
    }
  start_address = dat->byte;
  result = bit_read_RS (dat);
  LOG_TRACE ("read CRC at %lu: %04X\n", start_address, result)

  return result;
}
bit_read_CRC (Bit_Chain *dat)
{
  uint16_t result;
  long unsigned int start_address;
  loglevel = dat->opts & DWG_OPTS_LOGLEVEL;

  if (dat->bit > 0)
    {
      dat->byte++;
      dat->bit = 0;
    }
  start_address = dat->byte;
  result = bit_read_RS (dat);
  LOG_TRACE ("read CRC at %lu: %04X\n", start_address, result)

  return result;
}