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

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

?? minigzip.c

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? C
字號:
/* minigzip.c -- simulate gzip using the zlib compression library
 * Copyright (C) 1995-1998 Jean-loup Gailly.
 * Copyright (C) 2000      Tenik Co.,Ltd.
 * For conditions of distribution and use, see copyright notice in zlib.h 
 */

/*
 * minigzip is a minimal implementation of the gzip utility. This is
 * only an example of using zlib and isn't meant to replace the
 * full-featured gzip. No attempt is made to deal with file systems
 * limiting names to 14 or 8+3 characters, etc... Error checking is
 * very limited. So use minigzip only for testing; use gzip for the
 * real thing. On MSDOS, use only on file names without extension
 * or in pipe mode.
 */

/* @(#) $Id: minigzip.c,v 1.1.1.1 2006/12/05 17:55:41 gazza Exp $ */

#if defined(_WIN32_WCE)
#if _WIN32_WCE < 211
#error (f|w)printf functions is not support old WindowsCE.
#endif
#undef USE_MMAP
#include <windows.h>
#else
#include <stdio.h>
#endif
#include "zlib.h"

#ifdef STDC
#  include <string.h>
#  include <stdlib.h>
#else
   extern void exit  OF((int));
#endif

#ifdef USE_MMAP
#  include <sys/types.h>
#  include <sys/mman.h>
#  include <sys/stat.h>
#endif

#if (defined(MSDOS) || defined(OS2) || defined(WIN32)) && !defined(_WIN32_WCE)
#  include <fcntl.h>
#  include <io.h>
#  define SET_BINARY_MODE(file) setmode(fileno(file), O_BINARY)
#else
#  define SET_BINARY_MODE(file)
#endif

#ifdef VMS
#  define unlink delete
#  define GZ_SUFFIX "-gz"
#endif
#ifdef RISCOS
#  define unlink remove
#  define GZ_SUFFIX "-gz"
#  define fileno(file) file->__file
#endif
#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
#  include <unix.h> /* for fileno */
#endif

#ifndef WIN32 /* unlink already in stdio.h for WIN32 */
  extern int unlink OF((const char *));
#endif

#ifndef GZ_SUFFIX
#  define GZ_SUFFIX ".gz"
#endif
#define SUFFIX_LEN (sizeof(GZ_SUFFIX)-1)

#define BUFLEN      16384
#define MAX_NAME_LEN 1024

#ifdef MAXSEG_64K
#  define local static
   /* Needed for systems with limitation on stack size. */
#else
#  define local
#endif

#if defined(_WIN32_WCE)
#undef  stderr
#define stderr  stdout
#define F_FILE  HANDLE
#define F_NULL  INVALID_HANDLE_VALUE
#else
#define F_FILE  FILE*
#define F_NULL  NULL
#endif

char *prog;

void error            OF((const char *msg));
void gz_compress      OF((F_FILE in, gzFile out));
#ifdef USE_MMAP
int  gz_compress_mmap OF((F_FILE in, gzFile out));
#endif
void gz_uncompress    OF((gzFile in, F_FILE out));
void file_compress    OF((char  *file, char *mode));
void file_uncompress  OF((char  *file));
int  main             OF((int argc, char *argv[]));

/* ===========================================================================
 * Display error message and exit
 */
void error(msg)
    const char *msg;
{
    fprintf(stderr, "%s: %s\n", prog, msg);
    exit(1);
}

#if defined(_WIN32_WCE)
void perror(msg)
    const char *msg;
{
    DWORD dwError;
    LPVOID lpMsgBuf;

    dwError = GetLastError();
    if ( FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
        FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE |
        FORMAT_MESSAGE_IGNORE_INSERTS,
        NULL,
        dwError,
        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
        (LPTSTR) &lpMsgBuf,
        0,
        NULL) )
    {
        wprintf(TEXT("%S: %s\n"), msg, (LPTSTR)lpMsgBuf);
        LocalFree(lpMsgBuf);
    }
    else
    {
        wprintf(TEXT("%S: Error #%d\n"), msg, dwError);
    }
}

int unlink(filename)
    const char *filename;
{
    TCHAR path[MAX_PATH];

    MultiByteToWideChar(CP_ACP, 0, filename, -1, path, MAX_PATH);
    return DeleteFile(path);
}
#endif

/* ===========================================================================
 * Compress input to output then close both files.
 */

