亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? jmemdos.c

?? JPEG算法源代碼(包含JPEG的各種算法實現的VC++的源代碼)
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * jmemdos.c
 *
 * Copyright (C) 1992-1996, Thomas G. Lane.
 * This file is part of the Independent JPEG Group's software.
 * For conditions of distribution and use, see the accompanying README file.
 *
 * This file provides an MS-DOS-compatible implementation of the system-
 * dependent portion of the JPEG memory manager.  Temporary data can be
 * stored in extended or expanded memory as well as in regular DOS files.
 *
 * If you use this file, you must be sure that NEED_FAR_POINTERS is defined
 * if you compile in a small-data memory model; it should NOT be defined if
 * you use a large-data memory model.  This file is not recommended if you
 * are using a flat-memory-space 386 environment such as DJGCC or Watcom C.
 * Also, this code will NOT work if struct fields are aligned on greater than
 * 2-byte boundaries.
 *
 * Based on code contributed by Ge' Weijers.
 */

/*
 * If you have both extended and expanded memory, you may want to change the
 * order in which they are tried in jopen_backing_store.  On a 286 machine
 * expanded memory is usually faster, since extended memory access involves
 * an expensive protected-mode-and-back switch.  On 386 and better, extended
 * memory is usually faster.  As distributed, the code tries extended memory
 * first (what? not everyone has a 386? :-).
 *
 * You can disable use of extended/expanded memory entirely by altering these
 * definitions or overriding them from the Makefile (eg, -DEMS_SUPPORTED=0).
 */

#ifndef XMS_SUPPORTED
#define XMS_SUPPORTED  1
#endif
#ifndef EMS_SUPPORTED
#define EMS_SUPPORTED  1
#endif


#define JPEG_INTERNALS
#include "jinclude.h"
#include "jpeglib.h"
#include "jmemsys.h"		/* import the system-dependent declarations */

#ifndef HAVE_STDLIB_H		/* <stdlib.h> should declare these */
extern void * malloc JPP((size_t size));
extern void free JPP((void *ptr));
extern char * getenv JPP((const char * name));
#endif

#ifdef NEED_FAR_POINTERS

#ifdef __TURBOC__
/* These definitions work for Borland C (Turbo C) */
#include <alloc.h>		/* need farmalloc(), farfree() */
#define far_malloc(x)	farmalloc(x)
#define far_free(x)	farfree(x)
#else
/* These definitions work for Microsoft C and compatible compilers */
#include <malloc.h>		/* need _fmalloc(), _ffree() */
#define far_malloc(x)	_fmalloc(x)
#define far_free(x)	_ffree(x)
#endif

#else /* not NEED_FAR_POINTERS */

#define far_malloc(x)	malloc(x)
#define far_free(x)	free(x)

#endif /* NEED_FAR_POINTERS */

#ifdef DONT_USE_B_MODE		/* define mode parameters for fopen() */
#define READ_BINARY	"r"
#else
#define READ_BINARY	"rb"
#endif

#if MAX_ALLOC_CHUNK >= 65535L	/* make sure jconfig.h got this right */
  MAX_ALLOC_CHUNK should be less than 64K. /* deliberate syntax error */
#endif


/*
 * Declarations for assembly-language support routines (see jmemdosa.asm).
 *
 * The functions are declared "far" as are all their pointer arguments;
 * this ensures the assembly source code will work regardless of the
 * compiler memory model.  We assume "short" is 16 bits, "long" is 32.
 */

typedef void far * XMSDRIVER;	/* actually a pointer to code */
typedef struct {		/* registers for calling XMS driver */
	unsigned short ax, dx, bx;
	void far * ds_si;
      } XMScontext;
typedef struct {		/* registers for calling EMS driver */
	unsigned short ax, dx, bx;
	void far * ds_si;
      } EMScontext;

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 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 *));


/*
 * Selection of a file name for a temporary file.
 * This is highly system-dependent, and you may want to customize it.
 */

static int next_file_num;	/* to distinguish among several temp files */

