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

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

?? cpl_conv.cpp

?? mitab,讀取MapInfo的地圖文件
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
            {
                bWarned = TRUE;
                CPLDebug( "CPL", "CPLFGets() correcting for DOS text mode translation seek problem." );
            }
            chCheck = fgetc( fp );
        }
    }

    return pszBuffer;
}

/************************************************************************/
/*                         CPLReadLineBuffer()                          */
/*                                                                      */
/*      Fetch readline buffer, and ensure it is the desired size,       */
/*      reallocating if needed.  Manages TLS (thread local storage)     */
/*      issues for the buffer.                                          */
/************************************************************************/
static char *CPLReadLineBuffer( int nRequiredSize )

{
    
/* -------------------------------------------------------------------- */
/*      A required size of -1 means the buffer should be freed.         */
/* -------------------------------------------------------------------- */
    if( nRequiredSize == -1 )
    {
        if( CPLGetTLS( CTLS_RLBUFFERINFO ) != NULL )
        {
            CPLFree( CPLGetTLS( CTLS_RLBUFFERINFO ) );
            CPLSetTLS( CTLS_RLBUFFERINFO, NULL, FALSE );
        }
        return NULL;
    }

/* -------------------------------------------------------------------- */
/*      If the buffer doesn't exist yet, create it.                     */
/* -------------------------------------------------------------------- */
    GUInt32 *pnAlloc = (GUInt32 *) CPLGetTLS( CTLS_RLBUFFERINFO );

    if( pnAlloc == NULL )
    {
        pnAlloc = (GUInt32 *) CPLMalloc(200);
        *pnAlloc = 196;
        CPLSetTLS( CTLS_RLBUFFERINFO, pnAlloc, TRUE );
    }

/* -------------------------------------------------------------------- */
/*      If it is too small, grow it bigger.                             */
/* -------------------------------------------------------------------- */
    if( (int) *pnAlloc < nRequiredSize+1 )
    {
        int nNewSize = nRequiredSize + 4 + 500;

        pnAlloc = (GUInt32 *) CPLRealloc(pnAlloc,nNewSize);
        if( pnAlloc == NULL )
        {
            CPLSetTLS( CTLS_RLBUFFERINFO, NULL, FALSE );
            return NULL;
        }
            
        *pnAlloc = nNewSize - 4;
        CPLSetTLS( CTLS_RLBUFFERINFO, pnAlloc, TRUE );
    }

    return (char *) (pnAlloc+1);
}

/************************************************************************/
/*                            CPLReadLine()                             */
/************************************************************************/

/**
 * Simplified line reading from text file.
 * 
 * Read a line of text from the given file handle, taking care
 * to capture CR and/or LF and strip off ... equivelent of
 * DKReadLine().  Pointer to an internal buffer is returned.
 * The application shouldn't free it, or depend on it's value
 * past the next call to CPLReadLine().
 * 
 * Note that CPLReadLine() uses VSIFGets(), so any hooking of VSI file
 * services should apply to CPLReadLine() as well.
 *
 * CPLReadLine() maintains an internal buffer, which will appear as a 
 * single block memory leak in some circumstances.  CPLReadLine() may 
 * be called with a NULL FILE * at any time to free this working buffer.
 *
 * @param fp file pointer opened with VSIFOpen().
 *
 * @return pointer to an internal buffer containing a line of text read
 * from the file or NULL if the end of file was encountered.
 */

const char *CPLReadLine( FILE * fp )

{
    char *pszRLBuffer = CPLReadLineBuffer(1);
    int         nReadSoFar = 0;

/* -------------------------------------------------------------------- */
/*      Cleanup case.                                                   */
/* -------------------------------------------------------------------- */
    if( fp == NULL )
    {
        CPLReadLineBuffer( -1 );
        return NULL;
    }

/* -------------------------------------------------------------------- */
/*      Loop reading chunks of the line till we get to the end of       */
/*      the line.                                                       */
/* -------------------------------------------------------------------- */
    int nBytesReadThisTime;

    do {
/* -------------------------------------------------------------------- */
/*      Grow the working buffer if we have it nearly full.  Fail out    */
/*      of read line if we can't reallocate it big enough (for          */
/*      instance for a _very large_ file with no newlines).             */
/* -------------------------------------------------------------------- */
        pszRLBuffer = CPLReadLineBuffer( nReadSoFar + 129 );
        if( pszRLBuffer == NULL )
            return NULL;

/* -------------------------------------------------------------------- */
/*      Do the actual read.                                             */
/* -------------------------------------------------------------------- */
        if( CPLFGets( pszRLBuffer+nReadSoFar, 128, fp ) == NULL 
            && nReadSoFar == 0 )
            return NULL;

        nBytesReadThisTime = strlen(pszRLBuffer+nReadSoFar);
        nReadSoFar += nBytesReadThisTime;

    } while( nBytesReadThisTime >= 127
             && pszRLBuffer[nReadSoFar-1] != 13
             && pszRLBuffer[nReadSoFar-1] != 10 );

    return( pszRLBuffer );
}

