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

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

?? jmemdos.c

?? 一款最完整的工業(yè)組態(tài)軟源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 * jmemdos.c
 *
 * Copyright (C) 1992-1997, 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

#ifndef USE_MSDOS_MEMMGR	/* make sure user got configuration right */
  You forgot to define USE_MSDOS_MEMMGR in jconfig.h. /* deliberate syntax error */
#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;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品一区二区三区福利 | 福利视频网站一区二区三区| 欧美亚洲高清一区| 一区二区三区久久| 91啪亚洲精品| 亚洲激情网站免费观看| 色综合久久久久| 伊人夜夜躁av伊人久久| 欧美日韩视频专区在线播放| 亚洲二区在线观看| 日韩欧美在线综合网| 美女www一区二区| 精品久久国产字幕高潮| 国产高清不卡一区二区| 久久久高清一区二区三区| 国产成人在线观看免费网站| 精品国偷自产国产一区| 成人在线视频首页| 亚洲欧美日韩系列| 日韩一区二区三区四区| 成人av网站免费| 蜜臀a∨国产成人精品| 日本一区二区动态图| 欧美日韩精品一二三区| 制服丝袜成人动漫| 99久久国产综合色|国产精品| 午夜国产不卡在线观看视频| 国产拍揄自揄精品视频麻豆| 欧美午夜电影一区| 成人美女在线观看| 美国av一区二区| 亚洲6080在线| 亚洲成人一二三| 亚洲三级理论片| 国产日韩欧美高清| 久久综合狠狠综合久久综合88| 欧美日韩在线直播| 欧美色男人天堂| 欧美日韩亚洲综合在线| 在线精品视频一区二区| 欧美综合欧美视频| 99免费精品视频| 91亚洲精品久久久蜜桃| 菠萝蜜视频在线观看一区| 成人性生交大片| 91在线观看一区二区| 91啪九色porn原创视频在线观看| av一区二区三区四区| 欧美mv日韩mv国产网站| 国产日产亚洲精品系列| 日韩欧美成人午夜| 26uuu精品一区二区| 2019国产精品| 国产精品情趣视频| 亚洲精品ww久久久久久p站| 一区二区欧美在线观看| 日本午夜精品视频在线观看| 精品一区二区免费| 99精品一区二区三区| 欧美午夜在线一二页| 欧美一卡二卡三卡四卡| 久久色成人在线| 亚洲免费在线视频| 麻豆精品在线视频| 国产91精品一区二区麻豆亚洲| 99久久国产综合色|国产精品| 欧美精品1区2区3区| 国产清纯在线一区二区www| 伊人色综合久久天天人手人婷| 奇米色777欧美一区二区| 成人午夜av影视| 欧美疯狂做受xxxx富婆| 中文字幕av一区二区三区高| 午夜一区二区三区视频| 国产一区美女在线| 884aa四虎影成人精品一区| 久久久久久久久一| 天天操天天综合网| 99热这里都是精品| 中文字幕不卡一区| 国产aⅴ综合色| 日韩精品一区二区三区中文不卡 | 麻豆freexxxx性91精品| 在线观看日韩电影| 亚洲欧洲av在线| 国产91在线观看丝袜| 久久夜色精品一区| 美女视频网站久久| 欧美日韩的一区二区| 一区二区三区四区国产精品| 国产成人精品午夜视频免费| 日韩欧美国产电影| 蜜臀精品久久久久久蜜臀| 精品视频一区二区三区免费| 亚洲午夜电影在线| 欧美日韩在线播放三区| 亚洲aaa精品| 欧美午夜在线一二页| 一级精品视频在线观看宜春院| 色女孩综合影院| 一区二区在线观看免费| 欧美精品18+| 秋霞成人午夜伦在线观看| 日韩一区二区免费电影| 久久97超碰国产精品超碰| 久久综合九色综合97婷婷女人 | 中文字幕日本乱码精品影院| 99视频国产精品| 亚洲成人免费观看| 欧美精品一区二区高清在线观看 | 亚洲激情av在线| 7777女厕盗摄久久久| 日本欧美在线观看| 久久久国产午夜精品| 色狠狠av一区二区三区| 午夜精品久久久久久| 久久亚洲综合色一区二区三区 | 粉嫩av一区二区三区| 亚洲国产美女搞黄色| 国产视频一区二区在线| 欧美色精品在线视频| 成人av午夜影院| 国产精品羞羞答答xxdd| 亚洲成人av电影| 国产精品毛片久久久久久| 欧美老女人第四色| 91高清在线观看| 成人午夜看片网址| 国内外精品视频| 日本中文在线一区| 亚洲成人av中文| 一区二区三区四区不卡在线| 亚洲国产高清aⅴ视频| 久久综合九色综合97婷婷女人| 91精品国产一区二区三区蜜臀| 91老司机福利 在线| 91蜜桃网址入口| 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 成人免费黄色在线| 亚洲一区二区中文在线| 91丝袜国产在线播放| 国产美女精品人人做人人爽 | 久久久噜噜噜久久中文字幕色伊伊 | 欧美二区在线观看| 欧美日韩国产不卡| 欧美精品18+| 日韩欧美国产系列| 久久夜色精品一区| 亚洲人成网站在线| 亚洲成人综合视频| 日韩国产欧美在线播放| 日韩国产欧美在线播放| 国产自产高清不卡| 国产露脸91国语对白| 色狠狠综合天天综合综合| 欧美日韩国产一区| 欧美www视频| 亚洲国产激情av| 一区二区三区欧美视频| 青青草精品视频| 风间由美一区二区三区在线观看| 成人午夜视频福利| 91精品在线一区二区| 国产欧美日韩三区| 亚洲视频一区在线| 精品在线播放午夜| 成人涩涩免费视频| 91久久国产综合久久| 久久精品一区二区三区不卡| 国产精品高潮呻吟| 亚洲bt欧美bt精品| 懂色av中文字幕一区二区三区| 丁香网亚洲国际| 欧美老肥妇做.爰bbww| 国产精品久久久久久久久图文区 | 国产成人在线看| 欧美三级日韩在线| 国产精品久久久久久妇女6080| 亚洲国产成人av| caoporen国产精品视频| 欧美变态口味重另类| 亚洲制服丝袜一区| 99久久精品99国产精品| 国产农村妇女精品| 国产一区91精品张津瑜| 欧美一区日韩一区| 亚洲一区二区视频| 一本色道综合亚洲| 国产精品国产精品国产专区不片| 国产不卡视频在线播放| 日韩精品在线看片z| 久久精品99国产精品日本| 91精品国产日韩91久久久久久| 一区二区三区中文免费| 色婷婷国产精品综合在线观看| 亚洲黄色尤物视频| 欧美日韩国产123区| 免费观看日韩av| 久久免费的精品国产v∧| 久久99国产精品免费网站|