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

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

?? bin2c.c

?? Source code (C++) of the Icebloxx game for Symbian OS UIQ3.x
?? C
字號:
/*
 *  bin2c - compresses data files & converts the result to C source code
 *  Copyright (C) 1998-2000  Anders Widell  <awl@hem.passagen.se>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 * This command uses the zlib library to compress each file given on
 * the command line, and outputs the compressed data as C source code
 * to the file 'data.c' in the current directory
 *
 */


#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef USE_LIBZ
#include <zlib.h>
#else
typedef unsigned char Bytef;
typedef unsigned long uLongf;
#endif

#define BUFSIZE 16384            /* Increase buffer size by this amount */

static Bytef *source=NULL;       /* Buffer containing uncompressed data */
static Bytef *dest=NULL;         /* Buffer containing compressed data */
static uLongf sourceBufSize=0;   /* Buffer size */
#ifdef USE_LIBZ
static uLongf destBufSize=0;     /* Buffer size */
#endif

static uLongf sourceLen;         /* Length of uncompressed data */
static uLongf destLen;           /* Length of compressed data */

static FILE *infile=NULL;        /* The input file containing binary data */
static FILE *outfile=NULL;       /* The output file 'data.c' */

static const char *programName="";

/*
 * Print error message and free allocated resources
 *
 */

static int
error (msg1, msg2, msg3)
     char *msg1;
     char *msg2;
     char *msg3;
{
  fprintf (stderr, "%s: %s%s%s\n", programName, msg1, msg2, msg3);

  if (infile != NULL) fclose (infile);
  if (outfile != NULL) fclose (outfile);
  remove ("data.c");
  free (dest);
  free (source);

  return 1;
}

/*
 * Replacement for strrchr in case it isn't present in libc
 *
 */

static char *
my_strrchr (s, c)
     char *s;
     int c;
{
  char *ptr = NULL;

  while (*s) {
    if (*s == c) ptr = s;
    s++;
  }

  return ptr;
}

#ifdef USE_LIBZ
/*
 * NOTE: my_compress2 is taken directly from zlib 1.1.3
 *
 * This is for compability with early versions of zlib that
 * don't have the compress2 function.
 *
 */

/* ===========================================================================
     Compresses the source buffer into the destination buffer. The level
   parameter has the same meaning as in deflateInit.  sourceLen is the byte
   length of the source buffer. Upon entry, destLen is the total size of the
   destination buffer, which must be at least 0.1% larger than sourceLen plus
   12 bytes. Upon exit, destLen is the actual size of the compressed buffer.

     compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough
   memory, Z_BUF_ERROR if there was not enough room in the output buffer,
   Z_STREAM_ERROR if the level parameter is invalid.
*/
int my_compress2 (dest, destLen, source, sourceLen, level)
    Bytef *dest;
    uLongf *destLen;
    const Bytef *source;
    uLong sourceLen;
    int level;
{
    z_stream stream;
    int err;

    stream.next_in = (Bytef*)source;
    stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
    /* Check for source > 64K on 16-bit machine: */
    if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
#endif
    stream.next_out = dest;
    stream.avail_out = (uInt)*destLen;
    if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;

    stream.zalloc = (alloc_func)0;
    stream.zfree = (free_func)0;
    stream.opaque = (voidpf)0;

    err = deflateInit(&stream, level);
    if (err != Z_OK) return err;

    err = deflate(&stream, Z_FINISH);
    if (err != Z_STREAM_END) {
        deflateEnd(&stream);
        return err == Z_OK ? Z_BUF_ERROR : err;
    }
    *destLen = stream.total_out;

    err = deflateEnd(&stream);
    return err;
}
#endif

