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

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

?? cpl_conv.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
/******************************************************************************
 * $Id: cpl_conv.cpp 12407 2007-10-13 17:33:44Z rouault $
 *
 * Project:  CPL - Common Portability Library
 * Purpose:  Convenience functions.
 * Author:   Frank Warmerdam, warmerdam@pobox.com
 *
 ******************************************************************************
 * Copyright (c) 1998, Frank Warmerdam
 *
 * 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.
 ****************************************************************************/

#include "cpl_conv.h"
#include "cpl_string.h"
#include "cpl_vsi.h"
#include "cpl_multiproc.h"

CPL_CVSID("$Id: cpl_conv.cpp 12407 2007-10-13 17:33:44Z rouault $");

#if defined(WIN32CE)
#  include "cpl_wince.h"
#  include <wce_errno.h>
#endif

static void *hConfigMutex = NULL;
static volatile char **papszConfigOptions = NULL;

static void *hSharedFileMutex = NULL;
static volatile int nSharedFileCount = 0;
static volatile CPLSharedFileInfo *pasSharedFileList = NULL;


/************************************************************************/
/*                             CPLCalloc()                              */
/************************************************************************/

/**
 * Safe version of calloc().
 *
 * This function is like the C library calloc(), but raises a CE_Fatal
 * error with CPLError() if it fails to allocate the desired memory.  It
 * should be used for small memory allocations that are unlikely to fail
 * and for which the application is unwilling to test for out of memory
 * conditions.  It uses VSICalloc() to get the memory, so any hooking of
 * VSICalloc() will apply to CPLCalloc() as well.  CPLFree() or VSIFree()
 * can be used free memory allocated by CPLCalloc().
 *
 * @param nCount number of objects to allocate.
 * @param nSize size (in bytes) of object to allocate.
 * @return pointer to newly allocated memory, only NULL if nSize * nCount is
 * NULL.
 */

void *CPLCalloc( size_t nCount, size_t nSize )

{
    void        *pReturn;

    if( nSize * nCount == 0 )
        return NULL;
    
    pReturn = VSICalloc( nCount, nSize );
    if( pReturn == NULL )
    {
        CPLError( CE_Fatal, CPLE_OutOfMemory,
                  "CPLCalloc(): Out of memory allocating %d bytes.\n",
                  nSize * nCount );
    }

    return pReturn;
}

/************************************************************************/
/*                             CPLMalloc()                              */
/************************************************************************/

/**
 * Safe version of malloc().
 *
 * This function is like the C library malloc(), but raises a CE_Fatal
 * error with CPLError() if it fails to allocate the desired memory.  It
 * should be used for small memory allocations that are unlikely to fail
 * and for which the application is unwilling to test for out of memory
 * conditions.  It uses VSIMalloc() to get the memory, so any hooking of
 * VSIMalloc() will apply to CPLMalloc() as well.  CPLFree() or VSIFree()
 * can be used free memory allocated by CPLMalloc().
 *
 * @param nSize size (in bytes) of memory block to allocate.
 * @return pointer to newly allocated memory, only NULL if nSize is zero.
 */

void *CPLMalloc( size_t nSize )

{
    void        *pReturn;

    CPLVerifyConfiguration();

    if( nSize == 0 )
        return NULL;

    if( nSize < 0 )
    {
        CPLError( CE_Failure, CPLE_AppDefined,
                  "CPLMalloc(%d): Silly size requested.\n",
                  nSize );
        return NULL;
    }
    
    pReturn = VSIMalloc( nSize );
    if( pReturn == NULL )
    {
        CPLError( CE_Fatal, CPLE_OutOfMemory,
                  "CPLMalloc(): Out of memory allocating %d bytes.\n",
                  nSize );
    }

    return pReturn;
}

/************************************************************************/
/*                             CPLRealloc()                             */
/************************************************************************/

/**
 * Safe version of realloc().
 *
 * This function is like the C library realloc(), but raises a CE_Fatal
 * error with CPLError() if it fails to allocate the desired memory.  It
 * should be used for small memory allocations that are unlikely to fail
 * and for which the application is unwilling to test for out of memory
 * conditions.  It uses VSIRealloc() to get the memory, so any hooking of
 * VSIRealloc() will apply to CPLRealloc() as well.  CPLFree() or VSIFree()
 * can be used free memory allocated by CPLRealloc().
 *
 * It is also safe to pass NULL in as the existing memory block for
 * CPLRealloc(), in which case it uses VSIMalloc() to allocate a new block.
 *
 * @param pData existing memory block which should be copied to the new block.
 * @param nNewSize new size (in bytes) of memory block to allocate.
 * @return pointer to allocated memory, only NULL if nNewSize is zero.
 */