/************************************************************************/
/*                            CPLReadLineL()                            */
/************************************************************************/

/**
 * Simplified line reading from text file.
 * 
 * Similar to CPLReadLine(), but reading from a large file API handle.
 *
 * @param fp file pointer opened with VSIFOpenL().
 *
 * @return pointer to an internal buffer containing a line of text read
 * from the file or NULL if the end of file was encountered.
 */

const char *CPLReadLineL( FILE * fp )

{
/* -------------------------------------------------------------------- */
/*      Cleanup case.                                                   */
/* -------------------------------------------------------------------- */
    if( fp == NULL )
    {
        CPLReadLineBuffer( -1 );
        return NULL;
    }

/* -------------------------------------------------------------------- */
/*      Loop reading chunks of the line till we get to the end of       */
/*      the line.                                                       */
/* -------------------------------------------------------------------- */
    char *pszRLBuffer;
    const size_t nChunkSize = 40;
    char szChunk[nChunkSize];
    size_t nChunkBytesRead = 0;
    int nBufLength = 0;
    size_t nChunkBytesConsumed = 0;

    while( TRUE )
    {
/* -------------------------------------------------------------------- */
/*      Read a chunk from the input file.                               */
/* -------------------------------------------------------------------- */
        pszRLBuffer = CPLReadLineBuffer( nBufLength + nChunkSize + 1 );

        if( nChunkBytesRead == nChunkBytesConsumed + 1 )
        {

            // case where one character is left over from last read.
            szChunk[0] = szChunk[nChunkBytesConsumed];

            nChunkBytesConsumed = 0;
            nChunkBytesRead = VSIFReadL( szChunk+1, 1, nChunkSize-1, fp ) + 1;
        }
        else
        {
            nChunkBytesConsumed = 0;

            // fresh read.
            nChunkBytesRead = VSIFReadL( szChunk, 1, nChunkSize, fp );
            if( nChunkBytesRead == 0 )
            {
                if( nBufLength == 0 )
                    return NULL;
                else
                    break;
            }
        }
        
/* -------------------------------------------------------------------- */
/*      copy over characters watching for end-of-line.                  */
/* -------------------------------------------------------------------- */
        int bBreak = FALSE;
        while( nChunkBytesConsumed < nChunkBytesRead-1 && !bBreak )
        {
            if( (szChunk[nChunkBytesConsumed] == 13
                 && szChunk[nChunkBytesConsumed+1] == 10)
                || (szChunk[nChunkBytesConsumed] == 10
                    && szChunk[nChunkBytesConsumed+1] == 13) )
            {
                nChunkBytesConsumed += 2;
                bBreak = TRUE;
            }
            else if( szChunk[nChunkBytesConsumed] == 10
                     || szChunk[nChunkBytesConsumed] == 13 )
            {
                nChunkBytesConsumed += 1;
                bBreak = TRUE;
            }
            else
                pszRLBuffer[nBufLength++] = szChunk[nChunkBytesConsumed++];
        }

        if( bBreak )
            break;

/* -------------------------------------------------------------------- */
/*      If there is a remaining character and it is not a newline       */
/*      consume it.  If it is a newline, but we are clearly at the      */
/*      end of the file then consume it.                                */
/* -------------------------------------------------------------------- */
        if( nChunkBytesConsumed == nChunkBytesRead-1 
            && nChunkBytesRead < nChunkSize )
        {
            if( szChunk[nChunkBytesConsumed] == 10
                || szChunk[nChunkBytesConsumed] == 13 )
            {
                nChunkBytesConsumed++;
                break;
            }

            pszRLBuffer[nBufLength++] = szChunk[nChunkBytesConsumed++];
            break;
        }
    }

/* -------------------------------------------------------------------- */
/*      If we have left over bytes after breaking out, seek back to     */
/*      ensure they remain to be read next time.                        */
/* -------------------------------------------------------------------- */
    if( nChunkBytesConsumed < nChunkBytesRead )
    {
        size_t nBytesToPush = nChunkBytesRead - nChunkBytesConsumed;
        
        VSIFSeekL( fp, VSIFTellL( fp ) - nBytesToPush, SEEK_SET );
    }

    pszRLBuffer[nBufLength] = '\0';

    return( pszRLBuffer );
}

/************************************************************************/
/*                            CPLScanString()                           */
/************************************************************************/