int
main (argc, argv)
     int argc;
     char **argv;
{
  int i;
  const char *suffix;
#ifdef USE_LIBZ
  int result;
#endif
  unsigned j;
  char *ptr;
  int position;

  programName = argv[0];

  outfile = fopen ("data.c", "w");
  if (outfile == NULL) {
      fprintf (stderr, "%s: can't open 'data.c' for writing\n", argv[0]);
      return 1;
  }

  suffix = argv[1];
  /* Process each file given on command line */
  for (i=2; i<argc; i++) {
    infile = fopen (argv[i], "rb");
    if (infile == NULL) return error ("can't open '", argv[i], "' for reading");

    /* Read infile to source buffer */
    sourceLen = 0;
    while (!feof (infile)) {
      if (sourceLen + BUFSIZE > sourceBufSize) {
	sourceBufSize += BUFSIZE;
	source = realloc (source, sourceBufSize);
	if (source == NULL) return error ("memory exhausted", "", "");
      }
      sourceLen += fread (source+sourceLen, 1, BUFSIZE, infile);
      if (ferror (infile)) return error ("error reading '", argv[i], "'");
    }
    fclose (infile);

#ifdef USE_LIBZ

    /* (Re)allocate dest buffer */
    destLen = sourceBufSize + (sourceBufSize+9)/10 + 12;
    if (destBufSize < destLen) {
      destBufSize = destLen;
      dest = realloc (dest, destBufSize);
      if (dest == NULL) return error ("memory exhausted", "", "");
    }

    /* Compress dest buffer */
    destLen = destBufSize;
    result = my_compress2 (dest, &destLen, source, sourceLen, 9);
    if (result != Z_OK) return error ("error compressing '", argv[i], "'");

#else

    destLen = sourceLen;
    dest = source;

#endif

    /* Output dest buffer as C source code to outfile */
    ptr = my_strrchr (argv[i], '.');
    if (ptr != NULL) *ptr = '\0';
    /* use only the file 2name and throw away the path name */
    position = strlen(argv[i]) - 1;
    while (position && argv[i][position] != '/') position--;
    if (argv[i][position] == '/') position++;
    
    fprintf (outfile, "static const unsigned char %s_data_%s[] = {\n", argv[i] + position, suffix);

    for (j=0; j<destLen-1; j++) {
      switch (j%8) {
      case 0:
	fprintf (outfile, "  0x%02x, ", ((unsigned) dest[j]) & 0xffu);
	break;
      case 7:
	fprintf (outfile, "0x%02x,\n", ((unsigned) dest[j]) & 0xffu);
	break;
      default:
	fprintf (outfile, "0x%02x, ", ((unsigned) dest[j]) & 0xffu);
	break;
      }
    }

    if ((destLen-1)%8 == 0) fprintf (outfile, "  0x%02x\n};\n\n", ((unsigned) dest[destLen-1]) & 0xffu);
    else fprintf (outfile, "0x%02x\n};\n\n", ((unsigned) dest[destLen-1]) & 0xffu);
  }

  fclose (outfile);
#ifdef USE_LIBZ
  free (dest);
#endif
  free (source);

  return 0;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美天天综合网| 成人欧美一区二区三区黑人麻豆 | 久久久久久黄色| 蜜桃久久精品一区二区| 日韩欧美综合一区| 美国毛片一区二区三区| 久久久久久免费| 99在线精品观看| 一区二区三区小说| 欧美日韩第一区日日骚| 黄网站免费久久| 国产精品国产三级国产a | 欧美自拍偷拍一区| 午夜精品久久久久久久久久| 日韩欧美的一区二区| 国产69精品久久久久777| 亚洲视频综合在线| 欧美一区二区免费视频| 国产aⅴ综合色| 亚洲一区二区三区四区在线| 欧美成人女星排行榜| 盗摄精品av一区二区三区| 夜夜夜精品看看| 欧美白人最猛性xxxxx69交| 成人app下载| 免费亚洲电影在线| 国产精品福利影院| 7777精品伊人久久久大香线蕉超级流畅 | jvid福利写真一区二区三区| 亚洲大型综合色站| 精品播放一区二区| a美女胸又www黄视频久久| 日韩高清电影一区| 中文字幕一区二区三区四区| 91精品国产综合久久久蜜臀粉嫩 | 亚洲自拍偷拍综合| 精品成人a区在线观看| 在线观看av一区二区| 精品一区二区久久久| 亚洲一区二区三区三| 久久久精品免费免费| 69堂成人精品免费视频| 99久久精品费精品国产一区二区| 麻豆成人综合网| 亚洲资源中文字幕| 国产精品美女久久久久久2018| 精品视频一区 二区 三区| 成人精品鲁一区一区二区| 美女一区二区三区| 亚洲一区二区综合| 国产精品国产成人国产三级| www国产成人免费观看视频 深夜成人网| 99精品在线免费| 国产精品伊人色| 日韩精彩视频在线观看| 亚洲日本青草视频在线怡红院 | 不卡的电影网站| 国产一区不卡视频| 日日摸夜夜添夜夜添亚洲女人| 国产精品久久久久精k8| 久久午夜老司机| 欧美一区二区三区公司| 欧美日韩你懂的| 91在线观看污| 成人午夜视频福利| 国产电影一区二区三区| 韩国女主播成人在线| 男人操女人的视频在线观看欧美| 亚洲高清免费视频| 一区二区久久久久| 亚洲免费观看高清完整版在线| 中文字幕不卡一区| 国产亚洲欧美激情| 国产欧美日韩不卡| 国产欧美精品一区二区色综合朱莉 | 国产综合色精品一区二区三区| 日欧美一区二区| 日韩精品一二三四| 日韩精品成人一区二区三区| 日本成人在线看| 麻豆91精品91久久久的内涵| 另类综合日韩欧美亚洲| 久久精品国产77777蜜臀| 免费看欧美美女黄的网站| 日韩av中文在线观看| 麻豆成人免费电影| 国产在线一区观看| 国产精品911| 成年人网站91| 欧美一a一片一级一片| 91精品婷婷国产综合久久 | 色老汉av一区二区三区| 欧美曰成人黄网| 欧美精品一卡二卡| 日韩欧美国产综合一区 | 成人深夜在线观看| 91网站视频在线观看| 欧美午夜一区二区| 91精品国产aⅴ一区二区| 欧美精品一区二区三区视频| 日本一区二区三区四区在线视频 | 91传媒视频在线播放| 欧美日韩一级视频| 精品女同一区二区| 国产精品美女久久久久久久网站| 一区二区在线观看视频| 日韩专区欧美专区| 国产高清视频一区| 色呦呦一区二区三区| 欧美日韩精品电影| 337p日本欧洲亚洲大胆色噜噜| 国产精品高潮呻吟久久| 五月激情丁香一区二区三区| 国产在线精品一区在线观看麻豆| 成人爱爱电影网址| 制服丝袜在线91| 欧美韩国一区二区| 天天av天天翘天天综合网| 国产精品69久久久久水密桃| 在线影院国内精品| 久久先锋影音av| 亚洲成a天堂v人片| 粉嫩一区二区三区性色av| 日本丰满少妇一区二区三区| 精品久久久久一区二区国产| 亚洲少妇30p| 久久精品72免费观看| 99国产一区二区三精品乱码| 亚洲免费视频中文字幕| 国产免费观看久久| 欧美激情一区二区在线| 亚洲欧美国产77777| 美女www一区二区| 91蝌蚪国产九色| 欧美刺激午夜性久久久久久久| 51精品国自产在线| 制服丝袜av成人在线看| 久久精品这里都是精品| 婷婷综合另类小说色区| 免费人成精品欧美精品| 9人人澡人人爽人人精品| 高清av一区二区| 欧洲国产伦久久久久久久| 久久久久久久综合| 一区二区三区欧美| 国产精品小仙女| 欧美一区二区免费| 亚洲尤物在线视频观看| 国产成a人无v码亚洲福利| 欧美日韩国产影片| 亚洲视频一区二区免费在线观看| 国产在线国偷精品产拍免费yy| 9191成人精品久久| 一区二区三区鲁丝不卡| 成人听书哪个软件好| 日韩美女在线视频| 天堂成人国产精品一区| 91福利在线播放| 国产精品久久久久久亚洲毛片| 不卡大黄网站免费看| 精品国产一区二区三区久久影院| 久久99最新地址| 中文字幕五月欧美| 国产一区二区三区四| 亚洲人妖av一区二区| 欧美性一二三区| 玉足女爽爽91| 欧美激情一区二区三区四区| 国产乱码精品一区二区三区忘忧草 | 99re在线视频这里只有精品| 欧美精品一区二区精品网| 日韩国产精品大片| 欧美性猛片xxxx免费看久爱| 亚洲狠狠丁香婷婷综合久久久| 99久久免费精品| 亚洲欧洲美洲综合色网| 福利视频网站一区二区三区| 国产婷婷一区二区| 国产精品91xxx| 欧美高清在线一区| 不卡电影一区二区三区| 中文字幕一区二区日韩精品绯色| 国产iv一区二区三区| 久久精品视频一区二区三区| 国产精品1区2区| 欧美高清一级片在线观看| 处破女av一区二区| 中文字幕成人在线观看| 一区二区在线看| 国产欧美日韩视频在线观看| 欧美一区二区三区婷婷月色| 色狠狠桃花综合| 99久久精品免费看| 国产精品66部| 色哟哟精品一区| 日韩一卡二卡三卡四卡| 麻豆免费精品视频| 国产精品区一区二区三区| av在线不卡免费看| 日韩免费一区二区|