Cross-Platform C Library Integration

Panoramica

HotPDF usa HPDFCLibs.pas come bridge Pascal-facing tra Delphi e i file object C collegati staticamente usati da HPDFZLib.pas, HPDFJpeg.pas e HPDFTiff.pas. L'unit espone i simboli runtime attesi da tali librerie mantenendo un solo layer di dichiarazioni Pascal coerente per build Win32 e Win64

Key Features

  • Bridge runtime condiviso per zlib-ng in modalità zlib-compatible, dispatch SIMD runtime zlib-ng 64-bit, libjpeg-turbo 3.1.90 con object NASM SIMD e libtiff 4.7.1
  • Memory, stdio, string/character, and selected math/runtime helper coverage
  • 32-byte aligned malloc, free, realloc, and calloc bridging for SIMD-friendly native buffers
  • Compatibilità Win32 con object zlib-ng OMF compilati con bcc32c e object JPEG/TIFF OMF compilati con bcc32 da Lib\thirdparty\Win32
  • Compatibilità Win64 con file obj COFF64 da Lib\thirdparty\Win64 e object zlib-ng COFF da Lib\thirdparty\Win64x
  • Helper types pointer-sized e stub Pascal per simboli che il linker Delphi non può importare direttamente

High-Performance JPEG Backend

I workflow JPEG standard sono supportati da libjpeg-turbo 3.1.90 tramite la classica API compatibile libjpeg esposta da HPDFJpeg.pas. Le build object Win32, Win64 e Win64x includono i relativi object NASM SIMD acceleration, e lo stesso set di object incluso è disponibile anche al layer integrazione TIFF per la gestione TIFF compressa JPEG

Zlib-ng Bridge Notes

Gli stream immagine Flate Win64 usano un piccolo bridge C attorno alla compressione one-shot zlib-ng. Il bridge mantiene i tipi length nativi zlib-ng in C preservando verso Pascal le lunghezze buffer HotPDF a 32 bit e il comportamento di massima compressione

Le build object zlib-ng Win64x e MSVC Win64 diagnostiche includono implementazioni SSE2, SSSE3, SSE4.1, SSE4.2, PCLMULQDQ e AVX2 dispatchate a runtime con fallback generici. Win32 mantiene gli object zlib-ng OMF generici per compatibilità bcc32c, mentre il percorso JPEG/TIFF Win32 resta su classici object OMF bcc32

Gruppi di funzioni supportati

  • Memory Management: malloc, free, realloc, calloc with 32-byte aligned allocation
  • File and Stream Operations: fopen, fclose, fputc, fread, fwrite, fflush, ferror
  • String and Character Functions: strcpy, sprintf, memcpy, memmove, memset, tolower, toupper, towlower, towupper, getenv, atoi
  • Runtime Helpers: ftol, setjmp, log, snprintf, memcmp

Architecture Support

  • Win32: wrapper Pascal e helper basati su WinAPI che corrispondono agli object OMF bcc32c e bcc32 collegati da ogni versione Delphi Win32 supportata
  • Win64: msvcrt.dll imports plus small helper stubs required by the MSVC-generated COFF64 objects
  • Common Types: PtrInt and PtrUInt keep pointer-sized declarations aligned across both targets

Vedi anche