LOCAL(void)
select_file_name (char * fname)
{
  const char * env;
  char * ptr;
  FILE * tfile;

  /* Keep generating file names till we find one that's not in use */
  for (;;) {
    /* Get temp directory name from environment TMP or TEMP variable;
     * if none, use "."
     */
    if ((env = (const char *) getenv("TMP")) == NULL)
      if ((env = (const char *) getenv("TEMP")) == NULL)
	env = ".";
    if (*env == '\0')		/* null string means "." */
      env = ".";
    ptr = fname;		/* copy name to fname */
    while (*env != '\0')
      *ptr++ = *env++;
    if (ptr[-1] != '\\' && ptr[-1] != '/')
      *ptr++ = '\\';		/* append backslash if not in env variable */
    /* Append a suitable file name */
    next_file_num++;		/* advance counter */
    sprintf(ptr, "JPG%03d.TMP", next_file_num);
    /* Probe to see if file name is already in use */
    if ((tfile = fopen(fname, READ_BINARY)) == NULL)
      break;
    fclose(tfile);		/* oops, it's there; close tfile & try again */
  }
}


/*
 * Near-memory allocation and freeing are controlled by the regular library
 * routines malloc() and free().
 */

GLOBAL(void *)
jpeg_get_small (j_common_ptr cinfo, size_t sizeofobject)
{
  return (void *) malloc(sizeofobject);
}

GLOBAL(void)
jpeg_free_small (j_common_ptr cinfo, void * object, size_t sizeofobject)
{
  free(object);
}


/*
 * "Large" objects are allocated in far memory, if possible
 */

GLOBAL(void FAR *)
jpeg_get_large (j_common_ptr cinfo, size_t sizeofobject)
{
  return (void FAR *) far_malloc(sizeofobject);
}

GLOBAL(void)
jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
{
  far_free(object);
}


/*
 * This routine computes the total memory space available for allocation.
 * It's impossible to do this in a portable way; our current solution is
 * to make the user tell us (with a default value set at compile time).
 * If you can actually get the available space, it's a good idea to subtract
 * a slop factor of 5% or so.
 */

#ifndef DEFAULT_MAX_MEM		/* so can override from makefile */
#define DEFAULT_MAX_MEM		300000L /* for total usage about 450K */
#endif

GLOBAL(long)
jpeg_mem_available (j_common_ptr cinfo, long min_bytes_needed,
		    long max_bytes_needed, long already_allocated)
{
  return cinfo->mem->max_memory_to_use - already_allocated;
}


/*
 * Backing store (temporary file) management.
 * Backing store objects are only used when the value returned by
 * jpeg_mem_available is less than the total space needed.  You can dispense
 * with these routines if you have plenty of virtual memory; see jmemnobs.c.
 */

/*
 * For MS-DOS we support three types of backing storage:
 *   1. Conventional DOS files.  We access these by direct DOS calls rather
 *      than via the stdio package.  This provides a bit better performance,
 *      but the real reason is that the buffers to be read or written are FAR.
 *      The stdio library for small-data memory models can't cope with that.
 *   2. Extended memory, accessed per the XMS V2.0 specification.
 *   3. Expanded memory, accessed per the LIM/EMS 4.0 specification.
 * You'll need copies of those specs to make sense of the related code.
 * The specs are available by Internet FTP from the SIMTEL archives 
 * (oak.oakland.edu and its various mirror sites).  See files
 * pub/msdos/microsoft/xms20.arc and pub/msdos/info/limems41.zip.
 */


/*
 * Access methods for a DOS file.
 */


METHODDEF(void)
read_file_store (j_common_ptr cinfo, backing_store_ptr info,
		 void FAR * buffer_address,
		 long file_offset, long byte_count)
{
  if (jdos_seek(info->handle.file_handle, file_offset))
    ERREXIT(cinfo, JERR_TFILE_SEEK);
  /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
  if (byte_count > 65535L)	/* safety check */
    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
  if (jdos_read(info->handle.file_handle, buffer_address,
		(unsigned short) byte_count))
    ERREXIT(cinfo, JERR_TFILE_READ);
}


METHODDEF(void)
write_file_store (j_common_ptr cinfo, backing_store_ptr info,
		  void FAR * buffer_address,
		  long file_offset, long byte_count)
{
  if (jdos_seek(info->handle.file_handle, file_offset))
    ERREXIT(cinfo, JERR_TFILE_SEEK);
  /* Since MAX_ALLOC_CHUNK is less than 64K, byte_count will be too. */
  if (byte_count > 65535L)	/* safety check */
    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
  if (jdos_write(info->handle.file_handle, buffer_address,
		 (unsigned short) byte_count))
    ERREXIT(cinfo, JERR_TFILE_WRITE);
}


