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

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

?? 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)    {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级黄色录像| 国内精品第一页| 欧美日韩一级片在线观看| 午夜av区久久| 精品欧美一区二区三区精品久久| 精品亚洲成a人在线观看 | 韩国成人福利片在线播放| 精品精品国产高清a毛片牛牛| 久久91精品久久久久久秒播| 国产视频一区不卡| 91麻豆国产自产在线观看| 午夜欧美视频在线观看| 久久综合九色综合欧美98| 丁香啪啪综合成人亚洲小说| 伊人婷婷欧美激情| 日韩欧美卡一卡二| 盗摄精品av一区二区三区| 亚洲精选一二三| 欧美一区二区视频观看视频| 国产毛片精品一区| 一区二区三区在线视频播放| 日韩手机在线导航| 国产高清不卡一区| 一区二区欧美在线观看| 欧美一级高清片| 成人免费黄色在线| 免费黄网站欧美| 亚洲色图在线看| 欧美va亚洲va在线观看蝴蝶网| 岛国精品在线播放| 婷婷六月综合亚洲| 国产精品乱码一区二区三区软件| 欧美日精品一区视频| 国产在线精品一区二区| 亚洲亚洲人成综合网络| 国产日产欧产精品推荐色| 欧美日韩亚洲国产综合| 高清在线不卡av| 日韩精品乱码免费| 亚洲欧美一区二区三区久本道91| 日韩一区二区三区视频| 91精品福利视频| 国产91在线观看丝袜| 日日骚欧美日韩| 一区二区三区四区精品在线视频| 久久亚洲综合色| 欧美一区二区三区思思人| 99久久精品免费看国产免费软件| 激情亚洲综合在线| 调教+趴+乳夹+国产+精品| 最新高清无码专区| 久久亚洲免费视频| 欧美一区二区三区的| 色素色在线综合| 国产不卡视频在线观看| 麻豆久久一区二区| 日本亚洲一区二区| 亚洲成人一二三| 亚洲美女一区二区三区| 亚洲欧洲成人精品av97| 欧美激情中文不卡| 国产网站一区二区| 久久久欧美精品sm网站| 精品国产乱码久久久久久牛牛| 欧美视频完全免费看| 色婷婷久久久久swag精品| 国产91综合一区在线观看| 精品在线视频一区| 日本中文字幕一区二区有限公司| 亚洲综合在线电影| 亚洲三级在线观看| 亚洲精品ww久久久久久p站| 亚洲婷婷国产精品电影人久久| 国产精品私人自拍| 国产日韩精品一区二区三区 | 中文在线资源观看网站视频免费不卡| 日韩亚洲欧美在线观看| 日韩精品一区二区三区视频| 日韩欧美国产一区二区三区| 日韩欧美不卡一区| 精品日韩成人av| 国产欧美日韩视频一区二区| 中文一区二区在线观看| 亚洲欧洲韩国日本视频| 亚洲码国产岛国毛片在线| 一区二区三区国产精品| 一区二区视频免费在线观看| 樱花影视一区二区| 五月天欧美精品| 久久精品噜噜噜成人av农村| 狠狠色狠狠色合久久伊人| 韩国欧美国产1区| 成人午夜视频免费看| 色综合久久中文综合久久97| 色婷婷精品久久二区二区蜜臂av| 欧美精品粉嫩高潮一区二区| 日韩欧美一区二区不卡| 2020国产精品久久精品美国| 亚洲国产精品99久久久久久久久 | 免费人成精品欧美精品| 老鸭窝一区二区久久精品| 风间由美一区二区av101| 成人福利在线看| 91香蕉视频mp4| 777午夜精品视频在线播放| 精品美女一区二区| 国产精品毛片无遮挡高清| 综合在线观看色| 视频在线在亚洲| 高潮精品一区videoshd| 99re热这里只有精品免费视频| 欧美最新大片在线看| 欧美成人a视频| 中文字幕不卡在线播放| 亚洲国产精品自拍| 国产一区二区三区精品欧美日韩一区二区三区 | 91精品国产欧美日韩| 日韩免费在线观看| 亚洲欧洲日韩在线| 午夜精品福利久久久| 成人综合激情网| 欧美日韩高清在线播放| 国产欧美精品一区aⅴ影院 | 国产精品乱码人人做人人爱 | 中文字幕一区二区三区蜜月| 亚洲 欧美综合在线网络| 国产精品一二三在| 欧美综合亚洲图片综合区| 26uuu国产电影一区二区| 亚洲黄色录像片| 国产91丝袜在线播放九色| 88在线观看91蜜桃国自产| 亚洲欧洲www| 高清beeg欧美| 欧美成va人片在线观看| 亚洲免费在线播放| 成人午夜私人影院| 久久一夜天堂av一区二区三区| 日欧美一区二区| 日本精品视频一区二区| 久久久久国产成人精品亚洲午夜| 午夜精品久久一牛影视| 91一区一区三区| 成人性视频免费网站| 精品理论电影在线| 婷婷综合久久一区二区三区| 日本丰满少妇一区二区三区| 中文字幕一区在线观看| 国产成人在线看| 精品成人一区二区三区四区| 日韩激情一区二区| 在线一区二区三区| 亚洲婷婷在线视频| 99精品视频中文字幕| 国产精品美女视频| 国产精品一二三| 欧美国产丝袜视频| 丁香激情综合国产| 中文一区一区三区高中清不卡| 国产精品456露脸| 久久久久久久久久久99999| 久久精品99国产精品日本| 7777精品伊人久久久大香线蕉的| 日韩视频免费直播| 捆绑调教美女网站视频一区| 日韩三级高清在线| 六月婷婷色综合| 亚洲精品在线一区二区| 激情综合一区二区三区| 欧美电影免费观看高清完整版 | 欧美成人乱码一区二区三区| 欧美疯狂性受xxxxx喷水图片| 亚洲在线中文字幕| eeuss影院一区二区三区| 欧美韩国日本一区| www.日韩精品| 国产精品久久久久aaaa樱花| 99久久精品国产一区| 亚洲精品v日韩精品| 欧美日韩国产成人在线免费| 免费在线观看一区| 久久综合丝袜日本网| 国产资源在线一区| 亚洲欧洲99久久| 欧美亚洲综合网| 日本成人中文字幕在线视频| 精品国产乱码久久久久久蜜臀 | av在线不卡电影| 一区二区三区中文字幕在线观看| 在线免费观看视频一区| 久久精品理论片| 国产精品久久久久婷婷| 欧美在线观看禁18| 精品无人码麻豆乱码1区2区| 日本一区二区成人在线| 欧美日韩视频在线第一区| 精品一区二区三区影院在线午夜| 综合久久一区二区三区| 9色porny自拍视频一区二区| 亚洲高清视频中文字幕|