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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? jmemname.c

?? 這是JPEG解碼、編碼的源代碼
?? C
字號(hào):
/*
 * jmemname.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 a generic implementation of the system-dependent
 * portion of the JPEG memory manager.  This implementation assumes that
 * you must explicitly construct a name for each temp file.
 * Also, the problem of determining the amount of memory available
 * is shoved onto the user.
 */

#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 malloc(),free() */
extern void * malloc JPP((size_t size));
extern void free JPP((void *ptr));
#endif

#ifndef SEEK_SET		/* pre-ANSI systems may not define this; */
#define SEEK_SET  0		/* if not, assume 0 is correct */
#endif

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


/*
 * Selection of a file name for a temporary file.
 * This is system-dependent!
 *
 * The code as given is suitable for most Unix systems, and it is easily
 * modified for most non-Unix systems.  Some notes:
 *  1.  The temp file is created in the directory named by TEMP_DIRECTORY.
 *      The default value is /usr/tmp, which is the conventional place for
 *      creating large temp files on Unix.  On other systems you'll probably
 *      want to change the file location.  You can do this by editing the
 *      #define, or (preferred) by defining TEMP_DIRECTORY in jconfig.h.
 *
 *  2.  If you need to change the file name as well as its location,
 *      you can override the TEMP_FILE_NAME macro.  (Note that this is
 *      actually a printf format string; it must contain %s and %d.)
 *      Few people should need to do this.
 *
 *  3.  mktemp() is used to ensure that multiple processes running
 *      simultaneously won't select the same file names.  If your system
 *      doesn't have mktemp(), define NO_MKTEMP to do it the hard way.
 *      (If you don't have <errno.h>, also define NO_ERRNO_H.)
 *
 *  4.  You probably want to define NEED_SIGNAL_CATCHER so that cjpeg.c/djpeg.c
 *      will cause the temp files to be removed if you stop the program early.
 */

#ifndef TEMP_DIRECTORY		/* can override from jconfig.h or Makefile */
#define TEMP_DIRECTORY  "/usr/tmp/" /* recommended setting for Unix */
#endif

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

#ifdef NO_MKTEMP

#ifndef TEMP_FILE_NAME		/* can override from jconfig.h or Makefile */
#define TEMP_FILE_NAME  "%sJPG%03d.TMP"
#endif

#ifndef NO_ERRNO_H
#include <errno.h>		/* to define ENOENT */
#endif

/* ANSI C specifies that errno is a macro, but on older systems it's more
 * likely to be a plain int variable.  And not all versions of errno.h
 * bother to declare it, so we have to in order to be most portable.  Thus:
 */
#ifndef errno
extern int errno;
#endif


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

  /* Keep generating file names till we find one that's not in use */
  for (;;) {
    next_file_num++;		/* advance counter */
    sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
    if ((tfile = fopen(fname, READ_BINARY)) == NULL) {
      /* fopen could have failed for a reason other than the file not
       * being there; for example, file there but unreadable.
       * If <errno.h> isn't available, then we cannot test the cause.
       */
#ifdef ENOENT
      if (errno != ENOENT)
	continue;
#endif
      break;
    }
    fclose(tfile);		/* oops, it's there; close tfile & try again */
  }
}

#else /* ! NO_MKTEMP */

/* Note that mktemp() requires the initial filename to end in six X's */
#ifndef TEMP_FILE_NAME		/* can override from jconfig.h or Makefile */
#define TEMP_FILE_NAME  "%sJPG%dXXXXXX"
#endif

LOCAL(void)
select_file_name (char * fname)
{
  next_file_num++;		/* advance counter */
  sprintf(fname, TEMP_FILE_NAME, TEMP_DIRECTORY, next_file_num);
  mktemp(fname);		/* make sure file name is unique */
  /* mktemp replaces the trailing XXXXXX with a unique string of characters */
}

#endif /* NO_MKTEMP */


/*
 * 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 treated the same as "small" ones.
 * NB: although we include FAR keywords in the routine declarations,
 * this file won't actually work in 80x86 small/medium model; at least,
 * you probably won't be able to process useful-size images in only 64KB.
 */

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

