read_2004_section_summary (Bit_Chain *restrict dat, Dwg_Data *restrict dwg)
{
  Bit_Chain old_dat, sec_dat = { 0 };
  int error = 0;

  // not compressed, page size: 0x100
  error
      = read_2004_compressed_section (dat, dwg, &sec_dat, SECTION_SUMMARYINFO);
  if (error >= DWG_ERR_CRITICAL)
    {
      LOG_ERROR ("Failed to read uncompressed %s section", "SummaryInfo");
      return error;
    }
  if (dwg->header.summaryinfo_address != (BITCODE_RL)dat->byte)
    LOG_WARN ("summaryinfo_address mismatch: " FORMAT_RL " != %lu",
              dwg->header.summaryinfo_address, dat->byte);
  LOG_TRACE ("SummaryInfo\n-------------------\n")
  old_dat = *dat;
  dat = &sec_dat; // restrict in size

  error = summaryinfo_private (dat, dwg);

  if (sec_dat.chain)
    free (sec_dat.chain);
  *dat = old_dat; // unrestrict
  return error;
}
read_2004_section_summary (Bit_Chain *restrict dat, Dwg_Data *restrict dwg)
{
  Bit_Chain old_dat, sec_dat = { 0 };
  int error = 0;

   
  error
      = read_2004_compressed_section (dat, dwg, &sec_dat, SECTION_SUMMARYINFO);
  if (error >= DWG_ERR_CRITICAL)
    {
      LOG_ERROR ("Failed to read uncompressed %s section", "SummaryInfo");
      return error;
    }
  if (dwg->header.summaryinfo_address != (BITCODE_RL)dat->byte)
    LOG_WARN ("summaryinfo_address mismatch: " FORMAT_RL " != %lu",
              dwg->header.summaryinfo_address, dat->byte);
  LOG_TRACE ("SummaryInfo\n-------------------\n")
  old_dat = *dat;
  dat = &sec_dat;  

  error = summaryinfo_private (dat, dwg);

  if (sec_dat.chain)
    free (sec_dat.chain);
  *dat = old_dat;  
  return error;
}