void sentinelAfterMainBlkx()

in dmg/attribution.c [130:184]


void sentinelAfterMainBlkx(AbstractAttribution* attribution, AbstractFile* abstractOut, ChecksumToken* dataForkToken, AttributionResource* attributionResource) {
  AttributionPreservingSentinelData* data = attribution->data;

  // Sentinels no longer make sense.
  if (data->raw_UncompressedLength < 0) {
    data->raw_UncompressedLength = 0;
  }
  if (data->afterRaw_UncompressedLength < 0) {
    data->afterRaw_UncompressedLength = 0;
  }
  if (data->raw_CompressedLength < 0) {
    data->raw_CompressedLength = 0;
  }
  if (data->afterRaw_CompressedLength < 0) {
    data->afterRaw_CompressedLength = 0;
  }

  printf("\n");
  printf("data->beforeRaw_UncompressedChkToken CRC32: 0x%x, length: 0x%llx\n", data->beforeRaw_UncompressedChkToken.crc, data->beforeRaw_UncompressedLength);
  printf("data->raw_UncompressedChkToken CRC32: 0x%x, length: 0x%llx\n", data->raw_UncompressedChkToken.crc, data->raw_UncompressedLength);
  printf("data->afterRaw_UncompressedChkToken CRC32: 0x%x, length: 0x%llx\n", data->afterRaw_UncompressedChkToken.crc, data->afterRaw_UncompressedLength);

  printf("uncompressed combined CRC32: 0x%lx\n",
         crc32_combine(crc32_combine(data->beforeRaw_UncompressedChkToken.crc, data->raw_UncompressedChkToken.crc, data->raw_UncompressedLength),
                       data->afterRaw_UncompressedChkToken.crc, data->afterRaw_UncompressedLength));

  printf("\n");
  printf("data->beforeRaw_CompressedChkToken CRC32: 0x%x, length: 0x%llx\n", data->beforeRaw_CompressedChkToken.crc, data->beforeRaw_CompressedLength);
  printf("data->raw_CompressedChkToken CRC32: 0x%x, length: 0x%llx\n", data->raw_CompressedChkToken.crc, data->raw_CompressedLength);
  printf("data->afterRaw_CompressedChkToken CRC32: 0x%x, length: 0x%llx\n", data->afterRaw_CompressedChkToken.crc, data->afterRaw_CompressedLength);

  printf("compressed combined CRC32: 0x%lx\n\n",
         crc32_combine(crc32_combine(data->beforeRaw_CompressedChkToken.crc, data->raw_CompressedChkToken.crc, data->raw_CompressedLength),
                       data->afterRaw_CompressedChkToken.crc, data->afterRaw_CompressedLength));

  // Update attribution metadata.
  attributionResource->signature = ATTR_SIGNATURE;
  attributionResource->version = 1;

  attributionResource->beforeCompressedLength = data->beforeRaw_CompressedLength;
  attributionResource->beforeCompressedChecksum = data->beforeRaw_CompressedChkToken.crc;
  attributionResource->beforeUncompressedLength = data->beforeRaw_UncompressedLength;
  attributionResource->beforeUncompressedChecksum = data->beforeRaw_UncompressedChkToken.crc;

  attributionResource->rawPos = data->beforeRaw_CompressedLength;
  attributionResource->rawLength = data->raw_CompressedLength;
  attributionResource->rawChecksum = data->raw_CompressedChkToken.crc;

  attributionResource->afterCompressedLength = data->afterRaw_CompressedLength;
  attributionResource->afterCompressedChecksum = data->afterRaw_CompressedChkToken.crc;
  attributionResource->afterUncompressedLength = data->afterRaw_UncompressedLength;
  attributionResource->afterUncompressedChecksum = data->afterRaw_UncompressedChkToken.crc;

  printf("sentinelAfterMainBlkx: %d, 0x%llx, 0x%llx\n", attributionResource->version, attributionResource->rawPos, attributionResource->rawLength);
}