/**
 * Scan up to a maximum number of characters from a given string,
 * allocate a buffer for a new string and fill it with scanned characters.
 *
 * @param pszString String containing characters to be scanned. It may be
 * terminated with a null character.
 *
 * @param nMaxLength The maximum number of character to read. Less
 * characters will be read if a null character is encountered.
 *
 * @param bTrimSpaces If TRUE, trim ending spaces from the input string.
 * Character considered as empty using isspace(3) function.
 *
 * @param bNormalize If TRUE, replace ':' symbol with the '_'. It is needed if
 * resulting string will be used in CPL dictionaries.
 * 
 * @return Pointer to the resulting string buffer. Caller responsible to free
 * this buffer with CPLFree().
 */

char *CPLScanString( const char *pszString, int nMaxLength,
                     int bTrimSpaces, int bNormalize )
{
    char    *pszBuffer;

    if ( !pszString )
        return NULL;

    if ( !nMaxLength )
        return CPLStrdup( "" );

    pszBuffer = (char *)CPLMalloc( nMaxLength + 1 );
    if ( !pszBuffer )
        return NULL;

    strncpy( pszBuffer, pszString,  nMaxLength );
    pszBuffer[nMaxLength] = '\0';

    if ( bTrimSpaces )
    {
        size_t  i = strlen( pszBuffer );
        while ( i-- > 0 && isspace(pszBuffer[i]) )
            pszBuffer[i] = '\0';
    }

    if ( bNormalize )
    {
        size_t  i = strlen( pszBuffer );
        while ( i-- > 0 )
        {
            if ( pszBuffer[i] == ':' )
                pszBuffer[i] = '_';
        }
    }

    return pszBuffer;
}

/************************************************************************/
/*                             CPLScanLong()                            */
/************************************************************************/

/**
 * Scan up to a maximum number of characters from a string and convert
 * the result to a long.
 *
 * @param pszString String containing characters to be scanned. It may be
 * terminated with a null character.
 *
 * @param nMaxLength The maximum number of character to consider as part
 * of the number. Less characters will be considered if a null character
 * is encountered.
 * 
 * @return Long value, converted from its ASCII form.
 */

long CPLScanLong( const char *pszString, int nMaxLength )
{
    long    iValue;
    char    *pszValue = (char *)CPLMalloc( nMaxLength + 1);

/* -------------------------------------------------------------------- */
/*      Compute string into local buffer, and terminate it.             */
/* -------------------------------------------------------------------- */
    strncpy( pszValue, pszString, nMaxLength );
    pszValue[nMaxLength] = '\0';

/* -------------------------------------------------------------------- */
/*      Use atol() to fetch out the result                              */
/* -------------------------------------------------------------------- */
    iValue = atol( pszValue );

    CPLFree( pszValue );
    return iValue;
}