void gz_compress(in, out)
    F_FILE in;
    gzFile out;
{
    local char buf[BUFLEN];
    int len;
    int err;

#ifdef USE_MMAP
    /* Try first compressing with mmap. If mmap fails (minigzip used in a
     * pipe), use the normal fread loop.
     */
    if (gz_compress_mmap(in, out) == Z_OK) return;
#endif
    for (;;) {
#if defined(_WIN32_WCE)
        if (!ReadFile(in, buf, sizeof(buf), &len, NULL)) {
#else
        len = fread(buf, 1, sizeof(buf), in);
        if (ferror(in)) {
#endif
            perror("fread");
            exit(1);
        }
        if (len == 0) break;

        if (gzwrite(out, buf, (unsigned)len) != len) error(gzerror(out, &err));
    }
#if defined(_WIN32_WCE)
    CloseHandle(in);
#else
    fclose(in);
#endif
    if (gzclose(out) != Z_OK) error("failed gzclose");
}

#ifdef USE_MMAP /* MMAP version, Miguel Albrecht <malbrech@eso.org> */

/* Try compressing the input file at once using mmap. Return Z_OK if
 * if success, Z_ERRNO otherwise.
 */
int gz_compress_mmap(in, out)
    F_FILE in;
    gzFile out;
{
    int len;
    int err;
    int ifd = fileno(in);
    caddr_t buf;    /* mmap'ed buffer for the entire input file */
    off_t buf_len;  /* length of the input file */
    struct stat sb;

    /* Determine the size of the file, needed for mmap: */
    if (fstat(ifd, &sb) < 0) return Z_ERRNO;
    buf_len = sb.st_size;
    if (buf_len <= 0) return Z_ERRNO;

    /* Now do the actual mmap: */
    buf = mmap((caddr_t) 0, buf_len, PROT_READ, MAP_SHARED, ifd, (off_t)0); 
    if (buf == (caddr_t)(-1)) return Z_ERRNO;

    /* Compress the whole file at once: */
    len = gzwrite(out, (char *)buf, (unsigned)buf_len);

    if (len != (int)buf_len) error(gzerror(out, &err));

    munmap(buf, buf_len);
    fclose(in);
    if (gzclose(out) != Z_OK) error("failed gzclose");
    return Z_OK;
}
#endif /* USE_MMAP */

/* ===========================================================================
 * Uncompress input to output then close both files.
 */
void gz_uncompress(in, out)
    gzFile in;
    F_FILE out;
{
    local char buf[BUFLEN];
    int len;
    int err;
#if defined(_WIN32_WCE)
    int size;
#endif

    for (;;) {
        len = gzread(in, buf, sizeof(buf));
        if (len < 0) error (gzerror(in, &err));
        if (len == 0) break;

#if defined(_WIN32_WCE)
        if (!WriteFile(out, buf, (unsigned)len, &size, NULL) || size != len) {
#else
        if ((int)fwrite(buf, 1, (unsigned)len, out) != len) {
#endif
	    error("failed fwrite");
	}
    }
#if defined(_WIN32_WCE)
    if (!CloseHandle(out)) error("failed fclose");
#else
    if (fclose(out)) error("failed fclose");
#endif

    if (gzclose(in) != Z_OK) error("failed gzclose");
}


/* ===========================================================================
 * Compress the given file: create a corresponding .gz file and remove the
 * original.
 */
void file_compress(file, mode)
    char  *file;
    char  *mode;
{
    local char outfile[MAX_NAME_LEN];
    F_FILE in;
    gzFile out;
#if defined(_WIN32_WCE)
    TCHAR path[MAX_PATH];
#endif

    strcpy(outfile, file);
    strcat(outfile, GZ_SUFFIX);

#if defined(_WIN32_WCE)
    MultiByteToWideChar(CP_ACP, 0, file, -1, path, MAX_PATH);
    in = CreateFile(path, GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
#else
    in = fopen(file, "rb");
#endif
    if (in == F_NULL) {
        perror(file);
        exit(1);
    }
    out = gzopen(outfile, mode);
    if (out == F_NULL) {
        fprintf(stderr, "%s: can't gzopen %s\n", prog, outfile);
        exit(1);
    }
    gz_compress(in, out);

    unlink(file);
}


/* ===========================================================================
 * Uncompress the given file and remove the original.
 */
void file_uncompress(file)
    char  *file;
{
    local char buf[MAX_NAME_LEN];
    char *infile, *outfile;
    F_FILE out;
    gzFile in;
    int len = strlen(file);
#if defined(_WIN32_WCE)
    TCHAR path[MAX_PATH];
#endif

    strcpy(buf, file);

    if (len > SUFFIX_LEN && strcmp(file+len-SUFFIX_LEN, GZ_SUFFIX) == 0) {
        infile = file;
        outfile = buf;
        outfile[len-3] = '\0';
    } else {
        outfile = file;
        infile = buf;
        strcat(infile, GZ_SUFFIX);
    }
    in = gzopen(infile, "rb");
    if (in == F_NULL) {
        fprintf(stderr, "%s: can't gzopen %s\n", prog, infile);
        exit(1);
    }
#if defined(_WIN32_WCE)
    MultiByteToWideChar(CP_ACP, 0, outfile, -1, path, MAX_PATH);
    out = CreateFile(path, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 0, NULL);
#else
    out = fopen(outfile, "wb");
#endif
    if (out == F_NULL) {
        perror(file);
        exit(1);
    }

    gz_uncompress(in, out);

    unlink(infile);
}


/* ===========================================================================
 * Usage:  minigzip [-d] [-f] [-h] [-1 to -9] [files...]
 *   -d : decompress
 *   -f : compress with Z_FILTERED
 *   -h : compress with Z_HUFFMAN_ONLY
 *   -1 to -9 : compression level
 */

int main(argc, argv)
    int argc;
    char *argv[];
{
    int uncompr = 0;
#if !defined(_WIN32_WCE)
    gzFile file;
#endif
    char outmode[20];

    strcpy(outmode, "wb6 ");

    prog = argv[0];
    argc--, argv++;

    while (argc > 0) {
      if (strcmp(*argv, "-d") == 0)
	uncompr = 1;
      else if (strcmp(*argv, "-f") == 0)
	outmode[3] = 'f';
      else if (strcmp(*argv, "-h") == 0)
	outmode[3] = 'h';
      else if ((*argv)[0] == '-' && (*argv)[1] >= '1' && (*argv)[1] <= '9' &&
	       (*argv)[2] == 0)
	outmode[2] = (*argv)[1];
      else
	break;
      argc--, argv++;
    }
    if (argc == 0) {
#if defined(_WIN32_WCE)
        wprintf(TEXT("Usage:  minigzip [-d] [-f] [-h] [-1 to -9] [files...]\n"));
        wprintf(TEXT("  -d : decompress\n"));
        wprintf(TEXT("  -f : compress with Z_FILTERED\n"));
        wprintf(TEXT("  -h : compress with Z_HUFFMAN_ONLY\n"));
        wprintf(TEXT("  -1 to -9 : compression level\n"));
#else
        SET_BINARY_MODE(stdin);
        SET_BINARY_MODE(stdout);
        if (uncompr) {
            file = gzdopen(fileno(stdin), "rb");
            if (file == NULL) error("can't gzdopen stdin");
            gz_uncompress(file, stdout);
        } else {
            file = gzdopen(fileno(stdout), outmode);
            if (file == NULL) error("can't gzdopen stdout");
            gz_compress(stdin, file);
        }
#endif
    } else {
        do {
            if (uncompr) {
                file_uncompress(*argv);
            } else {
                file_compress(*argv, outmode);
            }
        } while (argv++, --argc);
    }
    exit(0);
    return 0; /* to avoid warning */
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
thepron国产精品| 欧美日韩中字一区| 99久久精品国产毛片| 欧美日韩国产综合草草| 国产色产综合产在线视频| 亚洲妇女屁股眼交7| av动漫一区二区| 欧美一区二区三区在线观看| 国产精品成人在线观看| 国产一区二区精品久久| 日韩午夜精品电影| 亚洲一二三区在线观看| 91亚洲永久精品| 国产精品人人做人人爽人人添| 美女视频一区二区三区| 欧美色老头old∨ideo| 亚洲人成电影网站色mp4| 国产精品一区二区三区网站| 91麻豆精品国产| 亚欧色一区w666天堂| 色94色欧美sute亚洲13| 国产精品毛片久久久久久久| 毛片av一区二区| 6080亚洲精品一区二区| 午夜免费久久看| 欧美亚洲日本一区| 亚洲一区二区在线视频| 一本色道综合亚洲| 亚洲男同性恋视频| 日本韩国精品在线| 亚洲免费观看高清完整版在线观看熊| 国产高清在线观看免费不卡| 久久久国产一区二区三区四区小说| 奇米四色…亚洲| 在线综合亚洲欧美在线视频| 亚洲第一激情av| 91精品久久久久久久99蜜桃| 天天影视网天天综合色在线播放| 欧美在线三级电影| 亚洲国产日韩在线一区模特| 在线视频一区二区三| 亚洲精品日日夜夜| 欧美日韩五月天| 免费一级片91| 久久精品亚洲乱码伦伦中文| 成人综合在线视频| 国产精品白丝在线| 在线这里只有精品| 日本v片在线高清不卡在线观看| 91精品在线观看入口| 九九**精品视频免费播放| 2024国产精品| 91在线丨porny丨国产| 亚洲男帅同性gay1069| 欧美午夜一区二区| 国产一区二区三区黄视频| 中文字幕制服丝袜成人av| 色88888久久久久久影院野外| 首页综合国产亚洲丝袜| 精品少妇一区二区三区在线视频 | 国产乱子轮精品视频| 久久久久久99久久久精品网站| 国产电影精品久久禁18| 亚洲手机成人高清视频| 欧美日韩高清一区二区| 国内国产精品久久| 一区二区三区波多野结衣在线观看| 欧美精品乱码久久久久久按摩| 久久国产精品99久久久久久老狼| 国产人成一区二区三区影院| 91福利区一区二区三区| 激情欧美一区二区三区在线观看| 中文字幕在线观看不卡视频| 欧美乱熟臀69xxxxxx| 国产精一品亚洲二区在线视频| 亚洲乱码中文字幕| 久久久久久一级片| 欧美群妇大交群中文字幕| 国产盗摄精品一区二区三区在线| 亚洲一本大道在线| 亚洲国产精品高清| 91精品在线一区二区| 在线影院国内精品| 国产精品影视天天线| 午夜电影网一区| 中文字幕一区二区不卡| 精品国产3级a| 欧美精品vⅰdeose4hd| 99久久久国产精品免费蜜臀| 欧美aa在线视频| 午夜国产不卡在线观看视频| 亚洲欧美日韩久久| 国产欧美综合色| 日韩欧美电影在线| 欧美日本韩国一区二区三区视频| 成人免费视频网站在线观看| 精品一区二区在线免费观看| 亚洲精品美腿丝袜| 国产精品成人免费在线| 欧美极品美女视频| 久久久99久久精品欧美| 91精品国产黑色紧身裤美女| 91国偷自产一区二区三区成为亚洲经典 | 国产suv精品一区二区883| 日韩av在线发布| 亚洲成人动漫在线免费观看| 亚洲天堂网中文字| 国产日产精品一区| 中文字幕不卡一区| 国产欧美精品在线观看| 久久精品夜色噜噜亚洲aⅴ| 欧美xingq一区二区| 日韩欧美综合一区| 欧美一区二区三区在线电影| 69堂亚洲精品首页| 欧美欧美欧美欧美| 欧美高清精品3d| 日韩欧美一级二级| 精品国产成人在线影院| 亚洲精品一区二区三区香蕉| 精品国产乱码久久| 国产三级三级三级精品8ⅰ区| 久久久91精品国产一区二区精品 | 日韩精品一二三| 视频一区中文字幕国产| 免费观看在线综合| 国产综合色精品一区二区三区| 国产中文字幕一区| www.久久久久久久久| 色拍拍在线精品视频8848| 欧美主播一区二区三区| 在线电影欧美成精品| 欧美一级搡bbbb搡bbbb| 久久综合九色综合久久久精品综合| 精品国产免费人成电影在线观看四季| 久久综合久久综合久久| 亚洲欧洲美洲综合色网| 亚洲国产色一区| 韩国中文字幕2020精品| 成人黄色av电影| 欧美性色aⅴ视频一区日韩精品| 在线成人小视频| 国产清纯美女被跳蛋高潮一区二区久久w | 久久久精品国产免大香伊 | 蜜桃在线一区二区三区| 成人午夜短视频| 欧美优质美女网站| 日韩精品专区在线影院观看 | 91美女在线视频| 在线观看91av| 中文字幕久久午夜不卡| 亚洲激情第一区| 免费观看一级特黄欧美大片| 国产成人免费在线观看| 欧美在线免费播放| 久久亚洲精精品中文字幕早川悠里| 欧美高清在线一区二区| 亚洲第一福利视频在线| 国产成人在线观看免费网站| 在线观看免费一区| 日本一区二区三区高清不卡| 亚洲午夜视频在线观看| 韩国午夜理伦三级不卡影院| 一本大道综合伊人精品热热 | 欧美一区欧美二区| 中文字幕一区视频| 久久成人久久爱| 欧美在线免费观看视频| 国产精品毛片久久久久久| 日本一区中文字幕| 欧美性色aⅴ视频一区日韩精品| 久久精品人人做人人爽人人| 日韩专区欧美专区| 日本高清无吗v一区| 中文子幕无线码一区tr| 免费观看成人av| 欧美日韩一区三区| 亚洲日本免费电影| 成人做爰69片免费看网站| 欧美mv日韩mv国产网站| 日本中文在线一区| 欧美精品tushy高清| 亚洲国产日韩av| 91福利小视频| 一区二区三区在线观看动漫| 国产91精品一区二区麻豆亚洲| 欧美大度的电影原声| 亚洲第一综合色| 欧美视频一二三区| 亚洲综合色网站| 在线观看www91| 一区二区三区高清| 欧美专区亚洲专区| 亚洲午夜免费福利视频| 在线免费av一区| 有码一区二区三区| 91极品视觉盛宴| 亚洲成人综合在线| 欧美老女人第四色| 青青草国产成人99久久|