Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped 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.

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

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

Variables

You forgot to define USE_MSDOS_MEMMGR in jconfig h MAX_ALLOC_CHUNK should be less than typedef void far * XMSDRIVER
 

Macro Definition Documentation

◆ DEFAULT_MAX_MEM

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

Definition at line 204 of file jmemdos.c.

◆ DST_HANDLE

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

Definition at line 479 of file jmemdos.c.

Referenced by read_ems_store(), and write_ems_store().

◆ DST_OFFSET

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

Definition at line 480 of file jmemdos.c.

Referenced by write_ems_store().

◆ DST_PAGE

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

Definition at line 481 of file jmemdos.c.

Referenced by write_ems_store().

◆ DST_PTR

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

Definition at line 482 of file jmemdos.c.

Referenced by read_ems_store().

◆ DST_TYPE

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

Definition at line 478 of file jmemdos.c.

Referenced by read_ems_store(), and write_ems_store().

◆ EMS_SUPPORTED

#define EMS_SUPPORTED   1

Definition at line 38 of file jmemdos.c.

◆ EMSPAGESIZE

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

Definition at line 484 of file jmemdos.c.

Referenced by open_ems_store(), read_ems_store(), and write_ems_store().

◆ far_free

#define far_free (   x)    free(x)

Definition at line 70 of file jmemdos.c.

Referenced by jpeg_free_large().

◆ far_malloc

#define far_malloc (   x)    malloc(x)

Definition at line 69 of file jmemdos.c.

Referenced by jpeg_get_large().

◆ FIELD_AT

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

Definition at line 472 of file jmemdos.c.

◆ HIBYTE

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

Definition at line 486 of file jmemdos.c.

Referenced by open_ems_store(), read_ems_store(), and write_ems_store().

◆ JPEG_INTERNALS

#define JPEG_INTERNALS

Definition at line 42 of file jmemdos.c.

◆ LOBYTE

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

Definition at line 487 of file jmemdos.c.

Referenced by open_ems_store().

◆ ODD

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

Definition at line 329 of file jmemdos.c.

◆ READ_BINARY

#define READ_BINARY   "rb"

Definition at line 77 of file jmemdos.c.

Referenced by select_file_name().

◆ SRC_HANDLE

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

Definition at line 474 of file jmemdos.c.

Referenced by read_ems_store(), and write_ems_store().

◆ SRC_OFFSET

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

Definition at line 475 of file jmemdos.c.

Referenced by read_ems_store().

◆ SRC_PAGE

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

Definition at line 476 of file jmemdos.c.

Referenced by read_ems_store().

◆ SRC_PTR

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

Definition at line 477 of file jmemdos.c.

Referenced by write_ems_store().

◆ SRC_TYPE

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

Definition at line 473 of file jmemdos.c.

Referenced by read_ems_store(), and write_ems_store().

◆ XMS_SUPPORTED

#define XMS_SUPPORTED   1

Definition at line 35 of file jmemdos.c.

Typedef Documentation

◆ EMSPTR

typedef void far* EMSPTR

Definition at line 464 of file jmemdos.c.

Function Documentation

◆ close_ems_store()

close_ems_store ( j_common_ptr  cinfo,
backing_store_ptr  info 
)

Definition at line 541 of file jmemdos.c.

References info, LOCAL, and TRACEMS1.

Referenced by open_ems_store().

◆ close_file_store()

close_file_store ( j_common_ptr  cinfo,
backing_store_ptr  info 
)

Definition at line 275 of file jmemdos.c.

References info, LOCAL, backing_store_struct::temp_name, and TRACEMSS.

Referenced by open_file_store().

◆ close_xms_store()

close_xms_store ( j_common_ptr  cinfo,
backing_store_ptr  info 
)

Definition at line 401 of file jmemdos.c.

References info.

◆ jpeg_free_large()

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

Definition at line 189 of file jmemdos.c.

References far_free.

◆ jpeg_free_small()

