doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Typedefs | Functions | Variables
jmemdos.c File Reference
#include "jinclude.h"
#include "jpeglib.h"
#include "jmemsys.h"

Go to the source code of this file.

Classes

struct  XMScontext
 
struct  EMScontext
 
union  XMSPTR
 
struct  XMSspec
 
union  EMSspec
 

Macros

#define XMS_SUPPORTED   1
 
#define EMS_SUPPORTED   1
 
#define JPEG_INTERNALS
 
#define far_malloc(x)   malloc(x)
 
#define far_free(x)   free(x)
 
#define READ_BINARY   "rb"
 
#define DEFAULT_MAX_MEM   300000L /* for total usage about 450K */
 
#define ODD(X)   (((X) & 1L) != 0)
 
#define FIELD_AT(spec, offset, type)   (*((type *) &(spec.bytes[offset])))
 
#define SRC_TYPE(spec)   FIELD_AT(spec,4,char)
 
#define SRC_HANDLE(spec)   FIELD_AT(spec,5,EMSH)
 
#define SRC_OFFSET(spec)   FIELD_AT(spec,7,unsigned short)
 
#define SRC_PAGE(spec)   FIELD_AT(spec,9,unsigned short)
 
#define SRC_PTR(spec)   FIELD_AT(spec,7,EMSPTR)
 
#define DST_TYPE(spec)   FIELD_AT(spec,11,char)
 
#define DST_HANDLE(spec)   FIELD_AT(spec,12,EMSH)
 
#define DST_OFFSET(spec)   FIELD_AT(spec,14,unsigned short)
 
#define DST_PAGE(spec)   FIELD_AT(spec,16,unsigned short)
 
#define DST_PTR(spec)   FIELD_AT(spec,14,EMSPTR)
 
#define EMSPAGESIZE   16384L /* gospel, see the EMS specs */
 
#define HIBYTE(W)   (((W) >> 8) & 0xFF)
 
#define LOBYTE(W)   ((W) & 0xFF)
 

Typedefs

typedef void far * EMSPTR
 

Functions

EXTERN short far jdos_open JPP ((short far *handle, char far *filename))
 
EXTERN short far jdos_close JPP ((short handle))
 
EXTERN short far jdos_seek JPP ((short handle, long offset))
 
EXTERN short far jdos_read JPP ((short handle, void far *buffer, unsigned short count))
 
EXTERN void far jxms_getdriver JPP ((XMSDRIVER far *))
 
EXTERN void far jxms_calldriver JPP ((XMSDRIVER, XMScontext far *))
 
EXTERN short far jems_available JPP ((void))
 
EXTERN void far jems_calldriver JPP ((EMScontext far *))
 
LOCAL void select_file_name (char *fname)
 
GLOBAL voidjpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
 
GLOBAL void jpeg_free_small (j_common_ptr cinfo, void *object, size_t sizeofobject)
 
GLOBAL void FARjpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
 
GLOBAL void jpeg_free_large (j_common_ptr cinfo, void FAR *object, size_t sizeofobject)
 
GLOBAL long jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed, long max_bytes_needed, long already_allocated)
 
METHODDEF void read_file_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 
METHODDEF void write_file_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 
METHODDEF void close_file_store (j_common_ptr cinfo, backing_store_ptr info)
 
