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

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

?? jmemdos.c

?? JPEG source code converts the image into compressed format
?? 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| 亚洲国产岛国毛片在线| 麻豆久久久久久久| 欧美无人高清视频在线观看| 亚洲国产电影在线观看| 久久精品国产77777蜜臀| 日本二三区不卡| 中文字幕一区二区三区四区不卡 | 国产精品一线二线三线| 欧美日韩国产乱码电影| 国产精品国产三级国产| 国产一区二区三区电影在线观看 | 亚洲成人av一区二区三区| 成人av电影在线观看| 久久色在线观看| 久久国产综合精品| 日韩一区国产二区欧美三区| 亚洲国产精品视频| 欧美亚洲精品一区| 亚洲一区二区在线观看视频 | 亚洲精品欧美在线| av激情成人网| 成人欧美一区二区三区1314 | 在线观看一区日韩| 一区二区三区日韩精品| 91免费在线视频观看| 国产精品不卡视频| 91欧美激情一区二区三区成人| 国产精品萝li| 一本色道久久综合亚洲aⅴ蜜桃| 国产精品毛片久久久久久久| av影院午夜一区| 一区二区三区蜜桃| 欧美乱妇15p| 另类的小说在线视频另类成人小视频在线| 欧美在线免费视屏| 日韩成人午夜电影| 精品久久国产字幕高潮| 国产精品小仙女| 国产精品另类一区| 色吧成人激情小说| 午夜精品久久久久| 精品日本一线二线三线不卡| 国内精品久久久久影院薰衣草| 精品国产在天天线2019| 国产激情91久久精品导航| 中文在线免费一区三区高中清不卡| 不卡电影免费在线播放一区| 亚洲精品成人天堂一二三| 欧美日韩精品二区第二页| 日韩av二区在线播放| 久久网站热最新地址| 成人黄色综合网站| 亚洲成人第一页| 国产丝袜欧美中文另类| 在线欧美日韩精品| 免费不卡在线视频| 国产精品国产三级国产| 欧美精品日韩一区| 成人午夜视频在线| 午夜免费久久看| 国产日韩一级二级三级| 91搞黄在线观看| 国产综合久久久久久久久久久久| 成人欧美一区二区三区白人| 884aa四虎影成人精品一区| 国产福利一区二区| 亚洲午夜激情网站| 国产三级欧美三级| 欧美欧美午夜aⅴ在线观看| 国产成人精品影院| 天天操天天综合网| 中文字幕一区二区三区在线观看 | 91官网在线观看| 国产福利一区二区| 日本不卡视频在线| 亚洲码国产岛国毛片在线| 精品少妇一区二区三区日产乱码 | 2021中文字幕一区亚洲| 欧美主播一区二区三区| 高清久久久久久| 久久成人免费网| 一区二区久久久| 国产精品视频在线看| 精品久久99ma| 欧美美女网站色| 色综合久久66| www.综合网.com| 国产一区二区美女诱惑| 天堂成人国产精品一区| 亚洲一二三专区| 一区在线播放视频| 欧美高清在线精品一区| 日韩久久久久久| 欧美一区二区成人6969| 欧美三级三级三级| 91国产丝袜在线播放| 99re成人精品视频| gogo大胆日本视频一区| 国产sm精品调教视频网站| 韩国成人福利片在线播放| 麻豆91小视频| 久久超级碰视频| 麻豆精品蜜桃视频网站| 免费国产亚洲视频| 欧美a级理论片| 蜜桃视频一区二区三区 | 亚洲最新视频在线观看| 最新中文字幕一区二区三区| 国产精品理伦片| 亚洲人成网站在线| 亚洲你懂的在线视频| 亚洲人成在线观看一区二区| 中文字幕中文字幕中文字幕亚洲无线| 久久精品夜色噜噜亚洲a∨| 欧美sm极限捆绑bd| 国产日韩高清在线| 国产精品久久久久久久裸模| 亚洲日本在线天堂| 亚洲一区二区三区爽爽爽爽爽| 亚洲mv在线观看| 日本中文一区二区三区| 紧缚奴在线一区二区三区| 国产suv精品一区二区6| 色悠悠亚洲一区二区| 欧美日韩视频在线一区二区| 在线电影欧美成精品| 欧美一区二区不卡视频| 久久久www成人免费毛片麻豆 | jizzjizzjizz欧美| 欧美综合欧美视频| 日韩午夜av电影| 日本一区免费视频| 狠狠色丁香久久婷婷综| 九九**精品视频免费播放| 国产精品亚洲第一区在线暖暖韩国| 成人av在线看| 欧美日本高清视频在线观看| 日韩精品一区二区三区swag| 久久久亚洲午夜电影| 综合久久久久久| 日韩电影在线免费看| 成人激情视频网站| 国产 欧美在线| 99国产精品久| 精品999在线播放| 日韩毛片高清在线播放| 午夜久久久久久久久久一区二区| 国产老肥熟一区二区三区| 欧美在线视频不卡| 国产视频一区二区在线观看| 亚洲二区视频在线| 成人免费视频一区二区| 欧美日本乱大交xxxxx| 国产精品免费丝袜| 蜜桃免费网站一区二区三区| 99国产精品一区| 久久综合国产精品| 婷婷一区二区三区| 99国产精品久久久久久久久久久| 日韩限制级电影在线观看| 亚洲欧美日韩中文播放| 国产综合色产在线精品| 欧美日韩精品一区视频| 国产精品久久看| 国产精品一卡二| 日韩亚洲欧美综合| 亚洲国产一二三| 93久久精品日日躁夜夜躁欧美| 精品国产在天天线2019| 视频一区二区不卡| 色爱区综合激月婷婷| 国产精品久久一级| 国产精品一区二区黑丝| 日韩丝袜情趣美女图片| 亚洲小说欧美激情另类| 91网站视频在线观看| 国产精品麻豆网站| 懂色av一区二区三区蜜臀 | 久久精品99国产精品| 欧美日韩国产美女| 亚洲综合av网| 在线欧美小视频| 亚洲精品成人少妇| 日本精品裸体写真集在线观看| 中文字幕成人在线观看| 国产成人久久精品77777最新版本| 欧美精品一区二区蜜臀亚洲| 蜜臀av在线播放一区二区三区| 欧美精品视频www在线观看| 亚洲电影你懂得| 在线不卡a资源高清| 天天免费综合色| 日韩欧美三级在线| 裸体在线国模精品偷拍|