jpeg_free_small ( j_common_ptr  cinfo,
void object,
size_t  sizeofobject 
)

Definition at line 172 of file jmemdos.c.

References FAR, free(), and GLOBAL.

◆ jpeg_get_large()

jpeg_get_large ( j_common_ptr  cinfo,
size_t  sizeofobject 
)

Definition at line 183 of file jmemdos.c.

References FAR, far_malloc, GLOBAL, and sizeofobject.

◆ jpeg_get_small()

jpeg_get_small ( j_common_ptr  cinfo,
size_t  sizeofobject 
)

Definition at line 166 of file jmemdos.c.

References GLOBAL, and malloc().

◆ jpeg_mem_available()

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

Definition at line 208 of file jmemdos.c.

References already_allocated, and METHODDEF.

◆ jpeg_mem_init()

jpeg_mem_init ( j_common_ptr  cinfo)

Definition at line 623 of file jmemdos.c.

◆ jpeg_mem_term()

jpeg_mem_term ( j_common_ptr  cinfo)

Definition at line 630 of file jmemdos.c.

◆ jpeg_open_backing_store()

jpeg_open_backing_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

◆ JPP() [1/8]

short far jdos_open JPP ( (short far *handle, char far *filename )

◆ JPP() [2/8]

short far jdos_close JPP ( (short handle)  )

◆ JPP() [3/8]

short far jdos_seek JPP ( (short handle, long offset )

◆ JPP() [4/8]

short far jdos_write JPP ( (short handle, void far *buffer, unsigned short count )

◆ JPP() [5/8]

void far jxms_getdriver JPP ( (XMSDRIVER far *)  )

◆ JPP() [6/8]

void far jxms_calldriver JPP ( (XMSDRIVER, XMScontext far *)  )

◆ JPP() [7/8]

short far jems_available JPP ( (void )

◆ JPP() [8/8]

void far jems_calldriver JPP ( (EMScontext far *)  )

◆ open_ems_store()

open_ems_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

◆ open_file_store()

open_file_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

◆ open_xms_store()

open_xms_store ( j_common_ptr  cinfo,
backing_store_ptr  info,
long  total_bytes_needed 
)

Definition at line 414 of file jmemdos.c.

References XMSDRIVER.

Referenced by jpeg_open_backing_store().

◆ read_ems_store()

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

Definition at line 491 of file jmemdos.c.

References DST_HANDLE, DST_PTR, DST_TYPE, EMSPAGESIZE, ERREXIT, HIBYTE, METHODDEF, SRC_HANDLE, SRC_OFFSET, SRC_PAGE, and SRC_TYPE.

Referenced by open_ems_store().

◆ read_file_store()

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

Definition at line 243 of file jmemdos.c.

References ERREXIT, info, and METHODDEF.

Referenced by open_file_store().

◆ read_xms_store()

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

Definition at line 333 of file jmemdos.c.

◆ select_file_name()

select_file_name ( char *  fname)

Definition at line 128 of file jmemdos.c.

References GLOBAL, NULL, ptr, and READ_BINARY.

Referenced by open_file_store().

◆ write_ems_store()

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

Definition at line 516 of file jmemdos.c.

References DST_HANDLE, DST_OFFSET, DST_PAGE, DST_TYPE, EMSPAGESIZE, ERREXIT, HIBYTE, info, METHODDEF, SRC_HANDLE, SRC_PTR, and SRC_TYPE.

Referenced by open_ems_store().

◆ write_file_store()

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

Definition at line 259 of file jmemdos.c.

References ERREXIT, info, and METHODDEF.

Referenced by open_file_store().

◆ write_xms_store()

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

Definition at line 366 of file jmemdos.c.

References info.

Variable Documentation

◆ XMSDRIVER

You forgot to define USE_MSDOS_MEMMGR in jconfig h MAX_ALLOC_CHUNK should be less than typedef void far* XMSDRIVER

Definition at line 97 of file jmemdos.c.

Referenced by open_file_store(), and open_xms_store().