GLOBAL(void)
jpeg_free_large (j_common_ptr cinfo, void FAR * object, size_t sizeofobject)
{
  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		1000000L /* default: one megabyte */
#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.
 */


METHODDEF(void)
read_backing_store (j_common_ptr cinfo, backing_store_ptr info,
		    void FAR * buffer_address,
		    long file_offset, long byte_count)
{
  if (fseek(info->temp_file, file_offset, SEEK_SET))
    ERREXIT(cinfo, JERR_TFILE_SEEK);
  if (JFREAD(info->temp_file, buffer_address, byte_count)
      != (size_t) byte_count)
    ERREXIT(cinfo, JERR_TFILE_READ);
}


METHODDEF(void)
write_backing_store (j_common_ptr cinfo, backing_store_ptr info,
		     void FAR * buffer_address,
		     long file_offset, long byte_count)
{
  if (fseek(info->temp_file, file_offset, SEEK_SET))
    ERREXIT(cinfo, JERR_TFILE_SEEK);
  if (JFWRITE(info->temp_file, buffer_address, byte_count)
      != (size_t) byte_count)
    ERREXIT(cinfo, JERR_TFILE_WRITE);
}


METHODDEF(void)
close_backing_store (j_common_ptr cinfo, backing_store_ptr info)
{
  fclose(info->temp_file);	/* close the file */
  unlink(info->temp_name);	/* delete the file */
/* If your system doesn't have unlink(), use remove() instead.
 * remove() is the ANSI-standard name for this function, but if
 * your system was ANSI you'd be using jmemansi.c, right?
 */
  TRACEMSS(cinfo, 1, JTRC_TFILE_CLOSE, info->temp_name);
}


/*
 * Initial opening of a backing-store object.
 */

GLOBAL(void)
jpeg_open_backing_store (j_common_ptr cinfo, backing_store_ptr info,
			 long total_bytes_needed)
{
  select_file_name(info->temp_name);
  if ((info->temp_file = fopen(info->temp_name, RW_BINARY)) == NULL)
    ERREXITS(cinfo, JERR_TFILE_CREATE, info->temp_name);
  info->read_backing_store = read_backing_store;
  info->write_backing_store = write_backing_store;
  info->close_backing_store = close_backing_store;
  TRACEMSS(cinfo, 1, JTRC_TFILE_OPEN, info->temp_name);
}


/*
 * These routines take care of any system-dependent initialization and
 * cleanup required.
 */

GLOBAL(long)
jpeg_mem_init (j_common_ptr cinfo)
{
  next_file_num = 0;		/* initialize temp file name generator */
  return DEFAULT_MAX_MEM;	/* default for max_memory_to_use */
}

GLOBAL(void)
jpeg_mem_term (j_common_ptr cinfo)
{
  /* no work */
}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品欧美极品| 国产在线精品免费| 狠狠网亚洲精品| 欧美亚洲国产bt| 国产情人综合久久777777| 午夜欧美2019年伦理| 成人午夜激情影院| 精品国产一区a| 午夜精品久久久久影视| 波多野结衣欧美| 欧美mv和日韩mv的网站| 亚洲午夜一区二区| 99久久精品免费看| 国产亚洲精品aa| 狠狠色狠狠色综合| 91精品视频网| 午夜av一区二区| 欧美伊人久久久久久午夜久久久久| 国产亚洲欧美日韩俺去了| 免费在线视频一区| 欧美美女一区二区三区| 亚洲主播在线观看| 在线视频你懂得一区| 有码一区二区三区| 91蝌蚪porny| 亚洲三级免费观看| 99精品桃花视频在线观看| 国产欧美综合在线观看第十页 | 国产精品视频在线看| 国产亚洲综合在线| 一区二区三区国产| 99re视频精品| 国产精品欧美一区二区三区| 国产精品自拍一区| 欧美大片在线观看一区| 久久国产日韩欧美精品| 日韩欧美一级二级三级久久久| 日本免费新一区视频| 日韩一级免费一区| 久久国产精品第一页| 精品三级av在线| 国产一区欧美日韩| 久久久精品一品道一区| 9191成人精品久久| 污片在线观看一区二区| 欧美第一区第二区| 国产成人免费视频一区| 国产精品另类一区| 日本道色综合久久| 午夜视频久久久久久| 91麻豆精品国产91久久久更新时间| 婷婷久久综合九色综合伊人色| 日韩三级视频在线观看| 国产乱码精品1区2区3区| 国产精品免费网站在线观看| 91丨porny丨最新| 亚洲一区二区三区激情| 欧美一级片在线观看| 国产麻豆精品视频| 亚洲色图视频网| 在线不卡免费欧美| 国产精品亚洲第一| 亚洲精品v日韩精品| 日韩一区二区三区av| 国产99久久久久| 偷拍亚洲欧洲综合| 久久女同性恋中文字幕| 日本韩国一区二区三区视频| 免费成人在线网站| 综合网在线视频| 欧美一区二区免费观在线| 国产+成+人+亚洲欧洲自线| 一区二区三区四区国产精品| 精品久久久久久久人人人人传媒| 国产成人精品免费在线| 一区二区三区欧美久久| 精品国产91久久久久久久妲己| 91麻豆.com| 国产成人一级电影| 天天影视网天天综合色在线播放| 国产精品网友自拍| 日韩免费视频一区二区| 91免费看片在线观看| 国模无码大尺度一区二区三区| 亚洲人成影院在线观看| 精品88久久久久88久久久| 色噜噜狠狠色综合欧洲selulu| 国产一区二区三区四| 日日摸夜夜添夜夜添亚洲女人| 国产精品美女久久久久高潮| 欧美刺激午夜性久久久久久久| 一本色道久久综合亚洲精品按摩| 国产麻豆午夜三级精品| 天堂一区二区在线| 一区二区高清视频在线观看| 国产欧美一区二区三区在线老狼| 日韩欧美视频一区| 欧美日本韩国一区| 97久久人人超碰| 久久se这里有精品| 亚洲chinese男男1069| 中文字幕一区二区三区四区不卡| 精品国产一二三| 日韩三级伦理片妻子的秘密按摩| 欧美日韩精品一区二区| 色婷婷激情综合| 99精品国产热久久91蜜凸| 成人自拍视频在线| 成人永久免费视频| 国产激情一区二区三区| 国产呦萝稀缺另类资源| 久久爱www久久做| 国精产品一区一区三区mba视频 | 国产亚洲欧美色| 久久人人爽爽爽人久久久| 日韩欧美一区在线观看| 欧美一区二区三区白人| 欧美一区二区三区在线观看| 4438x亚洲最大成人网| 欧美日韩国产大片| 91精品国产色综合久久不卡电影| 717成人午夜免费福利电影| 欧美日韩国产一区二区三区地区| 91精品在线一区二区| 欧美一区二区三区视频在线| 日韩色视频在线观看| 久久亚洲精品国产精品紫薇| 国产女主播一区| 亚洲视频电影在线| 亚洲自拍欧美精品| 久久精品国产色蜜蜜麻豆| 国产精品系列在线观看| 97se狠狠狠综合亚洲狠狠| 欧美在线观看视频一区二区| 日韩一区二区三区视频在线| wwww国产精品欧美| 自拍偷自拍亚洲精品播放| 亚洲综合成人网| 麻豆精品久久久| 99亚偷拍自图区亚洲| 欧美亚洲综合一区| 精品国精品自拍自在线| 中文字幕高清一区| 亚洲一卡二卡三卡四卡五卡| 美日韩一级片在线观看| 成人在线视频一区| 欧美精品日韩综合在线| 国产亚洲成年网址在线观看| 一区二区三区在线观看视频| 蜜臀a∨国产成人精品| 不卡一区在线观看| 91精品国产综合久久精品麻豆| 久久久国产一区二区三区四区小说| 亚洲欧洲www| 日本va欧美va欧美va精品| 成人黄色国产精品网站大全在线免费观看| 欧美色手机在线观看| 久久久久国产成人精品亚洲午夜 | 久久精品亚洲乱码伦伦中文| 一区二区三区丝袜| 国产传媒欧美日韩成人| 欧美在线观看18| 中文字幕免费一区| 日日夜夜免费精品| 97久久精品人人做人人爽50路 | 日韩中文字幕亚洲一区二区va在线| 国产精品亚洲午夜一区二区三区 | 日韩三级免费观看| 亚洲欧美偷拍三级| 国产精品亚洲专一区二区三区 | 成人高清免费观看| 日韩亚洲欧美成人一区| 亚洲人成影院在线观看| 国产成人亚洲精品狼色在线| 欧美裸体bbwbbwbbw| 亚洲另类一区二区| 成人精品视频.| 久久综合色8888| 日产精品久久久久久久性色| 色综合天天视频在线观看| 亚洲国产精品二十页| 国产在线不卡一卡二卡三卡四卡| 91精品国产综合久久精品| 亚洲国产va精品久久久不卡综合| 成人国产电影网| 亚洲香蕉伊在人在线观| 99久久婷婷国产综合精品| 欧美高清在线视频| 国模套图日韩精品一区二区| 欧美本精品男人aⅴ天堂| 日日摸夜夜添夜夜添亚洲女人| 91国偷自产一区二区三区观看| 中文字幕一区二区在线观看| 高潮精品一区videoshd| 久久婷婷国产综合国色天香| 国产一区二区免费看| 久久人人爽爽爽人久久久| 极品尤物av久久免费看| 精品久久久久久亚洲综合网| 韩国一区二区在线观看|