void * CPLRealloc( void * pData, size_t nNewSize )

{
    void        *pReturn;

    if ( nNewSize == 0 )
    {
        VSIFree(pData);
        return NULL;
    }

    if( nNewSize < 0 )
    {
        CPLError( CE_Failure, CPLE_AppDefined,
                  "CPLRealloc(%d): Silly size requested.\n",
                  nNewSize );
        return NULL;
    }
    
    if( pData == NULL )
        pReturn = VSIMalloc( nNewSize );
    else
        pReturn = VSIRealloc( pData, nNewSize );
    
    if( pReturn == NULL )
    {
        CPLError( CE_Fatal, CPLE_OutOfMemory,
                  "CPLRealloc(): Out of memory allocating %d bytes.\n",
                  nNewSize );
    }

    return pReturn;
}

/************************************************************************/
/*                             CPLStrdup()                              */
/************************************************************************/

/**
 * Safe version of strdup() function.
 *
 * This function is similar to the C library strdup() function, but if
 * the memory allocation fails it will issue a CE_Fatal error with
 * CPLError() instead of returning NULL.  It uses VSIStrdup(), so any
 * hooking of that function will apply to CPLStrdup() as well.  Memory
 * allocated with CPLStrdup() can be freed with CPLFree() or VSIFree().
 *
 * It is also safe to pass a NULL string into CPLStrdup().  CPLStrdup()
 * will allocate and return a zero length string (as opposed to a NULL
 * string).
 *
 * @param pszString input string to be duplicated.  May be NULL.
 * @return pointer to a newly allocated copy of the string.  Free with
 * CPLFree() or VSIFree().
 */

char *CPLStrdup( const char * pszString )

{
    char        *pszReturn;

    if( pszString == NULL )
        pszString = "";

    pszReturn = VSIStrdup( pszString );
        
    if( pszReturn == NULL )
    {
        CPLError( CE_Fatal, CPLE_OutOfMemory,
                  "CPLStrdup(): Out of memory allocating %d bytes.\n",
                  strlen(pszString) );
        
    }
    
    return( pszReturn );
}

/************************************************************************/
/*                             CPLStrlwr()                              */
/************************************************************************/

/**
 * Convert each characters of the string to lower case.
 *
 * For example, "ABcdE" will be converted to "abcde".
 * This function is locale dependent.
 *
 * @param pszString input string to be converted.
 * @return pointer to the same string, pszString.
 */

char *CPLStrlwr( char *pszString )

{
    if (pszString)
    {
        char *pszTemp = pszString;

        while (*pszTemp)
        {
            *pszTemp = tolower (*pszTemp);
            pszTemp++;
        }
    }

    return pszString;
}

/************************************************************************/
/*                              CPLFGets()                              */
/*                                                                      */
/*      Note: CR = \r = ASCII 13                                        */
/*            LF = \n = ASCII 10                                        */
/************************************************************************/

/**
 * Reads in at most one less than nBufferSize characters from the fp
 * stream and stores them into the buffer pointed to by pszBuffer.
 * Reading stops after an EOF or a newline. If a newline is read, it
 * is _not_ stored into the buffer. A '\0' is stored after the last
 * character in the buffer. All three types of newline terminators
 * recognized by the CPLFGets(): single '\r' and '\n' and '\r\n'
 * combination.
 *
 * @param pszBuffer pointer to the targeting character buffer.
 * @param nBufferSize maximum size of the string to read (not including
 * termonating '\0').
 * @param fp file pointer to read from.
 * @return pointer to the pszBuffer containing a string read
 * from the file or NULL if the error or end of file was encountered.
 */

char *CPLFGets( char *pszBuffer, int nBufferSize, FILE * fp )

