亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
亚洲综合激情网| 欧美va亚洲va在线观看蝴蝶网| 色综合久久88色综合天天免费| 99国产精品一区| 欧美精品色一区二区三区| 欧美电影免费观看高清完整版在线观看 | 色又黄又爽网站www久久| 欧美视频一区在线| 久久影院午夜论| 一区二区三区不卡视频| 免费高清视频精品| 97se狠狠狠综合亚洲狠狠| 欧美精品免费视频| **欧美大码日韩| 美女脱光内衣内裤视频久久网站| 国产精华液一区二区三区| 精品国产一区二区在线观看| 国产精品污污网站在线观看| 日本亚洲三级在线| 国产激情一区二区三区四区 | 中文字幕不卡在线观看| 亚洲一区二区三区国产| 国产精品一区久久久久| 欧美精品在线观看播放| 国产精品久久久久久久岛一牛影视 | 一区av在线播放| 国产sm精品调教视频网站| 6080国产精品一区二区| 亚洲精品一二三| 国产成人综合视频| 日韩亚洲欧美成人一区| 亚洲妇女屁股眼交7| 成人av在线播放网站| 26uuu亚洲综合色| 麻豆精品国产传媒mv男同| 精品视频在线免费看| 亚洲视频电影在线| 国产精品一区二区黑丝| 日韩区在线观看| 午夜精品视频一区| 91久久香蕉国产日韩欧美9色| 国产欧美精品一区二区三区四区| 韩日av一区二区| 日韩精品一区国产麻豆| 日本不卡视频一二三区| 欧美疯狂做受xxxx富婆| 亚洲国产乱码最新视频| 欧美亚洲国产一区二区三区va | 国产69精品久久777的优势| 亚洲欧洲成人av每日更新| 另类小说一区二区三区| 欧美日本在线看| 亚洲电影中文字幕在线观看| 在线看国产日韩| 亚洲电影第三页| 欧美久久久久久蜜桃| 亚洲成av人片在www色猫咪| 91美女视频网站| 一区二区三区在线观看视频| 色综合咪咪久久| 亚洲精品中文在线影院| 欧美唯美清纯偷拍| 亚洲一区二区黄色| 欧美老肥妇做.爰bbww视频| 性做久久久久久免费观看| 亚洲成人动漫在线免费观看| 91在线视频18| 这里只有精品视频在线观看| 又紧又大又爽精品一区二区| 色婷婷av一区二区三区软件 | 精品播放一区二区| 成人午夜伦理影院| 亚洲欧洲日韩在线| 欧美最猛黑人xxxxx猛交| 日韩国产在线一| 26uuu欧美| www.亚洲色图.com| 综合久久久久综合| 欧美日韩国产一级| 国产精品一二三在| 国产精品色眯眯| 欧美日韩国产经典色站一区二区三区 | 国产精品三级av| 欧美午夜免费电影| 精品在线免费视频| 亚洲欧洲一区二区三区| 欧美一区二区在线播放| 欧美夫妻性生活| 久久国产精品72免费观看| 国产精品美女久久久久久久久久久| 色av综合在线| 国产传媒日韩欧美成人| 一区二区三区在线观看国产| 欧美大尺度电影在线| 本田岬高潮一区二区三区| 午夜欧美视频在线观看| 日本一区二区三区高清不卡| 欧美性感一区二区三区| 国产精品自拍三区| 亚洲无线码一区二区三区| 国产亚洲成av人在线观看导航| 色婷婷综合久色| 国产乱子伦视频一区二区三区| 亚洲午夜精品在线| 亚洲欧美区自拍先锋| 中文字幕在线不卡一区二区三区| 久久综合色之久久综合| 精品国产污网站| 日韩欧美精品三级| 欧美xxxx老人做受| 精品久久久久久久久久久久久久久久久| 欧美吻胸吃奶大尺度电影| 色婷婷综合久久久久中文一区二区 | 久久久久久久久久久久电影 | 欧美军同video69gay| 91.com视频| 91麻豆精品国产自产在线观看一区| 欧美色网一区二区| 91精品免费在线观看| 制服丝袜亚洲色图| 日韩欧美国产麻豆| 亚洲免费av高清| 亚洲电影一区二区| 日本欧美久久久久免费播放网| 日本在线不卡视频一二三区| 日本美女一区二区| 国产在线日韩欧美| 成人小视频在线| 99久久99久久精品国产片果冻 | 国产一区二区在线视频| 国产91丝袜在线18| 91丨porny丨首页| 欧美亚洲日本一区| 日韩欧美一级二级| 久久久噜噜噜久噜久久综合| 国产精品美女久久久久高潮| 日韩伦理电影网| 亚洲大型综合色站| 国产主播一区二区| 91色在线porny| 欧美一级一区二区| 久久久不卡影院| 亚洲老妇xxxxxx| 日韩国产一二三区| 国产成人精品aa毛片| 欧美亚洲动漫精品| 精品动漫一区二区三区在线观看| 中文字幕va一区二区三区| 亚洲成人动漫在线免费观看| 精品一区二区三区免费视频| 99精品视频在线观看免费| 7777精品伊人久久久大香线蕉 | 国产精品护士白丝一区av| 亚洲动漫第一页| 国产69精品久久99不卡| 欧美三级电影在线观看| 久久老女人爱爱| 亚洲午夜激情网站| 成人妖精视频yjsp地址| 欧美乱熟臀69xxxxxx| 国产精品九色蝌蚪自拍| 美女视频黄 久久| 一本色道久久综合狠狠躁的推荐| 日韩欧美123| 亚洲最大色网站| 国产精一区二区三区| 在线不卡一区二区| 日韩美女久久久| 国产成人精品一区二区三区四区| 欧美色网站导航| 亚洲三级久久久| 国产激情视频一区二区三区欧美| 欧美日韩国产另类一区| 1024亚洲合集| 国产精品一卡二卡在线观看| 欧美一区二区视频在线观看| 夜色激情一区二区| 成人国产亚洲欧美成人综合网| 日韩欧美在线一区二区三区| 一区二区三区波多野结衣在线观看| 成人免费高清视频在线观看| 欧美电影精品一区二区| 日日夜夜免费精品| 91福利资源站| 亚洲精品乱码久久久久久久久| 国产精品99久久不卡二区| 精品久久久三级丝袜| 日本欧美韩国一区三区| 91精品久久久久久久91蜜桃| 亚洲午夜精品一区二区三区他趣| 色视频成人在线观看免| 自拍视频在线观看一区二区| 成人性色生活片免费看爆迷你毛片| 久久综合九色欧美综合狠狠| 麻豆精品视频在线观看| 日韩写真欧美这视频| 日韩电影一区二区三区| 日韩一区国产二区欧美三区| 99国产精品国产精品久久| 中文字幕欧美国产|