LOCAL boolean open_file_store (j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
 
METHODDEF void read_xms_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 
METHODDEF void write_xms_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 
METHODDEF void close_xms_store (j_common_ptr cinfo, backing_store_ptr info)
 
LOCAL boolean open_xms_store (j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
 
METHODDEF void read_ems_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 
METHODDEF void write_ems_store (j_common_ptr cinfo, backing_store_ptr info, void FAR *buffer_address, long file_offset, long byte_count)
 
METHODDEF void close_ems_store (j_common_ptr cinfo, backing_store_ptr info)
 
LOCAL boolean open_ems_store (j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
 
GLOBAL void jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info, long total_bytes_needed)
 
GLOBAL long jpeg_mem_init (j_common_ptr cinfo)
 
GLOBAL void jpeg_mem_term (j_common_ptr cinfo)
 

Variables

MAX_ALLOC_CHUNK should be less
than typedef void far * 
XMSDRIVER
 

Macro Definition Documentation

#define DEFAULT_MAX_MEM   300000L /* for total usage about 450K */

Definition at line 200 of file jmemdos.c.

#define DST_HANDLE (   spec)    FIELD_AT(spec,12,EMSH)

Definition at line 475 of file jmemdos.c.

#define DST_OFFSET (   spec)    FIELD_AT(spec,14,unsigned short)

Definition at line 476 of file jmemdos.c.

#define DST_PAGE (   spec)    FIELD_AT(spec,16,unsigned short)

Definition at line 477 of file jmemdos.c.

#define DST_PTR (   spec)    FIELD_AT(spec,14,EMSPTR)

Definition at line 478 of file jmemdos.c.

#define DST_TYPE (   spec)    FIELD_AT(spec,11,char)

Definition at line 474 of file jmemdos.c.

#define EMS_SUPPORTED   1

Definition at line 38 of file jmemdos.c.

#define EMSPAGESIZE   16384L /* gospel, see the EMS specs */

Definition at line 480 of file jmemdos.c.

#define far_free (   x)    free(x)

Definition at line 70 of file jmemdos.c.

#define far_malloc (   x)    malloc(x)

Definition at line 69 of file jmemdos.c.

#define FIELD_AT (   spec,
  offset,
  type 
)    (*((type *) &(spec.bytes[offset])))

Definition at line 468 of file jmemdos.c.

#define HIBYTE (   W)    (((W) >> 8) & 0xFF)

Definition at line 482 of file jmemdos.c.

#define JPEG_INTERNALS

Definition at line 42 of file jmemdos.c.

#define LOBYTE (   W)    ((W) & 0xFF)

Definition at line 483 of file jmemdos.c.

#define ODD (   X)    (((X) & 1L) != 0)

Definition at line 325 of file jmemdos.c.

#define READ_BINARY   "rb"

Definition at line 77 of file jmemdos.c.

#define SRC_HANDLE (   spec)    FIELD_AT(spec,5,EMSH)

Definition at line 470 of file jmemdos.c.

#define SRC_OFFSET (   spec)    FIELD_AT(spec,7,unsigned short)

Definition at line 471 of file jmemdos.c.

#define SRC_PAGE (   spec)    FIELD_AT(spec,9,unsigned short)

Definition at line 472 of file jmemdos.c.

#define SRC_PTR (   spec)    FIELD_AT(spec,7,EMSPTR)

Definition at line 473 of file jmemdos.c.

#define SRC_TYPE (   spec)    FIELD_AT(spec,4,char)

Definition at line 469 of file jmemdos.c.

#define XMS_SUPPORTED   1

Definition at line 35 of file jmemdos.c.

Typedef Documentation

typedef void far* EMSPTR

Definition at line 460 of file jmemdos.c.

Function Documentation

METHODDEF void close_ems_store ( j_common_ptr  cinfo,
backing_store_ptr  info 
)

Definition at line 537 of file jmemdos.c.

METHODDEF void close_file_store ( j_common_ptr  cinfo,
backing_store_ptr  info 
)

Definition at line 271 of file jmemdos.c.

METHODDEF void close_xms_store ( j_common_ptr  cinfo,
backing_store_ptr  info 
)

Definition at line 397 of file jmemdos.c.

GLOBAL void jpeg_free_large ( j_common_ptr  cinfo,
void FAR object,
size_t  sizeofobject 
)

Definition at line 185 of file jmemdos.c.

GLOBAL void jpeg_free_small ( j_common_ptr  cinfo,
void object,
size_t  sizeofobject 
)

Definition at line 168 of file jmemdos.c.

GLOBAL void FAR* jpeg_get_large ( j_common_ptr  cinfo,
size_t  sizeofobject 
)

Definition at line 179 of file jmemdos.c.

GLOBAL void* jpeg_get_small ( j_common_ptr  cinfo,
size_t  sizeofobject 
)

Definition at line 162 of file jmemdos.c.

GLOBAL long jpeg_mem_available ( j_common_ptr  cinfo,
long  min_bytes_needed,
long  max_bytes_needed,
long  already_allocated 
)

Definition at line 204 of file jmemdos.c.

GLOBAL long jpeg_mem_init ( j_common_ptr  cinfo)

Definition at line 619 of file jmemdos.c.

GLOBAL void jpeg_mem_term ( j_common_ptr  cinfo)

Definition at line 626 of file jmemdos.c.

GLOBAL void jpeg_open_backing_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

Definition at line 595 of file jmemdos.c.

EXTERN short far jdos_open JPP ( (short far *handle, char far *filename)  )
EXTERN short far jdos_close JPP ( (short handle)  )
EXTERN short far jdos_seek JPP ( (short handle, long offset )
EXTERN short far jdos_write JPP ( (short handle, void far *buffer, unsigned short count )
EXTERN void far jxms_getdriver JPP ( (XMSDRIVER far *)  )
EXTERN void far jxms_calldriver JPP ( (XMSDRIVER, XMScontext far *)  )
EXTERN short far jems_available JPP ( (void )
EXTERN void far jems_calldriver JPP ( (EMScontext far *)  )
LOCAL boolean open_ems_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

Definition at line 550 of file jmemdos.c.

LOCAL boolean open_file_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

Definition at line 284 of file jmemdos.c.

LOCAL boolean open_xms_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

Definition at line 410 of file jmemdos.c.

METHODDEF void read_ems_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 487 of file jmemdos.c.

METHODDEF void read_file_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 239 of file jmemdos.c.

METHODDEF void read_xms_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 329 of file jmemdos.c.

LOCAL void select_file_name ( char *  fname)

Definition at line 124 of file jmemdos.c.

METHODDEF void write_ems_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 512 of file jmemdos.c.

METHODDEF void write_file_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 255 of file jmemdos.c.

METHODDEF void write_xms_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
void FAR buffer_address,
long  file_offset,
long  byte_count 
)

Definition at line 362 of file jmemdos.c.

Variable Documentation

MAX_ALLOC_CHUNK should be less than typedef void far* XMSDRIVER

Definition at line 93 of file jmemdos.c.