{
    int nActuallyRead, nOriginalOffset;

    if ( nBufferSize == 0 || pszBuffer == NULL || fp == NULL )
        return NULL;

/* -------------------------------------------------------------------- */
/*      Let the OS level call read what it things is one line.  This    */
/*      will include the newline.  On windows, if the file happens      */
/*      to be in text mode, the CRLF will have been converted to        */
/*      just the newline (LF).  If it is in binary mode it may well     */
/*      have both.                                                      */
/* -------------------------------------------------------------------- */
    nOriginalOffset = VSIFTell( fp );
    if( VSIFGets( pszBuffer, nBufferSize, fp ) == NULL )
        return NULL;
    
    nActuallyRead = strlen(pszBuffer);
    if ( nActuallyRead == 0 )
        return NULL;

/* -------------------------------------------------------------------- */
/*      If we found \r and out buffer is full, it is possible there     */
/*      is also a pending \n.  Check for it.                            */
/* -------------------------------------------------------------------- */
    if( nBufferSize == nActuallyRead+1
        && pszBuffer[nActuallyRead-1] == 13 )
    {
        int chCheck;
        chCheck = fgetc( fp );
        if( chCheck != 10 )
        {
            // unget the character.
            VSIFSeek( fp, nOriginalOffset+nActuallyRead, SEEK_SET );
        }
    }

/* -------------------------------------------------------------------- */
/*      Trim off \n, \r or \r\n if it appears at the end.  We don't     */
/*      need to do any "seeking" since we want the newline eaten.       */
/* -------------------------------------------------------------------- */
    if( nActuallyRead > 1 
        && pszBuffer[nActuallyRead-1] == 10 
        && pszBuffer[nActuallyRead-2] == 13 )
    {
        pszBuffer[nActuallyRead-2] = '\0';
    }
    else if( pszBuffer[nActuallyRead-1] == 10 
             || pszBuffer[nActuallyRead-1] == 13 )
    {
        pszBuffer[nActuallyRead-1] = '\0';
    }

/* -------------------------------------------------------------------- */
/*      Search within the string for a \r (MacOS convention             */
/*      apparently), and if we find it we need to trim the string,      */
/*      and seek back.                                                  */
/* -------------------------------------------------------------------- */
    char *pszExtraNewline = strchr( pszBuffer, 13 );
    
    if( pszExtraNewline != NULL )
    {
        int chCheck;

        nActuallyRead = pszExtraNewline - pszBuffer + 1;
        
        *pszExtraNewline = '\0';
        VSIFSeek( fp, nOriginalOffset + nActuallyRead - 1, SEEK_SET );

        /* 
         * This hackery is necessary to try and find our correct
         * spot on win32 systems with text mode line translation going 
         * on.  Sometimes the fseek back overshoots, but it doesn't
         * "realize it" till a character has been read. Try to read till
         * we get to the right spot and get our CR. 
         */ 
        chCheck = fgetc( fp );
        while( (chCheck != 13 && chCheck != EOF)
               || VSIFTell(fp) < nOriginalOffset + nActuallyRead )
        {
            static volatile int bWarned = FALSE;

            if( !bWarned )

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧洲av在线精品| 国产精品资源在线观看| 在线观看一区不卡| 夜夜精品视频一区二区| 欧美日韩精品一区二区三区蜜桃| 亚洲一级在线观看| 在线成人高清不卡| 日本不卡一区二区三区 | www.成人网.com| 国产精品久久久久7777按摩| 97超碰欧美中文字幕| 亚洲风情在线资源站| 日韩一级片网址| 国产98色在线|日韩| 国产精品色噜噜| 欧美中文字幕一区二区三区亚洲| 午夜欧美大尺度福利影院在线看| 亚洲成人你懂的| 精品久久人人做人人爰| 丁香婷婷综合激情五月色| 亚洲四区在线观看| 9191精品国产综合久久久久久| 精品一区免费av| 亚洲男人天堂av| 日韩精品一区二区三区在线| 国产91精品一区二区| 亚洲成人福利片| 国产日韩欧美一区二区三区乱码| 在线中文字幕一区二区| 韩国三级电影一区二区| 亚洲色图19p| 精品久久久久久久久久久久久久久| 懂色av中文一区二区三区| 亚洲第四色夜色| 国产精品欧美一级免费| 欧美久久一二区| 91视频免费观看| 国内成人精品2018免费看| 亚洲另类春色国产| 久久夜色精品一区| 欧美疯狂性受xxxxx喷水图片| 成人午夜av影视| 精品一区二区三区在线观看| 亚洲欧美日韩久久| 国产欧美日韩精品在线| 538在线一区二区精品国产| voyeur盗摄精品| 国产在线国偷精品免费看| 午夜精品久久久久久| 亚洲三级在线免费观看| 精品久久久久av影院| 欧美色手机在线观看| 成人福利视频网站| 久久精品999| 欧美在线影院一区二区| 成人av手机在线观看| 国产一区视频网站| 亚洲成人精品在线观看| 亚洲三级在线播放| 国产亚洲精品7777| 久久青草国产手机看片福利盒子| 欧美高清性hdvideosex| 欧美在线|欧美| 日本韩国一区二区三区| 91性感美女视频| 91麻豆文化传媒在线观看| 成人免费av在线| 成人在线综合网站| 成人午夜视频网站| 懂色中文一区二区在线播放| 国产在线麻豆精品观看| 精品亚洲免费视频| 韩国精品在线观看| 国精产品一区一区三区mba视频| 日本不卡不码高清免费观看| 日韩精品1区2区3区| 天天综合色天天综合| 丝袜a∨在线一区二区三区不卡 | 久久精品一区二区三区av| 日韩免费在线观看| 欧美videofree性高清杂交| 欧美一级在线免费| 欧美成人艳星乳罩| 久久毛片高清国产| 国产精品久久久久桃色tv| 国产精品网曝门| 国产精品剧情在线亚洲| 亚洲精品欧美激情| 亚洲成人www| 秋霞电影一区二区| 国产一区福利在线| 99久久久免费精品国产一区二区| 成人av影视在线观看| 91麻豆自制传媒国产之光| 欧美日本在线播放| 日韩久久精品一区| 国产一区不卡视频| 盗摄精品av一区二区三区| aaa欧美大片| 欧美色图天堂网| 日韩免费观看2025年上映的电影| 26uuu欧美日本| 亚洲欧美综合网| 亚洲va欧美va国产va天堂影院| 美女网站一区二区| 国产91清纯白嫩初高中在线观看| av网站一区二区三区| 欧美日韩精品系列| 久久久久国产精品麻豆ai换脸 | 欧美伊人久久久久久久久影院| 69p69国产精品| 国产日韩欧美a| 亚洲国产精品视频| 久久99精品久久只有精品| 成人免费毛片a| 欧美视频中文字幕| 欧美精品一区二区三区蜜桃| 欧美国产激情二区三区| 亚洲午夜久久久久久久久电影院| 日韩在线一二三区| 国产高清亚洲一区| 欧美亚洲精品一区| 国产欧美日韩在线看| 亚洲一区二区三区四区中文字幕| 欧美日本国产视频| 国产精品剧情在线亚洲| 美国精品在线观看| 色狠狠色噜噜噜综合网| 久久久天堂av| 日本特黄久久久高潮| 色噜噜狠狠成人网p站| 久久欧美一区二区| 天堂资源在线中文精品| av福利精品导航| 精品国产凹凸成av人网站| 亚洲一区二区三区国产| 成人高清视频在线| 久久亚洲综合av| 免费精品99久久国产综合精品| 91免费视频网| 国产无人区一区二区三区| 免费av网站大全久久| 欧洲精品一区二区三区在线观看| 国产精品午夜春色av| 国产一区二区三区四区在线观看| 欧美日韩一区二区三区四区五区| 中文字幕不卡一区| 国产精品影视网| 久久综合久久鬼色中文字| 婷婷综合在线观看| 欧美探花视频资源| 亚洲男同1069视频| 91视频观看免费| 亚洲欧洲在线观看av| 国产成人在线免费| 国产欧美一区二区精品婷婷| 麻豆国产精品一区二区三区| 51久久夜色精品国产麻豆| 午夜精品免费在线观看| 欧美婷婷六月丁香综合色| 亚洲亚洲人成综合网络| 欧美日韩在线精品一区二区三区激情| 亚洲免费伊人电影| 色婷婷香蕉在线一区二区| 中文字幕一区二区三区av| 成人性生交大片免费看中文网站| 日本一区二区视频在线| 国产91富婆露脸刺激对白| 国产农村妇女精品| 北条麻妃国产九九精品视频| 国产精品成人网| 色诱视频网站一区| 亚洲在线观看免费| 91麻豆精品国产自产在线 | 欧美国产一区二区在线观看| 丁香六月久久综合狠狠色| 亚洲天堂免费看| 色乱码一区二区三区88| 亚洲一区二区三区四区在线免费观看 | 亚洲男帅同性gay1069| 在线亚洲人成电影网站色www| 亚洲国产精品久久人人爱蜜臀| 欧美日本在线播放| 久久99精品国产.久久久久久| 久久男人中文字幕资源站| 成人av在线影院| 亚洲电影一级片| www一区二区| 色哟哟在线观看一区二区三区| 91视频观看视频| 视频一区欧美日韩| 欧美成人猛片aaaaaaa| 国产福利一区在线| 亚洲免费色视频| 精品国产百合女同互慰| 99久久免费国产| 日韩av中文字幕一区二区三区| 久久久91精品国产一区二区精品| 色久优优欧美色久优优| 麻豆视频一区二区|