Unit jinclude

Classes

Functions

JFMWRITE - @\\\*) (*@/// function JFMWRITE(var f : TStream; buf : pointer; sizeofbuf : size_t) : size_t;
JFREAD - function SIZEOF(object) : size_t;

@\\\*) { In ANSI C, and indeed any rational implementation, size_t is also the type returned by sizeof().
MEMCOPY - @\\\*) (*@/// procedure MEMCOPY(dest, src : pointer; size : size_t);
MEMZERO - @\\\*) { We need the NULL macro and size_t typedef.

Types

Constants

Variables


Functions


function JFMWRITE(var f : TStream; buf : pointer; sizeofbuf : size_t) : size_t;

@\\\*) (*@/// function JFMWRITE(var f : TStream; buf : pointer; sizeofbuf : size_t) : size_t;

function JFREAD(stream:TStream; buf : pointer; sizeofbuf : size_t) : size_t;

function SIZEOF(object) : size_t;

@\\\*) { In ANSI C, and indeed any rational implementation, size_t is also the type returned by sizeof(). However, it seems there are some irrational implementations out there, in which sizeof() returns an int even though size_t is defined as long or unsigned long. To ensure consistent results we always use this SIZEOF() macro in place of using sizeof() directly. } {#define SIZEOF(object) (size_t(sizeof(object))} { The modules that use fread() and fwrite() always invoke them through these macros. On some systems you may need to twiddle the argument casts. CAUTION: argument order is different from underlying functions! } (*@/// function JFREAD(stream:TStream; buf : pointer; sizeofbuf : size_t) : size_t;


procedure MEMCOPY(dest, src : pointer; size : size_t);

@\\\*) (*@/// procedure MEMCOPY(dest, src : pointer; size : size_t);

procedure MEMZERO(target : pointer; size : size_t);

@\\\*) { We need the NULL macro and size_t typedef. On an ANSI-conforming system it is sufficient to include . Otherwise, we get them from or ; we may have to pull in as well. Note that the core JPEG library does not require ; only the default error handler and data source/destination modules do. But we must pull it in because of the references to FILE in jpeglib.h. You can remove those references if you want to compile without .} { We need memory copying and zeroing functions, plus strncpy(). ANSI and System V implementations declare these in . BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). Some systems may declare memset and memcpy in . NOTE: we assume the size parameters to these functions are of type size_t. Change the casts in these macros if not!

@/// procedure MEMZERO(target : pointer; size : size_t);


Types


Constants


Variables