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

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

?? avc_rawbin.c

?? 支持各種柵格圖像和矢量圖像讀取的庫
?? C
?? 第 1 頁 / 共 2 頁
字號:
/********************************************************************** * $Id: avc_rawbin.c,v 1.13 2005/06/03 03:49:59 daniel Exp $ * * Name:     avc_rawbin.c * Project:  Arc/Info vector coverage (AVC)  BIN->E00 conversion library * Language: ANSI C * Purpose:  Raw Binary file access functions. * Author:   Daniel Morissette, dmorissette@dmsolutions.ca * ********************************************************************** * Copyright (c) 1999-2005, Daniel Morissette * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: *  * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. *  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER  * DEALINGS IN THE SOFTWARE. ********************************************************************** * * $Log: avc_rawbin.c,v $ * Revision 1.13  2005/06/03 03:49:59  daniel * Update email address, website url, and copyright dates * * Revision 1.12  2004/08/19 23:41:04  warmerda * fixed pointer aliasing optimization bug * * Revision 1.11  2000/09/22 19:45:21  daniel * Switch to MIT-style license * * Revision 1.10  2000/05/29 15:36:07  daniel * Fixed compile warning * * Revision 1.9  2000/05/29 15:31:31  daniel * Added Japanese DBCS support * * Revision 1.8  2000/01/10 02:59:11  daniel * Fixed problem in AVCRawBinOpen() when file not found * * Revision 1.7  1999/12/24 07:18:34  daniel * Added PC Arc/Info coverages support * * Revision 1.6  1999/08/29 15:05:43  daniel * Added source filename in "Attempt to read past EOF" error message * * Revision 1.5  1999/06/08 22:09:03  daniel * Allow opening file with "r+" (but no real random access support yet) * * Revision 1.4  1999/05/11 02:10:51  daniel * Added write support * * Revision 1.3  1999/03/03 19:55:21  daniel * Fixed syntax error in the CPL_MSB version of AVCRawBinReadInt32() * * Revision 1.2  1999/02/25 04:20:08  daniel * Modified AVCRawBinEOF() to detect EOF even if AVCRawBinFSeek() was used. * * Revision 1.1  1999/01/29 16:28:52  daniel * Initial revision * **********************************************************************/#include "avc.h"#include "avc_mbyte.h"/*--------------------------------------------------------------------- * Define a static flag and set it with the byte ordering on this machine * we will then compare with this value to decide if we nned to swap * bytes or not. * * CPL_MSB or CPL_LSB should be set in the makefile... the default is * CPL_LSB. *--------------------------------------------------------------------*/#ifndef CPL_LSBstatic AVCByteOrder geSystemByteOrder = AVCBigEndian;#elsestatic AVCByteOrder geSystemByteOrder = AVCLittleEndian;#endif/*===================================================================== * Stuff related to buffered reading of raw binary files *====================================================================*//********************************************************************** *                          AVCRawBinOpen() * * Open a binary file for reading with buffering, or writing. * * Returns a valid AVCRawBinFile structure, or NULL if the file could * not be opened or created. * * AVCRawBinClose() will eventually have to be called to release the  * resources used by the AVCRawBinFile structure. **********************************************************************/AVCRawBinFile *AVCRawBinOpen(const char *pszFname, const char *pszAccess,                             AVCByteOrder eFileByteOrder,                             AVCDBCSInfo *psDBCSInfo){    AVCRawBinFile *psFile;    psFile = (AVCRawBinFile*)CPLCalloc(1, sizeof(AVCRawBinFile));    /*-----------------------------------------------------------------     * Validate access mode and open/create file.       * For now we support only: "r" for read-only or "w" for write-only     * or "a" for append.     *     * A case for "r+" is included here, but random access is not     * properly supported yet... so this option should be used with care.     *----------------------------------------------------------------*/    if (EQUALN(pszAccess, "r+", 2))    {        psFile->eAccess = AVCReadWrite;        psFile->fp = VSIFOpen(pszFname, "r+b");    }    else if (EQUALN(pszAccess, "r", 1))    {        psFile->eAccess = AVCRead;        psFile->fp = VSIFOpen(pszFname, "rb");    }    else if (EQUALN(pszAccess, "w", 1))    {        psFile->eAccess = AVCWrite;        psFile->fp = VSIFOpen(pszFname, "wb");    }    else if (EQUALN(pszAccess, "a", 1))    {        psFile->eAccess = AVCWrite;        psFile->fp = VSIFOpen(pszFname, "ab");    }    else    {        CPLError(CE_Failure, CPLE_IllegalArg,                 "Acces mode \"%s\" not supported.", pszAccess);        CPLFree(psFile);        return NULL;    }    /*-----------------------------------------------------------------     * Check that file was opened succesfully, and init struct.     *----------------------------------------------------------------*/    if (psFile->fp == NULL)    {        CPLError(CE_Failure, CPLE_OpenFailed,                 "Failed to open file %s", pszFname);        CPLFree(psFile);        return NULL;    }    /*-----------------------------------------------------------------     * OK... Init psFile struct     *----------------------------------------------------------------*/    psFile->pszFname = CPLStrdup(pszFname);    psFile->eByteOrder = eFileByteOrder;    psFile->psDBCSInfo = psDBCSInfo; /* Handle on dataset DBCS info */    /*-----------------------------------------------------------------     * One can set nFileDataSize based on some header fields to force     * EOF beyond a given point in the file.  Useful for cases like     * PC Arc/Info where the physical file size is always a multiple of     * 256 bytes padded with some junk at the end.     *----------------------------------------------------------------*/    psFile->nFileDataSize = -1;    return psFile;}/********************************************************************** *                          AVCRawBinClose() * * Close a binary file previously opened with AVCRawBinOpen() and release * any memory used by the handle. **********************************************************************/void AVCRawBinClose(AVCRawBinFile *psFile){    if (psFile)    {        if (psFile->fp)            VSIFClose(psFile->fp);        CPLFree(psFile->pszFname);        CPLFree(psFile);    }}/********************************************************************** *                          AVCRawBinSetFileDataSize() * * One can set nFileDataSize based on some header fields to force * EOF beyond a given point in the file.  Useful for cases like * PC Arc/Info where the physical file size is always a multiple of * 256 bytes padded with some junk at the end. * * The default value is -1 which just looks for the real EOF.  **********************************************************************/void AVCRawBinSetFileDataSize(AVCRawBinFile *psFile, int nFileDataSize){    if (psFile)    {        psFile->nFileDataSize = nFileDataSize;    }}/********************************************************************** *                          AVCRawBinReadBytes() * * Copy the number of bytes from the input file to the specified  * memory location. **********************************************************************/static GBool bDisableReadBytesEOFError = FALSE;void AVCRawBinReadBytes(AVCRawBinFile *psFile, int nBytesToRead, GByte *pBuf){    /* Make sure file is opened with Read access     */    if (psFile == NULL ||         (psFile->eAccess != AVCRead && psFile->eAccess != AVCReadWrite))    {        CPLError(CE_Failure, CPLE_FileIO,                "AVCRawBinReadBytes(): call not compatible with access mode.");        return;    }    /* Quick method: check to see if we can satisfy the request with a     * simple memcpy... most calls should take this path.     */    if (psFile->nCurPos + nBytesToRead <= psFile->nCurSize)    {        memcpy(pBuf, psFile->abyBuf+psFile->nCurPos, nBytesToRead);        psFile->nCurPos += nBytesToRead;        return;    }    /* This is the long method... it supports reading data that      * overlaps the input buffer boundaries.     */    while(nBytesToRead > 0)    {        /* If we reached the end of our memory buffer then read another         * chunk from the file         */        CPLAssert(psFile->nCurPos <= psFile->nCurSize);        if (psFile->nCurPos == psFile->nCurSize)        {            psFile->nOffset += psFile->nCurSize;            psFile->nCurSize = VSIFRead(psFile->abyBuf, sizeof(GByte),                                        AVCRAWBIN_READBUFSIZE, psFile->fp);            psFile->nCurPos = 0;        }        if (psFile->nCurSize == 0)        {            /* Attempt to read past EOF... generate an error.             *             * Note: AVCRawBinEOF() can set bDisableReadBytesEOFError=TRUE             *       to disable the error message whils it is testing             *       for EOF.             */            if (bDisableReadBytesEOFError == FALSE)                CPLError(CE_Failure, CPLE_FileIO,                         "Attempt to read past EOF in %s.", psFile->pszFname);            return;        }        /* If the requested bytes are not all in the current buffer then         * just read the part that's in memory for now... the loop will          * take care of the rest.         */        if (psFile->nCurPos + nBytesToRead > psFile->nCurSize)        {            int nBytes;            nBytes = psFile->nCurSize-psFile->nCurPos;            memcpy(pBuf, psFile->abyBuf+psFile->nCurPos, nBytes);            psFile->nCurPos += nBytes;            pBuf += nBytes;            nBytesToRead -= nBytes;        }        else        {            /* All the requested bytes are now in the buffer...              * simply copy them and return.             */            memcpy(pBuf, psFile->abyBuf+psFile->nCurPos, nBytesToRead);            psFile->nCurPos += nBytesToRead;            nBytesToRead = 0;   /* Terminate the loop */        }    }}/********************************************************************** *                          AVCRawBinReadString() * * Same as AVCRawBinReadBytes() except that the string is run through * the DBCS conversion function. * * pBuf should be allocated with a size of at least nBytesToRead+1 bytes. **********************************************************************/void AVCRawBinReadString(AVCRawBinFile *psFile, int nBytesToRead, GByte *pBuf){    const GByte *pszConvBuf;    AVCRawBinReadBytes(psFile, nBytesToRead, pBuf);    pBuf[nBytesToRead] = '\0';    pszConvBuf = AVCE00ConvertFromArcDBCS(psFile->psDBCSInfo, pBuf,                                           nBytesToRead);    if (pszConvBuf != pBuf)    {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱码精品1区2区3区| 欧美成人在线直播| 91精品综合久久久久久| 久久精品人人做人人综合 | 欧美电影免费观看完整版| 中文在线资源观看网站视频免费不卡| 亚洲午夜电影在线| 99久久综合国产精品| 欧美精品一区二| 三级欧美在线一区| 91在线高清观看| 中文字幕第一页久久| 久久国产精品第一页| 欧美日韩精品欧美日韩精品| 亚洲三级理论片| 成人丝袜18视频在线观看| 欧美v亚洲v综合ⅴ国产v| 午夜亚洲国产au精品一区二区| av在线不卡观看免费观看| 久久婷婷综合激情| 蜜桃av噜噜一区| 91精品国产全国免费观看| 亚洲精选视频在线| 色综合天天综合网天天狠天天| 国产视频一区在线观看| 精品一区二区三区香蕉蜜桃| 日韩一级黄色大片| 五月天欧美精品| 欧美麻豆精品久久久久久| 亚洲国产视频一区| 欧美日韩一区二区三区四区五区| 中文字幕一区在线观看| 一本一道久久a久久精品 | 成人福利电影精品一区二区在线观看| 精品欧美乱码久久久久久1区2区| 久久精品国产在热久久| 精品国一区二区三区| 国产一区91精品张津瑜| 欧美—级在线免费片| av网站免费线看精品| 亚洲精品成人a在线观看| 欧美三级日韩三级国产三级| 日本亚洲欧美天堂免费| 精品国产麻豆免费人成网站| 国产剧情一区二区| 亚洲欧洲一区二区三区| 精品视频在线看| 免费成人在线观看视频| 国产亚洲午夜高清国产拍精品| 成人国产亚洲欧美成人综合网| 亚洲欧洲制服丝袜| 91精品麻豆日日躁夜夜躁| 久久99久久久久| 中文字幕视频一区二区三区久| 色综合久久99| 人禽交欧美网站| 国产精品久久久久三级| 欧美亚男人的天堂| 精品一区二区影视| 中文字幕中文字幕一区| 欧美人妖巨大在线| 国产成人av电影在线观看| 亚洲综合无码一区二区| 精品久久久久久久人人人人传媒| 成人午夜精品一区二区三区| 亚洲二区在线观看| 精品国产免费一区二区三区香蕉| 成人在线一区二区三区| 亚洲一区二区免费视频| 久久久国产精华| 欧美日韩免费电影| 国产宾馆实践打屁股91| 丝袜美腿一区二区三区| 国产精品嫩草影院com| 欧美美女黄视频| eeuss国产一区二区三区| 麻豆专区一区二区三区四区五区| 亚洲欧美在线另类| 精品日韩成人av| 欧美视频第二页| 99久久99久久精品免费观看| 捆绑调教美女网站视频一区| 一区二区三区欧美久久| 国产蜜臀97一区二区三区 | 色丁香久综合在线久综合在线观看| 奇米影视在线99精品| 一区二区三区在线观看欧美| 国产欧美久久久精品影院| 日韩欧美一区二区在线视频| 在线视频综合导航| jiyouzz国产精品久久| 国产精品亚洲午夜一区二区三区| 日日夜夜精品视频天天综合网| 亚洲男人天堂av网| 国产精品色婷婷| 久久久影视传媒| 欧美成人欧美edvon| 欧美精品三级在线观看| 在线视频综合导航| 色婷婷激情一区二区三区| 成人av电影在线网| 成人激情免费视频| 国产91综合一区在线观看| 精品一区二区三区视频在线观看| 日韩电影在线观看网站| 亚洲不卡av一区二区三区| 夜色激情一区二区| 亚洲国产综合色| 亚洲国产精品自拍| 午夜精品久久久久| 日日摸夜夜添夜夜添国产精品| 亚洲第一福利一区| 天堂成人国产精品一区| 视频一区中文字幕| 美腿丝袜一区二区三区| 老司机精品视频导航| 免费av网站大全久久| 久久精品国产免费| 精彩视频一区二区三区| 国产老女人精品毛片久久| 国产一区二区三区免费看| 国产在线国偷精品产拍免费yy| 轻轻草成人在线| 久久国产剧场电影| 国产成人av福利| 97精品视频在线观看自产线路二| 欧美人与性动xxxx| 正在播放一区二区| 亚洲精品一区二区三区影院| 久久久综合精品| 亚洲欧洲av色图| 亚洲一区二区五区| 久久99精品久久久久久动态图 | 丁香激情综合国产| 99免费精品在线| 欧美精品在线观看播放| 欧美变态口味重另类| 国产精品美女久久久久久久久 | 国产精品综合二区| 91在线porny国产在线看| 欧美日韩三级一区| 日韩精品一区二区三区三区免费| 久久精品夜色噜噜亚洲a∨ | 久久久久久毛片| 亚洲人成亚洲人成在线观看图片| 亚洲18色成人| 高清beeg欧美| 欧美图片一区二区三区| 久久蜜桃av一区精品变态类天堂 | 日本va欧美va瓶| 国产成人免费av在线| 欧美图区在线视频| 日本一区二区三区免费乱视频| 亚洲激情第一区| 国产一区二区三区四区五区入口| 色哦色哦哦色天天综合| 日韩欧美国产高清| 亚洲女厕所小便bbb| 国产乱国产乱300精品| 欧美日韩一级片在线观看| 国产日产欧美一区二区三区| 三级欧美在线一区| 91在线你懂得| 久久久www成人免费无遮挡大片| 亚洲嫩草精品久久| 国产精品99久久久久久似苏梦涵| 欧美偷拍一区二区| 日韩毛片在线免费观看| 免费在线观看成人| 欧美性视频一区二区三区| 中文幕一区二区三区久久蜜桃| 日韩电影一二三区| 91福利在线导航| 国产精品家庭影院| 国产精品99久| wwwwww.欧美系列| 秋霞电影网一区二区| 欧美在线观看一二区| 日韩理论在线观看| 丁香天五香天堂综合| 精品剧情在线观看| 天堂蜜桃91精品| 欧美日韩精品一区二区在线播放| 亚洲视频一区二区在线| 成人av在线播放网址| 欧美国产精品一区| 懂色av噜噜一区二区三区av| 精品免费国产一区二区三区四区| 福利视频网站一区二区三区| 日韩一区二区三区高清免费看看| 亚洲不卡av一区二区三区| 在线观看一区日韩| 亚洲精品亚洲人成人网在线播放| 成人的网站免费观看| 国产农村妇女精品| gogogo免费视频观看亚洲一| 亚洲欧洲日韩女同| 91蝌蚪porny成人天涯| 亚洲婷婷综合久久一本伊一区 | 亚洲欧美日韩国产手机在线|