/************************************************************************/
/*                            CPLScanULong()                            */
/************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美亚洲动漫制服丝袜| 2020国产精品自拍| 国产激情精品久久久第一区二区 | 日韩一卡二卡三卡四卡| 欧美综合天天夜夜久久| 色婷婷av一区二区三区软件 | 免费在线观看一区| 一个色综合av| 偷拍自拍另类欧美| 日韩国产在线一| 另类调教123区| 免费av成人在线| 精品一区二区三区的国产在线播放 | 精品国精品国产| 久久综合九色综合久久久精品综合| 欧美大胆一级视频| 中文字幕免费观看一区| 国产精品大尺度| 亚洲精品视频自拍| 亚洲狠狠爱一区二区三区| 亚洲愉拍自拍另类高清精品| 午夜精品免费在线观看| 国产精品一级在线| 91麻豆精品在线观看| 欧美体内she精视频| xfplay精品久久| 亚洲素人一区二区| 免费成人你懂的| av激情成人网| 欧美一区日本一区韩国一区| 欧美激情中文不卡| 日韩中文字幕亚洲一区二区va在线 | 国产盗摄女厕一区二区三区| 成人毛片在线观看| 一本色道久久综合亚洲aⅴ蜜桃| 欧美丰满一区二区免费视频| 日本一区二区三区国色天香| 亚洲成人精品影院| 国产麻豆视频一区| 欧美美女视频在线观看| 国产精品久久久久久久午夜片| 亚洲成人激情自拍| 99久久婷婷国产综合精品电影| 欧美一级国产精品| 玉米视频成人免费看| 国产精品一区免费视频| 欧美一区二区三区不卡| 亚洲精品视频在线看| 国产成人在线影院 | 蜜臀a∨国产成人精品| 懂色av一区二区三区蜜臀| 7777精品伊人久久久大香线蕉| 欧美国产日韩精品免费观看| 九九视频精品免费| 国内成人自拍视频| 欧美老人xxxx18| 亚洲一区二区四区蜜桃| 色屁屁一区二区| 亚洲人妖av一区二区| 国产91丝袜在线播放九色| 欧美哺乳videos| 亚洲18影院在线观看| 91免费小视频| 亚洲欧美激情插| 色哟哟国产精品| 亚洲欧美国产毛片在线| 91丨九色丨黑人外教| 17c精品麻豆一区二区免费| 狠狠色伊人亚洲综合成人| 777久久久精品| 男女性色大片免费观看一区二区 | 欧美国产精品一区| 国产精品影视网| 久久久久九九视频| 高清在线观看日韩| 中文字幕av不卡| 成人精品免费网站| 国产精品美女久久久久久| www.色综合.com| 中文字幕一区二区日韩精品绯色| 不卡一区二区在线| 亚洲免费看黄网站| 欧美裸体bbwbbwbbw| 日韩电影免费一区| 2024国产精品| av一二三不卡影片| 亚洲制服欧美中文字幕中文字幕| 欧美精品v日韩精品v韩国精品v| 日本中文字幕不卡| 国产午夜亚洲精品午夜鲁丝片| 国产成人aaa| 亚洲国产成人av网| 日韩欧美国产综合一区| 国产成人在线影院| 亚洲高清免费观看| www亚洲一区| 色综合天天狠狠| 免费欧美日韩国产三级电影| 久久亚洲私人国产精品va媚药| thepron国产精品| 午夜精品久久久久久久| 日韩精品一区二区三区四区 | 精品999在线播放| 成人免费视频一区| 日韩精品乱码免费| 国产精品免费视频一区| 欧美日韩一级大片网址| 经典三级在线一区| 一区二区三区产品免费精品久久75| 欧美一区二区三区精品| 99久久综合国产精品| 久久99久久精品欧美| 亚洲黄色小说网站| 久久免费看少妇高潮| 欧美中文字幕不卡| 国产成人一区在线| 日韩 欧美一区二区三区| 亚洲天堂免费看| 精品99久久久久久| 欧美高清视频一二三区| 不卡一区二区中文字幕| 狠狠久久亚洲欧美| 日本中文在线一区| 一区二区三区四区av| 中文字幕av在线一区二区三区| 精品免费国产一区二区三区四区| 波多野结衣91| 国产999精品久久久久久绿帽| 男人的天堂亚洲一区| 亚洲v精品v日韩v欧美v专区 | 欧美日韩一区二区三区高清| 成人av在线播放网址| 精品在线观看视频| 五月天网站亚洲| 一区二区三区欧美日| 成人欧美一区二区三区| 国产精品人妖ts系列视频| 久久综合久色欧美综合狠狠| 精品捆绑美女sm三区| 欧美精品日韩一区| 欧美亚洲精品一区| 欧美丝袜自拍制服另类| 在线观看91视频| 色婷婷综合视频在线观看| 99久久婷婷国产综合精品电影 | 精品国产一区二区三区久久影院| 欧美揉bbbbb揉bbbbb| 在线观看视频一区二区| 91黄色免费网站| 欧美在线观看一二区| 日本伦理一区二区| 色婷婷香蕉在线一区二区| 色偷偷久久人人79超碰人人澡| 91在线小视频| 91理论电影在线观看| 欧美主播一区二区三区美女| 欧美性一级生活| 欧美日韩国产一区二区三区地区| 日本精品裸体写真集在线观看| 在线影院国内精品| 欧美猛男超大videosgay| 在线不卡一区二区| 欧美一区欧美二区| 久久久久久久久久美女| 日本一区二区久久| 亚洲欧洲日韩女同| 亚洲成人午夜影院| 另类中文字幕网| 成人精品亚洲人成在线| 欧美中文字幕一区| 日韩精品一区二区三区老鸭窝| 久久美女艺术照精彩视频福利播放 | 日本怡春院一区二区| 国产一区高清在线| 北条麻妃国产九九精品视频| 欧美色精品在线视频| 日韩欧美一级二级三级久久久| 国产日韩欧美一区二区三区乱码| 自拍偷自拍亚洲精品播放| 性久久久久久久| 国产美女在线精品| 在线观看日韩一区| 欧美va亚洲va国产综合| 成人欧美一区二区三区黑人麻豆 | 欧美色网站导航| 日韩一级二级三级| 日韩欧美第一区| 亚洲人成网站影音先锋播放| 日韩av一二三| 成人网在线播放| 精品免费国产一区二区三区四区| 中文字幕在线一区二区三区| 日本欧美久久久久免费播放网| 免费在线欧美视频| 99久久精品免费看| 欧洲精品一区二区三区在线观看| 精品国产精品网麻豆系列| 亚洲精品成人精品456| 福利视频网站一区二区三区| 欧美嫩在线观看|