METHODDEF(void)
close_file_store (j_common_ptr cinfo, backing_store_ptr info)
{
  jdos_close(info->handle.file_handle);	/* close the file */
  remove(info->temp_name);	/* delete the file */
/* If your system doesn't have remove(), try unlink() instead.
 * remove() is the ANSI-standard name for this function, but
 * unlink() was more common in pre-ANSI systems.
 */
  TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);
}


LOCAL(boolean)
open_file_store (j_common_ptr cinfo, backing_store_ptr info,
		 long total_bytes_needed)
{
  short handle;

  select_file_name(info->temp_name);
  if (jdos_open((short far *) & handle, (char far *) info->temp_name)) {
    /* might as well exit since jpeg_open_backing_store will fail anyway */
    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
    return FALSE;
  }
  info->handle.file_handle = handle;
  info->read_backing_store = read_file_store;
  info->write_backing_store = write_file_store;
  info->close_backing_store = close_file_store;
  TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
  return TRUE;			/* succeeded */
}


/*
 * Access methods for extended memory.
 */

#if XMS_SUPPORTED

static XMSDRIVER xms_driver;	/* saved address of XMS driver */

typedef union {			/* either long offset or real-mode pointer */
	long offset;
	void far * ptr;
      } XMSPTR;

typedef struct {		/* XMS move specification structure */
	long length;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频在线观看三级| 天天综合网 天天综合色| 亚洲成人午夜影院| 国产成人在线视频网址| 欧美日韩高清在线| 亚洲欧洲国产日韩| 国产**成人网毛片九色| 欧美一二三四在线| 亚洲h在线观看| 色综合色综合色综合色综合色综合 | 日韩一区二区三区免费看| 国产精品第一页第二页第三页| 久久精品国产秦先生| 欧美蜜桃一区二区三区| 亚洲欧美日韩国产成人精品影院| 国产一区二区三区在线看麻豆| 51午夜精品国产| 亚洲一区二区欧美| 色94色欧美sute亚洲线路一久 | 岛国精品一区二区| 久久久久国色av免费看影院| 美女视频黄免费的久久| 欧美日韩dvd在线观看| 亚洲午夜成aⅴ人片| 国产成人综合在线| 国产亚洲欧美日韩俺去了| 精品无人码麻豆乱码1区2区| 欧美电影免费观看高清完整版在线 | 欧美吻胸吃奶大尺度电影| 亚洲人成在线播放网站岛国| www.成人在线| 国产精品久久久久婷婷二区次| 国产69精品久久99不卡| 欧美激情一区在线| 成人免费视频播放| 国产精品欧美久久久久无广告| 国产精品综合一区二区三区| 久久九九全国免费| 国产福利一区在线| 国产精品欧美一区喷水| 99视频超级精品| 亚洲人被黑人高潮完整版| 97久久精品人人做人人爽50路| 一区二区三区日韩精品视频| 欧美午夜精品理论片a级按摩| 天天免费综合色| 欧美一级电影网站| 国产sm精品调教视频网站| 中文字幕中文字幕中文字幕亚洲无线| 成人a区在线观看| 亚洲最色的网站| 欧美一级黄色大片| 国产大陆精品国产| 亚洲乱码精品一二三四区日韩在线 | 精品欧美一区二区三区精品久久| 国产精品一级在线| 一区二区久久久| 精品欧美乱码久久久久久| youjizz国产精品| 亚洲综合区在线| 精品久久久久久久人人人人传媒 | 欧美日韩国产美女| 精品亚洲porn| 一区二区三区久久| 欧美一区二区三区四区高清| 成人免费毛片高清视频| 亚洲国产一二三| 国产情人综合久久777777| 日本韩国视频一区二区| 蜜桃视频在线观看一区| 亚洲天堂精品在线观看| 日韩美女视频一区二区在线观看| av亚洲精华国产精华精| 蜜桃视频在线观看一区| 亚洲免费av高清| 亚洲精品在线观看网站| 欧美日韩一区二区三区免费看| 国产电影一区二区三区| 亚洲va国产va欧美va观看| 亚洲国产高清aⅴ视频| 欧美一级理论性理论a| 色视频欧美一区二区三区| 激情五月婷婷综合| 香蕉久久一区二区不卡无毒影院| 日本一区二区三区国色天香| 欧美日韩成人综合在线一区二区| 国产成人丝袜美腿| 另类调教123区| 一区二区三区成人在线视频| 欧美国产一区在线| 欧美成人一区二区三区在线观看 | 97久久精品人人澡人人爽| 久久精品国产亚洲高清剧情介绍 | 亚洲成人av中文| 一区精品在线播放| 欧美激情综合五月色丁香| 日韩欧美一级片| 欧美日韩国产电影| 一本一道久久a久久精品| 国产成人福利片| 国产一区二区视频在线| 久久激情五月婷婷| 丝袜美腿亚洲色图| 亚洲成人久久影院| 亚洲国产欧美在线| 一区二区三区在线播| 亚洲欧美偷拍另类a∨色屁股| 中文字幕电影一区| 国产欧美日韩在线| 久久久精品天堂| 久久久久99精品一区| 国产亚洲综合性久久久影院| 精品国产污污免费网站入口| 日韩精品资源二区在线| 精品日韩一区二区三区免费视频| 欧美成人免费网站| 久久蜜桃av一区二区天堂| 久久精品亚洲精品国产欧美| 国产欧美日韩在线看| 国产精品成人一区二区艾草 | 另类的小说在线视频另类成人小视频在线| 性久久久久久久| 麻豆91在线观看| 国产在线不卡一区| 国产成人aaaa| av中文字幕在线不卡| 色婷婷国产精品久久包臀| 欧美午夜影院一区| 欧美一区三区四区| 精品国精品自拍自在线| 亚洲国产成人午夜在线一区| 国产精品午夜久久| 悠悠色在线精品| 日韩电影在线观看网站| 国产一区二区伦理| www.在线欧美| 7777精品久久久大香线蕉| 久久综合色综合88| 国产精品无人区| 亚洲国产成人av| 国产在线看一区| 91在线porny国产在线看| 欧美日韩的一区二区| 国产午夜亚洲精品不卡| 亚洲欧美一区二区三区久本道91 | 午夜免费久久看| 极品美女销魂一区二区三区| 成人av第一页| 7777精品伊人久久久大香线蕉最新版| 精品久久久三级丝袜| 亚洲女性喷水在线观看一区| 三级影片在线观看欧美日韩一区二区 | 久久久久国产精品人| 亚洲一区在线观看免费| 国产精品99久久不卡二区| 欧美日韩一区成人| 国产欧美日韩亚州综合| 亚州成人在线电影| 成人aaaa免费全部观看| 91精品久久久久久久91蜜桃| 中文字幕在线免费不卡| 久久精品国产在热久久| 色偷偷一区二区三区| 久久久一区二区三区捆绑**| 亚洲高清在线视频| 成人黄色777网| 精品国产电影一区二区| 亚洲超碰精品一区二区| www.99精品| 久久久久久久久久久电影| 日本人妖一区二区| 色天使色偷偷av一区二区| 中文字幕国产精品一区二区| 久久99精品一区二区三区三区| 欧美影院一区二区三区| 亚洲桃色在线一区| 成人教育av在线| 久久综合久久综合久久| 日韩中文字幕不卡| 欧美私人免费视频| 亚洲精品中文字幕在线观看| 成人福利电影精品一区二区在线观看| 日韩欧美国产一区二区三区| 午夜精品久久久久久久久久 | a在线播放不卡| 久久免费偷拍视频| 韩国三级中文字幕hd久久精品| 欧美精品xxxxbbbb| 一卡二卡欧美日韩| 色综合天天性综合| 国产精品久久久久久久浪潮网站| 久久99精品视频| 26uuu精品一区二区| 久久精品国产一区二区三| 日韩女优av电影| 九九视频精品免费| 欧美精品一区二区三区在线播放 | 在线亚洲人成电影网站色www| 日韩美女视频19| 一本到不卡免费一区二区|