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

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

?? jmemdos.c

?? 一款最完整的工業組態軟源代碼
?? 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一区二区三区免费野_久草精品视频
日本欧美肥老太交大片| 亚洲永久免费av| 91.com视频| 欧美视频一区在线| 在线免费亚洲电影| 91国偷自产一区二区三区成为亚洲经典| 国产精品一区二区在线观看不卡 | 国产盗摄一区二区| 裸体歌舞表演一区二区| 麻豆传媒一区二区三区| 看电视剧不卡顿的网站| 黑人巨大精品欧美一区| 国产精品综合在线视频| 成人午夜视频在线观看| 99精品视频一区二区三区| 在线看一区二区| 91精品婷婷国产综合久久性色| 欧美放荡的少妇| 精品日韩在线观看| 国产精品久久久久国产精品日日| 欧美高清一级片在线观看| 亚洲色图.com| 日韩电影在线观看一区| 加勒比av一区二区| 丁香婷婷综合激情五月色| 91国偷自产一区二区三区成为亚洲经典| 在线免费视频一区二区| 日韩欧美电影一区| ●精品国产综合乱码久久久久| 亚洲bdsm女犯bdsm网站| 狠狠色狠狠色综合系列| 91影院在线免费观看| 在线综合亚洲欧美在线视频| 久久久久久久久蜜桃| 亚洲一二三四在线| 国产精品一区二区三区乱码| 欧美性猛交一区二区三区精品| 日韩写真欧美这视频| 国产精品二区一区二区aⅴ污介绍| 亚洲黄色免费电影| 韩国视频一区二区| 欧美丰满高潮xxxx喷水动漫| 国产精品视频九色porn| 美国三级日本三级久久99| a级精品国产片在线观看| 日韩欧美高清在线| 亚洲狠狠爱一区二区三区| 国产成人免费视频| 日韩欧美成人午夜| 亚洲一区二区在线免费观看视频 | 国产欧美日韩视频一区二区| 亚洲影视在线播放| 成人性生交大片免费| 日韩精品一区二区三区蜜臀| 亚洲精品乱码久久久久久日本蜜臀| 奇米精品一区二区三区在线观看一| 99精品视频在线播放观看| 26uuu亚洲综合色欧美| 亚洲一二三四久久| www.亚洲人| 国产亲近乱来精品视频| 九九**精品视频免费播放| 欧美日韩一二区| 一区二区三区视频在线看| 成人激情免费网站| 久久久国产午夜精品| 美日韩一区二区| 欧美日韩国产成人在线91| 亚洲欧美激情视频在线观看一区二区三区 | 成人国产一区二区三区精品| 亚洲精品在线网站| 精品一区二区三区的国产在线播放| 欧美日韩午夜影院| 一区二区三区在线影院| 色诱视频网站一区| 亚洲猫色日本管| 在线观看三级视频欧美| 亚洲综合久久久| 精品视频色一区| 亚洲bt欧美bt精品777| 欧美人动与zoxxxx乱| 肉色丝袜一区二区| 51久久夜色精品国产麻豆| 免费人成网站在线观看欧美高清| 777午夜精品视频在线播放| 日韩中文字幕91| 欧美猛男gaygay网站| 日韩av中文字幕一区二区| 精品国产乱码久久久久久影片| 国内一区二区视频| 中文字幕一区二区三区四区| 91国产视频在线观看| 香蕉久久一区二区不卡无毒影院| 777午夜精品免费视频| 久久se精品一区精品二区| 久久精品欧美一区二区三区麻豆| 成人精品视频一区| 亚洲不卡在线观看| 久久亚洲欧美国产精品乐播| 成人免费毛片片v| 一区二区不卡在线播放 | 日韩一级免费观看| 国产一区二区三区在线看麻豆| 国产三级精品视频| 色综合天天性综合| 午夜久久久久久久久| 日韩欧美在线网站| 成人av小说网| 午夜精品久久久久久久99水蜜桃| 亚洲精品一区二区精华| 97se亚洲国产综合在线| 男女激情视频一区| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美性受极品xxxx喷水| 国产综合成人久久大片91| 一区二区三区久久| 久久这里只有精品6| 色欧美日韩亚洲| 久久疯狂做爰流白浆xx| 亚洲精品免费在线播放| 国产亚洲欧美一级| 91精品国产全国免费观看| 国精产品一区一区三区mba桃花| 亚洲免费在线视频一区 二区| 久久这里只有精品6| 在线播放视频一区| 91麻豆蜜桃一区二区三区| 韩国av一区二区| 日韩va亚洲va欧美va久久| 一区二区三区在线影院| 国产精品久久久久精k8| 精品国产91乱码一区二区三区| 欧美性猛片xxxx免费看久爱| 99久久99久久精品国产片果冻| 九色|91porny| 日韩激情一二三区| 亚洲激情综合网| 中文字幕在线不卡| 欧美国产亚洲另类动漫| 久久免费电影网| 欧美tk丨vk视频| 欧美一区二区免费视频| 欧美日韩精品一区二区天天拍小说| 99久久久免费精品国产一区二区 | 国产精品三级在线观看| 91精品黄色片免费大全| 欧美体内she精视频| 91视频观看免费| av激情成人网| www.色综合.com| 风间由美性色一区二区三区| 激情亚洲综合在线| 狠狠色综合播放一区二区| 韩国av一区二区三区| 国产一区二区三区久久悠悠色av| 美美哒免费高清在线观看视频一区二区| 日韩va亚洲va欧美va久久| 蜜桃传媒麻豆第一区在线观看| 毛片一区二区三区| 精品亚洲免费视频| 国产一区二区三区不卡在线观看 | 91黄色免费看| 欧美日韩一区二区在线视频| 欧美日韩免费观看一区三区| 欧美精品丝袜久久久中文字幕| 欧美日韩国产免费| 日韩欧美视频一区| 国产日韩欧美不卡在线| 国产精品另类一区| 亚洲黄色免费网站| 麻豆成人av在线| 国产精品99精品久久免费| av一区二区三区在线| 欧美三电影在线| 欧美一级艳片视频免费观看| 久久综合狠狠综合久久激情| ●精品国产综合乱码久久久久| 一区二区三区欧美在线观看| 日本视频中文字幕一区二区三区| 国产在线麻豆精品观看| 波多野结衣91| 欧美一区二区免费视频| 国产亚洲欧洲997久久综合| 亚洲视频中文字幕| 免费观看一级欧美片| 波多野结衣中文字幕一区| 欧洲一区在线电影| 久久精品人人做人人爽人人| 亚洲国产成人av网| 国产黄色精品网站| 欧美亚洲高清一区二区三区不卡| 日韩三级伦理片妻子的秘密按摩| 国产精品私房写真福利视频| 午夜欧美在线一二页| 成人v精品蜜桃久久一区| 欧美日韩精品一区二区三区四区| 国产喷白浆一区二区三区| 日韩av一级电影| 在线视频国内一区二区| 国产欧美日韩在线|